diff --git a/application/modules/courses/controllers/PublicViewController.php b/application/modules/courses/controllers/PublicViewController.php index 6b56227a291ad352d64786bb65cf9d7c88394278..1271d3dfbc318dc132310819b3e7b393780bc8e7 100644 --- a/application/modules/courses/controllers/PublicViewController.php +++ b/application/modules/courses/controllers/PublicViewController.php @@ -268,21 +268,12 @@ class Courses_PublicViewController extends App_Controller_Action { public function searchAction() { - $this->view->activityTypes = array( - 1 => 'Lec - Lecture', - 2 => 'Lab - Lab', - 3 => 'Quz - Quiz', - 4 => 'Rct - Recitation', - 5 => 'Stu - Studio', - 6 => 'Fld - Field', - 7 => 'Ind - Independent Study', - 8 => 'Psi - Personalized System of Instruction' - ); + $this->_loadSearchBoxViewData(); $in = $this->_getAllParams(); $criteria = $in; $criteria['title'] = $criteria['courseTitle']; - $courses = Courses_CourseModel::findWithCriteria($criteria); + $courses = Courses_CourseModel::findWithCriteria($criteria, true); $data = new Unl_Model_Collection('Unl_Model_Array'); foreach ($courses as $requestId => $course) { @@ -318,6 +309,7 @@ class Courses_PublicViewController extends App_Controller_Action { 'department' => $course->getDepartment(), 'title' => $title, 'courseId' => $course->getCourseId(), + 'className' => ($course->getRemoved() ? 'removed': '') )); } @@ -343,35 +335,11 @@ class Courses_PublicViewController extends App_Controller_Action { $this->view->data = $data; $this->view->criteria = $criteria; - $this->view->hasSearched = isset($criteria['college']); - $hierarchy = Courses_CourseModel::getSubjectDepartmentCollegeHierarchy(); - $colleges = array(); - $departments = array(); - $departmentsSerial = array(); - $subjects = array(); - $subjectsSerial = array(); - foreach ($hierarchy as $collegeId => $college) { - $colleges[$collegeId] = $college['name']; - foreach ($college['departments'] as $departmentId => $department) { - $departments[$department['name']] = array('collegeId' => $collegeId, 'departmentId' => $departmentId); - $departmentsSerial[$departmentId] = $department['name']; - foreach ($department['subjects'] as $subjectCode => $subjectName) { - $subjects[$subjectCode . ' - ' . $subjectName] = array('departmentId' => $departmentId, 'subjectCode' => $subjectCode); - $subjectsSerial[$subjectCode] = $subjectCode . ' - ' . $subjectName; - } - } - } - ksort($departments); - ksort($subjects); - - $this->view->colleges = $colleges; - $this->view->departments = $departments; - $this->view->departmentsSerial = $departmentsSerial; - $this->view->subjects = $subjects; - $this->view->subjectsSerial = $subjectsSerial; - $this->view->revise = $in['revise']; + if (isset($criteria['college'])) { + $this->render('results'); + } } @@ -403,17 +371,21 @@ class Courses_PublicViewController extends App_Controller_Action { } } - $this->view->colleges = $colleges; - $this->view->departments = $departments; - $this->view->departmentsSerial = $departmentsSerial; - $this->view->subjects = $subjects; - $this->view->subjectsSerial = $subjectsSerial; + $this->view->criteria = $session->recentSearchCriteria; $this->view->course = $course; + $this->_loadSearchBoxViewData(); + $previousRequests = Courses_CourseModel::findAllRequestsForCourse($course); $previousRequests->orderBy('getLastApprovalTimestamp', SORT_DESC); + $this->view->effectiveDate = new Zend_Date(0); + foreach ($previousRequests as $previousRequest) { + $this->view->effectiveDate = $previousRequest->getLastApprovalTime(); + break; + } + $requestParentCourses = Courses_CourseModel::findParentOfRequest($previousRequests); $requestFinalCourses = Courses_CourseModel::findLatestOfRequest($previousRequests); @@ -425,7 +397,89 @@ class Courses_PublicViewController extends App_Controller_Action { $this->view->requestComments = $requestComments; $offerings = Courses_ScheduleModel::fetchForCourses($course); - $offerings->orderBy('getSemesterCode', SORT_DESC); + + $session = new Zend_Session_Namespace(__CLASS__ . __METHOD__); + + // sort offerings + + $sortBy = $session->sortBy; + if (!Unl_Util::isArray($sortBy)) { + $sortBy = array('semesterCode'); + } + if ($in['sort']) { + if (($key = array_search($in['sort'], $sortBy)) !== FALSE) { + unset($sortBy[$key]); + } + $sortBy[] = $in['sort']; + } + $session->sortBy = $sortBy; + + // sort request history + + $sortBy = $session->sortHistoryBy; + if (!Unl_Util::isArray($sortBy)) { + $sortBy = array(); + } + if ($in['sort-history']) { + if (($key = array_search($in['sort-history'], $sortBy)) !== FALSE) { + unset($sortBy[$key]); + } + $sortBy[] = $in['sort-history']; + } + $session->sortHistoryBy = $sortBy; + + foreach ($sortBy as $sortKey) { + if ($sortKey == 'lastApprovalTimestamp') { + $previousRequests->orderBy('get' . $sortKey, SORT_DESC); + } else { + $previousRequests->orderBy('get' . $sortKey); + } + } + + + $this->view->offerings = $offerings; + + } + + protected function _loadSearchBoxViewData() + { + $hierarchy = Courses_CourseModel::getSubjectDepartmentCollegeHierarchy(); + $colleges = array(); + $departments = array(); + $departmentsSerial = array(); + $subjects = array(); + $subjectsSerial = array(); + foreach ($hierarchy as $collegeId => $college) { + $colleges[$collegeId] = $college['name']; + foreach ($college['departments'] as $departmentId => $department) { + $departments[$department['name']] = array('collegeId' => $collegeId, 'departmentId' => $departmentId); + $departmentsSerial[$departmentId] = $department['name']; + foreach ($department['subjects'] as $subjectCode => $subjectName) { + $subjects[$subjectCode . ' - ' . $subjectName] = array('departmentId' => $departmentId, 'subjectCode' => $subjectCode); + $subjectsSerial[$subjectCode] = $subjectCode . ' - ' . $subjectName; + } + } + } + + ksort($departments); + ksort($subjects); + + $this->view->colleges = $colleges; + $this->view->departments = $departments; + $this->view->departmentsSerial = $departmentsSerial; + $this->view->subjects = $subjects; + $this->view->subjectsSerial = $subjectsSerial; + + $this->view->activityTypes = array( + 1 => 'Lec - Lecture', + 2 => 'Lab - Lab', + 3 => 'Quz - Quiz', + 4 => 'Rct - Recitation', + 5 => 'Stu - Studio', + 6 => 'Fld - Field', + 7 => 'Ind - Independent Study', + 8 => 'Psi - Personalized System of Instruction' + ); } } diff --git a/application/modules/courses/models/CourseModel.php b/application/modules/courses/models/CourseModel.php index 928219e28887dbb7ccb4336221c04a144530a467..b693c6da396b79d9412fb2fc65a40f412e788972 100644 --- a/application/modules/courses/models/CourseModel.php +++ b/application/modules/courses/models/CourseModel.php @@ -479,9 +479,9 @@ class Courses_CourseModel extends Unl_Model return self::find($generationIds); } - static public function findWithCriteria(&$criteria = array()) + static public function findWithCriteria(&$criteria = array(), $includeRemoved = false) { - $validKeys = array('college', 'department', 'subject', 'courseNumber', 'courseLetter', 'title', 'campus', 'ace', 'aceOutcomes', 'essentialStudies', 'integratedStudies'); + $validKeys = array('college', 'department', 'subject', 'courseNumber', 'courseLetter', 'title', 'campus', 'ace', 'aceOutcomes', 'essentialStudies', 'integratedStudies', 'activity'); $criteria = array_intersect_key($criteria, array_flip($validKeys)); $emptySearch = true; foreach ($criteria as $value) { @@ -504,7 +504,9 @@ class Courses_CourseModel extends Unl_Model $select->join(array('g' => 'creqCourseGenerations'), 'x.generation = g.courseGenerationId', array('courseGenerationId')); $select->join(array('p' => 'creqCourses'), 'g.courseGenerationId = p.currentGeneration', array()); $select->join(array('e' => 'creqCourseDetails'), 'g.courseGenerationId = e.generation', array()); - $select->where('g.removed = "no"'); + if (!$includeRemoved) { + $select->where('g.removed = "no"'); + } $select->where('g.type = "official"'); if ($criteria['college']) { $select->where('l.collegeId = ?', $criteria['college']); diff --git a/application/modules/courses/views/scripts/public-view/results.phtml b/application/modules/courses/views/scripts/public-view/results.phtml index c3c31f97fdb76686a469dc45eb7f8a8abdadc944..77247fae55580ed4a15f8b3e9d4f305d71ddf716 100644 --- a/application/modules/courses/views/scripts/public-view/results.phtml +++ b/application/modules/courses/views/scripts/public-view/results.phtml @@ -1,22 +1,33 @@ -<?php $this->headLink()->appendStylesheet($this->baseUrl() . '/css/iace/reports/weekly.css', 'all'); ?> -<?php $this->layout()->breadcrumbs = array('Curriculum Search'); ?> +<?php $this->headLink()->appendStylesheet($this->baseUrl() . '/css/courses/public-view/results.css', 'all'); ?> +<?php $this->headScript()->appendFile($this->baseUrl() . '/javascript/courses/public-view/results.js'); ?> <?php $this->layout()->hideMenu = true; ?> -<h2>Results for:</h2> -<div> - <?php - foreach ($this->criteria as $key => $value) { - if ($value && $value != -1) { - ?> - <?php echo $key; ?> <?php echo $value; ?> - <?php } } ?> + +<?php echo $this->partial('public-view/search-box-sidebar.phtml', $this); ?> + +<div id="instructions"> + <button id="printButton">Print</button> + You can sort the list below by clicking on any column heading. Click on a specific course to see more details. </div> -<?php +<?php if ($this->data && count($this->data) > 0) { ?> + +<div id="results"> +<?php echo $this->collectionTable( $this->data, - array('slo' => 'SLO', 'college' => 'College', 'courseCode' => 'Course', 'title' => 'Title'), + array('courseCode' => 'Course', 'title' => 'Title', 'college' => 'College', 'department' => 'Department', 'slo' => 'ACE/CEP Status'), $this->criteria, array('courseCode' => array('type' => 'link', - 'urlSpec' => array($this->baseUrl() . '/courses/public-view/view/id/%s', 'courseId'))) + 'urlSpec' => array($this->baseUrl() . '/courses/public-view/view/id/%s', 'courseId'))), + 'className' ); +?> +</div> + +<?php } else { ?> + +<div class="warning"> + Unfortunately, no courses were found. +</div> +<?php } diff --git a/application/modules/courses/views/scripts/public-view/search-box-full.phtml b/application/modules/courses/views/scripts/public-view/search-box-full.phtml new file mode 100644 index 0000000000000000000000000000000000000000..f3dde632550a5b8dc6dce4d841c1b6b68c67219b --- /dev/null +++ b/application/modules/courses/views/scripts/public-view/search-box-full.phtml @@ -0,0 +1,13 @@ +<form method="get" + action="<?php echo $this->baseUrl(); ?>/courses/public-view/search" + id="searchForm" +> + +<?php + +$this->searchBoxFull = true; +echo $this->partial('public-view/search-box.phtml', $this); + +?> + +</form> diff --git a/application/modules/courses/views/scripts/public-view/search-box-sidebar.phtml b/application/modules/courses/views/scripts/public-view/search-box-sidebar.phtml new file mode 100644 index 0000000000000000000000000000000000000000..037bef1fd408c12ec4262e8e34b4d7d543a8a8ad --- /dev/null +++ b/application/modules/courses/views/scripts/public-view/search-box-sidebar.phtml @@ -0,0 +1,10 @@ +<div id="searchFormSidebar"> +<form method="get" action="<?php echo $this->baseUrl(); ?>/courses/public-view/search" id="searchFormSmall"> + +<?php echo $this->partial('public-view/search-box.phtml', $this); ?> + +</form> + +<button id="restartSearchButton" onclick="location.href = '<?php echo $this->baseUrl(); ?>/courses/public-view/search';">Restart Search</button> +<button id="logInButton" onclick="location.href = '<?php echo $this->baseUrl(); ?>/auth/index/login';">Log In</button> +</div> \ No newline at end of file diff --git a/application/modules/courses/views/scripts/public-view/search-box.phtml b/application/modules/courses/views/scripts/public-view/search-box.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9730c34148c9c8626d5990dc719c008570c48558 --- /dev/null +++ b/application/modules/courses/views/scripts/public-view/search-box.phtml @@ -0,0 +1,105 @@ +<?php $this->headLink()->appendStylesheet($this->baseUrl() . '/css/courses/public-view/search-box.css', 'all'); ?> +<?php $this->headScript()->appendFile($this->baseUrl() . '/javascript/courses/public-view/search-box.js'); ?> + +<div class="helpText"> + Begin your search by entering or selecting information in at least<br /> on of the following fields: +</div> + +<?php if (!$this->searchBoxFull) { ?> +<h3>Results for</h3> +<?php } ?> + +<div> + <label class="aligned" for="college">College</label> + <?php echo $this->formSelect('college', $this->criteria['college'], null, array(0 => '') + $this->colleges); ?> +</div> + +<div> + <label class="aligned" for="department">Department</label> + <select id="department" name="department"> + <option value="0"></option> + <?php foreach ($this->departments as $departmentName => $departmentInfo) { ?> + <option rel="<?php echo $departmentInfo['collegeId']; ?>" + value="<?php echo $departmentInfo['departmentId']; ?>" + <?php if ($this->criteria['department'] == $departmentInfo['departmentId']) { ?>selected="selected"<?php } ?> + > + <?php echo $departmentName; ?> + </option> + <?php } ?> + </select> +</div> + +<div> + <label class="aligned" for="subject">Subject</label> + <select id="subject" name="subject"> + <option value="0"></option> + <?php foreach ($this->subjects as $subjectName => $subjectInfo) { ?> + <option rel="<?php echo $subjectInfo['departmentId']; ?>" + value="<?php echo $subjectInfo['subjectCode']; ?>" + <?php if ($this->criteria['subject'] == $subjectInfo['subjectCode']) { ?>selected="selected"<?php } ?> + > + <?php echo $subjectName; ?> + </option> + <?php }?> + </select> +</div> + +<div> + <label class="aligned" for="courseNumber"><span class="verbose">Course </span>Number</label> + <?php echo $this->formText('courseNumber', $this->criteria['courseNumber']); ?> + <a class="hoverHelp" target="_new" href="#"> + <span class="hoverHelpText">Specifc number (i.e. 101) or Partial number (i.e. 1 for 100 level courses)</span> + ? + </a> + <label for="courseLetter"><span class="verbose">Course </span>Letter</label> + <?php echo $this->formText('courseLetter', $this->criteria['courseLetter']); ?> + <a class="hoverHelp" target="_new" href="#"> + <span class="hoverHelpText">One letter (i.e. H for Honors courses, or A, G, etc.)</span> + ? + </a> +</div> + +<div> + <label class="aligned" for="courseTitle">Title Keyword(s)</label> + <?php echo $this->formText('courseTitle', $this->criteria['courseTitle']); ?> +</div> + +<div class="helpText"> + You can narrow your results further by selecting one or more of the following +</div> + +<div> + <label class="aligned" for="activity">Activity Type</label> + <?php echo $this->formSelect('activity', $this->criteria['activity'], null, array(-1 => '') + $this->activityTypes); ?> + <label for="campus">Campus</label> + <?php echo $this->formSelect('campus', $this->criteria['campus'], null, array('' => '', 'UNL' => 'UNL', 'UNO' => 'UNO', 'UNK' => 'UNK')); ?> + <?php echo $this->formCheckbox('specialFee', null, array('disabled' => 'disabled')); ?> + <label for="specialFee">Special Fees</label> +</div> + +<div> + General Education Designation: + <?php echo $this->formCheckbox('ace', $this->criteria['ace'], null, array('1', '0')); ?> + <label for="ace">ACE</label> + <?php + $aceOutcomesOptions = array('multiple' => 'multiple'); + if (!$this->criteria['ace']) { + $aceOutcomesOptions['disabled'] = 'disabled'; + } + echo $this->formSelect('aceOutcomes', + $this->criteria['aceOutcomes'], + $aceOutcomesOptions, + array(1 => 'ACE 1','ACE 2','ACE 3','ACE 4','ACE 5','ACE 6','ACE 7','ACE 8','ACE 9','ACE 10')); ?> + <label for="essentialStudies">ES</label> + <?php echo $this->formCheckbox('essentialStudies', $this->criteria['essentialStudies'], null, array('1', '0')); ?> + <label for="integratedStudies">IS</label> + <?php echo $this->formCheckbox('integratedStudies', $this->criteria['integratedStudies'], null, array('1', '0')); ?> +</div> + +<div class="helpText"> + You can narow your search to one or more ACE Outcomes by selecting from the list. + To select multiple outcomes hold down the Ctrl key (Windows) or Command Key (Mac). +</div> + +<?php echo $this->formSubmit('submit', 'Search'); ?> +<?php echo $this->formReset('reset', 'Clear Form')?> \ No newline at end of file diff --git a/application/modules/courses/views/scripts/public-view/search.phtml b/application/modules/courses/views/scripts/public-view/search.phtml index 836c74e0bfd69344a10b85a81c40a8b5a6c78a0d..0069a4b9f57a7d6371514bfb40a8755272ea5c9e 100644 --- a/application/modules/courses/views/scripts/public-view/search.phtml +++ b/application/modules/courses/views/scripts/public-view/search.phtml @@ -1,146 +1,8 @@ <?php $this->headLink()->appendStylesheet($this->baseUrl() . '/css/courses/public-view/search.css', 'all'); ?> -<?php $this->headLink()->appendStylesheet($this->baseUrl() . '/css/iace/reports/weekly.css', 'all'); ?> <?php $this->headScript()->appendFile($this->baseUrl() . '/javascript/courses/public-view/search.js'); ?> <?php $this->layout()->breadcrumbs = array('Curriculum Search'); ?> <?php $this->layout()->tagline = 'Curriculum Search'; ?> <?php $this->layout()->hideMenu = true; ?> -<?php if ($this->hasSearched && !$this->revise) { ?> -<?php echo $this->partial('public-view/search-summary.phtml', $this); ?> -<div id="instructions"> - <button id="printButton">Print</button> - You can sort the list below by clicking on any column heading. Click on a specific course to see more details. -</div> - -<?php } ?> - - -<form method="get" - action="<?php echo $this->baseUrl(); ?>/courses/public-view/search" - id="searchForm" - <?php if ($this->hasSearched && !$this->revise) { ?> style="display:none;"<?php }?> -> - - <div class="helpText"> - Begin your search by entering or selecting information in at least<br /> on of the following fields: - </div> - - <div> - <label class="aligned" for="college">College</label> - <?php echo $this->formSelect('college', $this->criteria['college'], null, array(0 => '') + $this->colleges); ?> - </div> - - <div> - <label class="aligned" for="department">Department</label> - <select id="department" name="department"> - <option value="0"></option> - <?php foreach ($this->departments as $departmentName => $departmentInfo) { ?> - <option rel="<?php echo $departmentInfo['collegeId']; ?>" - value="<?php echo $departmentInfo['departmentId']; ?>" - <?php if ($this->criteria['department'] == $departmentInfo['departmentId']) { ?>selected="selected"<?php } ?> - > - <?php echo $departmentName; ?> - </option> - <?php } ?> - </select> - </div> - - <div> - <label class="aligned" for="subject">Subject</label> - <select id="subject" name="subject"> - <option value="0"></option> - <?php foreach ($this->subjects as $subjectName => $subjectInfo) { ?> - <option rel="<?php echo $subjectInfo['departmentId']; ?>" - value="<?php echo $subjectInfo['subjectCode']; ?>" - <?php if ($this->criteria['subject'] == $subjectInfo['subjectCode']) { ?>selected="selected"<?php } ?> - > - <?php echo $subjectName; ?> - </option> - <?php }?> - </select> - </div> - - <div> - <label class="aligned" for="courseNumber">Course Number</label> - <?php echo $this->formText('courseNumber', $this->criteria['courseNumber']); ?> - <a class="hoverHelp" target="_new" href="#"> - <span class="hoverHelpText">Specifc number (i.e. 101) or Partial number (i.e. 1 for 100 level courses)</span> - ? - </a> - <label for="courseLetter">Course Letter</label> - <?php echo $this->formText('courseLetter', $this->criteria['courseLetter']); ?> - <a class="hoverHelp" target="_new" href="#"> - <span class="hoverHelpText">One letter (i.e. H for Honors courses, or A, G, etc.)</span> - ? - </a> - </div> - - <div> - <label class="aligned" for="courseTitle">Title Keyword(s)</label> - <?php echo $this->formText('courseTitle', $this->criteria['courseTitle']); ?> - </div> - - <div class="helpText"> - You can narrow your results further by selecting one or more of the following - </div> - - <div> - <label class="aligned" for="activity">Activity Type</label> - <?php echo $this->formSelect('activity', $this->criteria['activity'], null, array(-1 => '') + $this->activityTypes); ?> - <label for="campus">Campus</label> - <?php echo $this->formSelect('campus', $this->criteria['campus'], null, array('' => '', 'UNL' => 'UNL', 'UNO' => 'UNO', 'UNK' => 'UNK')); ?> - <?php echo $this->formCheckbox('specialFee', null, array('disabled' => 'disabled')); ?> - <label for="specialFee">Special Fees</label> - </div> - - <div> - General Education Designation: - <?php echo $this->formCheckbox('ace', $this->criteria['ace'], null, array('1', '0')); ?> - <label for="ace">ACE</label> - <?php - $aceOutcomesOptions = array('multiple' => 'multiple'); - if (!$this->criteria['ace']) { - $aceOutcomesOptions['disabled'] = 'disabled'; - } - echo $this->formSelect('aceOutcomes', - $this->criteria['aceOutcomes'], - $aceOutcomesOptions, - array(1 => 'ACE 1','ACE 2','ACE 3','ACE 4','ACE 5','ACE 6','ACE 7','ACE 8','ACE 9','ACE 10')); ?> - <label for="essentialStudies">ES</label> - <?php echo $this->formCheckbox('essentialStudies', $this->criteria['essentialStudies'], null, array('1', '0')); ?> - <label for="integratedStudies">IS</label> - <?php echo $this->formCheckbox('integratedStudies', $this->criteria['integratedStudies'], null, array('1', '0')); ?> - </div> - - <div class="helpText"> - You can narow your search to one or more ACE Outcomes by selecting from the list. - To select multiple outcomes hold down the Ctrl key (Windows) or Command Key (Mac). - </div> - - <?php echo $this->formSubmit('submit', 'Search'); ?> - <?php echo $this->formReset('reset', 'Clear Form')?> -</form> - - - -<?php if ($this->hasSearched && $this->data && count($this->data) > 0) { ?> - -<div id="results"> -<?php -echo $this->collectionTable( - $this->data, - array('courseCode' => 'Course', 'title' => 'Title', 'college' => 'College', 'department' => 'Department', 'slo' => 'ACE/CEP Status'), - $this->criteria, - array('courseCode' => array('type' => 'link', - 'urlSpec' => array($this->baseUrl() . '/courses/public-view/view/id/%s', 'courseId'))) -); -?> -</div> - -<?php } else if ($this->hasSearched) { ?> - -<div class="warning"> - Unfortunately, no courses were found. -</div> -<?php } +<?php echo $this->partial('public-view/search-box-full.phtml', $this); diff --git a/application/modules/courses/views/scripts/public-view/view.phtml b/application/modules/courses/views/scripts/public-view/view.phtml index 3e04e89a0ff291ba770481c42b3e7b66108a4321..64a9b7e542e2229d93d7b937912ee817f6175ffe 100644 --- a/application/modules/courses/views/scripts/public-view/view.phtml +++ b/application/modules/courses/views/scripts/public-view/view.phtml @@ -2,64 +2,82 @@ <?php $this->headLink()->appendStylesheet($this->baseUrl() . '/css/courses/public-view/view.css', 'all'); ?> <?php $this->layout()->hideMenu = true; ?> -<?php echo $this->partial('public-view/search-summary.phtml', $this); ?> +<?php echo $this->partial('public-view/search-box-sidebar.phtml', $this); ?> -<div id="courseDescription"> - <div class="heading">Course Description:</div> - <div class="content"> - <?php echo $this->bulletinEntry($this->course); ?> - </div> -</div> - -<button id="backToResultsButton">Back to Results</button> -<button id="printButton">Print</button> -<button id="returnToHistoryButton">Return to History</button> -<div class="clear"></div> - -<table id="historyTable"> - <caption>Curriculum Request History</caption> - <tbody> - <tr> - <th>Date</th> - <th>Curriculum Request Type</th> - <th></th> - </tr> - <?php foreach ($this->previousRequests as $request) { ?> - <tr <?php if ($rowCount++ % 2) { ?>class="even"<?php }?>> - <td> - <?php if ($request->getLastApprovalTime()) { - echo $request->getLastApprovalTime()->toString('MMM d, yyyy'); - } ?> - </td> - <td><?php echo $request->getTypeDescription(); ?></td> - <td><a class="viewDetailsLink" id="viewDetailsLink<?php echo $request->getId(); ?>" href="#">View Details</a></td> - </tr> - <?php } ?> - </tbody> -</table> -<button id="viewAllDetailsButton">View All Details</button> -<div class="clear"></div> - - -<div id="requestDetailsContainer"> -<?php foreach ($this->previousRequests as $request) { ?> +<div id="viewMain"> - -<div class="requestDetail" id="requestDetail<?php echo $request->getId();?>"> -<div class="titled_box"> - <div class="box_shadow_2"> - <div class="tr"></div> - <div class="tl"> - <h2> - Details for: <?php echo $request->getTypeDescription(); ?> - - <img src="<?php echo $this->baseUrl(); ?>/images/index/arrow1.png" alt="arrow 1" class="toggle_arrow" /> - </h2> - <h3><em><?php echo $request->getLastApprovalTime()->toString('MMM d, yyyy'); ?></em></h3> + <div id="printAndBackButtons"> + <button id="printButton">Print</button><br /> + <button id="backToResultsButton">Back to Results</button><br /> + <button id="returnToHistoryButton">Back to Request History</button> + </div> + + <div id="courseDescription"> + <div class="heading">Course Description:</div> + <div class="content"> + <?php echo $this->bulletinEntry($this->course); ?> + </div> + </div> + + <div id="courseStatus"> + <div class="heading">Course Status:</div> + <div class="content"> + <?php if ($this->course->getRemoved()) { ?> + REMOVED + <?php } else { ?> + ACTIVE + <?php } ?> + </div> + </div> + + <div id="effectiveDate"> + <div class="heading">Effective Date:</div> + <div class="content"> + <?php echo $this->effectiveDate->toString('MMM d, yyyy'); ?> </div> - <div class="bl"></div> </div> - <div class="content"> + + <div class="clear"></div> + + <table id="historyTable"> + <caption>Curriculum Request History</caption> + <tbody> + <tr> + <th> + <a href="<?php echo $this->url(array('sort-history' => 'lastApprovalTimestamp')); ?>">Date</a> + </th> + <th> + <a href="<?php echo $this->url(array('sort-history' => 'typeDescription')); ?>">Curriculum Request Type</a> + </th> + <th></th> + </tr> + <?php foreach ($this->previousRequests as $request) { ?> + <tr <?php if ($rowCount++ % 2) { ?>class="even"<?php }?>> + <td> + <?php if ($request->getLastApprovalTime()) { + echo $request->getLastApprovalTime()->toString('MMM d, yyyy'); + } ?> + </td> + <td><?php echo $request->getTypeDescription(); ?></td> + <td><a class="viewDetailsLink" id="viewDetailsLink<?php echo $request->getId(); ?>" href="#">View Details</a></td> + </tr> + <?php } ?> + </tbody> + </table> + + <button id="viewAllDetailsButton">View All Details</button> + <div class="clear"></div> + + + <div id="requestDetailsContainer"> + <?php foreach ($this->previousRequests as $request) { ?> + + + + <div class="requestDetail" id="requestDetail<?php echo $request->getId();?>"> + + <div class="heading">Details for: <?php echo $request->getTypeDescription(); ?> | <?php echo $request->getLastApprovalTime()->toString('MMM d, yyyy'); ?></div> + <?php echo $this->partial('view/course-info.phtml', array('request' => $request, 'course' => $this->requestFinalCourses[$request->getId()], 'parentCourse' => $this->requestParentCourses[$request->getId()])); ?> @@ -82,40 +100,45 @@ } else { ?> <div>No comments for this request</div> <?php } } else { ?> - <div>Log in is required to view comments associated with this request. <a href="<?php echo $this->baseUrl(); ?>/auth/index/login">Log In</a></div> + <span class="loginMessage"> + <a href="<?php echo $this->baseUrl(); ?>/auth/index/login">Log In</a> + to view comments associated with this request (users must have approval) + </span> <?php } ?> - + </div> -</div> -</div> -<?php } ?> -</div> - - - - - -<div id="offeringsContainer" class="titled_box"> - <div class="box_shadow_2"> - <div class="tr"></div> - <div class="tl"> - <h2> - Course Offerings - <img src="<?php echo $this->baseUrl(); ?>/images/index/arrow1.png" alt="arrow 1" class="toggle_arrow" /> - </h2> - <h3><em></em></h3> - </div> - <div class="bl"></div> + <?php } ?> </div> - <div class="content"> - <?php echo $this->collectionTable( - $this->offerings, - array('semesterCode' => 'Semester', 'section' => 'Section', 'building' => 'Building', 'room' => 'Room', 'startTime' => 'Start Time', 'endTime' => 'End Time', 'days' => 'Days', 'instructors' => 'Instructors'), - null, - array( - 'startTime' => array('type' => 'Zend_Date', 'format' => 'h:mm a'), - 'endTime' => array('type' => 'Zend_Date', 'format' => 'h:mm a') - ) - ); ?> + + + + + + <?php /* ?> + <div id="offeringsContainer" class="titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2> + Course Offerings + <img src="<?php echo $this->baseUrl(); ?>/images/index/arrow1.png" alt="arrow 1" class="toggle_arrow" /> + </h2> + <h3><em></em></h3> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <?php echo $this->collectionTable( + $this->offerings, + array('semesterCode' => 'Semester', 'section' => 'Section', 'building' => 'Building', 'room' => 'Room', 'startTime' => 'Start Time', 'endTime' => 'End Time', 'days' => 'Days', 'instructors' => 'Instructors'), + null, + array( + 'startTime' => array('type' => 'Zend_Date', 'format' => 'h:mm a'), + 'endTime' => array('type' => 'Zend_Date', 'format' => 'h:mm a') + ) + ); ?> + </div> </div> + */ ?> + </div> \ No newline at end of file diff --git a/application/modules/courses/views/scripts/view/course-info.phtml b/application/modules/courses/views/scripts/view/course-info.phtml index d8b7cd6edc249e6384dc4e1efecfca20da3dac1c..3e24b4ed36d34dc02caabe6270289b92d18048ba 100644 --- a/application/modules/courses/views/scripts/view/course-info.phtml +++ b/application/modules/courses/views/scripts/view/course-info.phtml @@ -114,18 +114,14 @@ <table id="otherInfo"> <caption>Other Information</caption> - <?php if (in_array($this->request->getType(), array('ChangeCourse', 'AddISToCourse', 'AddACEAndChangeCourse'))) { ?> <tr> <th>DF Removal</th> <td><?php echo $course->getDfRemoval(); ?></td> </tr> - <?php } ?> - <?php if (!in_array($this->request->getType(), array('RemoveCourse', 'AddACEToCourse', 'RemoveACEFromCourse'))) { ?> <tr> <th>Grading Type</th> <td><?php echo $course->getGradingType(); ?></td> </tr> - <?php } ?> <tr> <th>Effective Term</th> <td><?php echo $course->getEffectiveSemester(); ?></td> diff --git a/document_root/css/courses/public-view/results.css b/document_root/css/courses/public-view/results.css new file mode 100644 index 0000000000000000000000000000000000000000..82764a312de7600f76e304559c0a8bf2fc4ad346 --- /dev/null +++ b/document_root/css/courses/public-view/results.css @@ -0,0 +1,14 @@ +@CHARSET "UTF-8"; + +#printButton {float: right;} +#instructions {margin: 1em 0;} + +@media print { + #instructions {display: none;} +} + +#results table {color: #a00; text-align: center;} +#results table th {background-color: #aaa; padding: 0.3em 0.5em; white-space: nowrap;} +#results table tr.even {background-color: #ddd;} +#results table td {padding: 0.5em 0.5em;} +#results table tr.removed td {text-decoration: line-through;} diff --git a/document_root/css/courses/public-view/search-box.css b/document_root/css/courses/public-view/search-box.css new file mode 100644 index 0000000000000000000000000000000000000000..f2e330a590a4a492345c1af1f83c5cd60c21fdcc --- /dev/null +++ b/document_root/css/courses/public-view/search-box.css @@ -0,0 +1,31 @@ +@CHARSET "UTF-8"; + + +#searchForm,#searchFormSmall {background-color: #ccc; border: 1px solid #888; padding: 1px;} +#searchForm {width: 550px; padding: 0 5px; border-radius: 20px; -moz-border-radius: 20px; -webkit-border-radius: 20px; margin: 0px auto;} +#searchFormSidebar {float: left;} +#searchFormSmall {width: 200px; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px;} +#searchFormSmall .verbose {display: none;} +#searchForm div {margin: 0.5em 0;} +#searchForm .helpText {color: #048; text-align: center;} +#searchFormSmall .helpText {display: none;} +#searchFormSmall h3 {text-align: center;} +#searchForm label.aligned {display: block; float: left; width: 100px; text-align: right; margin: 0em 1em;} +#searchForm #college,#searchForm #department,#searchForm #subject, #searchForm #courseTitle {width: 400px;} +#searchFormSmall #college,#searchFormSmall #department,#searchFormSmall #subject, #searchFormSmall #courseTitle {width: 195px;} +#searchForm #courseNumber, #searchForm #activity {width: 120px;} +#searchFormSmall #courseNumber {width: 45px;} +#searchFormSmall #activity {width: 100px;} +#courseLetter {width: 45px;} +#aceOutcomes {height: 4em; vertical-align: top;} +#submit {height: 25px; padding: 0px 1em; color: #fff; font-size: 14px; background-image: url(../../../images/redBlackGrad.png); border: 1px solid #000; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; margin: 0px auto; display: block;} +#reset {display: block; margin: 0.5em auto; color: #c00; border: 0px solid #000; background-color: transparent; } + + +#creqMain a.hoverHelp {color: #c00; text-decoration: none; background: none;} +#searchFormSmall a.hoverHelp {display: none;} +.hoverHelpText {display: none;} +#floating_help_text_div {background-color: #eee; border: 1px solid #000;} + +#restartSearchButton, #logInButton {clear: left; float: left; width: 120px; margin-left: 40px; margin-top: 1em; border: 1px solid #444; font-size: 12px; padding: 2px 0; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;} +#logInButton {color: #c00;} \ No newline at end of file diff --git a/document_root/css/courses/public-view/search.css b/document_root/css/courses/public-view/search.css index 6d5f71202f483956b153c5461af3fd8d63f7ebd5..a07825d0b06579ac2087e74d6912ae3b924bc07d 100644 --- a/document_root/css/courses/public-view/search.css +++ b/document_root/css/courses/public-view/search.css @@ -1,25 +1,5 @@ @CHARSET "UTF-8"; #creqMain {width: 940px;} -#searchForm {width: 550px; background-color: #ccc; border: 1px solid #888; padding: 0 5px; border-radius: 20px; -moz-border-radius: 20px; -webkit-border-radius: 20px; margin: 0px auto;} -#searchForm div {margin: 0.5em 0;} -#searchForm .helpText {color: #048; text-align: center;} -#searchForm label.aligned {display: block; float: left; width: 100px; text-align: right; margin: 0em 1em;} -#college,#department,#subject,#courseTitle {width: 400px;} -#courseNumber, #activity {width: 120px;} -#courseLetter {width: 50px;} -#aceOutcomes {height: 4em; vertical-align: top;} #creqMain .warning {border: 2px dashed #ff0; background-color: #ffc; padding: 0.5em;} -#printButton {float: right;} -#instructions {margin: 1em 0;} -@media print { - #instructions {display: none;} -} - -#creqMain a.hoverHelp {color: #c00; text-decoration: none; background: none;} -.hoverHelpText {display: none;} -#floating_help_text_div {background-color: #eee; border: 1px solid #000;} - -#submit {height: 25px; padding: 0px 1em; color: #fff; font-size: 14px; background-image: url(../../../images/redBlackGrad.png); border: 1px solid #000; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; margin: 0px auto; display: block;} -#reset {display: block; margin: 0.5em auto; color: #c00; border: 0px solid #000; background-color: transparent; } \ No newline at end of file diff --git a/document_root/css/courses/public-view/view.css b/document_root/css/courses/public-view/view.css index ebcdb97515b443725ba4c03f48a34e65b70d34b1..02c69cdba3f5335a70e25d5ae504ad1dcb318357 100644 --- a/document_root/css/courses/public-view/view.css +++ b/document_root/css/courses/public-view/view.css @@ -2,21 +2,34 @@ #creqMain {width: 944px;} +#viewMain {overflow: hidden; padding-left: 5px;} + #courseDescription {margin: 1em 0;} -#courseDescription .heading {float: left; font-size: 18px; line-height: 25px; padding: 0 0.5em 0 0; width: 125px;} -#courseDescription .content {overflow: hidden; border: 1px solid #888; background-color: #ccc; min-height: 4em;} +#courseDescription .heading {float: left; font-size: 16px; line-height: 25px; padding: 0 0.5em 0 0; width: 125px;} +#courseDescription .content {overflow: hidden; min-height: 4em;} + +#courseStatus {margin: 1em 0;} +#courseStatus .heading {float: left; font-size: 16px; padding: 0 0.5em 0 0; width: 125px;} +#courseStatus .content {float: left; color: #c00;} -#printButton, #backToResultsButton {float: right; margin-left: 1em;} +#effectiveDate {margin: 1em 0;} +#effectiveDate .heading {float: left; font-size: 16px; padding: 0 0.5em 0 1em; width: 125px;} + +#printAndBackButtons {float: right; margin-left: 1em; text-align: right;} +#printAndBackButtons button {margin-top: 1em; border: 1px solid #444; font-size: 12px; padding: 2px 0; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;} +#printButton {width: 75px;} #historyTable {width: 100%;} -#historyTable caption {background-color: #aaa; font-size: 18px; text-align: left; padding: 0.2em 0.5em;} +#historyTable caption, +.requestDetail .heading {background-color: #999; font-size: 18px; text-align: left; padding: 0.2em 0.5em; color: #fff;} #historyTable td {text-align: center; padding: 0.2em 0;} #historyTable .even {background-color: #ccc;} #viewAllDetailsButton {float: right;} #returnToHistoryButton {float: right; display: none;} #requestDetailsContainer {display: none;} -.requestDetail {display: none;} +.requestDetail {display: none; margin-bottom: 1em;} +.requestDetail .heading {margin-bottom: 1em;} .requestDetail .content {margin: 2em 3px;} .courseInfo {overflow: hidden;} @@ -25,6 +38,8 @@ .requestComments table th {background-color: #aaa;} .requestComments table .even {background-color: #ccc;} +.loginMessage {background-color: #ccc; font-weight: bold; padding: 0.5em;} + #offeringsContainer table {width: 100%;} #offeringsContainer table th {background-color: #aaa;} #offeringsContainer table .even {background-color: #ccc;} diff --git a/document_root/javascript/courses/public-view/view.js b/document_root/javascript/courses/public-view/view.js index 3e67a3d4986c457079b9452fd3e7c528e2fe0b89..be28eb9dbebf621df023282a12212f99ad95da96 100644 --- a/document_root/javascript/courses/public-view/view.js +++ b/document_root/javascript/courses/public-view/view.js @@ -36,6 +36,12 @@ function handleViewDetailsLinkClick() document.getElementById('viewAllDetailsButton').style.display = 'none'; document.getElementById('returnToHistoryButton').style.display = 'inline'; document.getElementById('requestDetailsContainer').style.display = 'block'; + + var requestDetails = getElementsByClassName('requestDetail'); + for (var i = requestDetails.length - 1; i >= 0; i--) { + requestDetails[i].style.display = 'none'; + } + document.getElementById('requestDetail' + requestId).style.display = 'block'; return false; diff --git a/library/App/View/Helper/CollectionTable.php b/library/App/View/Helper/CollectionTable.php index e45a0f948c89c7b6fb64bd3c6269eb6b53e916c2..05f9d7b8ae917cdef0bc57d67eb4170eee43e988 100644 --- a/library/App/View/Helper/CollectionTable.php +++ b/library/App/View/Helper/CollectionTable.php @@ -4,7 +4,8 @@ class App_View_Helper_CollectionTable extends Zend_View_Helper_Abstract public function collectionTable(Unl_Model_Collection $collection, array $columns, array $searchUrlParameters = null, - array $formatOptions = null) + array $formatOptions = null, + $rowClassColumn = null) { if (!is_array($searchUrlParameters)) { @@ -20,24 +21,37 @@ class App_View_Helper_CollectionTable extends Zend_View_Helper_Abstract $output .= "<tr>\n"; foreach ($columns as $field => $title) { $output .= "<th>\n"; - $output .= '<a href="' - . $this->view->url(array_merge($searchUrlParameters, array('sort' => $field))) - . '">' . $title . '</a>' . "\n"; + if ($field[0] != '#') { + $output .= '<a href="' + . $this->view->url(array_merge($searchUrlParameters, array('sort' => $field))) + . '">' . $title . '</a>' . "\n"; + } $output .= "</th>\n"; } $output .= "</tr>\n"; foreach ($collection as $row) { - if ($rowCount++ % 2) { - $output .= '<tr class="even">'; + $rowClasses = array(); + if ($rowCount++ % 2) { + $rowClasses[] = 'even'; + } + if ($rowClassColumn) { + if ($row->{'get' . $rowClassColumn}()) { + $rowClasses[] = $row->{'get' . $rowClassColumn}(); + } + } + if ($rowClasses) { + $output .= '<tr class="' . implode(' ', $rowClasses) . '">'; } else { $output .= '<tr>'; } foreach ($columns as $field => $title) { - $output .= "<td>"; - $output .= $this->_applyFormatting($row->{'get' . $field}(), $formatOptions[$field], $row); - if ($url) { - $output .= '</a>'; + if ($field[0] == '#') { + $data = $title; + } else { + $data = $row->{'get' . $field}(); } + $output .= "<td>"; + $output .= $this->_applyFormatting($data, $formatOptions[$field], $row); $output .= "</td>\n"; } $output .= "</tr>\n";