diff --git a/application/controllers/RequestController.php b/application/controllers/RequestController.php index 67d3d0556cc69001b994965fc476d598947f74fb..5d1cb9877a73c8cdc8391d893b98c53e1a793d89 100755 --- a/application/controllers/RequestController.php +++ b/application/controllers/RequestController.php @@ -738,6 +738,7 @@ class RequestController extends Nmc_Controller_Action $out->addSidebarModule('bulletinPreview'); $out->course = $course; $out->request = $request; + $out->terms = $this->_getFutureTerms(); $out->page = 'request/edit_wrapper'; $out->tagline = 'Edit Request'; $out->requestPage = 'submit'; @@ -796,6 +797,7 @@ class RequestController extends Nmc_Controller_Action $currentGeneration = $currentGeneration->getParentGeneration(); } + $out = new Application_View(); //$out->addSidebarModule('requestProgress'); $out->addSidebarModule('bulletinPreview'); @@ -803,6 +805,7 @@ class RequestController extends Nmc_Controller_Action $out->request = $request; $out->currentGeneration = $currentGeneration; $out->proposedGeneration = $proposedGeneration; + $out->terms = $this->_getFutureTerms(); $out->page = 'request/view'; $out->tagline = 'Preview Request'; $out->addCssFile('/ooss/request/submit'); @@ -891,5 +894,28 @@ class RequestController extends Nmc_Controller_Action $view->refresh = '/home'; echo $view->render('unlModernWrapper.xhtml'); } + + protected function _getFutureTerms() + { + $now = new Zend_Date(); + $month = $now->get(Zend_Date::MONTH); + $thisYear = $now->get(Zend_Date::YEAR); + $nextYear = $thisYear + 1; + + $terms = array(); + if ($month < 3) { + $terms[$thisYear . '3'] = 'Summer ' . $thisYear; + } + if ($month < 8) { + $terms[$nextYear . '1'] = 'Fall ' . $thisYear; + } + for ($year = $nextYear; $year < $thisYear + 5; $year++) { + $terms[$year . '2'] = 'Spring ' . $year; + $terms[$year . '3'] = 'Summer ' . $year; + $terms[($year + 1) . '1'] = 'Fall ' . ($year + 1); + } + + return $terms; + } } diff --git a/application/views/request/submit.xhtml b/application/views/request/submit.xhtml index ca601c845348219d905907903d715b32b79ee25f..f9a3c262d7d6692d91e4beab1c15ec8618225d94 100644 --- a/application/views/request/submit.xhtml +++ b/application/views/request/submit.xhtml @@ -11,13 +11,7 @@ 'effectiveSemester', $this->course->effectiveSemester, array('id' => 'effectiveSemester'), - array( - '20082' => 'Spring 2008', - '20083' => 'Summer 2008', - '20091' => 'Fall 2008', - '20092' => 'Spring 2009', - '20093' => 'Summer 2009' - ) + $this->terms ); ?> </label> diff --git a/application/views/request/view.xhtml b/application/views/request/view.xhtml index fdebfa26a1d0eb3a332fcb633b6142286c79b0a8..9a45cc207b33d19b722c8bd9859a1e38ddf6ed53 100644 --- a/application/views/request/view.xhtml +++ b/application/views/request/view.xhtml @@ -97,13 +97,7 @@ 'effectiveSemester', $this->course->effectiveSemester, array('id' => 'effectiveSemester'), - array( - '20082' => 'Spring 2008', - '20083' => 'Summer 2008', - '20091' => 'Fall 2008', - '20092' => 'Spring 2009', - '20093' => 'Summer 2009' - ) + $this->terms ); ?> </label>