Author Topic: Dashboard Changes I Make Upon Each Code Update  (Read 6272 times)

JKMickelson

  • Newbie
  • *
  • Posts: 2
    • View Profile
Dashboard Changes I Make Upon Each Code Update
« on: June 01, 2009, 01:19:40 pm »
This is a list of code changes I make to make the Dashboard useful for me.  I think others would find these settings useful for User Configuration.  Please advise for the proper way to incorporate these changes on an ongoing basis.

Sort Tasks By Due Date
controllers/DashboardController.class.php
Code: [Select]
117c117
<                       $tasks = ProjectTasks::getProjectTasks(active_project(),null,'ASC',null,null,$tag,$to_company,$to_user,null,true);
---
>                       $tasks = ProjectTasks::getProjectTasks(active_project(),ORDER_BY_DUEDATE,'ASC',null,null,$tag,$to_company,$to_user,null,true);

Sort Tasks By Priority and Due Date
models/project_tasks/ProjectTasks.class.php
Code: [Select]
229c229
<                       $order_by = '`order` ' . $orderdir;
---
>                       $order_by = "priority DESC, due_date ASC ";

Show Two Weeks in Calendar (very helpful on Fridays)
views/dashboard/widget_calendar.php
Code: [Select]
1a2
> $my_weeks=2; //JKM
18c19
<       $endday = $startday + 7;
---
>       $endday = $startday + (7 * $my_weeks);
63c64
<       for ($week_index = 0;$week_index<1; $week_index++) {
---
>       for ($week_index = 0;$week_index<$my_weeks; $week_index++) {
Show Ten Pending Tasks (enough for one day of work and planning)
views/dashboard/widget_pending_tasks.php
Code: [Select]
5a6,7
>
> $shortlist=10;
22c24
<               <tr class="<?php echo $c == 1'':'dashAltRow'; echo ' ' . ($c 5'dashSMTC':''); ?>" style="<?php echo $c 5'display:none':'' ?>">
---
>               <tr class="<?php echo $c == 1'':'dashAltRow'; echo ' ' . ($c $shortlist'dashSMTC':''); ?>" style="<?php echo $c $shortlist'display:none':'' ?>">
52c54
< <?php if ($c 5) { ?>
---
> <?php if ($c $shortlist) { ?>
54c56
<       <a href="#" onclick="og.hideAndShowByClass('dashSMTT', 'dashSMTC', 'dashTablePT'); return false;"><?php echo lang("show more amount"$c -5?>...</a>
---
>       <a href="#" onclick="og.hideAndShowByClass('dashSMTT', 'dashSMTC', 'dashTablePT'); return false;"><?php echo lang("show more amount"$c -$shortlist?>...</a>

« Last Edit: July 29, 2009, 01:06:30 am by JKMickelson »

Pet

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 638
  • Always mining for solutions!
    • View Profile
    • The Bet!
Re: Dashboard Changes I Make Upon Each Code Update
« Reply #1 on: June 04, 2009, 07:35:52 pm »
Nice list, thanks for posting that! To make it easier for others to cut & paste, you could also use the code tags (it is the icon with a # on a white page), it does this:

Code: [Select]
10 ? HELLO WORLD
20 GOTO 10

cheers
Support OpenGoo - Sponsor a Feature! | Follow me on Twitter | OG Support Chat | Did you turn debugging on?

conrado

  • Administrator
  • Hero Member
  • *****
  • Posts: 998
  • Conrado
    • View Profile
    • Feng Office
    • Email
Re: Dashboard Changes I Make Upon Each Code Update
« Reply #2 on: June 04, 2009, 07:56:08 pm »
Useful! Thanks!  :D
Get Official Support for your Feng Office. Support the development team. Sign up for a Free Trial here.

JKMickelson

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Dashboard Changes I Make Upon Each Code Update
« Reply #3 on: July 29, 2009, 01:08:39 am »
I updated the posting with the code tag.

Thank you for a very nice product.

taca

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Dashboard Changes I Make Upon Each Code Update
« Reply #4 on: July 29, 2009, 01:42:35 am »
Hi,

and please use unified (or context) diff.  Use -u or -c option to diff command.

Best regards.
--
Takahiro Kambe

krashnik

  • Freshman
  • *
  • Posts: 25
    • View Profile
    • HardMagic Publishing
Re: Dashboard Changes I Make Upon Each Code Update
« Reply #5 on: May 03, 2011, 03:08:44 pm »
Any update to this?

I'd actually like to be able to sort our tasks based on the latest activity in the file. 

I've changed
Code: [Select]
static function getProjectTasks($project = null, $order = null, $orderdir = 'ASC', $parent_id = null, $milestone_id = null, $tag = null, $assigned_to_company = null, $assigned_to_user = null, $assigned_by_user = null, $pending = false, $priority = "all", $is_template = false, $is_today = false, $is_late = false, $limit = null, $archived = false) {
if ($order == self::ORDER_BY_STARTDATE) {
$order_by = '`start_date` ' . $orderdir;
} else if ($order == self::ORDER_BY_DUEDATE) {
$order_by = '`due_date` ' . $orderdir;
} else {
// default
$order_by = '`order` ' . $orderdir;

} // if

And I have updated it to add this:

Code: [Select]
static function getProjectTasks($project = null, $order = null, $orderdir = 'ASC', $parent_id = null, $milestone_id = null, $tag = null, $assigned_to_company = null, $assigned_to_user = null, $assigned_by_user = null, $pending = false, $priority = "all", $is_template = false, $is_today = false, $is_late = false, $limit = null, $archived = false) {
if ($order == self::ORDER_BY_STARTDATE) {
$order_by = '`start_date` ' . $orderdir;
} else if ($order == self::ORDER_BY_DUEDATE) {
$order_by = '`due_date` ' . $orderdir;
} else if ($order == self::ORDER_BY_ACTIVITY) {
$order_by = '`updated_on` ' . $orderdir;
} else {
// default
$order_by = '`order` ' . $orderdir;

} // if

However... now I need to add ORDER_BY_ACTIVITY into the drop down list for the options.  I'd also like to be able to sort based on which tasks have messages that haven't been read yet.

Any help would be appreciated!
Owner of HardMagic Publishing