Index: Themes/default/Trunk/stylesheets/project/calendar.css =================================================================== --- Themes/default/Trunk/stylesheets/project/calendar.css (revision 0) +++ Themes/default/Trunk/stylesheets/project/calendar.css (revision 0) @@ -0,0 +1,39 @@ +.calendar th { + width: 14%; + text-align: center; +} + +.calendar th.weekend { + background-color: #c8d7ff; +} + +.calendar td { + background-color: #eee; +} + +.calendar .date { + margin-bottom: 4px; + padding-right: 4px; + text-align: right; + font-weight: bold; +} + +.calendar td.weekend .date { + background-color: #c8d7ff; +} + +.calendar td.weekday .date { + background-color: #d9e8ff; +} + +.calendar .month-nav { + font-weight: bold; +} + +.calendar .month-nav .prev-month { + float: left; +} + +.calendar .month-nav .next-month { + float: right; +} Index: ProjectPier/Trunk/language/en_us/errors.php =================================================================== --- ProjectPier/Trunk/language/en_us/errors.php (revision 145) +++ ProjectPier/Trunk/language/en_us/errors.php (working copy) @@ -12,6 +12,7 @@ // General 'invalid email address' => 'Email address format is not valid', + 'id missing' => 'Required ID value is missing', // Company validation errors 'company name required' => 'Company / organization name is required', Index: ProjectPier/Trunk/language/en_us/general.php =================================================================== --- ProjectPier/Trunk/language/en_us/general.php (revision 145) +++ ProjectPier/Trunk/language/en_us/general.php (working copy) @@ -117,6 +117,14 @@ 'month 10' => 'October', 'month 11' => 'November', 'month 12' => 'December', + + 'dow 1' => 'Monday', + 'dow 2' => 'Tuesday', + 'dow 3' => 'Wednesday', + 'dow 4' => 'Thursday', + 'dow 5' => 'Friday', + 'dow 6' => 'Saturday', + 'dow 7' => 'Sunday', ); // array ?> Index: ProjectPier/Trunk/language/en_us/actions.php =================================================================== --- ProjectPier/Trunk/language/en_us/actions.php (revision 145) +++ ProjectPier/Trunk/language/en_us/actions.php (working copy) @@ -63,6 +63,7 @@ 'add milestone' => 'Add milestone', 'edit milestone' => 'Edit milestone', 'delete milestone' => 'Delete milestone', + 'view calendar' => 'View calendar', // People 'update people' => 'Update', Index: ProjectPier/Trunk/application/models/projects/Project.class.php =================================================================== --- ProjectPier/Trunk/application/models/projects/Project.class.php (revision 145) +++ ProjectPier/Trunk/application/models/projects/Project.class.php (working copy) @@ -496,6 +496,31 @@ } // if } // splitOpenMilestones + + /** + * Return array of milestones for the month specified that the user has + * haccess to. + * + * @access public + * @param int $year + * @param int $month + * @return array + */ + function getMilestonesByMonth($year, $month) { + $from_date = DateTimeValueLib::make(0, 0, 0, $month, 1, $year); + $to_date = new DateTimeValue(strtotime('+1 month -1 day', $from_date->getTimestamp())); + + if (logged_user()->isMemberOfOwnerCompany()) { + $conditions = array('`project_id` = ? AND (`due_date` >= ? AND `due_date` < ?)', $this->getId(), $from_date, $to_date); + } else { + $conditions = array('`project_id` = ? AND (`due_date` >= ? AND `due_date` < ?) AND `is_private` = ?', $this->getId(), $from_date, $to_date, 0); + } + return ProjectMilestones::findAll(array( + 'conditions' => $conditions, + 'order' => 'due_date' + )); // findAll + } // getMilestonesByMonth + // --------------------------------------------------- // Task lists // --------------------------------------------------- Index: ProjectPier/Trunk/application/controllers/MilestoneController.class.php =================================================================== --- ProjectPier/Trunk/application/controllers/MilestoneController.class.php (revision 145) +++ ProjectPier/Trunk/application/controllers/MilestoneController.class.php (working copy) @@ -362,6 +362,32 @@ $this->redirectToReferer($milestone->getViewUrl()); } // open + /** + * Show calendar view milestone page + * + * @access public + * @param void + * @return null + */ + function calendar() { + $this->addHelper('textile'); + + $project = active_project(); + $id = get_id(); + if (strlen($id) == 0) { + $id = gmdate('Ym'); + } + if (preg_match('/^(\d{4})(\d{2})$/', $id, $matches)) { + list (, $year, $month) = $matches; + tpl_assign('year', $year); + tpl_assign('month', $month); + } else { + flash_error(lang('id missing')); + $this->redirectToReferer(get_url('milestone')); + } + tpl_assign('milestones', $project->getMilestonesByMonth($year, $month)); + } // calendar + } // MilestoneController ?> Index: ProjectPier/Trunk/application/views/milestone/calendar.php =================================================================== --- ProjectPier/Trunk/application/views/milestone/calendar.php (revision 0) +++ ProjectPier/Trunk/application/views/milestone/calendar.php (revision 0) @@ -0,0 +1,137 @@ + +
| $daysInWeek ? $dow - $daysInWeek : $dow))); ?> | + +|
|---|---|
| + $daysInWeek ? $dow - $daysInWeek : $dow, array(1, 7))) { + $dow_class = "weekend"; + } else { + $dow_class = "weekday"; + } +?> + |
+
+
+
|
+
+
+
| + + |