Today, 'This Week', 'Next Week' Dashboard hack
Page: 1, 2
Brady J. Frey
on Aug 7. 2007. 4:02 pm
Alright, I hired Watershed Studios (http://watershedstudio.com) to implement this for us since I don't have time, and they did a fantastic job. Brian Groce was a great support in getting this moving. He set this up to be a 30 day outlook, as well as current day/late milestones.
Download is available at:
http://dotfive.com/bf/activeCollab_Upcoming_Events_v1.0.zip
His directions:
-------------------------
"Brady,
I've attached the first version of the activeCollab Upcoming Events code.
We created this in a manner that requires minimal core changes.
Installation...
To install backup your files and FTP these three files:
init.php
application/views/dashboard/index.php
plugins/upcomingevents.php
init.php
This adds the call to the new plugin file/directory...
// Watershed's hack: get plugins
$plugins = glob(dirname(__FILE__).'/plugins/*.php');
if( is_array( $plugins ) ) {
foreach ( $plugins as $plugin ) {
if( is_file( $plugin ) )
include_once( $plugin );
}
}
// end Watershed's hack
application/views/dashboard/index.php
This adds to function call to display the additional milestones...
<?php if ( function_exists('extra_milestones') ) extra_milestones(); ?>
plugins/upcomingevents.php
This is a new file and directory and contains all of the functionality used to display the additional milestones."
-------------------------
So in theory, add the plugins folder with content, replace the other two files, and it works just fine - atleat for me!
Download is available at:
http://dotfive.com/bf/activeCollab_Upcoming_Events_v1.0.zip
His directions:
-------------------------
"Brady,
I've attached the first version of the activeCollab Upcoming Events code.
We created this in a manner that requires minimal core changes.
Installation...
To install backup your files and FTP these three files:
init.php
application/views/dashboard/index.php
plugins/upcomingevents.php
init.php
This adds the call to the new plugin file/directory...
// Watershed's hack: get plugins
$plugins = glob(dirname(__FILE__).'/plugins/*.php');
if( is_array( $plugins ) ) {
foreach ( $plugins as $plugin ) {
if( is_file( $plugin ) )
include_once( $plugin );
}
}
// end Watershed's hack
application/views/dashboard/index.php
This adds to function call to display the additional milestones...
<?php if ( function_exists('extra_milestones') ) extra_milestones(); ?>
plugins/upcomingevents.php
This is a new file and directory and contains all of the functionality used to display the additional milestones."
-------------------------
So in theory, add the plugins folder with content, replace the other two files, and it works just fine - atleat for me!
To fix the order.
FIND:
return self::findAll(array(
'conditions' => array('`completed_on` = ? AND (`due_date` >= ? AND `due_date` < ?) AND `project_id` IN (?)', EMPTY_DATETIME, $from_date, $to_date, $project_ids)
)); // findAll
REPLACE WITH:
return self::findAll(array(
'conditions' => array('`completed_on` = ? AND (`due_date` >= ? AND `due_date` < ?) AND `project_id` IN (?)', EMPTY_DATETIME, $from_date, $to_date, $project_ids),
'order' => '`due_date`'
)); // findAll
FIND:
return self::findAll(array(
'conditions' => array('`completed_on` = ? AND (`due_date` >= ? AND `due_date` < ?) AND `project_id` IN (?)', EMPTY_DATETIME, $from_date, $to_date, $project_ids)
)); // findAll
REPLACE WITH:
return self::findAll(array(
'conditions' => array('`completed_on` = ? AND (`due_date` >= ? AND `due_date` < ?) AND `project_id` IN (?)', EMPTY_DATETIME, $from_date, $to_date, $project_ids),
'order' => '`due_date`'
)); // findAll
that does it! a note to others trying this, if you want to save a backup of the original upcomingevents.php, rename it to something like upcomingevents.bak and *not* upcomingevents-bak.php, having two .php files with similar code in the plug-in folder causes a conflict that breaks activecollab.
Brady J. Frey
on Aug 14. 2007. 4:50 pm
Fantastic, thank you both for the improved directions and updated code:)
Topic is locked. If you have something important to say about issues discussed on this page please write at hi@a51dev.com.



