Anonymous Login
2019-11-17 22:56 PST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000959Pending RequestsTaskspublic2014-08-16 18:19
ReporterCkr 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusnewResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000959: Custom Colors for Task Status
DescriptionI introduced a system lookup value and made some code changes so I can now easily adjust the task status colors within the admin backend.
Additional InformationAdding this as requested by caseydk here: http://forums.web2project.net/viewtopic.php?p=12929
TagsNo tags attached.
Attached Files
  • txt file icon Custom Colors for Task Status.txt (12,536 bytes) 1969-12-31 16:00 -
    ######## system lookup values ######################################################################
    
    I made a new variable:
    
    #Name
    CustomColorTaskStatus
    
    #Type of Key#
    ColorSelection
    
    
    #Value#
    futuretask_bg|FFFFFF
    futuretask_text|000000
    startedontime_bg|E6EEDD
    startedontime_text|000000
    shouldhavestarted_bg|FFEEBB
    shouldhavestarted_text|000000
    overdue_bg|CC6666
    overdue_text|000000
    done_bg|AADDAA
    done_text|000000
    
    
    ######## web2project-2.4\includes\cleanup_functions.php ######################################################################
    
    In function #showtask# I changed
    
    ##
    // prepare coloured highlight of task time information
    	$sign = 1;
    	$style = '';
    	if ($start_date) {
    		if (!$end_date) {
    			/*
    			** end date calc has been moved to calcEndByStartAndDuration()-function
    			** called from array_csort and tasks.php
    			** perhaps this fallback if-clause could be deleted in the future,
    			** didn't want to remove it shortly before the 2.0.2
    			*/
    			$end_date = new w2p_Utilities_Date('0000-00-00 00:00:00');
    		}
    
    		if ($now->after($start_date) && $arr['task_percent_complete'] == 0) {
    			$style = 'background-color:#ffeebb';
    		} elseif ($now->after($start_date) && $arr['task_percent_complete'] < 100) {
    			$style = 'background-color:#e6eedd';
    		}
    
    		if ($now->after($end_date)) {
    			$sign = -1;
    			$style = 'background-color:#cc6666;color:#ffffff';
    		}
    		if ($arr['task_percent_complete'] == 100) {
    			$style = 'background-color:#aaddaa; color:#00000';
    		}
    
    		$days = $now->dateDiff($end_date) * $sign;
    	}
    ##
    
    to
    
    ##
    	// prepare coloured highlight of task time information
    	
    	$colors = w2PgetSysVal('CustomColorTaskStatus');	
    	$sign = 1;
    	$style = 'background-color:#'.$colors["futuretask_bg"].';color:#'.$colors["futuretask_text"];
    	if ($start_date) {
    	//$style = 'background-color:#'.$colors["futuretask_bg"];
    		if (!$end_date) {
    			/*
    			** end date calc has been moved to calcEndByStartAndDuration()-function
    			** called from array_csort and tasks.php
    			** perhaps this fallback if-clause could be deleted in the future,
    			** didn't want to remove it shortly before the 2.0.2
    			*/
    			$end_date = new w2p_Utilities_Date('0000-00-00 00:00:00');
    		}
    
    		if ($now->after($start_date) && $arr['task_percent_complete'] == 0) {
    			$style = 'background-color:#'.$colors["shouldhavestarted_bg"].';color:#'.$colors["shouldhavestarted_text"];			
    		} elseif ($now->after($start_date) && $arr['task_percent_complete'] < 100) {
    			$style = 'background-color:#'.$colors["startedontime_bg"].';color:#'.$colors["startedontime_text"];
    		}
    
    		if ($now->after($end_date)) {
    			$sign = -1;
    			$style = 'background-color:#'.$colors["overdue_bg"].';color:#'.$colors["overdue_text"];
    		}
    		if ($arr['task_percent_complete'] == 100) {
    			$style = 'background-color:#'.$colors["done_bg"].';color:#'.$colors["done_text"];
    		}
    
    		$days = $now->dateDiff($end_date) * $sign;
    	}
    ##
    
    
    
    
    
    In function #showtask_pd# I changed
    
    ##
    // prepare coloured highlight of task time information
    	$sign = 1;
    	$style = '';
    	if ($start_date) {
    		if (!$end_date) {
    			$end_date = new w2p_Utilities_Date('0000-00-00 00:00:00');
    		}
    
    		if ($now->after($start_date) && $a['task_percent_complete'] == 0) {
    			$style = 'background-color:#ffeebb';
    		} elseif ($now->after($start_date) && $a['task_percent_complete'] < 100) {
    			$style = 'background-color:#e6eedd';
    		}
    
    		if ($now->after($end_date)) {
    			$sign = -1;
    			$style = 'background-color:#cc6666;color:#ffffff';
    		}
    		if ($a['task_percent_complete'] == 100) {
    			$style = 'background-color:#aaddaa; color:#00000';
    		}
    
    		$days = $now->dateDiff($end_date) * $sign;
    	}
    ##
    
    to
    
    ##
    	// prepare coloured highlight of task time information
    	$colors = w2PgetSysVal('CustomColorTaskStatus');
    	$sign = 1;
    	$style = 'background-color:#'.$colors["futuretask_bg"].';color:#'.$colors["futuretask_text"];
    	if ($start_date) {
    		if (!$end_date) {
    			$end_date = new w2p_Utilities_Date('0000-00-00 00:00:00');
    		}
    
    		if ($now->after($start_date) && $a['task_percent_complete'] == 0) {
    			$style = 'background-color:#'.$colors["shouldhavestarted_bg"].';color:#'.$colors["shouldhavestarted_text"];
    		} elseif ($now->after($start_date) && $a['task_percent_complete'] < 100) {
    			$style = 'background-color:#'.$colors["startedontime_bg"].';color:#'.$colors["startedontime_text"];
    		}
    
    		if ($now->after($end_date)) {
    			$sign = -1;
    			$style = 'background-color:#'.$colors["overdue_bg"].';color:#'.$colors["overdue_text"];
    		}
    		if ($a['task_percent_complete'] == 100) {
    			$style = 'background-color:#'.$colors["done_bg"].';color:#'.$colors["done_text"];
    		}
    
    		$days = $now->dateDiff($end_date) * $sign;
    	}
    ##
    
    ######## web2project-2.4\modules\projectdesigner\vw_tasks.php ######################################################################
    
    I changed
    
    ##
    <table>
    <tr>
            <td><?php echo $AppUI->_('Key'); ?>:</td>
            <th>&nbsp;P&nbsp;</th>
            <td>=<?php echo $AppUI->_('Overall Priority'); ?></td>
            <th>&nbsp;U&nbsp;</th>
            <td>=<?php echo $AppUI->_('User Priority'); ?></td>
            <th>&nbsp;A&nbsp;</th>
            <td>=<?php echo $AppUI->_('Access'); ?></td>
            <th>&nbsp;T&nbsp;</th>
            <td>=<?php echo $AppUI->_('Type'); ?></td>
            <th>&nbsp;R&nbsp;</th>
            <td>=<?php echo $AppUI->_('Reminder'); ?></td>
            <th>&nbsp;I&nbsp;</th>
            <td>=<?php echo $AppUI->_('Inactive'); ?></td>
            <td>&nbsp; &nbsp;</td>
            <td style="border-style:solid;border-width:1px" bgcolor="#ffffff">&nbsp; &nbsp;</td>
            <td>=<?php echo $AppUI->_('Future Task'); ?></td>
            <td>&nbsp; &nbsp;</td>
            <td style="border-style:solid;border-width:1px" bgcolor="#e6eedd">&nbsp; &nbsp;</td>
            <td>=<?php echo $AppUI->_('Started and on time'); ?></td>
            <td style="border-style:solid;border-width:1px" bgcolor="#ffeebb">&nbsp; &nbsp;</td>
            <td>=<?php echo $AppUI->_('Should have started'); ?></td>
            <td>&nbsp; &nbsp;</td>
            <td style="border-style:solid;border-width:1px" bgcolor="#CC6666">&nbsp; &nbsp;</td>
            <td>=<?php echo $AppUI->_('Overdue'); ?></td>
            <td>&nbsp; &nbsp;</td>
            <td style="border-style:solid;border-width:1px" bgcolor="#aaddaa">&nbsp; &nbsp;</td>
            <td>=<?php echo $AppUI->_('Done'); ?></td>
    </tr>
    </table>
    ##
    
    to
    
    ##
    <?php
    $colors = w2PgetSysVal('CustomColorTaskStatus');
    ?>
    
    <table>
    <tr>
            <td><?php echo $AppUI->_('Key'); ?>:</td>
            <th>&nbsp;P&nbsp;</th>
            <td>=<?php echo $AppUI->_('Overall Priority'); ?></td>
            <th>&nbsp;U&nbsp;</th>
            <td>=<?php echo $AppUI->_('User Priority'); ?></td>
            <th>&nbsp;A&nbsp;</th>
            <td>=<?php echo $AppUI->_('Access'); ?></td>
            <th>&nbsp;T&nbsp;</th>
            <td>=<?php echo $AppUI->_('Type'); ?></td>
            <th>&nbsp;R&nbsp;</th>
            <td>=<?php echo $AppUI->_('Reminder'); ?></td>
            <th>&nbsp;I&nbsp;</th>
            <td>=<?php echo $AppUI->_('Inactive'); ?></td>
            <td>&nbsp; &nbsp;</td>
            <td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["futuretask_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Future Task'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["startedontime_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Started and on time'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["shouldhavestarted_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Should have started'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["overdue_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Overdue'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["done_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Done'); ?></td>
    </tr>
    </table>
    ##
    
    
    ######## web2project-2.4\modules\tasks\tasks.php ######################################################################
    
    I changed
    
    ##
    <table width="100%" class="std">
    	<tr>
    		<td nowrap="nowrap"><?php echo $AppUI->_('Key'); ?>:</td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#ffffff">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Future Task'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#e6eedd">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Started and on time'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#ffeebb">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Should have started'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#CC6666">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Overdue'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#aaddaa">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Done'); ?></td>
    		<td width="40%">&nbsp;</td>
    	</tr>
    </table>
    ##
    
    to
    
    ##
    <?php
    $colors = w2PgetSysVal('CustomColorTaskStatus');
    ?>
    
    <table width="100%" class="std">
    	<tr>
    		<td nowrap="nowrap"><?php echo $AppUI->_('Key'); ?>:</td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["futuretask_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Future Task'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["startedontime_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Started and on time'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["shouldhavestarted_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Should have started'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["overdue_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Overdue'); ?></td>
    		<td>&nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["done_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Done'); ?></td>
    		<td width="40%">&nbsp;</td>
    	</tr>
    </table>
    ##
    
    
    ######## web2project-2.4\modules\tasks\todo_tasks_sub.php ######################################################################
    
    I changed
    
    ##
    <table>
        <tr>
            <td>&nbsp; &nbsp;</td>
            <td style="border-style:solid;border-width:1px" bgcolor="#ffffff">&nbsp; &nbsp;</td>
            <td>=<?php echo $AppUI->_('Future Task'); ?></td>
            <td>&nbsp; &nbsp;</td>
            <td style="border-style:solid;border-width:1px" bgcolor="#e6eedd">&nbsp; &nbsp;</td>
            <td>=<?php echo $AppUI->_('Started and on time'); ?></td>
            <td style="border-style:solid;border-width:1px" bgcolor="#ffeebb">&nbsp; &nbsp;</td>
            <td>=<?php echo $AppUI->_('Should have started'); ?></td>
            <td>&nbsp; &nbsp;</td>
            <td style="border-style:solid;border-width:1px" bgcolor="#CC6666">&nbsp; &nbsp;</td>
            <td>=<?php echo $AppUI->_('Overdue'); ?></td>
        </tr>
    </table>
    ##
    
    to
    
    ##
    <?php
    $colors = w2PgetSysVal('CustomColorTaskStatus');
    ?>
    
    <table>
        <tr>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["futuretask_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Future Task'); ?></td>
    		<td>&nbsp; &nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["startedontime_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Started and on time'); ?></td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["shouldhavestarted_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Should have started'); ?></td>
    		<td>&nbsp; &nbsp;</td>
    		<td style="border-style:solid;border-width:1px" bgcolor="#<?php echo $colors["overdue_bg"]; ?>">&nbsp;&nbsp;</td>
    		<td nowrap="nowrap">=<?php echo $AppUI->_('Overdue'); ?></td>
        </tr>
    </table>
    ##
    txt file icon Custom Colors for Task Status.txt (12,536 bytes) 1969-12-31 16:00 +

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2011-09-11 23:03 Ckr New Issue
2011-09-11 23:03 Ckr File Added: Custom Colors for Task Status.txt
2014-08-16 18:19 caseydk Category General => Tasks
+Issue History