diff --git a/application/controllers/ApprovalbodyadminController.php b/application/controllers/ApprovalbodyadminController.php new file mode 100644 index 0000000000000000000000000000000000000000..feef3b26543fa332b63a3ea087c756c5e18a7c0c --- /dev/null +++ b/application/controllers/ApprovalbodyadminController.php @@ -0,0 +1,101 @@ +<?php + +class ApprovalBodyAdminController extends Nmc_Controller_Action +{ + public function indexAction() + { + $out = new Nmc_View(); + $out->page = 'approval_body_admin'; + + $out->approvalBodies = ApprovalBodies::getInstance()->fetchAll(); + + echo $out->render(); + } + + public function editBodyAction() + { + $in = $this->_getAllParams(); + $approvalBodyId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + + $out = new Nmc_View(); + $out->page = 'approval_body_admin'; + + $out->approvalBody = ApprovalBodies::getInstance()->find($approvalBodyId); + $out->approvalBodies = ApprovalBodies::getInstance()->fetchAll(); + + echo $out->render(); + } + + public function editRoleAction() + { + $in = $this->_getAllParams(); + $roleId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + + $out = new Nmc_View(); + $out->page = 'approval_body_admin'; + + $out->groups = Groups::getInstance()->fetchAll(); + $out->approvalBodyRole = ApprovalBodyRoles::getInstance()->find($roleId); + $out->approvalBodies = ApprovalBodies::getInstance()->fetchAll(); + + echo $out->render(); + } + + public function addRoleAction() + { + $in = $this->_getAllParams(); + $approvalBodyId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + $parentApprovalBody = ApprovalBodies::getInstance()->find($approvalBodyId); + + $out = new Nmc_View(); + $out->page = 'approval_body_admin'; + + $out->groups = Groups::getInstance()->fetchAll(); + $out->approvalBodyRole = ApprovalBodyRoles::getInstance()->fetchNew(); + $out->approvalBodyRole->approvalBody = $parentApprovalBody->id; + $out->approvalBodies = ApprovalBodies::getInstance()->fetchAll(); + + echo $out->render(); + } + + public function editBodyPostAction() + { + $in = $this->_getAllParams(); + $bodyId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + $body = ApprovalBodies::getInstance()->find($bodyId); + + if(!$body) { + $body = ApprovalBodies::getInstance()->fetchNew(); + } + + $body->name = $in['name']; + $body->description = $in['description']; + $body->save(); + + $out = new Nmc_View(); + $out->refresh = '/ApprovalBodyAdmin/EditBody/' . $body->id; + echo $out->render(); + } + + public function editRolePostAction() + { + $in = $this->_getAllParams(); + $roleId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + if($roleId < 0) { + $role = ApprovalBodyRoles::getInstance()->fetchNew(); + $role->approvalBody = abs($roleId); + } else { + $role = ApprovalBodyRoles::getInstance()->find($roleId); + } + + $role->name = $in['name']; + $role->group = $in['group']; + $role->save(); + + $out = new Nmc_View(); + $out->refresh = '/ApprovalBodyAdmin/EditRole/' . $role->id; + echo $out->render(); + } +} + +?> \ No newline at end of file diff --git a/application/controllers/AuthController.php b/application/controllers/AuthController.php new file mode 100644 index 0000000000000000000000000000000000000000..75172a04dfb85cc5d1bb4f334be7b1117e2794da --- /dev/null +++ b/application/controllers/AuthController.php @@ -0,0 +1,84 @@ +<?php + +class AuthController extends Nmc_Controller_Action +{ + + public function indexAction() + { + $out = new Nmc_View_Unl(); + $out->location = '/'; + echo $out->render(); + } + + public function loginAction() + { + Nmc_Registry_Session::getInstance()->erase('loginError'); + + $in = new Zend_Filter_Input($this->_action->getParams()); + + $out = new Nmc_View(); + $out->title = 'Processing...'; + + try { + $auth = new Nmc_Auth_Multi(); + $ldap = new Nmc_Ldap('ldap://localhost:10389'); + $authTable = new Auth(); + //$auth->push(new Nmc_Auth_Always()); + $auth->push(new Nmc_Auth_Ldap($ldap)); + $auth->push(new Nmc_Auth_Mysql($authTable)); + $auth->login($in->getRaw('user_name'), $in->getRaw('password')); + Nmc_Registry_Session::getInstance()->userName = $in->getRaw('user_name'); + + $user = People::findByUserName($in->getRaw('user_name')); + if(!$user) { + $user = People::getInstance()->fetchNew(); + $filter = 'uid=' + . strtr($in->getRaw('user_name'), + array(',' => '', '=' => '', ' ' => '')); + $ldap->bind('uid=tsteiner2,ou=people,dc=unl,dc=edu', $in->getRaw('password')); + $userInfo = $ldap->search('ou=people,dc=unl,dc=edu', $filter); + + $departmentIn = $userInfo[0]['unlhrprimarydepartment'][0]; + $department = Departments::getInstance()->fetchByName($departmentIn); + if(!$department) { + $departments = Departments::getInstance()->fetchAll(); + $minDiff = 99999; + $bestMatch = null; + foreach($departments as $row) { + $diff = levenshtein($departmentIn, $row->name); + if($diff < $minDiff) { + $minDiff = $diff; + $bestMatch = $row; + } + } + $department = $bestMatch; + } + + $user->userName = $in->getRaw('user_name'); + $user->firstName = $userInfo[0]['givenname'][0]; + $user->lastName = $userInfo[0]['sn'][0]; + $user->email = $userInfo[0]['mail'][0]; + $user->phone = $userInfo[0]['telephonenumber'][0]; + $user->department = $department->id; + $user->save(); + } + Nmc_User::getInstance()->login($user); + + $out->refresh = '/home'; + } catch(Exception $e) { + Nmc_Registry_Session::getInstance()->loginError = $e->getMessage(); + $out->refresh = '/'; + } + + echo $out->render('index.xhtml'); + } + + public function logoutAction() + { + Nmc_User::getInstance()->logout(); + $out = new Nmc_View(); + $out->assign('location', '/'); + echo $out->render(); + } + +} \ No newline at end of file diff --git a/application/controllers/ConflictController.php b/application/controllers/ConflictController.php new file mode 100644 index 0000000000000000000000000000000000000000..65846a343b2b1d20972b1f09996c92846158ca4b --- /dev/null +++ b/application/controllers/ConflictController.php @@ -0,0 +1,89 @@ +<?php + +class ConflictController extends Nmc_Controller_Action +{ + public function __construct() + { + $this->_registerPlugin(new Nmc_Controller_Action_Plugin_Authorize()); + //$this->_registerPlugin(new Nmc_Controller_Action_Plugin_Test()); + } + + public function indexAction() + { + $skippedRecords = Nmc_Registry_Session::getInstance('conflict')->skippedRecords; + $sql = <<<EOF +SELECT DISTINCT a.* , d.subject, d.course_number, d.course_letter +FROM creq_course_crosslistings AS a, + creq_course_crosslistings AS b, + creq_course_generations AS c, + creq_course_generations AS c2, + creq_course_codes AS d +WHERE a.course_code = b.course_code + AND a.id != b.id + AND a.generation = c.id + AND c.type = 'official' + AND b.generation = c2.id + AND c2.type = 'official' + AND a.course_code = d.id +ORDER BY subject, course_number, course_letter +EOF; + + $db = CourseCrosslistings::getInstance()->getAdapter(); + $result = $db->fetchAll($sql); + for($i = 0; $i <= $skippedRecords; $i++) { + $dups = array(); + while($row = array_shift($result)) { + //foreach($result as $row) { + if(count($dups) == 0) { + $courseCode = $row['course_code']; + $conflictedCourseCode = CourseCodes::getInstance()->find($row['course_code']); + } + if($courseCode != $row['course_code']) { + array_unshift($result, $row); + break; + } + $dups[] = CourseGenerations::getInstance()->find($row['generation']); + } + } + + $allIds = array(); + foreach($dups as $dup) { + $allIds[] = $dup->id; + } + + $out = new Nmc_View(); + $out->dups = $dups; + $out->allIds = $allIds; + $out->conflictedCourseCode = $conflictedCourseCode; + $out->page = 'conflict'; + echo $out->render(); + } + + public function removeAction() + { + $in = $this->_getAllParams(); + $ids = array(); + for($i = 0; Zend_Filter::isInt($in['URI_PARAMS'][$i]); $i++) { + $ids[] = $in['URI_PARAMS'][$i]; + } + foreach($ids as $id) { + $id = Zend_Filter::getInt($id); + $generation = CourseGenerations::getInstance()->find($id); + $generation->delete(); + } + + $out = new Nmc_View(); + $out->location = '/conflict'; + echo $out->render(); + } + + public function skipAction() + { + Nmc_Registry_Session::getInstance('conflict')->skippedRecords++; + $out = new Nmc_View(); + $out->location = '/conflict'; + echo $out->render(); + } +} + +?> \ No newline at end of file diff --git a/application/controllers/CourseadminController.php b/application/controllers/CourseadminController.php new file mode 100644 index 0000000000000000000000000000000000000000..8b2a6dcb834dc6cd9f53ba7dd60d07349b4d994c --- /dev/null +++ b/application/controllers/CourseadminController.php @@ -0,0 +1,459 @@ +<?php + +class CourseAdminController extends Nmc_Controller_Action +{ + public function __construct() + { + $this->_registerPlugin(new Nmc_Controller_Action_Plugin_Authorize()); + } + + public function authorize() + { + if(!Nmc_Registry_Session::getInstance()->userName) { + return false; + } + return true; + } + + public function indexAction() + { + $in = new Zend_Filter_Input($this->_action->getParams()); + $uriParams = $this->_action->getParams(); + $uriParams = $uriParams['URI_PARAMS']; + + $out = new Nmc_View_Unl(); + if(Zend_Filter::isInt($uriParams[0])) { + $course = CourseGenerations::getInstance()->find($uriParams[0]); + $crosslisting = $course->crosslistings[0]; + } else { + $crosslisting = CourseCrosslistings::fetchBySubjectNumberLetter($uriParams[0], $uriParams[1], $uriParams[2]); + } + if(!$crosslisting) { + $course = CourseGenerations::getInstance()->fetchNew(); + } else { + $course = $crosslisting->getParentCourse(); + + if($nextCourse = $crosslisting->getNextAlphabetically()) { + $nextCourse = $nextCourse->getParentCourse(); + $nextCourseLink = '/' . $nextCourse->subject . '/' . $nextCourse->courseNumber . '/' . $nextCourse->courseLetter; + if($nextCourse->subject != $course->subject || $nextCourse->id == $course->id) { + foreach($nextCourse->crosslistings as $crosslisting) { + if($crosslisting->subject == $course->subject) { + $nextCourseLink = '/' . $crosslisting->subject . '/' . $crosslisting->courseNumber . '/' . $crosslisting->courseLetter; + break; + } + } + } + } + + if($prevCourse = $crosslisting->getPreviousAlphabetically()) { + $prevCourse = $prevCourse->getParentCourse(); + $prevCourseLink = '/' . $prevCourse->subject . '/' . $prevCourse->courseNumber . '/' . $prevCourse->courseLetter; + if($prevCourse->subject != $course->subject || $prevCourse->id == $course->id) { + foreach($prevCourse->crosslistings as $crosslisting) { + if($crosslisting->subject == $course->subject) { + $prevCourseLink = '/' . $crosslisting->subject . '/' . $crosslisting->courseNumber . '/' . $crosslisting->courseLetter; + break; + } + } + } + } + + $out->assign('prevCourseLink', $prevCourseLink); + $out->assign('nextCourseLink', $nextCourseLink); + + $creditsSingleValues = array(); + foreach($course->credits as $credit) { + if($credit->type == 1) { + $creditsSingleValues[] = $credit->hours; + } else if($credit->type == 2) { + $out->creditsRangeMin = $credit->hours; + } else if($credit->type == 3) { + $out->creditsRangeMax = $credit->hours; + } else if($credit->type == 4) { + $out->creditsMaxPerSemester = $credit->hours; + } else if($credit->type == 5) { + $out->creditsMaxPerDegree = $credit->hours; + } + } + $out->creditsSingleValues = implode(' ', $creditsSingleValues); + } + + $out->assign('page', 'edit_course'); + $out->assign('course', $course); + $out->assign('uriParams', $uriParams); + echo $out->render(); + } + + public function updateCourseAction() { + $uriParams = $this->_action->getParams(); + $uriParams = $uriParams['URI_PARAMS']; + + $course = CourseGenerations::getInstance()->find($_POST['courseId']); + if(!$course) { + $course = CourseGenerations::getInstance()->fetchNew(); + $course->type = 'official'; + } + + foreach($_POST as $key => $val) { + if(!is_array($val) && $key != 'courseId' /*&& $val != ''*/) { + //echo '$course->' . $key . ' = ' . $val . "<br />\n"; + $course->$key = $val; + } + } + + foreach($_POST as $key => $val) { + if($key == 'credits') { + $credits = $course->credits; + foreach($credits as $key => $credit) { + unset($credits[$key]); + } + foreach($val as $type => $hours) { + if($type == 1) { + foreach(explode(' ', $hours) as $singeValue) { + if(Zend_Filter::getDigits($hours) != '') { + $newAttribute = CourseCredits::getInstance()->fetchNew(); + $newAttribute->type = $type; + $newAttribute->hours = $singeValue; + $credits[] = $newAttribute; + } + } + continue; + } + if(Zend_Filter::getDigits($hours) != '') { + $newAttribute = CourseCredits::getInstance()->fetchNew(); + $newAttribute->type = $type; + $newAttribute->hours = $hours; + $credits[] = $newAttribute; + } + } + } else if(in_array($key, array('termsOffered','deliveryMethods','campuses'))) { + $course->$key = $val; + //echo '$course->' . $key . ' = '; print_r($val); echo "<br />\n"; + } else if($key == 'gradTieIn') { + if(!$course->gradTieIn instanceof CourseGradTieIn) { + $course->gradTieIn = CourseGradTieIns::getInstance()->fetchNew(); + } + foreach($val as $key2 => $val2) { + $course->gradTieIn->$key2 = $val2; + //echo '$course->gradTieIn->' . $key2 . ' = ' . $val2 . "\n"; + } + } else if(is_array($val)) { + $array = $course->$key; + foreach($array as $key2 => $row) { + unset($array[$key2]); + } + foreach($val as $key2 => $val2) { + if($val2['delete'] == 'yes') { + continue; + } + $attributeTable = call_user_func(array('Course' . $key, 'getInstance')); + $currentAttribute = $attributeTable->fetchNew(); + unset($val2['delete']); + + //loop over each attribute and set + foreach($val2 as $key3 => $val3) { + if($val3 == '') { + $val3 = null; + } + //echo '$currentAttribute->' . $key3 . ' = ' . $val3 . "<br />\n"; + $currentAttribute->$key3 = $val3; + } + $array[] = $currentAttribute; + //save changes + } + //print_r($array); + } + } + + $course->save(); + + $out = new Nmc_View(); + $out->refresh = '/courseadmin/index/' . implode('/', $uriParams); + echo $out->render(); + } + + public function deleteCourseAction() + { + $in = $this->_action->getParams(); + $courseId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + + if($courseId > 0) { + $course = CourseGenerations::getInstance()->find($courseId); + $course->delete(); + } + + $out = new Nmc_View(); + $out->refresh = '/courseadmin/index/' . $courseId; + echo $out->render(); + } + + public function otherAction() + { + echo "DO NOT RUN!!!"; + return; + + header('Content-type: text/plain'); + + $localDB = Zend::registry('db'); + $remoteDB = Zend_Db::factory('pdoMysql', + array('username' => 'creq', + 'password' => 'UrBJtMyvbEJ8KYzp', + 'dbname' => 'ugrad_curriculum_request')); + + $sql = 'SELECT * FROM creq_current_courses'; + $data = $remoteDB->fetchAll($sql); + + foreach($data as $row) + { + $course = array(); + $course['activities'] = array(); + $course['terms_offered'] = array(); + $course['delivery_methods'] = array(); + $course['credits'] = array(); + $course['campuses'] = array(); + + $sql = 'SELECT id FROM creq_colleges WHERE description=?'; + $course['college_id'] = $localDB->fetchOne($localDB->quoteInto($sql, $row['college'])); + $act = explode(',', trim($row['activities'])); + $act2 = explode(',', trim($row['course_act'])); + if($act[0] != '') { + foreach($act as $a) { + $course['activities'][$a] = ''; + } + } + /* + if($act2[0] != '') { + foreach($act2 as $a) + { + preg_match('/([a-zA-Z]*)[^0-9]*([0-9]*)/', $a, $matches); + $key = strtoupper($matches[1]); + if($key != '') { + $course['activities'][$key] = $matches[2]; + } + } + } + */ + + $terms = explode(',', trim($row['term_taught'])); + if($terms[0] != '') { + $course['terms_offered'] = $terms; + } + + if($row['df_removal'] != '') { + $course['df_removal'] = $row['df_removal']; + } + + if($row['delivery_method'] != '') { + $course['delivery_methods'] = explode(',', $row['delivery_method']); + } + + if($row['course_credit'] != '') { + preg_match('/([0-9]*)(-[0-9]*)?[^m]*(max [0-9]*)?/', $row['course_credit'], $matches); + $course['credits'] = array(); + if($matches[1] != '' && $matches[2] == '') { + $course['credits']['single'] = $matches[1]; + } else if($matches[1] != '' && $matches[2] != '') { + $course['credits']['range_min'] = $matches[1]; + } + if($matches[2] != '') { + $course['credits']['range_max'] = substr($matches[2], 1); + } + if($matches[3] != '') { + $course['credits']['max'] = substr($matches[3], 3); + } + } + + if($row['course_title'] != '') { + $course['title'] = $row['course_title']; + } + if($row['course_num'] != '') { + $course['course_num'] = $row['course_num']; + preg_match('/([a-zA-Z]*)[^0-9a-zA-Z]*(([0-9]*)([a-zA-Z]*))(\/([0-9]*)([a-zA-Z]*))?/', $row['course_num'], $matches); + if($matches[1] != '') { + $course['subject'] = $matches[1]; + } + if($matches[3] != '') { + $course['number'] = $matches[3]; + } + if($matches[4] != '') { + $course['letter'] = $matches[4]; + } + if($matches[6] != '') { + $course['alt_num'] = $matches[6]; + } + if($matches[7] != '') { + $course['alt_letter'] = $matches[7]; + } + } + + if($row['course_prereq'] != '') { + $course['prerequisite'] = $row['course_prereq']; + } + + if($row['course_note'] != '') { + $course['notes'] = $row['course_note']; + } + + if($row['course_desc'] != '') { + $course['description'] = $row['course_desc']; + } + + if($row['course_inst'] != '') { + $course['campuses'] = explode(',', $row['course_inst']); + } + + if($row['parent_xlist'] != '') { + $course['parent_course'] = array(); + preg_match('/([a-zA-Z]*)([0-9]*)([a-zA-Z]*)/', $row['parent_xlist'], $matches); + if($matches[1] != '') { + $course['parent_course']['subject'] = $matches[1]; + } + if($matches[2] != '') { + $course['parent_course']['number'] = $matches[2]; + } + if($matches[3] != '') { + $course['parent_course']['letter'] = $matches[3]; + } + + + if( $course['parent_course']['subject'] == $course['subject'] + && $course['parent_course']['number'] == $course['number'] + && $course['parent_course']['letter'] == $course['letter']) { + $parent_courses[] = $course; + } else { + $crosslisted_courses[] = $course; + } + } else { + $parent_courses[] = $course; + } + } + + $localDB->beginTransaction(); + foreach($parent_courses as $course) { + try { + try { + $sql = 'INSERT INTO creq_subjects(short_name) VALUES(?)'; + $localDB->query($sql, array($course['subject'])); + } catch(Exception $e) { + //do nothing + } + + $sql = 'INSERT INTO creq_courses() VALUES()'; + $localDB->query($sql); + $courseId = $localDB->lastInsertId(); + + $sql = 'INSERT INTO creq_course_generations(course, title, subject, course_number, course_letter, prerequisite, notes, description) ' + . 'VALUES(?, ?, ?, ?, ?, ?, ?, ?)'; + $localDB->query($sql, array($courseId, + $course['title'], + $course['subject'], + $course['number'], + $course['letter'], + $course['prerequisite'], + $course['notes'], + $course['description'])); + $generationId = $localDB->lastInsertId(); + + $sql = 'UPDATE creq_courses SET current_generation=? WHERE id=?'; + $localDB->query($sql, array($generationId, $courseId)); + + if($course['alt_num'] != '') { + $sql = 'INSERT INTO creq_course_crosslistings(parent_course, subject, course_number, course_letter) ' + . 'VALUES(?, ?, ?, ?)'; + $localDB->query($sql, array($generationId, + $course['subject'], + $course['alt_num'], + $course['alt_letter'])); + } + + foreach($course['activities'] as $activity => $hours) { + $sql = 'INSERT INTO creq_course_activities(course_generation, type, credits) ' + . 'VALUES(?, ?, ?)'; + $localDB->query($sql, array($generationId, + strtolower($activity), + $hours)); + } + foreach($course['campuses'] as $campus) { + $sql = 'INSERT INTO creq_course_campuses(course_generation, campus) ' + . 'VALUES(?, ?)'; + $localDB->query($sql, array($generationId, + $campus)); + } + foreach($course['credits'] as $type => $hours) { + if($type == 'single') { + $type = 1; + } else if($type == 'range_min') { + $type = 2; + } else if($type == 'range_max') { + $type = 3; + } else if($type == 'max') { + $type = 4; + } + $sql = 'INSERT INTO creq_course_credits(course_generation, type, hours) ' + . 'VALUES(?, ?, ?)'; + $localDB->query($sql, array($generationId, + $type, + $hours)); + } + foreach($course['delivery_methods'] as $method) { + if($method == 'classroom') { + $method = 1; + } else if($method == 'web') { + $method = 2; + } + $sql = 'INSERT INTO creq_course_delivery_methods(course_generation, delivery_method) ' + . 'VALUES(?, ?)'; + $localDB->query($sql, array($generationId, + $method)); + } + foreach($course['terms_offered'] as $term) { + if($term == 'I') { + $term = 1; + } else if($term == 'II') { + $term = 2; + } else if($term == 'III') { + $term = 3; + } + $sql = 'INSERT INTO creq_course_terms_offered(course_generation, term) ' + . 'VALUES(?, ?)'; + $localDB->query($sql, array($generationId, + $term)); + } + } catch(Exception $e) { + echo $i++ . ' ' . $e->getMessage() . "\n"; + //do nothing + } + } + foreach($crosslisted_courses as $course) { + try { + try { + $sql = 'INSERT INTO creq_subjects(short_name) VALUES(?)'; + $localDB->query($sql, array($course['subject'])); + } catch(Exception $e) { + //do nothing + } + + if(isset($course['parent_course'])) { + $sql = 'SELECT b.id FROM creq_courses AS a JOIN creq_course_generations AS b ON(a.current_generation = b.id) ' + . 'WHERE subject=? AND course_number=? AND (course_letter=? OR ISNULL(course_letter))'; + $parent_course_id = $localDB->fetchOne($sql, array($course['parent_course']['subject'], + $course['parent_course']['number'], + $course['parent_course']['letter'])); + $sql = 'INSERT INTO creq_course_crosslistings(parent_course, subject, course_number, course_letter) ' + . 'VALUES(?, ?, ?, ?)'; + $localDB->query($sql, array($parent_course_id, $course['subject'], $course['number'], $course['letter'])); + if($course['alt_num'] != '') { + $localDB->query($sql, array($parent_course_id, $course['subject'], $course['alt_num'], $course['alt_letter'])); + } + } + } catch(Exception $e) { + echo $i++ . ' ' . $e->getMessage() . "\n"; + //do nothing + } + } + //$localDB->rollBack(); + $localDB->commit(); + } + +} \ No newline at end of file diff --git a/application/controllers/HomeController.php b/application/controllers/HomeController.php new file mode 100644 index 0000000000000000000000000000000000000000..eafda27affb3e7b13561e3fba420cedcbf676372 --- /dev/null +++ b/application/controllers/HomeController.php @@ -0,0 +1,23 @@ +<?php + +class HomeController extends Nmc_Controller_Action +{ + + public function __construct() + { + $this->_registerPlugin(new Nmc_Controller_Action_Plugin_Authorize()); + } + + public function IndexAction() + { + $user = Nmc_User::getInstance()->getUser(); + $requests = Requests::getInstance()->getRequestsForUser($user); + + $out = new Nmc_View(); + $out->requests = $requests; + $out->page = 'my_home'; + + echo $out->render(); + } + +} \ No newline at end of file diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php new file mode 100644 index 0000000000000000000000000000000000000000..6a9984d2a942141854de5a294476e13347a0a7f2 --- /dev/null +++ b/application/controllers/IndexController.php @@ -0,0 +1,19 @@ +<?php + +class IndexController extends Nmc_Controller_Action +{ + + public function indexAction() + { + $in = new Zend_Filter_Input($this->_action->getParams()); + $out = new Nmc_View(); + $out->addScriptPath(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'views'); + $out->page = 'login'; + $out->assign('title', 'Curriculum Action Request'); + + echo $out->render('index.xhtml'); + } + +} + +?> \ No newline at end of file diff --git a/application/controllers/NewrequestController.php b/application/controllers/NewrequestController.php new file mode 100644 index 0000000000000000000000000000000000000000..0f8caf9a483855a69d0cf8f16a6a134f5e3ccb3b --- /dev/null +++ b/application/controllers/NewrequestController.php @@ -0,0 +1,545 @@ +<?php + +class NewRequestController extends Nmc_Controller_Action +{ + + public function __construct() + { + parent::__construct(); + $this->_registerPlugin(new Nmc_Controller_Action_Plugin_Authorize()); + } + + public function __destruct() + { + + } + + public function indexAction() + { + return $this->SearchAction(); + } + + public function searchAction() + { + $in = $this->_action->getParams(); + if($in[0] != '' && $in[1] != '') { + return $this->searchResultsAction(); + } + + $out = new Nmc_View(); + $out->page = 'request/search'; + $out->css_files[] = '/css/request/edit_wrapper.css'; + echo $out->render(); + } + + public function searchResultsAction() + { + $in = $this->_action->getParams(); + + $subject = Zend_Filter::getAlpha($in[0]); + $courseNumber = Zend_Filter::getDigits($in[1]); + $courseLetter = Zend_Filter::getAlpha($in[2]); + + $course = CourseCrosslistings::fetchBySubjectNumberLetter($subject, + $courseNumber, + $courseLetter); + + $out = new Nmc_View(); + $out->subject = $subject; + $out->courseNumber = $courseNumber; + $out->courseLetter = $courseLetter; + + if(!$course) { + // course not found + $out->page = 'request/create_new_course_ask'; + Nmc_Registry_Session::getInstance()->erase('course'); + } else { + // course found + Nmc_Registry_Session::getInstance()->erase('course'); + $out->page = 'request/course_found'; + $parentCourse = $course->getParentCourse(); + + $course = clone $parentCourse; + + Nmc_Registry_Session::getInstance()->course = $course; + } + echo $out->render(); + } + + public function createAction() + { + $in = $this->_action->getParams(); + + $type = Zend_Filter::getAlnum($in[0]); + $subject = Zend_Filter::getAlpha($in[1]); + $courseNumber = Zend_Filter::getDigits($in[2]); + $courseLetter = Zend_Filter::getAlpha($in[3]); + + $request = Requests::getInstance()->fetchNew(); + $request->owner = Nmc_User::getInstance()->getUser()->getId(); + $request->type = RequestTypes::getInstance()->stringToType($type); + + $course = Nmc_Registry_Session::getInstance()->course; + if(!$course) { + $course = CourseGenerations::getInstance()->fetchNew(); + $course->subject = $subject; + $course->courseNumber = $courseNumber; + $course->courseLetter = $courseLetter; + } + + $course->request = $request; + $course->type = 'proposed'; + + //print_r($course); + + Nmc_Registry_Session::getInstance()->request = $request; + Nmc_Registry_Session::getInstance()->course = $course; + + $out = new Nmc_View(); + $out->location = '/newrequest/CourseID'; + echo $out->render(); + } + + public function loadAction() + { + $in = $this->_action->getParams(); + + $requestId = Zend_Filter::getInt($in[0]); + $request = Requests::getInstance()->find($requestId); + $course = $request->getCourseGeneration(); + + Nmc_Registry_Session::getInstance()->course = $course; + Nmc_Registry_Session::getInstance()->request = $request; + + $out = new Nmc_View(); + $out->location = '/NewRequest/CourseID'; + $out->render(); + } + + public function updateAction() { + + $errors = array(); + + $course = Nmc_Registry_Session::getInstance()->course; + $request = Nmc_Registry_Session::getInstance()->request; + + + + $submit = Zend_Filter::getAlpha($_POST['submit']); + + if(is_array($_POST['request'])) { + foreach($_POST['request'] as $key => $val) { + if(!is_array($val) && $val != '') { + //echo '$request->' . $key . ' = ' . $val . "<br />\n"; + $request->$key = $val; + } + } } + unset($_POST['request']); + + unset($_POST['submit']); + unset($_POST['p_subject']); + unset($_POST['p_course_number']); + + + + + + + /* + foreach($_POST as $key => $val) { + if(!is_array($val) && $key != 'courseId' && $val != '') { + //echo '$course->' . $key . ' = ' . $val . "<br />\n"; + $course->$key = $val; + } + } + + foreach($_POST as $key => $val) { + if($key == 'credits') { + foreach($course->credits as $key => $credit) { + unset($course->credits[$key]); + } + foreach($val as $type => $hours) { + if($type == 1) { + foreach(explode(' ', $hours) as $singeValue) { + if(Zend_Filter::getDigits($hours) != '') { + $newAttribute = CourseCredits::getInstance()->fetchNew(); + $newAttribute->type = $type; + $newAttribute->hours = $singeValue; + $course->credits[] = $newAttribute; + } + } + continue; + } + if(Zend_Filter::getDigits($hours) != '') { + $newAttribute = CourseCredits::getInstance()->fetchNew(); + $newAttribute->type = $type; + $newAttribute->hours = $hours; + $course->credits[] = $newAttribute; + } + } + } else if(in_array($key, array('termsOffered','deliveryMethods','campuses'))) { + $course->$key = $val; + } else if($key == 'gradTieIn') { + if(!$course->gradTieIn instanceof CourseGradTieIn) { + $course->gradTieIn = CourseGradTieIns::getInstance()->fetchNew(); + } + foreach($val as $key2 => $val2) { + $course->gradTieIn->$key2 = $val2; + } + } else if(is_array($val)) { + $array = $course->$key; + foreach($val as $key2 => $val2) { + //either create or grab the current attribute + if($key2 < 0) { + $attributeTable = call_user_func(array('Course' . $key, 'getInstance')); + $currentAttribute = $attributeTable->fetchNew(); + $array[] = $currentAttribute; + } else { + $currentAttribute = $array[$key2]; + } + //delete it if marked for deletion, otherwise unset the delete field + if($val2['delete'] == 'yes') { + unset($array[$key2]); + continue; + } else { + unset($val2['delete']); + } + + //loop over each attribute and set + foreach($val2 as $key3 => $val3) { + if($val3 == '') { + $val3 = null; + } + //echo '$course->' . $key . '[' . $key2 . ']->' . $key3 . ' = ' . $val3 . "<br />\n"; + $currentAttribute->$key3 = $val3; + } + //save changes + } + } + } + */ + + + + + + + foreach($_POST as $key => $val) { + if(!is_array($val) && $key != 'courseId' /*&& $val != ''*/) { + //echo '$course->' . $key . ' = ' . $val . "<br />\n"; + $course->$key = $val; + } + } + + foreach($_POST as $key => $val) { + if($key == 'credits') { + $credits = $course->credits; + foreach($credits as $key => $credit) { + unset($credits[$key]); + } + foreach($val as $type => $hours) { + if($type == 1) { + foreach(explode(' ', $hours) as $singeValue) { + if(Zend_Filter::getDigits($hours) != '') { + $newAttribute = CourseCredits::getInstance()->fetchNew(); + $newAttribute->type = $type; + $newAttribute->hours = $singeValue; + $credits[] = $newAttribute; + } + } + continue; + } + if(Zend_Filter::getDigits($hours) != '') { + $newAttribute = CourseCredits::getInstance()->fetchNew(); + $newAttribute->type = $type; + $newAttribute->hours = $hours; + $credits[] = $newAttribute; + } + } + } else if(in_array($key, array('termsOffered','deliveryMethods','campuses'))) { + $course->$key = $val; + //echo '$course->' . $key . ' = '; print_r($val); echo "<br />\n"; + } else if($key == 'gradTieIn') { + if(!$course->gradTieIn instanceof CourseGradTieIn) { + $course->gradTieIn = CourseGradTieIns::getInstance()->fetchNew(); + } + foreach($val as $key2 => $val2) { + $course->gradTieIn->$key2 = $val2; + } + } else if(is_array($val)) { + $array = $course->$key; + foreach($array as $key2 => $row) { + unset($array[$key2]); + } + foreach($val as $key2 => $val2) { + if($val2['delete'] == 'yes') { + continue; + } + $attributeTable = call_user_func(array('Course' . $key, 'getInstance')); + $currentAttribute = $attributeTable->fetchNew(); + unset($val2['delete']); + + //loop over each attribute and set + foreach($val2 as $key3 => $val3) { + if($val3 == '') { + $val3 = null; + } + //echo '$currentAttribute->' . $key3 . ' = ' . $val3 . "<br />\n"; + $currentAttribute->$key3 = $val3; + } + $array[] = $currentAttribute; + //save changes + } + //print_r($array); + } + } + + + + + + + + + if(is_array($_FILES['request'])) { + $newRequestFiles = array(); + foreach($_FILES['request'] as $fieldName => $values) { + foreach($values as $key => $value) { + $newRequestFiles[$key][$fieldName] = $value; + } + } + + foreach($newRequestFiles as $key => $file) { + if($file['error'] != 0) { + unset($newRequestFiles[$key]); + $errors[] = 'request[' . $key . ']'; + } + } + + + $fileTypes = array(RequestFile::CROSSLIST_MEMO_TYPE, + RequestFile::IS_NARRATIVE_TYPE, + RequestFile::SYLLABUS_TYPE); + foreach($fileTypes as $fileType) { + if(is_array($newRequestFiles[$fileType])) { + $inFile = $newRequestFiles[$fileType]; + $file = RequestFiles::getInstance()->fetchNew(); + + $file->title = $inFile['name']; + $file->data = file_get_contents($inFile['tmp_name']); + $file->mimeType = $inFile['type']; + + $request->setFileByType($fileType, $file); + } + } + } + + if($submit == 'Submit') { + return $this->_submitRequestAction(); + } + + $out = new Nmc_View(); + + $requestFormOrder = array('CourseID', + 'CreditHours', + 'TimeLocation', + 'GraduateTieIn', + 'SupportiveMaterial', + //'AdditionalInformation', + 'SubmitRequest'); + + $currentForm = $_SERVER['HTTP_REFERER']; + $currentForm = explode('/', $currentForm); + while($currentForm[count($currentForm) - 1] == '') { + array_pop($currentForm); + } + $currentForm = array_pop($currentForm); + $currentForm = array_search(strtolower($currentForm), + array_map("strtolower", $requestFormOrder)); + if($currentForm < count($requestFormOrder) - 1) { + $nextForm = $requestFormOrder[$currentForm + 1]; + } else { + $nextForm = $requestFormOrder[$currentForm]; + } + if($currentForm > 0) { + $prevForm = $requestFormOrder[$currentForm - 1]; + } else { + $prevForm = $requestFormOrder[$currentForm]; + } + + if($submit == 'Prev') { + $targetForm = $prevForm; + } else { + $targetForm = $nextForm; + } + + $out->assign('refresh', '/NewRequest/' . $targetForm . '/'); + if(true || $_SERVER['REMOTE_ADDR'] != '129.93.39.17') { + echo $out->render(); + } else { + //print_r($course); + } + } + + public function saveAction() { + try { + $course = clone Nmc_Registry_Session::getInstance()->course; + $course->save(); + } catch(Exception $e) { + print_r($e); + throw $e; + } + } + + public function courseIdAction() + { + $course = Nmc_Registry_Session::getInstance()->course; + $out = new Nmc_View(); + + $out->page = 'request/edit_wrapper'; + $out->requestPage = 'course_id'; + $out->css_files[] = '/css/request/course_id.css'; + $out->js_files[] = '/tinymce/jscripts/tiny_mce/tiny_mce.js'; + $out->js_files[] = '/javascript/mce.js'; + + $out->course = $course; + + echo $out->render(); + } + + public function creditHoursAction() + { + $out = new Nmc_View(); + + $out->page = 'request/edit_wrapper'; + $out->requestPage = 'credit_hours'; + $out->css_files[] = '/css/request/credit_hours.css'; + + $course = Nmc_Registry_Session::getInstance()->course; + $out->course = $course; + + $creditsSingleValues = array(); + foreach($course->credits as $credit) { + if($credit->type == 1) { + $creditsSingleValues[] = $credit->hours; + } else if($credit->type == 2) { + $out->creditsRangeMin = $credit->hours; + } else if($credit->type == 3) { + $out->creditsRangeMax = $credit->hours; + } else if($credit->type == 4) { + $out->creditsMaxPerSemester = $credit->hours; + } else if($credit->type == 5) { + $out->creditsMaxPerDegree = $credit->hours; + } + } + $out->creditsSingleValues = implode(' ', $creditsSingleValues); + + echo $out->render(); + } + + public function timeLocationAction() + { + $out = new Nmc_View(); + + $out->page = 'request/edit_wrapper'; + $out->requestPage = 'time_location'; + $out->css_files[] = '/css/request/time_location.css'; + + $course = Nmc_Registry_Session::getInstance()->course; + $out->course = $course; + + echo $out->render(); + } + + public function graduateTieInAction() + { + $out = new Nmc_View(); + + $out->page = 'request/edit_wrapper'; + $out->requestPage = 'graduate_tie_in'; + $out->css_files[] = '/css/request/graduate_tie_in.css'; + $out->js_files[] = '/tinymce/jscripts/tiny_mce/tiny_mce.js'; + $out->js_files[] = '/javascript/mce.js'; + + $course = Nmc_Registry_Session::getInstance()->course; + + $hasGradTieIn = false; + foreach($course->crosslistings as $crosslisting) { + if($crosslisting->type == 'grad tie-in') { + $hasGradTieIn = true; + } + } + + $out->hasGradTieIn = $hasGradTieIn; + $out->course = $course; + + echo $out->render(); + } + + public function supportiveMaterialAction() + { + $out = new Nmc_View(); + + $out->page = 'request/edit_wrapper'; + $out->requestPage = 'supportive_material'; + $out->css_files[] = '/css/request/supportave_material.css'; + $out->js_files[] = '/tinymce/jscripts/tiny_mce/tiny_mce.js'; + $out->js_files[] = '/javascript/mce.js'; + + $course = Nmc_Registry_Session::getInstance()->course; + $out->course = $course; + $request = Nmc_Registry_Session::getInstance()->request; + $out->request = $request; + + echo $out->render(); + } + + public function additionalInformationAction() + { + $out = new Nmc_View(); + + $out->page = 'request/edit_wrapper'; + $out->requestPage = 'additional_information'; + $out->css_files[] = '/css/request/additional_information.css'; + + $course = Nmc_Registry_Session::getInstance()->course; + $out->course = $course; + + echo $out->render(); + } + + public function submitRequestAction() + { + $course = Nmc_Registry_Session::getInstance()->course; + $request = Nmc_Registry_Session::getInstance()->request; + + $out = new Nmc_View(); + $out->course = $course; + $out->request = $request; + $out->page = 'request/edit_wrapper'; + $out->requestPage = 'submit'; + $out->css_files[] = '/css/request/submit.css'; + + echo $out->render(); + } + + protected function _submitRequestAction() + { + try { + $course = Nmc_Registry_Session::getInstance()->course; + + $course->save(); + + Nmc_Registry_Session::getInstance()->erase('course'); + Nmc_Registry_Session::getInstance()->erase('request'); + + $out = new Nmc_View(); + $out->refresh = '/home'; + echo $out->render(); + } catch(Exception $e) { + throw $e; + } + } +} + +?> diff --git a/application/controllers/OossController.php b/application/controllers/OossController.php new file mode 100644 index 0000000000000000000000000000000000000000..e2d942948d71928af479b857848a72edb88c450a --- /dev/null +++ b/application/controllers/OossController.php @@ -0,0 +1,19 @@ +<?php + +class OossController extends Nmc_Controller_Action +{ + public function indexAction() + { + $ooss = new Nmc_View_Oss(); + $ooss->parseFile('./css/test.oss'); + } + + public function __call($method, $args) + { + $oossFile = substr($method, 0, -6) . '.oss'; + $ooss = new Nmc_View_Oss(); + $ooss->parseFile('./css/' . $oossFile); + } +} + +?> \ No newline at end of file diff --git a/application/controllers/TestController.php b/application/controllers/TestController.php new file mode 100644 index 0000000000000000000000000000000000000000..94716656312988afaab47a0e294dab6241f4dc3c --- /dev/null +++ b/application/controllers/TestController.php @@ -0,0 +1,17 @@ +<?php + +class TestController extends Nmc_Controller_Action +{ + public function __construct() + { + //$this->_registerPlugin(new Nmc_Controller_Action_Plugin_Authorize()); + $this->_registerPlugin(new Nmc_Controller_Action_Plugin_Test()); + } + + public function indexAction() + { + $foo = new Nmc_XMPP_Core(); + } +} + +?> \ No newline at end of file diff --git a/application/controllers/TestformController.php b/application/controllers/TestformController.php new file mode 100644 index 0000000000000000000000000000000000000000..bbc91222f2b9aefbc1696b1e5beba9a4297ad2ad --- /dev/null +++ b/application/controllers/TestformController.php @@ -0,0 +1,102 @@ +<?php + +class TestFormController extends Nmc_Controller_Action +{ + public function __construct() + { + // + } + + public function indexAction() + { + $record = CourseGenerations::fetchBySubjectNumberLetter('CSCE', 155); + $newRecord = clone $record; + $newRecord->title = 'Computer Science I, part 2'; + $newRecord->save(); + + /* + $sem = new Nmc_Semaphore('tnohu'); + $sem->lock(); + header('Content-type: text'); + echo "doing stuff...\n"; + sleep(10); + echo "done!\n"; + $sem->unlock(); + */ + + //return $this->viewAction(); + } + + public function listAction() + { + $table = new TestAddressBook(); + $recrods = $table->fetchAll(); + $out = new Nmc_View_Unl(); + $out->assign('page', 'listAddress'); + $out->assign('records', $recrods); + echo $out->render(); + } + + public function viewAction() + { + $in = $this->_getAllParams(); + $id = Zend_Filter::getInt($in['URI_PARAMS'][0]); + $table = new TestAddressBook(); + $record = $table->find($id); + + $out = new Nmc_View_Unl(); + $out->assign('page', 'viewAddress'); + $out->assign('record', $record); + echo $out->render(); + } + + public function addAction() + { + $out = new Nmc_View_Unl(); + $out->page = 'addAddress'; + echo $out->render(); + } + + public function editAction() + { + $in = $this->_getAllParams(); + $id = Zend_Filter::getInt($in['URI_PARAMS'][0]); + $table = new TestAddressBook(); + $record = $table->find($id); + + $out = new Nmc_View_Unl(); + $out->assign('page', 'editAddress'); + $out->assign('record', $record); + echo $out->render(); + } + + public function saveAction() + { + $in = new Zend_Filter_Input($this->_getAllParams()); + $id = $in->getInt('id'); + + $table = new TestAddressBook(); + if($id < 0) { + $record = $table->fetchNew(); + } else { + $record = $table->find($id); + } + + $record->firstName = $in->getAlnum('firstName'); + $record->lastName = $in->getAlnum('lastName'); + $record->phone = $in->getAlnum('phone'); + $record->address = $in->getAlnum('address'); + $record->zip = $in->getAlnum('zip'); + $record->save(); + + if($id < 0) { + $id = $table->getAdapter()->lastInsertId(); + } + + $out = new Nmc_View_Unl(); + $out->refresh = '/testform/view/' . $id; + echo $out->render(); + } +} + +?> \ No newline at end of file diff --git a/application/controllers/UseradminController.php b/application/controllers/UseradminController.php new file mode 100644 index 0000000000000000000000000000000000000000..a6c9868f8a465febced07e77f4703ee855a3dadc --- /dev/null +++ b/application/controllers/UseradminController.php @@ -0,0 +1,160 @@ +<?php + +class UserAdminController extends Nmc_Controller_Action +{ + public function indexAction() + { + $out = new Nmc_View(); + + $groups = Groups::getInstance()->fetchAllWithoutPrimaries(); + + $out->title = 'Group Administration'; + $out->page = 'user_admin'; + $out->groups = $groups; + echo $out->render(); + } + + public function editUserAction() + { + $in = $this->_getAllParams(); + $userId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + + if($in['Submit'] == 'Submit') { + return $this->editUserActionPost(); + } + + $out = new Nmc_View(); + + $out->title = 'Group Administration'; + $out->page = 'user_admin'; + + if($userId < 0) { + $out->user = People::getInstance()->fetchNew(); + } else { + $out->user = People::getInstance()->find($userId); + } + $out->groups = Groups::getInstance()->fetchAllWithoutPrimaries(); + + echo $out->render(); + } + + protected function editUserActionPost() + { + $in = $this->_getAllParams(); + $userId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + if(!$userId) { + $user = People::getInstance()->fetchNew(); + } else { + $user = People::getInstance()->find($userId); + } + + if($in['delete'] == '1') { + $user->delete(); + } else { + $user->firstName = Zend_Filter::getAlnum($in['firstName']); + $user->lastName = Zend_Filter::getAlnum($in['lastName']); + $user->save(); + } + + $selectedGroups = Groups::getInstance()->findAll($in['groups']); + $currentGroups = $user->getGroups(false); + + $removedGroups = $currentGroups->getRowsNotInCommonWith($selectedGroups); + $newGroups = $selectedGroups->getRowsNotInCommonWith($currentGroups); + + foreach($removedGroups as $removedGroup) { + $removedGroup->removeUser($user); + } + + foreach($newGroups as $newGroup) + { + $newGroup->addUser($user); + } + + + $out = new Nmc_View(); + $out->refresh = '/UserAdmin/EditUser/' . $userId; + echo $out->render(); + } + + public function editGroupAction() + { + $in = $this->_getAllParams(); + $groupId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + + if($in['Submit'] == 'Submit') { + return $this->editGroupActionPost(); + } + + $out = new Nmc_View(); + + $out->title = 'Group Administration'; + $out->page = 'user_admin'; + + if($groupId < 0) { + $out->group = Groups::getInstance()->fetchNew(); + } else { + $out->group = Groups::getInstance()->find($groupId); + } + $out->groups = Groups::getInstance()->fetchAllWithoutPrimaries(); + $out->users = People::getInstance()->fetchAll(); + $out->groups = Groups::getInstance()->fetchAllWithoutPrimaries(); + + echo $out->render(); + } + + protected function editGroupActionPost() + { + $in = $this->_getAllParams(); + $groupId = Zend_Filter::getInt($in['URI_PARAMS'][0]); + if(!$groupId) { + $group = Groups::getInstance()->fetchNew(); + $group->type = 1; + } else { + $group = Groups::getInstance()->find($groupId); + } + + if($in['delete'] == '1') { + $group->delete(); + } else { + $group->name = $in['name']; + $group->description = $in['description']; + $group->save(); + } + + $selectedGroups = Groups::getInstance()->findAll($in['groups']); + $currentGroups = $group->getGroups(false); + + $removedGroups = $currentGroups->getRowsNotInCommonWith($selectedGroups); + $newGroups = $selectedGroups->getRowsNotInCommonWith($currentGroups); + + foreach($removedGroups as $removedGroup) { + $group->removeGroup($removedGroup); + } + + foreach($newGroups as $newGroup) + { + $group->addGroup($newGroup); + } + + $selectedUsers = People::getInstance()->findAll($in['users']); + $currentUsers = $group->getUsers(false); + + $removedUsers = $currentUsers->getRowsNotInCommonWith($selectedUsers); + $newUsers = $selectedUsers->getRowsNotInCommonWith($currentUsers); + + foreach($removedUsers as $removedUser) { + $group->removeUser($removedUser); + } + + foreach($newUsers as $newUser) { + $group->addUser($newUser); + } + + $out = new Nmc_View(); + $out->refresh = '/UserAdmin/EditGroup/' . $groupId; + echo $out->render(); + } +} + +?> \ No newline at end of file diff --git a/application/library/Local/Db/CourseTableMany.php b/application/library/Local/Db/CourseTableMany.php new file mode 100644 index 0000000000000000000000000000000000000000..9cc737b9a4f9d91f33edb1e0479d525f1cee3e77 --- /dev/null +++ b/application/library/Local/Db/CourseTableMany.php @@ -0,0 +1,15 @@ +<?php + +abstract class Local_Db_CourseTableMany extends Nmc_Db_Table +{ + public function fetchByGeneration(CourseGeneration $generation) + { + $where = array(); + $where[] = $this->_db->quoteInto('generation = ?', $generation->id); + $where = implode(' AND ', $where); + + return $this->fetchAll($where); + } +} + +?> \ No newline at end of file diff --git a/application/library/Local/Db/CourseTableOne.php b/application/library/Local/Db/CourseTableOne.php new file mode 100644 index 0000000000000000000000000000000000000000..1d74f9c933a50fbf52276414637e7dcd98ab16f0 --- /dev/null +++ b/application/library/Local/Db/CourseTableOne.php @@ -0,0 +1,15 @@ +<?php + +abstract class Local_Db_CourseTableOne extends Nmc_Db_Table +{ + public function fetchByGeneration(CourseGeneration $generation) + { + $where = array(); + $where[] = $this->_db->quoteInto('generation = ?', $generation->id); + $where = implode(' AND ', $where); + + return $this->fetchRow($where); + } +} + +?> \ No newline at end of file diff --git a/application/models/rows/ApprovalBody.php b/application/models/rows/ApprovalBody.php new file mode 100644 index 0000000000000000000000000000000000000000..51e36af406e896ddd00aaa2ff61a8eda7cd48bd2 --- /dev/null +++ b/application/models/rows/ApprovalBody.php @@ -0,0 +1,20 @@ +<?php + +class ApprovalBody extends Nmc_Db_Table_Row +{ + function __construct($config = array()) + { + parent::__construct($config); + + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasMany( + ApprovalBodyRoles::getInstance(), + $this, + 'approval_body', + 'roles' + ) + ); + } +} + +?> \ No newline at end of file diff --git a/application/models/rows/ApprovalBodyRole.php b/application/models/rows/ApprovalBodyRole.php new file mode 100644 index 0000000000000000000000000000000000000000..7a352607323f7ae9979b7223a54d82c7b991040f --- /dev/null +++ b/application/models/rows/ApprovalBodyRole.php @@ -0,0 +1,19 @@ +<?php + +class ApprovalBodyRole extends Nmc_Db_Table_Row +{ + public function __construct($config = array()) + { + parent::__construct($config); + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasOne( + Groups::getInstance(), + $this, + 'group', + 'roleGroup' + ) + ); + } +} + +?> \ No newline at end of file diff --git a/application/models/rows/Course.php b/application/models/rows/Course.php new file mode 100644 index 0000000000000000000000000000000000000000..e7da63df62c3038830862120ed9df9a810da6e19 --- /dev/null +++ b/application/models/rows/Course.php @@ -0,0 +1,8 @@ +<?php + +class Course extends Nmc_Db_Table_Row +{ + +} + +?> \ No newline at end of file diff --git a/application/models/rows/CourseActivity.php b/application/models/rows/CourseActivity.php new file mode 100644 index 0000000000000000000000000000000000000000..fd166069b7ca17d90dae129a3c43c3e1f1efd154 --- /dev/null +++ b/application/models/rows/CourseActivity.php @@ -0,0 +1,6 @@ +<?php + +class CourseActivity extends Nmc_Db_Table_Row +{ + +} \ No newline at end of file diff --git a/application/models/rows/CourseCode.php b/application/models/rows/CourseCode.php new file mode 100644 index 0000000000000000000000000000000000000000..77e1e731ae451b7e60d4b1064471977186ecd190 --- /dev/null +++ b/application/models/rows/CourseCode.php @@ -0,0 +1,93 @@ +<?php + +class CourseCode extends Nmc_Db_Table_Row +{ + /** + * Gets the next course code + * + * @return CourseCode + */ + public function getNextAlphabetically() + { + $db = $this->_table->getAdapter(); + + $order = 'subject, course_number, course_letter'; + + $where = array(); + $where[] = $db->quoteInto('subject = ?', $this->subject); + $where[] = $db->quoteInto('course_number = ?', $this->courseNumber); + $where[] = $db->quoteInto('course_letter > ?', $this->courseLetter); + $where = implode(' AND ', $where); + + $row = $this->_table->fetchRow($where, $order); + if($row->id) { + return $row; + } + + $where = array(); + $where[] = $db->quoteInto('subject = ?', $this->subject); + $where[] = $db->quoteInto('course_number > ?', $this->courseNumber); + $where = implode(' AND ', $where); + + $row = $this->_table->fetchRow($where, $order); + if($row->id) { + return $row; + } + + $where = array(); + $where[] = $db->quoteInto('subject > ?', $this->subject); + $where = implode(' AND ', $where); + + $row = $this->_table->fetchRow($where, $order); + if($row->id) { + return $row; + } + + return null; + + } + + /** + * Returns the previous course code + * + * @return CourseCode + */ + public function getPreviousAlphabetically() + { + $db = $this->_table->getAdapter(); + + $order = 'subject DESC, course_number DESC, course_letter DESC'; + + $where = array(); + $where[] = $db->quoteInto('subject = ?', $this->subject); + $where[] = $db->quoteInto('course_number = ?', $this->courseNumber); + $where[] = $db->quoteInto('course_letter < ?', $this->courseLetter); + $where = implode(' AND ', $where); + + $row = $this->_table->fetchRow($where, $order); + if($row->id) { + return $row; + } + + $where = array(); + $where[] = $db->quoteInto('subject = ?', $this->subject); + $where[] = $db->quoteInto('course_number < ?', $this->courseNumber); + $where = implode(' AND ', $where); + + $row = $this->_table->fetchRow($where, $order); + if($row->id) { + return $row; + } + + $where = array(); + $where[] = $db->quoteInto('subject < ?', $this->subject); + $where = implode(' AND ', $where); + + $row = $this->_table->fetchRow($where, $order); + if($row->id) { + return $row; + } + + return null; + } +} \ No newline at end of file diff --git a/application/models/rows/CourseCredit.php b/application/models/rows/CourseCredit.php new file mode 100644 index 0000000000000000000000000000000000000000..e9ee6a5ea0ab8c4890ce321a0db5d547395408a5 --- /dev/null +++ b/application/models/rows/CourseCredit.php @@ -0,0 +1,8 @@ +<?php + +class CourseCredit extends Nmc_Db_Table_Row +{ + +} + +?> \ No newline at end of file diff --git a/application/models/rows/CourseCrosslisting.php b/application/models/rows/CourseCrosslisting.php new file mode 100644 index 0000000000000000000000000000000000000000..ef7326901ac4989814c853306d59b9f768d92d8d --- /dev/null +++ b/application/models/rows/CourseCrosslisting.php @@ -0,0 +1,104 @@ +<?php + +class CourseCrosslisting extends Nmc_Db_Table_Row +{ + protected $_subject; + protected $_courseNumber; + protected $_courseLetter; + protected $_integratedStudies; + protected $_courseCodeRow; + + public function __construct($config = array()) + { + parent::__construct($config); + $courseCode = CourseCodes::getInstance()->find($this->courseCode); + if($courseCode->id) { + $this->_subject = $courseCode->subject; + $this->_courseNumber = $courseCode->courseNumber; + $this->_courseLetter = $courseCode->courseLetter; + $this->_integratedStudies = $courseCode->integratedStudies; + $this->_courseCodeRow = $courseCode; + } + } + + public function _get($name) + { + switch($name) { + case 'subject': + case 'courseNumber': + case 'courseLetter': + case 'integratedStudies': + return $this->{'_' . $name}; + break; + default: + return parent::_get($name); + break; + } + } + + public function _set($name, $value) + { + switch($name) { + case 'subject': + case 'courseNumber': + case 'courseLetter': + case 'integratedStudies': + $this->{'_' . $name} = $value; + break; + default: + parent::_set($name, $value); + break; + } + } + + public function _save() + { + $db = $this->_table->getAdapter(); + $where = array(); + $where[] = $db->quoteInto('subject = ?', $this->_subject); + $where[] = $db->quoteInto('course_number = ?', $this->_courseNumber); + $where[] = $db->quoteInto('course_letter = ?', $this->_courseLetter); + $where = implode(' AND ', $where); + $courseCode = CourseCodes::getInstance()->fetchRow($where); + if(!$courseCode->id) { + $courseCode = CourseCodes::getInstance()->fetchNew(); + $courseCode->subject = $this->_subject; + $courseCode->courseNumber = $this->_courseNumber; + $courseCode->courseLetter = $this->_courseLetter; + } + $courseCode->integratedStudies = $this->_integratedStudies; + if(!$courseCode->courseLetter) { + $courseCode->courseLetter = ''; + } + $courseCode->save(); + $this->courseCode = $courseCode->id; + parent::_save(); + } + + public function getParentCourse() + { + $parentCourse = CourseGenerations::getInstance()->find($this->generation); + return $parentCourse; + } + + public function getNextAlphabetically() + { + $nextCourseCode = $this->_courseCodeRow->getNextAlphabetically(); + $next = CourseCrosslistings::fetchBySubjectNumberLetter($nextCourseCode->subject, + $nextCourseCode->courseNumber, + $nextCourseCode->courseLetter); + return $next; + } + + public function getPreviousAlphabetically() + { + $prevCourseCode = $this->_courseCodeRow->getPreviousAlphabetically(); + $prev = CourseCrosslistings::fetchBySubjectNumberLetter($prevCourseCode->subject, + $prevCourseCode->courseNumber, + $prevCourseCode->courseLetter); + return $prev; + } + +} + +?> \ No newline at end of file diff --git a/application/models/rows/CourseDetail.php b/application/models/rows/CourseDetail.php new file mode 100644 index 0000000000000000000000000000000000000000..7cbaedc4e01ed2f9778f065d1936e4d16545c750 --- /dev/null +++ b/application/models/rows/CourseDetail.php @@ -0,0 +1,40 @@ +<?php + +class CourseDetail extends Nmc_Db_Table_Row +{ + + public function __construct($config = array()) + { + parent::__construct($config); + $this->_humanize(); + } + + public function _save() + { + $this->_mechanize(); + try { + parent::_save(); + } catch(Exception $e) { + $this->_humanize(); + throw $e; + } + $this->_humanize(); + } + + protected function _humanize() + { + $this->campuses = explode(',', $this->campuses); + $this->deliveryMethods = explode(',', $this->deliveryMethods); + $this->termsOffered = explode(',', $this->termsOffered); + } + + protected function _mechanize() + { + $this->campuses = implode(',', $this->campuses); + $this->deliveryMethods = implode(',', $this->deliveryMethods); + $this->termsOffered = implode(',', $this->termsOffered); + } + +} + +?> \ No newline at end of file diff --git a/application/models/rows/CourseDfRemoval.php b/application/models/rows/CourseDfRemoval.php new file mode 100644 index 0000000000000000000000000000000000000000..c1c2f5587abe4e3b6581fb418e258d25859f10a7 --- /dev/null +++ b/application/models/rows/CourseDfRemoval.php @@ -0,0 +1,8 @@ +<?php + +class CourseDfRemoval extends Nmc_Db_Table_Row +{ + +} + +?> \ No newline at end of file diff --git a/application/models/rows/CourseGeneration.php b/application/models/rows/CourseGeneration.php new file mode 100644 index 0000000000000000000000000000000000000000..0e4eb488b4bc033cda03caf75ef3acc35110e88b --- /dev/null +++ b/application/models/rows/CourseGeneration.php @@ -0,0 +1,170 @@ +<?php + +class CourseGeneration extends Nmc_Db_Table_Row +{ + /* + public $request; + public $gradTieIn; + public $integratedStudies; + */ + protected $_homeCrosslisting; + + public function __construct($config = array()) + { + parent::__construct($config); + + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasOne(CourseDetails::getInstance(), $this, 'generation')); + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasMany(CourseActivities::getInstance(), $this, 'generation', 'activities')); + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasMany(CourseCredits::getInstance(), $this, 'generation', 'credits')); + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasMany(CourseCrosslistings::getInstance(), $this, 'generation', 'crosslistings')); + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasMany(CourseDfRemovals::getInstance(), $this, 'generation', 'dfRemovals')); + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasMany(CoursePrerequisites::getInstance(), $this, 'generation', 'prerequisites')); + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasOne(CourseGradTieIns::getInstance(), $this, 'generation', 'gradTieIn')); + + $this->_homeCrosslisting = $this->_getHomeCrosslisting(); + } + + public function _clone() + { + $parentId = $this->id; + + // duplicate parent record + parent::_clone(); + + $this->_homeCrosslisting = clone $this->_homeCrosslisting; + + if($parentId) { + $this->parent = $parentId; + } + } + + public function _get($name) + { + switch($name) + { + case 'subject': + case 'courseNumber': + case 'courseLetter': + case 'integratedStudies': + return $this->_homeCrosslisting->$name; + break; + default: + return parent::_get($name); + } + } + + public function _set($name, $value) + { + switch($name) + { + case 'subject': + case 'courseNumber': + case 'courseLetter': + case 'integratedStudies': + $this->_homeCrosslisting->$name = $value; + break; + default: + parent::_set($name, $value); + break; + } + } + + protected function _save() + { + $parentTransaction = false; + try { + $this->_db->beginTransaction(); + $parentTransaction = true; + } catch (PDOException $e) { + if($e->getMessage() != 'There is already an active transaction') { + throw $e; + } + } + + $saveCourse = $this->course; + $saveCreated = $this->created; + if($this->request instanceof Request) { + $saveRequest = $this->request->toArray(); + } + $saveRequestId = $this->_data['request']; + + try { + if(!$this->course) { + $course = Courses::getInstance()->fetchNew(); + $course->save(); + $this->course = $course->id; + } + if(!$this->created) { + $this->created = time(); + } + + if($this->request instanceof Request) { + $this->request->save(); + $this->_data['request'] = $this->request->id; + } + + $this->_setHomeCrosslisting($this->_homeCrosslisting); + + parent::_save(); + + if($parentTransaction) { + $this->_db->commit(); + } + } catch(Exception $e) { + if($parentTransaction) { + $this->_db->rollBack(); + } + + $this->course = $saveCourse; + $this->created = $saveCreated; + if($this->request instanceof Request) { + $this->_data['request'] = $saveRequestId; + $this->request->setFromArray($saveRequest); + } + throw $e; + } + } + + /** + * Returns a reference to the home crosslist + * + * @return CourseCrosslisting + */ + protected function _getHomeCrosslisting() + { + $crosslistings = $this->crosslistings; + foreach($crosslistings as $key => $crosslisting) { + if($crosslisting->type == 'home listing') { + $homeCrosslisting = $crosslisting; + } + } + if(!$homeCrosslisting) { + $homeCrosslisting = CourseCrosslistings::getInstance()->fetchNew(); + $homeCrosslisting->type = 'home listing'; + } + return $homeCrosslisting; + } + + protected function _setHomeCrosslisting($home) + { + $crosslistings = $this->crosslistings; + $found = false; + foreach($crosslistings as $key => $crosslisting) { + if($crosslisting->type == 'home listing') { + $crosslistings[$key] = $home; + $found = true; + break; + } + } + if(!$found) { + $crosslistings[] = $home; + } + } +} \ No newline at end of file diff --git a/application/models/rows/CourseGradTieIn.php b/application/models/rows/CourseGradTieIn.php new file mode 100644 index 0000000000000000000000000000000000000000..24c176434e6fcc150216500c24b133becca50686 --- /dev/null +++ b/application/models/rows/CourseGradTieIn.php @@ -0,0 +1,8 @@ +<?php + +class CourseGradTieIn extends Nmc_Db_Table_Row +{ + +} + +?> \ No newline at end of file diff --git a/application/models/rows/CoursePrerequisite.php b/application/models/rows/CoursePrerequisite.php new file mode 100644 index 0000000000000000000000000000000000000000..0e7066760025cef23a2ad30a96bd70d051a204a9 --- /dev/null +++ b/application/models/rows/CoursePrerequisite.php @@ -0,0 +1,8 @@ +<?php + +class CoursePrerequisite extends Nmc_Db_Table_Row +{ + +} + +?> \ No newline at end of file diff --git a/application/models/rows/Group.php b/application/models/rows/Group.php new file mode 100644 index 0000000000000000000000000000000000000000..2f745a38865528705b1f6d340a1fa650552ba842 --- /dev/null +++ b/application/models/rows/Group.php @@ -0,0 +1,83 @@ +<?php + +class Group extends Nmc_Db_Table_Row +{ + public function _get($name) + { + switch($name) { + case 'users': + return $this->getUsers(); + break; + case 'groups': + return $this->getGroups(); + break; + + default: + return parent::_get($name); + break; + } + } + + public function addUser(Person $user) + { + $childGroup = Groups::getInstance()->find($user->primaryGroup); + $this->addGroup($childGroup); + } + + public function removeUser(Person $user) + { + $childGroup = Groups::getInstance()->find($user->primaryGroup); + $this->removeGroup($childGroup); + } + + public function addGroup(Group $group) + { + $membership = GroupMemberships::getInstance()->fetchNew(); + $membership->parentGroup = $this->id; + $membership->childGroup = $group->id; + $membership->type = $this->type; + $membership->save(); + } + + public function removeGroup(Group $group) + { + $where = array(); + $where[] = $this->_db->quoteInto('parent_group = ?', $this->id); + $where[] = $this->_db->quoteInto('child_group = ?', $group->id); + $where = implode(' AND ', $where); + $membership = GroupMemberships::getInstance()->fetchRow($where); + $membership->delete(); + } + + /** + * Returns all users belonging to this group + * + * @param bool[optional] $impliedMemberships + * @param bool[optional] $explicitMemberships + * @return Nmc_Db_Table_Rowset + */ + public function getUsers($impliedMemberships = true, $explicitMemberships = true) + { + $membershipTable = GroupImpliedMemberships::getInstance(); + return $membershipTable->fetchUsersByParentGroup($this, $impliedMemberships, $explicitMemberships); + } + + /** + * Returns all groups belonging to this group + * + * @param bool[optional] $impliedMemberships + * @param bool[optional] $explicitMemberships + * @return Nmc_Db_Table_Rowset + */ + public function getGroups($impliedMemberships = true, $explicitMemberships = true) + { + $membershipTable = GroupImpliedMemberships::getInstance(); + return $membershipTable->fetchGroupsByParentGroup($this, $impliedMemberships, $explicitMemberships); + } + + public function isRootGroup() + { + $parentGroups = GroupImpliedMemberships::getInstance()->fetchGroupsByChildGroup($this); + return($parentGroups->count() === 0); + } +} \ No newline at end of file diff --git a/application/models/rows/GroupImpliedMembership.php b/application/models/rows/GroupImpliedMembership.php new file mode 100644 index 0000000000000000000000000000000000000000..fa6d7caa92ce98802846ace40b127a6477aa16ae --- /dev/null +++ b/application/models/rows/GroupImpliedMembership.php @@ -0,0 +1,14 @@ +<?php + +class GroupImpliedMembership extends Nmc_Db_Table_Row +{ + public function _save() + { + throw new Zend_Db_Exception('Cannot manually edit implied memberships!'); + } + + public function delete() + { + throw new Zend_Db_Exception('Cannot manually edit implied memberships!'); + } +} \ No newline at end of file diff --git a/application/models/rows/Person.php b/application/models/rows/Person.php new file mode 100644 index 0000000000000000000000000000000000000000..44cb735ce5b945c092199fe92045d7ba99f870af --- /dev/null +++ b/application/models/rows/Person.php @@ -0,0 +1,57 @@ +<?php + +Zend::loadInterface('Nmc_Model_UserInterface'); + +class Person extends Nmc_Db_Table_Row implements Nmc_Model_UserInterface +{ + + public function _save() + { + if(!$this->primaryGroup) { + $primaryGroup = Groups::getInstance()->fetchNew(); + $primaryGroup->type = 1; + $primaryGroup->name = $this->userName; + $primaryGroup->save(); + $this->primaryGroup = $primaryGroup->id; + } + + return parent::_save(); + } + + public function getId() + { + return $this->id; + } + + public function getUserName() + { + return $this->userName; + } + + public function getShortName() + { + return $this->firstName; + } + + public function getFullName() + { + return $this->firstName . ' ' . $this->lastName; + } + + public function _get($name) + { + switch($name) { + case 'groups': + return GroupImpliedMemberships::getInstance()->fetchGroupsByUser($this); + break; + default: + return parent::_get($name); + break; + } + } + + public function getGroups($implied = true, $explicit = true) + { + return GroupImpliedMemberships::getInstance()->fetchGroupsByUser($this, $implied, $explicit); + } +} \ No newline at end of file diff --git a/application/models/rows/Request.php b/application/models/rows/Request.php new file mode 100644 index 0000000000000000000000000000000000000000..d0f0349a715171a078c19754d44b9956cfa05230 --- /dev/null +++ b/application/models/rows/Request.php @@ -0,0 +1,76 @@ +<?php + +class Request extends Nmc_Db_Table_Row +{ + + public function __construct($config = array()) { + parent::__construct($config); + $this->_registerRelation( + new Nmc_Db_Table_Relation_HasMany(RequestFiles::getInstance(), + $this, 'request', 'files')); + } + + /** + * Retrieves the proposed course generation being requested. + * + * @return CourseGeneration + */ + public function getCourseGeneration() + { + $returnValue = null; + + $where = $this->_db->quoteInto('request = ?', $this->id); + $order = 'created'; + $generations = CourseGenerations::getInstance()->fetchAll($where, $order); + if($generations->count() > 0) { + $returnValue = $generations[0]; + } + + return $returnValue; + } + + /** + * Returns the file of the specified type for the request + * Please use the class constants + * + * @param string $type + * @return RequestFile + */ + public function getFileByType($type) + { + $result = null; + + foreach($this->files as $file) + { + if($file->type == $type) { + $result = $file; + } + } + + return $result; + } + + /** + * Sets (or adds) the provided file as the given file type for the request + * Please use class constants for type + * + * @param string $type + * @param RequestFile $newFile + */ + public function setFileByType($type, RequestFile $newFile) + { + $key = null; + foreach($this->files as $currentKey => $file) + { + if($file->type == $type) { + $key = $currentKey; + break; + } + } + + $newFile->type = $type; + $this->files[$key] = $newFile; + } +} + +?> \ No newline at end of file diff --git a/application/models/rows/RequestFile.php b/application/models/rows/RequestFile.php new file mode 100644 index 0000000000000000000000000000000000000000..05e499c9af3f8e82c6b793a9bc2866e9e9a6c420 --- /dev/null +++ b/application/models/rows/RequestFile.php @@ -0,0 +1,18 @@ +<?php + +class RequestFile extends Nmc_Db_Table_Row +{ + const SYLLABUS_TYPE = 'syllabus'; + const CROSSLIST_MEMO_TYPE = 'crosslist memo'; + const IS_NARRATIVE_TYPE = 'is_narrative'; + const OTHER_TYPE = 'other'; + + public function __construct($config = array()) + { + parent::__construct($config); + + $this->_registerRelation(new Nmc_Db_Table_Relation_Extend(Files::getInstance(), $this, 'file')); + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/ActivityTypes.php b/application/models/tables/ActivityTypes.php new file mode 100644 index 0000000000000000000000000000000000000000..6b4e35cfffb4710283d09d2f57504a5ea647a69e --- /dev/null +++ b/application/models/tables/ActivityTypes.php @@ -0,0 +1,26 @@ +<?php + +class ActivityTypes extends Nmc_Db_Table +{ + /** + * The one true instance + * + * @var ActivityTypes + */ + protected static $_instance = null; + + /** + * Returns the one true instance + * + * @return ActivityTypes + */ + public static function getInstance($config = array()) + { + if(!self::$_instance) { + self::$_instance = new ActivityTypes($config); + } + return self::$_instance; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/ApprovalBodies.php b/application/models/tables/ApprovalBodies.php new file mode 100644 index 0000000000000000000000000000000000000000..897e92048a6677f985c4ea5e33ca90690a065fab --- /dev/null +++ b/application/models/tables/ApprovalBodies.php @@ -0,0 +1,30 @@ +<?php + +class ApprovalBodies extends Nmc_Db_Table +{ + protected $_rowClass = 'ApprovalBody'; + + /** + * The one true instance + * + * @var ApprovalBodies + */ + protected static $_instance = null; + + /** + * Returns the one true instance + * + * @return ApprovalBodies + */ + public static function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new ApprovalBodies($config); + } + return self::$_instance; + } + + +} + +?> \ No newline at end of file diff --git a/application/models/tables/ApprovalBodyRoles.php b/application/models/tables/ApprovalBodyRoles.php new file mode 100644 index 0000000000000000000000000000000000000000..c4f48af03934085cad21bbac32034a46ceeb9eab --- /dev/null +++ b/application/models/tables/ApprovalBodyRoles.php @@ -0,0 +1,29 @@ +<?php + +class ApprovalBodyRoles extends Nmc_Db_Table +{ + protected $_className = 'ApprovalBodyRole'; + + /** + * The one true instance + * + * @var ApprovalBodyRoles + */ + protected static $_instance = null; + + /** + * Returns the one true instance + * + * @return ApprovalBodyRoles + */ + public static function getInstance($config = array()) + { + if(!self::$_instance) { + self::$_instance = new ApprovalBodyRoles($config); + } + return self::$_instance; + } + +} + +?> \ No newline at end of file diff --git a/application/models/tables/ApprovalChains.php b/application/models/tables/ApprovalChains.php new file mode 100644 index 0000000000000000000000000000000000000000..974cc347f9b90754130ebf3acb41213d81d95d91 --- /dev/null +++ b/application/models/tables/ApprovalChains.php @@ -0,0 +1,5 @@ +<?php + +class ApprovalChains extends Nmc_Db_Table {} + +?> \ No newline at end of file diff --git a/application/models/tables/ApprovalLinks.php b/application/models/tables/ApprovalLinks.php new file mode 100644 index 0000000000000000000000000000000000000000..1ef35557fda036978d342485e26f0bc07a9ea078 --- /dev/null +++ b/application/models/tables/ApprovalLinks.php @@ -0,0 +1,5 @@ +<?php + +class ApprovalLinks extends Nmc_Db_Table {} + +?> \ No newline at end of file diff --git a/application/models/tables/Auth.php b/application/models/tables/Auth.php new file mode 100644 index 0000000000000000000000000000000000000000..c5489d3e7d13133b3add6417da87c27074c6aeb8 --- /dev/null +++ b/application/models/tables/Auth.php @@ -0,0 +1,8 @@ +<?php + +class Auth extends Zend_Db_Table +{ + +} + +?> \ No newline at end of file diff --git a/application/models/tables/CourseActivities.php b/application/models/tables/CourseActivities.php new file mode 100644 index 0000000000000000000000000000000000000000..97097ddd0835f11dc4ce8af293f8579935ba0f5a --- /dev/null +++ b/application/models/tables/CourseActivities.php @@ -0,0 +1,61 @@ +<?php + +class CourseActivities extends Local_Db_CourseTableMany +{ + protected static $_instance; + protected $_rowClass = 'CourseActivity'; + + /** + * Return the singleton instance of this class + * + * @param array $config + * @return CourseActivities + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new CourseActivities($config); + } + return self::$_instance; + } + + static public function createWithParentCourse(CourseGeneration $course) + { + $me = self::getInstance(); + $config = array('db' => $me->_db, + 'table' => $me, + 'data' => array('course_generation' => $course->id)); + $newRecord = new CourseActivity($config); + return $newRecord; + } + + public function fetchAll($where = null, $order = null, $count = null, $offset = null) + { + if($order) { + $rowset = parent::fetchAll($where, $order, $count, $offset); + } else { + $activityTableInfo = ActivityTypes::getInstance()->info(); + $activityTableName = $activityTableInfo['name']; + $activityPrimary = $activityTableInfo['primary']; + + $select = $this->_db->select(); + $select->from($this->_name, '*'); + $select->join($activityTableName, + $this->_name . '.type = ' + . $activityTableName . '.short_name'); + + $select->where($where); + $select->order($activityTableName . '.id'); + $select->limit($count, $offset); + $resultData = $this->_db->fetchAll($select); + $config = array(); + $config['db'] = $this->_db; + $config['table'] = $this; + $config['data'] = $resultData; + $rowset = new Nmc_Db_Table_Rowset($config); + } + return $rowset; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/CourseCodes.php b/application/models/tables/CourseCodes.php new file mode 100644 index 0000000000000000000000000000000000000000..99d4fb20be5edfc12ea22aee5b32cae4599db3c5 --- /dev/null +++ b/application/models/tables/CourseCodes.php @@ -0,0 +1,38 @@ +<?php + +class CourseCodes extends Nmc_Db_Table +{ + + protected $_rowClass = 'CourseCode'; + + /** + * The one true instance + * + * @var CourseCodes + */ + protected static $_instance = null; + + /** + * Returns the one true instance + * + * @return CourseCodes + */ + public static function getInstance($config = array()) + { + if(!self::$_instance) { + self::$_instance = new CourseCodes($config); + } + return self::$_instance; + } + + public function fetchAll($where = null, $order = null, $count = null, $offset = null) + { + if(!$order) { + $order = 'subject, course_number, course_letter'; + } + return parent::fetchAll($where, $order, $count, $offset); + } + +} + +?> \ No newline at end of file diff --git a/application/models/tables/CourseCredits.php b/application/models/tables/CourseCredits.php new file mode 100644 index 0000000000000000000000000000000000000000..b04f554c519cdb8b011e0b729c3bea4d11c13aa0 --- /dev/null +++ b/application/models/tables/CourseCredits.php @@ -0,0 +1,33 @@ +<?php + +class CourseCredits extends Local_Db_CourseTableMany +{ + protected static $_instance; + protected $_rowClass = 'CourseCredit'; + + /** + * Return the singleton instance of this class + * + * @param array $config + * @return CourseCredits + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new CourseCredits($config); + } + return self::$_instance; + } + + static public function createWithParentCourse(CourseGeneration $course) + { + $me = self::getInstance(); + $config = array('db' => $me->_db, + 'table' => $me, + 'data' => array('course_generation' => $course->id)); + $newRecord = new CourseCredit($config); + return $newRecord; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/CourseCrosslistings.php b/application/models/tables/CourseCrosslistings.php new file mode 100644 index 0000000000000000000000000000000000000000..0df18fb4f79477f23afb3242dc8241a7afd95d5f --- /dev/null +++ b/application/models/tables/CourseCrosslistings.php @@ -0,0 +1,120 @@ +<?php + +class CourseCrosslistings extends Local_Db_CourseTableMany +{ + protected static $_instance; + protected $_rowClass = 'CourseCrosslisting'; + + /** + * Return the singleton instance of this class + * + * @param array $config + * @return CourseCrosslistings + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new CourseCrosslistings($config); + } + return self::$_instance; + } + + /** + * If a current course contains a crossliting with the given info, it will be returned + * + * @param string $subject + * @param integer $number + * @param string $letter + * @return CourseCrosslisting + */ + static public function fetchBySubjectNumberLetter($subject, $number, $letter = null) + { + $me = self::getInstance(); + $db = $me->getAdapter(); + + $select = $db->select(); + $select->from('creq_course_codes'); + $select->join('creq_course_crosslistings', + 'creq_course_codes.id = creq_course_crosslistings.course_code', + 'id'); + $select->join('creq_courses', + 'creq_course_crosslistings.generation = creq_courses.current_generation'); + $select->where($db->quoteInto('subject = ?', $subject)); + $select->where($db->quoteInto('course_number = ?', $number)); + $select->where($db->quoteInto('course_letter = ?', $letter)); + + $row = $db->fetchRow($select); + $result = $me->find($row['id']); + + + if($result->id == '') { + return null; + } else { + return $result; + } + } + + static public function fetchByCourseCodeId($courseCodeId) + { + $me = self::getInstance(); + $db = $me->getAdapter(); + + $where = $db->quoteInto('course_code = ?', $courseCodeId); + $self->fetchRow($where); + + if($result->id == '') { + return null; + } else { + return $result; + } + } + + static public function createWithParentCourse(CourseGeneration $course) + { + $me = self::getInstance(); + $config = array('db' => $me->_db, + 'table' => $me, + 'data' => array('parent_course' => $course->id)); + $newRecord = new CourseCrosslisting($config); + return $newRecord; + } + + public function fetchNew($config = array()) + { + $newRow = parent::fetchNew($config); + $newRow->type = 'crosslisting'; + $newRow->integratedStudies = 'no'; + + return $newRow; + } + + public function fetchAll($where = null, $order = null, $count = null, $offset = null) + { + if($order) { + $rowset = parent::fetchAll($where, $order, $count, $offset); + } else { + $courseCodeTableInfo = CourseCodes::getInstance()->info(); + $courseCodeTableName = $courseCodeTableInfo['name']; + $courseCodePrimary = $courseCodeTableInfo['primary']; + + $select = $this->_db->select(); + $select->from($this->_name, '*'); + $select->join($courseCodeTableName, + $this->_name . '.course_code = ' + . $courseCodeTableName . '.' . $courseCodePrimary); + + $select->where($where); + $select->order('subject, course_number, course_letter'); + $select->limit($count, $offset); + $resultData = $this->_db->fetchAll($select); + $config = array(); + $config['db'] = $this->_db; + $config['table'] = $this; + $config['data'] = $resultData; + $rowset = new Nmc_Db_Table_Rowset($config); + } + return $rowset; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/CourseDetails.php b/application/models/tables/CourseDetails.php new file mode 100644 index 0000000000000000000000000000000000000000..a0debddc09e1102c1ec3c37212b992e00d904bd3 --- /dev/null +++ b/application/models/tables/CourseDetails.php @@ -0,0 +1,22 @@ +<?php + +class CourseDetails extends Local_Db_CourseTableOne +{ + protected static $_instance; + protected $_rowClass = 'CourseDetail'; + + /** + * Return the singleton instance of this class + * + * @param array $config + * @return CourseDetails + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new CourseDetails($config); + } + return self::$_instance; + } + +} \ No newline at end of file diff --git a/application/models/tables/CourseDfRemovals.php b/application/models/tables/CourseDfRemovals.php new file mode 100644 index 0000000000000000000000000000000000000000..3eba430e6c29162a2187a67f7b54bd3ccdb42412 --- /dev/null +++ b/application/models/tables/CourseDfRemovals.php @@ -0,0 +1,33 @@ +<?php + +class CourseDfRemovals extends Local_Db_CourseTableMany +{ + protected static $_instance; + protected $_rowClass = 'CourseDfRemoval'; + + /** + * Return the singleton instance of this class + * + * @param array $config + * @return CourseDfRemovals + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new CourseDfRemovals($config); + } + return self::$_instance; + } + + static public function createWithParentCourse(CourseGeneration $course) + { + $me = self::getInstance(); + $config = array('db' => $me->_db, + 'table' => $me, + 'data' => array('course_generation_passed' => $course->id)); + $newRecord = new CourseCredit($config); + return $newRecord; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/CourseGenerations.php b/application/models/tables/CourseGenerations.php new file mode 100644 index 0000000000000000000000000000000000000000..76fc2555c1d850e236e44f82070e4b8852e4cccb --- /dev/null +++ b/application/models/tables/CourseGenerations.php @@ -0,0 +1,137 @@ +<?php + +class CourseGenerations extends Nmc_Db_Table +{ + protected static $_instance; + protected $_rowClass = 'CourseGeneration'; + + /** + * getInstance() - return singleton + * + * @param array $config + * @return Nmc_Db_Table + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new CourseGenerations($config); + } + return self::$_instance; + } + + /*public function find($val) + { + $row = parent::find($val); + $config = array('db' => $this->getAdapter(), + 'table' => $this, + 'data' => $row->toArray()); + return new CourseGeneration($config); + }*/ + + static public function fetchBySubjectNumberLetter($subject, $number, $letter = null) + { + $me = CourseGenerations::getInstance(); + + $row = CourseCrosslistings::fetchBySubjectNumberLetter($subject, $number, $letter); + if(!$row->id) { + return null; + } + + return $row->getParentCourse(); + } + + static public function getNext($subject, $number, $letter = null) + { + $db = self::getInstance()->getAdapter(); + $sql = 'SELECT id FROM (' + . 'SELECT id, subject, course_number, course_letter FROM creq_course_generations ' + . $db->quoteInto('WHERE subject >= ? ', $subject) + . $db->quoteInto('AND course_number >= ? ', $number) + . $db->quoteInto('AND course_letter > ? ', $letter) + . 'UNION ' + . 'SELECT id, subject, course_number, course_letter FROM creq_course_generations ' + . $db->quoteInto('WHERE subject >= ? ', $subject) + . $db->quoteInto('AND course_number > ? ', $number) + . 'UNION ' + . 'SELECT id, subject, course_number, course_letter FROM creq_course_generations ' + . $db->quoteInto('WHERE subject > ? ', $subject) + . 'UNION ' + . 'SELECT parent_course AS id, subject, course_number, course_letter FROM creq_course_crosslistings ' + . $db->quoteInto('WHERE subject >= ? ', $subject) + . $db->quoteInto('AND course_number >= ? ', $number) + . $db->quoteInto('AND course_letter > ? ', $letter) + . 'UNION ' + . 'SELECT parent_course AS id, subject, course_number, course_letter FROM creq_course_crosslistings ' + . $db->quoteInto('WHERE subject >= ? ', $subject) + . $db->quoteInto('AND course_number > ? ', $number) + . 'UNION ' + . 'SELECT parent_course AS id, subject, course_number, course_letter FROM creq_course_crosslistings ' + . $db->quoteInto('WHERE subject > ? ', $subject) + . 'ORDER BY subject, course_number, course_letter ' + . ') AS sub_table LIMIT 1 '; + $record = $db->fetchOne($sql); + $record = CourseGenerations::getInstance()->find($record); + return $record; + } + + static public function getPrevious($subject, $number, $letter = null) + { + $db = self::getInstance()->getAdapter(); + $sql = 'SELECT id FROM (' + . 'SELECT id, subject, course_number, course_letter FROM creq_course_generations ' + . $db->quoteInto('WHERE subject <= ? ', $subject) + . $db->quoteInto('AND course_number <= ? ', $number) + . $db->quoteInto('AND course_letter < ? ', $letter) + . 'UNION ' + . 'SELECT id, subject, course_number, course_letter FROM creq_course_generations ' + . $db->quoteInto('WHERE subject <= ? ', $subject) + . $db->quoteInto('AND course_number < ? ', $number) + . 'UNION ' + . 'SELECT id, subject, course_number, course_letter FROM creq_course_generations ' + . $db->quoteInto('WHERE subject < ? ', $subject) + . 'UNION ' + . 'SELECT parent_course AS id, subject, course_number, course_letter FROM creq_course_crosslistings ' + . $db->quoteInto('WHERE subject <= ? ', $subject) + . $db->quoteInto('AND course_number <= ? ', $number) + . $db->quoteInto('AND course_letter < ? ', $letter) + . 'UNION ' + . 'SELECT parent_course AS id, subject, course_number, course_letter FROM creq_course_crosslistings ' + . $db->quoteInto('WHERE subject <= ? ', $subject) + . $db->quoteInto('AND course_number < ? ', $number) + . 'UNION ' + . 'SELECT parent_course AS id, subject, course_number, course_letter FROM creq_course_crosslistings ' + . $db->quoteInto('WHERE subject < ? ', $subject) + . 'ORDER BY subject DESC, course_number DESC, course_letter DESC ' + . ') AS sub_table LIMIT 1 '; + $record = $db->fetchOne($sql); + $record = CourseGenerations::getInstance()->find($record); + return $record; + } + + public function fetchNew() + { + $newHomeCrosslist = CourseCrosslistings::getInstance()->fetchNew(); + $newHomeCrosslist->type = 'home listing'; + + $newCredit = CourseCredits::getInstance()->fetchNew(); + $newCredit->type = 1; + $newCredit->hours = 3; + + $newActivity = CourseActivities::getInstance()->fetchNew(); + $newActivity->type = 'lec'; + $newActivity->hours = 3; + + $newRecord = parent::fetchNew(); + $newRecord->termsOffered = array('Fall', 'Spring', 'Summer'); + $newRecord->gradingType = 'unrestricted'; + $newRecord->activities[] = $newActivity; + $newRecord->credits[] = $newCredit; + $newRecord->deliveryMethods = array('Classroom'); + $newRecord->campuses = array('UNL'); + + //print_r($newRecord->credits); + return $newRecord; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/CourseGradTieIns.php b/application/models/tables/CourseGradTieIns.php new file mode 100644 index 0000000000000000000000000000000000000000..cda84a48e3598e7ddacf1a45d5377c218d01806e --- /dev/null +++ b/application/models/tables/CourseGradTieIns.php @@ -0,0 +1,22 @@ +<?php + +class CourseGradTieIns extends Local_Db_CourseTableOne +{ + protected static $_instance; + protected $_rowClass = 'CourseGradTieIn'; + + /** + * Return the singleton instance of this class + * + * @param array $config + * @return CourseGradTieIns + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new CourseGradTieIns($config); + } + return self::$_instance; + } + +} \ No newline at end of file diff --git a/application/models/tables/CoursePrerequisites.php b/application/models/tables/CoursePrerequisites.php new file mode 100644 index 0000000000000000000000000000000000000000..88b445f2889a2ae11d1101952dd4aed891fa4069 --- /dev/null +++ b/application/models/tables/CoursePrerequisites.php @@ -0,0 +1,33 @@ +<?php + +class CoursePrerequisites extends Local_Db_CourseTableMany +{ + protected static $_instance; + protected $_rowClass = 'CoursePrerequisite'; + + /** + * Return the singleton instance of this class + * + * @param array $config + * @return CoursePrerequisites + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new CoursePrerequisites($config); + } + return self::$_instance; + } + + static public function createWithParentCourse(CourseGeneration $course) + { + $me = self::getInstance(); + $config = array('db' => $me->_db, + 'table' => $me, + 'data' => array('parent_course' => $course->id)); + $newRecord = new CourseCredit($config); + return $newRecord; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/Courses.php b/application/models/tables/Courses.php new file mode 100644 index 0000000000000000000000000000000000000000..023d9ee47aedd82a08eee41840b20b7e4e90d742 --- /dev/null +++ b/application/models/tables/Courses.php @@ -0,0 +1,24 @@ +<?php + +class Courses extends Nmc_Db_Table +{ + protected static $_instance; + protected $_rowClass = 'Course'; + + /** + * Enter description here... + * + * @param unknown_type $config + * @return Courses + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new Courses($config); + } + return self::$_instance; + } + +} + +?> \ No newline at end of file diff --git a/application/models/tables/Departments.php b/application/models/tables/Departments.php new file mode 100644 index 0000000000000000000000000000000000000000..0f7a62450462ef991237c5eb99aa44bd3fd2766b --- /dev/null +++ b/application/models/tables/Departments.php @@ -0,0 +1,35 @@ +<?php + +class Departments extends Nmc_Db_Table +{ + + //protected $_rowClass = 'Department'; + + /** + * The one true instance + * + * @var Departments + */ + protected static $_instance = null; + + /** + * Returns the one true instance + * + * @return Departments + */ + public static function getInstance($config = array()) + { + if(!self::$_instance) { + self::$_instance = new Departments($config); + } + return self::$_instance; + } + + public function fetchByName($departmentName) + { + $where = $this->_db->quoteInto('name = ?', $departmentName); + $row = $this->fetchRow($where); + return $row; + } + +} \ No newline at end of file diff --git a/application/models/tables/Files.php b/application/models/tables/Files.php new file mode 100644 index 0000000000000000000000000000000000000000..ef97892544640bb1214cad3928d6252845276a89 --- /dev/null +++ b/application/models/tables/Files.php @@ -0,0 +1,23 @@ +<?php + +class Files extends Nmc_Db_Table +{ + static protected $_instance; + //protected $_rowClass = 'File'; + + /** + * Returns the one true instance + * + * @param array [optional] $config + * @return Files + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new Files($config); + } + return self::$_instance; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/GroupImpliedMemberships.php b/application/models/tables/GroupImpliedMemberships.php new file mode 100644 index 0000000000000000000000000000000000000000..50f2db9b77cbe19f25d6d1178d14470314bb5f88 --- /dev/null +++ b/application/models/tables/GroupImpliedMemberships.php @@ -0,0 +1,143 @@ +<?php + +class GroupImpliedMemberships extends Nmc_Db_Table +{ + protected $_rowClass = 'GroupImpliedMembership'; + protected static $_instance = null; + + /** + * Return the one true instance + * + * @param array[optional] $config + * @return GroupImpliedMemberships + */ + public static function getInstance($config = array()) + { + if(!self::$_instance) { + self::$_instance = new GroupImpliedMemberships($config); + } + return self::$_instance; + } + + public function fetchNew() + { + throw new Zend_Db_Exception('Cannot manually edit implied memberships!'); + } + + /** + * Returns a rowset of all of the Groups the User belongs to + * + * @param Person $user + * @param bool[optional] $implied + * @param bool[optional] $explicit + * @return Nmc_Db_Table_Rowset + */ + public function fetchGroupsByUser(Person $user, $implied = true, $explicit = true) + { + $primaryGroup = Groups::getInstance()->find($user->primaryGroup); + return $this->fetchGroupsByChildGroup($primaryGroup, $implied, $explicit); + } + + /** + * Return a rowset of groups that the specified group is a member of + * + * @param Group $group + * @param bool[optional] $implied + * @param bool[optional] $explicit + * @return Nmc_Db_Table_Rowset + */ + public function fetchGroupsByChildGroup(Group $group, $implied = true, $explicit = true) + { + $db = $this->_db; + $where = array(); + $where[] = $db->quoteInto('child_group = ?', $group->id); + if(!$implied && $explicit) { + $where[] = "explicit = 'yes'"; + } else if($implied && !$explicit) { + $where[] = "explicit = 'no'"; + } else if(!$implied && !$explicit) { + $where[] = 'false'; + } + + $where = implode(' AND ', $where); + $groupIdSet = $this->fetchAll($where); + + $groupIds = array(); + foreach($groupIdSet as $row) { + $groupIds[] = $row->parentGroup; + } + + $groupIds[] = -1; + $where = $db->quoteInto('id IN(?)', $groupIds); + $groups = Groups::getInstance()->fetchAllWithoutPrimaries($where); + return $groups; + } + + /** + * Return a rowset of groups that belong to the specified group. + * + * @param Group $group + * @param bool[optional] $implied + * @param bool[optional] $explicit + * @return Nmc_Db_Table_Rowset + */ + public function fetchGroupsByParentGroup(Group $group, $implied = true, $explicit = true) + { + $db = $this->_db; + $where = array(); + $where[] = $db->quoteInto('parent_group = ?', $group->id); + if(!$implied && $explicit) { + $where[] = "explicit = 'yes'"; + } else if($implied && !$explicit) { + $where[] = "explicit = 'no'"; + } else if(!$implied && !$explicit) { + $where[] = 'false'; + } + + $where = implode(' AND ', $where); + $groupIdSet = $this->fetchAll($where); + + $groupIds = array(); + foreach($groupIdSet as $row) { + $groupIds[] = $row->childGroup; + } + + $groupIds[] = -1; + $where = $db->quoteInto('id IN(?)', $groupIds); + $groups = Groups::getInstance()->fetchAllWithoutPrimaries($where); + return $groups; + } + + /** + * Return a rowset of users that belong to the specified group. + * + * @param Group $group + * @param bool[optional] $implied + * @param bool[optional] $explicit + * @return Nmc_Db_Table_Rowset + */ + public function fetchUsersByParentGroup(Group $group, $implied = true, $explicit = true) + { + $select = $this->_db->select(); + $select->from('creq_people', 'id'); + $select->join($this->_name, + 'creq_people.primary_group = ' . $this->_name . '.child_group'); + $select->where($this->_db->quoteInto('parent_group = ?', $group->id)); + if(!$implied && $explicit) { + $select->where("explicit = 'yes'"); + } else if($implied && !$explicit) { + $select->where("explicit = 'no'"); + } else if(!$implied && !$explicit) { + $select->where('false'); + } + $select->distinct(); + $userIds = $this->_db->fetchCol($select); + + $userIds[] = -1; + $where = $this->_db->quoteInto('id IN(?)', $userIds); + $users = People::getInstance()->fetchAll($where); + return $users; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/GroupMemberships.php b/application/models/tables/GroupMemberships.php new file mode 100644 index 0000000000000000000000000000000000000000..6c0f809ca8491382e3cb6785b9f01c99ada3604e --- /dev/null +++ b/application/models/tables/GroupMemberships.php @@ -0,0 +1,22 @@ +<?php + +class GroupMemberships extends Nmc_Db_Table +{ + protected static $_instance = null; + + /** + * Return the one true instance + * + * @param array[optional] $config + * @return GroupMemberships + */ + public static function getInstance($config = array()) + { + if(!self::$_instance) { + self::$_instance = new GroupMemberships($config); + } + return self::$_instance; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/Groups.php b/application/models/tables/Groups.php new file mode 100644 index 0000000000000000000000000000000000000000..1f8a954fbe63fa2cc452d754608c3cd3e947641d --- /dev/null +++ b/application/models/tables/Groups.php @@ -0,0 +1,60 @@ +<?php + +class Groups extends Nmc_Db_Table +{ + protected $_rowClass = 'Group'; + /** + * The one true instance + * + * @var Groups + */ + protected static $_instance = null; + + /** + * Returns the one true instance + * + * @param array[optional] $config + * @return Groups + */ + public static function getInstance($config = array()) + { + if(!self::$_instance) { + self::$_instance = new Groups($config); + } + return self::$_instance; + } + + /** + * Fetches the group with the given name + * + * @param string $groupName + * @return Group + */ + public function fetchByName($groupName) + { + $where = $this->_db->quoteInto('name = ?', $groupName); + $row = $this->fetchRow($where); + return $row; + } + + public function fetchAllWithoutPrimaries($where = null, $order = null, $count = null, $offset = null) + { + $db = $this->_db; + $select = $db->select(); + $userTableInfo = People::getInstance()->info(); + $userTableName = $userTableInfo['name']; + $select->from($userTableName, 'primary_group'); + $select->distinct(); + $primaryGroupIds = $db->fetchCol($select); + + $extra_where = $db->quoteInto($this->_name . '.id NOT IN(?)', $primaryGroupIds); + if($where) { + $where .= ' AND '; + } + $where .= $extra_where; + + return $this->fetchAll($where, $order, $count, $offset); + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/People.php b/application/models/tables/People.php new file mode 100644 index 0000000000000000000000000000000000000000..299bcc104e7856eba025da7e58d835e644f0c27e --- /dev/null +++ b/application/models/tables/People.php @@ -0,0 +1,37 @@ +<?php + +class People extends Nmc_Db_Table +{ + static private $_instance; + protected $_rowClass = 'Person'; + + /** + * Return the one true instance + * + * @param array $config + * @return People + */ + static public function getInstance($config = array()) + { + if(!self::$_instance) { + self::$_instance = new People($config); + } + return self::$_instance; + } + + /** + * Returns the record for the person with the given user name + * or null if none is found. + * + * @param string $userName + * @return Person + */ + static public function findByUserName($userName) + { + $me = self::getInstance(); + $where = $me->_getDefaultAdapter()->quoteInto('user_name=?', $userName); + return $me->fetchRow($where); + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/RequestFiles.php b/application/models/tables/RequestFiles.php new file mode 100644 index 0000000000000000000000000000000000000000..352d7bb99b49d61322e0cce7c03b0e7fa8dbc489 --- /dev/null +++ b/application/models/tables/RequestFiles.php @@ -0,0 +1,23 @@ +<?php + +class RequestFiles extends Nmc_Db_Table +{ + static protected $_instance; + protected $_rowClass = 'RequestFile'; + + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new RequestFiles($config); + } + return self::$_instance; + } + + public function getByRequest(Request $request) + { + $where = $this->getAdapter()->quoteInto('request = ?', $request->id); + return $this->fetchAll($where); + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/RequestStacks.php b/application/models/tables/RequestStacks.php new file mode 100644 index 0000000000000000000000000000000000000000..ec46684799935d3a44ea16f6f79886cafa63aa0b --- /dev/null +++ b/application/models/tables/RequestStacks.php @@ -0,0 +1,5 @@ +<?php + +class RequestStacks extends Nmc_Db_Table {} + +?> \ No newline at end of file diff --git a/application/models/tables/RequestTypes.php b/application/models/tables/RequestTypes.php new file mode 100644 index 0000000000000000000000000000000000000000..b277de2445bb474fff6f3d52955f8f5b2ae5a53d --- /dev/null +++ b/application/models/tables/RequestTypes.php @@ -0,0 +1,38 @@ +<?php + +class RequestTypes extends Nmc_Db_Table +{ + private static $_instance; + private $_map; + + public function __construct($config = null) + { + parent::__construct($config); + $contents = $this->fetchAll(); + foreach($contents as $row) { + $this->_map[$row->name] = $row->id; + } + } + + /** + * Get the single instance of this class + * + * @param array $config + * @return RequestTypes + */ + static public function getInstance($config = null) + { + if(!self::$_instance) { + self::$_instance = new RequestTypes($config); + } + + return self::$_instance; + } + + public function stringToType($string) + { + return $this->_map[$string]; + } +} + +?> \ No newline at end of file diff --git a/application/models/tables/Requests.php b/application/models/tables/Requests.php new file mode 100644 index 0000000000000000000000000000000000000000..460a46a9b030feeb7ad47ef3ee42f7095ec38f5f --- /dev/null +++ b/application/models/tables/Requests.php @@ -0,0 +1,30 @@ +<?php + +class Requests extends Nmc_Db_Table { + + protected static $_instance; + protected $_rowClass = 'Request'; + + /** + * Return the one instance to rule them all + * + * @return Requests + */ + static public function getInstance() + { + if(!self::$_instance) { + self::$_instance = new Requests(); + } + return self::$_instance; + } + + public function getRequestsForUser(Person $user) + { + $where = $this->_db->quoteInto('owner = ?', $user->id); + $requests = $this->fetchAll($where); + return $requests; + } + +} + +?> \ No newline at end of file diff --git a/application/views/403.xhtml b/application/views/403.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..77f1d261c3aa4cc9dc4baac0010847a4b9359f86 --- /dev/null +++ b/application/views/403.xhtml @@ -0,0 +1 @@ +<p>Unfortunately, you do not have access to this area.</p> diff --git a/application/views/404.xhtml b/application/views/404.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..7e92366c67d69dd171da7e35bdf348aed6bfca7d --- /dev/null +++ b/application/views/404.xhtml @@ -0,0 +1 @@ +<p>Unfortunately, the page you requested could not be found.</p> diff --git a/application/views/addAddress.xhtml b/application/views/addAddress.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..29803a64dd8a464ad8e3210e4cbc3b36dc9de72c --- /dev/null +++ b/application/views/addAddress.xhtml @@ -0,0 +1,14 @@ +<form action="/testform/save" method="post"> + <input type="hidden" name="id" value="-1" /> + First Name:<br /> + <input type="text" name="firstName" /><br /> + Last Name:<br /> + <input type="text" name="lastName" /><br /> + Phone:<br /> + <input type="text" name="phone" /><br /> + Address:<br /> + <input type="text" name="address" /><br /> + Zip Code:<br /> + <input type="text" name="zip" /><br /> + <input type="submit" value="Add" /> +</form> \ No newline at end of file diff --git a/application/views/approval_body_admin.xhtml b/application/views/approval_body_admin.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..b6b28baf8291382442f0e59d42e17e7e91c17de6 --- /dev/null +++ b/application/views/approval_body_admin.xhtml @@ -0,0 +1,65 @@ +<div id="admin_list"> + <h2>Approval Bodies</h2> + <ul> + <?php foreach($this->approvalBodies as $approvalBody) { ?> + <li> + <a href="/ApprovalBodyAdmin/EditBody/<?php echo $approvalBody->id; ?>"> + <?php echo $approvalBody->name; ?> + </a> + <ul> + <li> + <a href="/ApprovalBodyAdmin/AddRole/<?php echo $approvalBody->id; ?>"> + --Add New Role-- + </a> + </li> + <?php foreach($approvalBody->roles as $role) { ?> + <li> + <a href="/ApprovalbodyAdmin/EditRole/<?php echo $role->id; ?>"> + <?php echo $role->name; ?> + </a> + </li> + <?php } ?> + </ul> + </li> + <?php } ?> + </ul> +</div> + +<?php if($this->approvalBody) { ?> +<div id="edit_user" class="edit_pane"> + <h2>Editing Approval Body: <?php echo $this->approvalBody->name; ?></h2> + <form action="/ApprovalBodyAdmin/EditBodyPost/<?php echo $this->approvalBody->id; ?>" method="post"> + <label for="name">Name:</label> + <?php echo $this->formText('name', + $this->approvalBody->name, + array('size' => 32)); ?> + <label for="description">Description:</label> + <?php echo $this->formText('description', + $this->approvalBody->description, + array('size' => 32)); ?> + <?php echo $this->formSubmit('Submit', 'Submit'); ?> + </form> +</div> +<?php } ?> + +<?php if($this->approvalBodyRole) { ?> +<div id="edit_user" class="edit_pane"> + <h2>Editing Approval Body Role: <?php echo $this->approvalBodyRole->name; ?></h2> + <?php if($this->approvalBodyRole->id) { ?> + <form action="/ApprovalBodyAdmin/EditRolePost/<?php echo $this->approvalBodyRole->id; ?>" method="post"> + <?php } else { ?> + <form action="/ApprovalBodyAdmin/EditRolePost/-<?php echo $this->approvalBodyRole->approvalBody; ?>" method="post"> + <?php } ?> + <label for="name">Name:</label> + <?php echo $this->formText('name', + $this->approvalBodyRole->name, + array('size' => 32)); ?> + <label for="group">User/Group:</label> + <?php echo $this->formSelect('group', + $this->approvalBodyRole->group, + null, + $this->groups->columnToArray('name', 'id')); ?> + <?php echo $this->formSubmit('Submit', 'Submit'); ?> + </form> +</div> +<?php } ?> \ No newline at end of file diff --git a/application/views/conflict.xhtml b/application/views/conflict.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..a8cbd43c55989e4c5c5e3a677c65184a6283cda1 --- /dev/null +++ b/application/views/conflict.xhtml @@ -0,0 +1,174 @@ +<h2 id="conflicted_course_code"> + Resolving Conflict With: + <?php echo $this->conflictedCourseCode->subject . ' ' + . $this->conflictedCourseCode->courseNumber + . $this->conflictedCourseCode->courseLetter; ?> +</h2> + +<a id="skip_link" href="/Conflict/Skip">Skip this Record</a> + +<ul id="selections"> + <?php foreach($this->dups as $dup) { ?> + <li id="<?php echo $dup->id; ?>"> + <?php __bulletinPreview($dup); ?> + <div class="choices"> + <a class="delete" href="/conflict/remove/<?php echo $dup->id; ?>">Delete</a> + <a class="edit" href="/CourseAdmin/index/<?php echo $dup->id; ?>">Edit</a> + </div> + </li> + <?php } ?> +</ul> + +<a id="delete_both_link" href="/Conflict/Remove/<?php echo implode('/', $this->allIds); ?>">Remove All</a> + +<?php function __bulletinPreview($course) { ?> + +<div class="bulletinEntry"> + +<div> + <b> + <?php + echo $course->subject . ' '; + + // course number with same-subject crosslistings + if(in_array('Classroom', $course->deliveryMethods)) { + echo $course->courseNumber . $course->courseLetter; + foreach($course->crosslistings as $crosslisting) { + if($crosslisting->type == 'home listing') { + continue; + } + if($crosslisting->subject == $course->subject) { + echo '/' . $crosslisting->courseNumber . $crosslisting->courseLetter; + } + } + } + + // course number with 'x' for correspondence courses + if(in_array('Correspondence', $course->deliveryMethods)) { + echo ' [' . $course->courseNumber . $course->courseLetter . 'x'; + foreach($course->crosslistings as $crosslisting) { + if($crosslisting->subject == $course->subject) { + echo '/' . $crosslisting->courseNumber . $crosslisting->courseLetter . 'x'; + } + } + echo ']'; + } + + ?>. + <?php echo $course->title; //title ?> + </b> + <?php + $shortCrosslisting = array(); + foreach($course->crosslistings as $crosslisting) { + if($crosslisting->type == 'home listing') { + continue; + } + if($crosslisting->subject != $course->subject) { + $shortCrosslisting[$crosslisting->subject][] = $crosslisting->courseNumber + . $crosslisting->courseLetter; + } + } + + // crosslistings in parenthesis + if(count($shortCrosslisting) > 0) { + echo '('; + $subjectListings = array(); + foreach($shortCrosslisting as $subject => $number) { + $subjectListings[] = $subject . ' ' . implode('/', $number); + } + echo implode(', ', $subjectListings); + echo ')'; + } + ?> + + <?php + // credits + $singleCredits = array(); + $minRange = ''; + $maxRange = ''; + $maxSemester = ''; + $maxMajor = ''; + foreach($course->credits as $credit) { + if($credit->type == 1) { + $singleCredits[] = $credit->hours; + } else if($credit->type == 2) { + $minRange = $credit->hours; + } else if($credit->type == 3) { + $maxRange = $credit->hours; + } else if($credit->type == 4) { + $maxSemester = $credit->hours; + } else if($credit->type == 5) { + $maxMajor = $credit->hours; + } + } + $creditListings = array(); + if(count($singleCredits) > 0) { + $creditListings[] = implode(' or ', $singleCredits) . ' cr'; + } + if($minRange != '' && $maxRange != '') { + $creditListings[] = $minRange . '-' . $maxRange . ' cr'; + } + if($maxSemester != '') { + $creditListings[] = $maxSemester . ' cr per sem'; + } + if($maxMajor != '') { + $creditListings[] = $maxMajor . ' max'; + } + + if(count($course->termsOffered) > 0 && count($course->termsOffered) < 3) { + $termsOffered = implode(',', $course->termsOffered); + $termsOffered = strtr($termsOffered, array('Fall' => 'I', 'Spring' => 'II', 'Summer' => 'III')); + } + + if(count($creditListings) > 0) { + echo '(' . implode(', ', $creditListings); + if($termsOffered != '') { + echo ' ' . $termsOffered; + } + echo ')'; + } else if($termsOffered != '') { + echo '(' . $termsOffered . ')'; + } + ?> + + <?php + // activities + $activityListing = array(); + foreach($course->activities as $activity) { + $newActivityListing = ucfirst($activity->type); + if($activity->hours != '' && $activity->hours != '0') { + $newActivityListing .= ' ' . $activity->hours; + } + $activityListing[] = $newActivityListing; + } + if(count($activityListing) > 0) { + echo implode(', ', $activityListing) . '.'; + } + + ?> + <?php if($course->prerequisite != '') { ?> + Prereq: <?php echo $course->prerequisite; ?> + <?php } ?> + <em><?php echo $course->notes; ?></em> +</div> + +<?php echo $course->description; ?> + +<?php if($course->gradTieIn->credits != '' || $course->gradTieIn->prerequisites != '' || $course->gradTieIn->notes != '') { ?> +<br /><br /> +<b>Grad Info</b><br /> +<?php if($course->gradTieIn->credits != '') { ?> +Credit: <?php echo $course->gradTieIn->credits; ?><br /> +<?php } ?> + +<?php if($course->gradTieIn->prerequisites != '') { ?> +Prereq: <?php echo $course->gradTieIn->prerequisites; ?><br /> +<?php } ?> + +<?php if($course->gradTieIn->notes != '') { ?> +Notes: <?php echo $course->gradTieIn->notes; ?><br /> +<?php } } ?> + +</div> + +<?php } ?> diff --git a/application/views/editAddress.xhtml b/application/views/editAddress.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..c64f937f6153c72eca777f840105f72ab6901b82 --- /dev/null +++ b/application/views/editAddress.xhtml @@ -0,0 +1,14 @@ +<form action="/testform/save" method="post"> + <input type="hidden" name="id" value="<?php echo $this->record->id; ?>" /> + First Name:<br /> + <input type="text" name="firstName" value="<?php echo $this->record->firstName; ?>" /><br /> + Last Name:<br /> + <input type="text" name="lastName" value="<?php echo $this->record->lastName; ?>" /><br /> + Phone:<br /> + <input type="text" name="phone" value="<?php echo $this->record->phone; ?>" /><br /> + Address:<br /> + <input type="text" name="address" value="<?php echo $this->record->address; ?>" /><br /> + Zip Code:<br /> + <input type="text" name="zip" value="<?php echo $this->record->zip; ?>" /><br /> + <input type="submit" value="Update" /> +</form> \ No newline at end of file diff --git a/application/views/edit_course.xhtml b/application/views/edit_course.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..4fc7d4c1644c40b400d7ff234f364b1550112ee6 --- /dev/null +++ b/application/views/edit_course.xhtml @@ -0,0 +1,461 @@ +<a href="/courseadmin/index<?php echo $this->prevCourseLink; ?>">Previous</a> +<a href="/courseadmin/index<?php echo $this->nextCourseLink; ?>">Next</a> + +<form action="/courseadmin/updatecourse/<?php echo implode('/', $this->uriParams); ?>" method="post"> + +<input type="hidden" name="courseId" value="<?php echo $this->course->id; ?>" /> + +<h2>Main Details</h2> +<fieldset> + <fieldset class="three_column"> + <label> + Title<br /> + <input type="text" id="title" name="title" value="<?php echo htmlentities($this->course->title); ?>" /> + </label> + <label> + Integrated Studies + <input type="hidden" name="integratedStudies" value="no" /> + <input type="checkbox" + name="integratedStudies" + value="yes" + <?php if($this->course->integratedStudies == 'yes') { ?> + checked="checked" + <?php } ?> + /> + </label> + </fieldset> + + <fieldset class="three_column"> + <label> + Subject<br /> + <input type="text" id="subject" name="subject" value="<?php echo htmlentities($this->course->subject); ?>" /> + </label> + <label> + Course Number<br /> + <input type="text" id="courseNumber" name="courseNumber" value="<?php echo htmlentities($this->course->courseNumber); ?>" /> + </label> + <label> + Course Letter + <input type="text" id="courseLetter" name="courseLetter" value="<?php echo htmlentities($this->course->courseLetter); ?>" /> + </label> + </fieldset> +</fieldset> + +<h2>Grading</h2> +<fieldset class="three_column"> + <label> + Unrestricted + <input type="radio" + class="radio" + name="gradingType" + value="unrestricted" + <?php if($this->course->gradingType == 'unrestricted') { ?> + checked="checked" + <?php } ?> + /> + </label> + + <label> + Letter Grade Only + <input type="radio" + class="radio" + name="gradingType" + value="letter grade only" + <?php if($this->course->gradingType == 'letter grade only') { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Pass / No Pass Only + <input type="radio" + class="radio" + name="gradingType" + value="pass/no pass only" + <?php if($this->course->gradingType == 'pass/no pass only') { ?> + checked="checked" + <?php } ?> + /> + </label> +</fieldset> + +<h2>Prerequisite</h2> +<fieldset> + <textarea id="prerequisite" name="prerequisite"><?php echo htmlentities($this->course->prerequisite); ?></textarea> +</fieldset> +<h2>Notes</h2> +<fieldset> + <textarea id="notes" name="notes"><?php echo htmlentities($this->course->notes); ?></textarea> +</fieldset> +<h2>Description</h2> +<fieldset> + <textarea id="description" name="description"><?php echo htmlentities($this->course->description); ?></textarea> +</fieldset> + +<h2>Credit (leave blank if not defined)</h2> +<fieldset id="credits"> + <div> + <label> + Single Values + </label> + <input type="text" + name="credits[1]" + id="creditsSingleValues" + value="<?php echo $this->creditsSingleValues; ?>" /> + </div> + <div> + <label>Range</label> + <input type="text" + name="credits[2]" + value="<?php echo $this->creditsRangeMin; ?>" /> - + <input type="text" + name="credits[3]" + value="<?php echo $this->creditsRangeMax; ?>" /> + </div> + <div> + <label> + Max per Semester + </label> + <input type="text" + name="credits[4]" + value="<?php echo $this->creditsMaxPerSemester; ?>" /> + </div> + <div> + <label> + Max per Degree + </label> + <input type="text" + name="credits[5]" + value="<?php echo $this->creditsMaxPerDegree; ?>" /> + </div> +</fieldset> + +<h2>Activity</h2> +<fieldset class="two_of_three_column"> + <table> + <tr> + <th>Type</th> + <th>Hours per week</th> + <th>Remove</th> + </tr> + <?php foreach($this->course->activities as $key => $activity) { ?> + <tr> + <td> + <select name="activities[<?php echo $key; ?>][type]"> + <option value="-1">--Select One--</option> + <option value="lec" + <?php if($activity->type == 'lec') { ?>selected="selected"<?php } ?> + >Lecture</option> + <option value="lab" + <?php if($activity->type == 'lab') { ?>selected="selected"<?php } ?> + >Lab</option> + <option value="quz" + <?php if($activity->type == 'quz') { ?>selected="selected"<?php } ?> + >Quiz</option> + <option value="rct" + <?php if($activity->type == 'rct') { ?>selected="selected"<?php } ?> + >Recitation</option> + <option value="stu" + <?php if($activity->type == 'stu') { ?>selected="selected"<?php } ?> + >Studio</option> + <option value="fld" + <?php if($activity->type == 'fld') { ?>selected="selected"<?php } ?> + >Field</option> + <option value="ind" + <?php if($activity->type == 'ind') { ?>selected="selected"<?php } ?> + >Independent Study</option> + <option value="psi" + <?php if($activity->type == 'psi') { ?>selected="selected"<?php } ?> + >P.S.I.</option> + </select> + </td> + <td> <input type="text" + name="activities[<?php echo $key; ?>][hours]" + value="<?php echo $activity->hours; ?>" /> </td> + <td> <input type="checkbox" + name="activities[<?php echo $key; ?>][delete]" + value="yes" /> </td> + </tr> + <?php } ?> + <tr class="hidden_new_record"> + <td> + <select disabled="disabled" name="activities[__key__][type]"> + <option value="-1">--Select One--</option> + <option value="lec">Lecture</option> + <option value="lab">Lab</option> + <option value="quz">Quiz</option> + <option value="rct">Recitation</option> + <option value="stu">Studio</option> + <option value="fld">Field</option> + <option value="ind">Independent Study</option> + <option value="psi">P.S.I.</option> + </select> + </td> + <td> <input disabled="disabled" type="text" name="activities[__key__][hours]" /> </td> + <td> <a href="#" class="remove_record_button">-</a> </td> + </tr> + <tr> + <td colspan="3"> + <a href="#" class="add_record_button">Add Activity</a> + </td> + </tr> + </table> +</fieldset> + +<h2>Campus(es)</h2> +<fieldset class="three_column"> + <label> + UNL + <input type="checkbox" + name="campuses[]" + value="UNL" + <?php if(in_array('UNL', $this->course->campuses)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + UNO + <input type="checkbox" + name="campuses[]" + value="UNO" + <?php if(in_array('UNO', $this->course->campuses)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + UNMC + <input type="checkbox" + name="campuses[]" + value="UNMC" + <?php if(in_array('UNMC', $this->course->campuses)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + UNK + <input type="checkbox" + name="campuses[]" + value="UNK" + <?php if(in_array('UNK', $this->course->campuses)) { ?> + checked="checked" + <?php } ?> + /> + </label> +</fieldset> + +<h2>Crosslistings</h2> +<fieldset class="three_column"> + <table> + <tr> + <th>Subject</th> + <th>Course Number</th> + <th>Course Letter</th> + <th>Remove</th> + </tr> + <?php $hasTieIn = false; + foreach($this->course->crosslistings as $key => $crosslist) { + if($crosslist->type == 'grad tie-in') { $hasTieIn = true; } + if($crosslist->type != 'home listing') { ?> + <tr <?php if($crosslist->type == 'grad tie-in') { ?>class="grad_tie_in_row"<?php } ?>> + <td> <input type="text" + name="crosslistings[<?php echo $key; ?>][subject]" + value="<?php echo $crosslist->subject; ?>" + <?php if($crosslist->type == 'grad tie-in') { ?>readonly=""<?php } ?>/> </td> + <td> <input type="text" + name="crosslistings[<?php echo $key; ?>][courseNumber]" + value="<?php echo $crosslist->courseNumber; ?>" + <?php if($crosslist->type == 'grad tie-in') { ?>readonly=""<?php } ?> /> </td> + <td> <input type="text" + name="crosslistings[<?php echo $key; ?>][courseLetter]" + value="<?php echo $crosslist->courseLetter; ?>" + <?php if($crosslist->type == 'grad tie-in') { ?>readonly=""<?php } ?> /> </td> + <td class="hidden"> + <input type="hidden" + name="crosslistings[<?php echo $key; ?>][type]" + value="<?php echo $crosslist->type; ?>" /> + </td> + <td> <input type="checkbox" + name="crosslistings[<?php echo $key; ?>][delete]" + value="yes" /> </td> + </tr> + <?php } } ?> + <tr class="hidden_new_record"> + <td> <input disabled="disabled" type="text" name="crosslistings[__key__][subject]" /> </td> + <td> <input disabled="disabled" type="text" name="crosslistings[__key__][courseNumber]" /> </td> + <td> <input disabled="disabled" type="text" name="crosslistings[__key__][courseLetter]" /> </td> + <td class="hidden"> <input disabled="disabled" type="hidden" name="crosslistings[__key__][type]" value="crosslisting" /> </td> + <td> <a href="#" class="remove_record_button">-</a> </td> + </tr> + <tr> + <td colspan="4"> + <a href="#" class="add_record_button">Add Crosslisting</a> + <?php if(!$hasTieIn) { ?> + <a href="#" + class="add_record_button" + id="add_tie_in_button_<?php echo $this->course->subject + . '_' . $this->course->courseNumber + . '_' . $this->course->courseLetter; ?>" + > + Add Graduate Tie-In + </a> + <?php } ?> + </td> + </tr> + </table> +</fieldset> + +<h2>Graduate Tie-In</h2> +<fieldset> + <label> + Credits<br /> + <input type="text" name="gradTieIn[credits]" value="<?php echo $this->course->gradTieIn->credits; ?>" /><br /> + </label> + <label> + Prereq<br /> + <textarea name="gradTieIn[prerequisites]"><?php echo $this->course->gradTieIn->prerequisites; ?></textarea><br /> + </label> + <label> + Notes<br /> + <textarea name="gradTieIn[notes]"><?php echo $this->course->gradTieIn->notes; ?></textarea> + </label> +</fieldset> + +<h2>Delivery Method(s)</h2> +<fieldset class="three_column"> + <label> + Classroom + <input type="checkbox" + name="deliveryMethods[]" + value="Classroom" + <?php if(in_array('Classroom', $this->course->deliveryMethods)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Web + <input type="checkbox" + name="deliveryMethods[]" + value="Web" + <?php if(in_array('Web', $this->course->deliveryMethods)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Correspondence + <input type="checkbox" + name="deliveryMethods[]" + value="Correspondence" + <?php if(in_array('Correspondence', $this->course->deliveryMethods)) { ?> + checked="checked" + <?php } ?> + /> + </label> +</fieldset> + +<?php /* +<h2>DF Removals (not implemented)</h2> +<table> + <tr> + <th>Subject</th> + <th>Course Number</th> + <th>Course Letter</th> + <th>Delete</th> + </tr> + <?php foreach($this->course->dfRemovals as $key => $dfRemoval) { ?> + <tr> + <td> + <input type="text" name="crosslistings[<?php echo $dfRemoval->id; ?>][subject]" value="<?php echo $crosslisting->subject; ?>" /> + </td> + <td> + <input type="text" name="crosslistings[<?php echo $dfRemoval->id; ?>][courseNumber]" value="<?php echo $crosslisting->courseNumber; ?>" /> + </td> + <td> + <input type="text" name="crosslistings[<?php echo $dfRemoval->id; ?>][courseLetter]" value="<?php echo $crosslisting->courseLetter; ?>" /> + </td> + <td> + <input type="hidden" name="dfRemovals[<?php echo $dfRemoval->id; ?>][delete]" value="no" /> + <input type="checkbox" name="dfRemovals[<?php echo $dfRemoval->id; ?>][delete]" value="yes" /> + </td> + </tr> + <?php } ?> +</table> +*/ ?> + +<?php /* +<h2>Prerequisites (not implemented)</h2> +<table> + <tr> + <th>Subject</th> + <th>Course Number</th> + <th>Course Letter</th> + <th>Delete</th> + </tr> + <?php foreach($this->course->prerequisites as $key => $prerequisite) { ?> + <tr> + <td> + <input type="text" name="crosslistings[<?php echo $prerequisite->id; ?>][subject]" value="<?php echo $crosslisting->subject; ?>" /> + </td> + <td> + <input type="text" name="crosslistings[<?php echo $prerequisite->id; ?>][courseNumber]" value="<?php echo $crosslisting->courseNumber; ?>" /> + </td> + <td> + <input type="text" name="crosslistings[<?php echo $prerequisite->id; ?>][courseLetter]" value="<?php echo $crosslisting->courseLetter; ?>" /> + </td> + <td> + <input type="hidden" name="prerequisites[<?php echo $prerequisite->id; ?>][delete]" value="no" /> + <input type="checkbox" name="prerequisites[<?php echo $prerequisite->id; ?>][delete]" value="yes" /> + </td> + </tr> + <?php } ?> +</table> */ ?> + +<h2>Terms Offered (Remove terms never taught)</h2> +<fieldset class="three_column"> + <label> + Fall + <input type="checkbox" + name="termsOffered[]" + value="Fall" + <?php if(in_array('Fall', $this->course->termsOffered)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Spring + <input type="checkbox" + name="termsOffered[]" + value="Spring" + <?php if(in_array('Spring', $this->course->termsOffered)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Summer + <input type="checkbox" + name="termsOffered[]" + value="Summer" + <?php if(in_array('Summer', $this->course->termsOffered)) { ?> + checked="checked" + <?php } ?> + /> + </label> +</fieldset> + +<input type="submit" /> + +</form> + +<form id="delete_course" method="post" action="/CourseAdmin/DeleteCourse/<?php echo $this->course->id; ?>"> + <label> + Enable Delete + <input type="checkbox" id="enable_delete" /> + </label> + <input id="submit_delete" type="submit" value="Delete Course" disabled="disabled" /> +</form> \ No newline at end of file diff --git a/application/views/index.xhtml b/application/views/index.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..59dea002683121a3e010481a5bf8185143775e11 --- /dev/null +++ b/application/views/index.xhtml @@ -0,0 +1,48 @@ +<?php + +if(isset($this->location)) +{ + header('Location: ' . $this->location); +} + +if($this->refresh != '') +{ + $this->page = 'refresh'; + header('Refresh: 0; URL=' . $this->refresh); + $this->assign('css_files', array_merge($this->css_files, array('css/refresh.css'))); +} + +if(strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false) { + $browser = 'MSIE'; +} else if(strpos( $_SERVER['HTTP_USER_AGENT'], 'Safari' ) !== false) { + $browser = 'Safari'; +} + +if(!in_array($browser, array('MSIE'))) +{ + header( 'Content-Type: application/xhtml+xml; charset=UTF-8' ); + echo( '<?xml version=\'1.0\' encoding=\'UTF-8\'?>' . "\n" ); +} +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> + <head> + <title><?php echo $this->title; ?></title> +<?php if(is_array($this->js_files)) { foreach($this->js_files as $js_file) { ?> + <script language="javascript" type="text/javascript" src="<?php echo $js_file; ?>"></script> +<?php } } ?> +<?php if(is_array($this->css_files)) { + foreach($this->css_files as $css_file) { ?> + <link rel="stylesheet" type="text/css" href="<?php echo $css_file ?>" /> +<?php } +} +if(is_array($this->alternate_css_files)) { + foreach($this->alternate_css_files as $css_file) { ?> + <link rel='alternate stylesheet' title="Alternate" type='text/css' href='<?php echo $css_file ?>' /> +<?php } +}?> + </head> + <body onload="handleOnLoad();"> + <?php include('index_' . (Nmc_User::getInstance()->isLoggedIn() ? 'private' : 'public') . '.xhtml'); ?> + </body> +</html> diff --git a/application/views/index_private.xhtml b/application/views/index_private.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..208ef0c7617d91de318fd4118c99b214c6cb1756 --- /dev/null +++ b/application/views/index_private.xhtml @@ -0,0 +1,53 @@ +<div id="index_wrapper"> + <div id="index_header" class="clear"> + <h1>Curriculum Action Request</h1> + <ul id="site_menu" class="horizontal_menu"> + <li>My Information</li> + <li>Request Help</li> + <li>Documentation</li> + <li><a href="/auth/logout">Logout</a></li> + </ul> + <div class="box_shadow" id="index_menu_bar"> + <div class="tr"></div> + <div id="menu_bar_wrapper" class="tl"> + <div id="menu_bar"> + <h2>Curriculum Action Request: Resources, Tasks & Links:</h2> + <ul id="task_menu" class="horizontal_menu"> + <li> + Requests + <ul> + <li><a href="/NewRequest/Search">New Request</a></li> + <li><a href="/Home">My Requests</a></li> + <li>Search Archive</li> + </ul> + </li> + <li> + User Role + </li> + <li> + Administrative + <ul> + <li><a href="/CourseAdmin/index/ABCD/123">Edit Courses</a></li> + <li><a href="/Conflict/">Resolve Conflicts</a></li> + </ul> + </li> + <li> + Curriculum Committee Resources + </li> + </ul> + </div> + </div> + <div class="bl"></div> + </div> + </div> + + <div id="index_content" class="clear"> + <?php @include($this->page . '.xhtml'); ?> + </div> + + <div id="index_footer_wrapper" class="clear"> + <div id="index_footer"> + 2006 University of Nebraska-Lincoln | Lincoln, NE 68588 | 402-472-7211 + </div> + </div> +</div> \ No newline at end of file diff --git a/application/views/index_public.xhtml b/application/views/index_public.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..8467969eb96b692345c9005055530385debc860c --- /dev/null +++ b/application/views/index_public.xhtml @@ -0,0 +1,80 @@ +<div id="index_wrapper"> + <div id="index_header" class="clear"> + <h1>Curriculum Action Request</h1> + <ul id="site_menu" class="horizontal_menu"> + <li>My Information</li> + <li>Request Help</li> + <li>Documentation</li> + <li><a href="/">Login</a></li> + </ul> + <div class="box_shadow" id="index_menu_bar"> + <div class="tr"></div> + <div id="menu_bar_wrapper" class="tl"> + <div id="menu_bar"> + <h2>Curriculum Action Request: Resources, Tasks & Links:</h2> + <ul id="task_menu" class="horizontal_menu"> + <li> + Curriculum Committee Resources + <ul> + <li>New Request</li> + <li>My Requests</li> + <li>Search Archive</li> + </ul> + </li> + <li> + Public Search + <ul> + <li>New Request</li> + <li>My Requests</li> + <li>Search Archive</li> + </ul> + </li> + <li> + IS Master + <ul> + <li>New Request</li> + <li>My Requests</li> + <li>Search Archive</li> + </ul> + </li> + <li> + ES Master + <ul> + <li>New Request</li> + <li>My Requests</li> + <li>Search Archive</li> + </ul> + </li> + <li> + Special Fee Master + <ul> + <li>New Request</li> + <li>My Requests</li> + <li>Search Archive</li> + </ul> + </li> + <li> + UCC Monthly Reports + <ul> + <li>New Request</li> + <li>My Requests</li> + <li>Search Archive</li> + </ul> + </li> + </ul> + </div> + </div> + <div class="bl"></div> + </div> + </div> + + <div id="index_content" class="clear"> + <?php @include($this->page . '.xhtml'); ?> + </div> + + <div id="index_footer_wrapper" class="clear"> + <div id="index_footer"> + 2006 University of Nebraska-Lincoln | Lincoln, NE 68588 | 402-472-7211 + </div> + </div> +</div> \ No newline at end of file diff --git a/application/views/listAddress.xhtml b/application/views/listAddress.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..19df2d2c70d76f3aea52537fbcc8674572366b1d --- /dev/null +++ b/application/views/listAddress.xhtml @@ -0,0 +1,19 @@ +<table> + <tr> + <th>First Name</th> + <th>Last Name</th> + <th>Phone #</th> + <th>Address</th> + <th>Zip Code</th> + </tr> + <?php foreach($this->records as $record) { ?> + <tr> + <td><?php echo $record->firstName; ?></td> + <td><?php echo $record->lastName; ?></td> + <td><?php echo $record->phone; ?></td> + <td><?php echo $record->address; ?></td> + <td><?php echo $record->zip; ?></td> + <td><a href="/testform/edit/<?php echo $record->id; ?>">Edit</a></td> + </tr> + <?php } ?> +</table> \ No newline at end of file diff --git a/application/views/login.xhtml b/application/views/login.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..79674b6eaf2870e05ae60815d75bf2357109697c --- /dev/null +++ b/application/views/login.xhtml @@ -0,0 +1,39 @@ +<div id="login_pane" class="titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Login [for registered users]</h2> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <form action="/auth/login" method="post"> + username <input type="text" name="user_name" /><br /> + password <input type="password" name="password" /><br /> + <input type="submit" value="Login" /><br /> + </form> + Use your MyUNL login/password + <a href="http://my.unl.edu/webapps/blackboard/password">Forgot userername or password?</a> + </div> +</div> + +<div id="notes" class="titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Title</h2> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <h1>Gail!</h1> + <br /> + <a href="http://creqdev.unl.edu">creqdev.unl.edu</a> is now running up to date code. + Please use it from now on. + CourseAdmin editting works just as it always has. + </div> +</div> + + + +<?php echo nl2br(Nmc_Registry_Session::getInstance()->loginError); ?> diff --git a/application/views/my_home.xhtml b/application/views/my_home.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..eb13f35de3493edefcd5ad02a937bbdd21db8f29 --- /dev/null +++ b/application/views/my_home.xhtml @@ -0,0 +1,63 @@ +<div id="announcements" class="titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Announcements</h2> + <h3><em>User ID:</em> <?php echo Nmc_User::getInstance()->getUser()->getUserName(); ?></h3> + </div> + <div class="bl"></div> + </div> + <div class="content"> + Welcome to Curriculum Action Request. Items in your activity basket indicate..... + </div> +</div> + +<div id="activity" class="titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Activity</h2> + <h3><em>Curent Roll:</em> Instructor</h3> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <?php if($this->requests->count() == 0) { ?> + <h2>You currently have no requests.</h2> + <?php } else { ?> + <table class="course_list"> + <tr> + <th id="check"> </th> + <th id="course">Course</th> + <th id="college">College</th> + <th id="type">Type</th> + <th id="status">Status</th> + <th id="view_edit">View/Edit</th> + </tr> + <?php + $row = 0; + foreach($this->requests as $request) { + $course = $request->getCourseGeneration(); + ?> + <tr <?php echo (++$row % 2 ? 'class="odd"' : ''); ?>> + <td><input type="checkbox" /></td> + <td><?php echo $request->getCourseGeneration()->subject . ' ' + . $request->getCourseGeneration()->courseNumber; ?></td> + <td>NONC</td> + <td><?php echo $request->type; ?></td> + <td><select><option>Submission</option></select></td> + <td> + <a href="/NewRequest/Load/<?php echo $request->id; ?>"> + View/Edit + </a> + </td> + </tr> + <?php } ?> + </table> + <?php } ?> + </div> +</div> + + + +<?php echo nl2br(Nmc_Registry_Session::getInstance()->loginError); ?> \ No newline at end of file diff --git a/application/views/public_search.xhtml b/application/views/public_search.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..04d538d973ec11677f1f9cdd0efdea8ad6980e1d --- /dev/null +++ b/application/views/public_search.xhtml @@ -0,0 +1,48 @@ +<div id="side_bar" class="titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Title....</h2> + </div> + <div class="bl"></div> + </div> + <div class="content"> + Instructions...<br /> + <br /> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce nisi + nulla, auctor ut, ultricies at, varius vitae, diam. Vestibulum dictum, + mi ac gravida porttitor, mauris justo molestie mauris, in aliquam dolor + tortor vitae metus. Pellentesque urna. Aliquam sagittis tortor vitae mi. + Integer eleifend, purus sit amet pharetra sagittis, lectus neque + molestie pede, non iaculis massa ligula ut erat. Sed risus ligula, porta + eu, nonummy quis, sollicitudin eu, libero. Fusce facilisis sodales + mauris. Curabitur egestas molestie eros. Nam ligula felis, sodales et, + facilisis vitae, ultrices eget, diam. Maecenas tristique elementum pede. + Suspendisse vel lectus. + </div> +</div> + +<div id="main_window" class="titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Search for Course</h2> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <form> + <label>Subject Area</label> + <select> + <option>--Select One--</option> + </select> + <label>Course Number</label> + <input type="text" /> + <input type="submit" value="Submit" /> + </form> + </div> +</div> + + + +<?php echo nl2br(Nmc_Registry_Session::getInstance()->loginError); ?> \ No newline at end of file diff --git a/application/views/request/additional_information.xhtml b/application/views/request/additional_information.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..55598c80e502e476e7b4b5c1cc0b77875fdf0ce1 --- /dev/null +++ b/application/views/request/additional_information.xhtml @@ -0,0 +1,15 @@ +<h2>DF Removal</h2> +<fieldset class="three_column"> + <label> + Subject + <input type="text" name="subject" /> + </label> + <label> + Course Number + <input type="text" name="course_number" /> + </label> + <label> + Course Letter + <input type="text" name="course_letter" /> + </label> +</fieldset> \ No newline at end of file diff --git a/application/views/request/bulletinEntry.xhtml b/application/views/request/bulletinEntry.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..8a8a64f4b59a9aa1f58818ef957ded9aaa75a853 --- /dev/null +++ b/application/views/request/bulletinEntry.xhtml @@ -0,0 +1,135 @@ +<?php function __bulletinPreview($course) { ?> + +<div class="bulletinEntry"> + +<div> + <b> + <?php + // course number with same-subject crosslistings + if(in_array('Classroom', $course->deliveryMethods)) { + echo $course->courseNumber . $course->courseLetter; + foreach($course->crosslistings as $crosslisting) { + if($crosslisting->type == 'home listing') { + continue; + } + if($crosslisting->subject == $course->subject) { + echo '/' . $crosslisting->courseNumber . $crosslisting->courseLetter; + } + } + } + + // course number with 'x' for correspondence courses + if(in_array('Correspondence', $course->deliveryMethods)) { + echo ' [' . $course->courseNumber . $course->courseLetter . 'x'; + foreach($course->crosslistings as $crosslisting) { + if($crosslisting->subject == $course->subject) { + echo '/' . $crosslisting->courseNumber . $crosslisting->courseLetter . 'x'; + } + } + echo ']'; + } + + ?>. + <?php echo $course->title; //title ?> + </b> + <?php + $shortCrosslisting = array(); + foreach($course->crosslistings as $crosslisting) { + if($crosslisting->type == 'home listing') { + continue; + } + if($crosslisting->subject != $course->subject) { + $shortCrosslisting[$crosslisting->subject][] = $crosslisting->courseNumber + . $crosslisting->courseLetter; + } + } + + // crosslistings in parenthesis + if(count($shortCrosslisting) > 0) { + echo '('; + $subjectListings = array(); + foreach($shortCrosslisting as $subject => $number) { + $subjectListings[] = $subject . ' ' . implode('/', $number); + } + echo implode(', ', $subjectListings); + echo ')'; + } + ?> + + <?php + // credits + $singleCredits = array(); + $minRange = ''; + $maxRange = ''; + $maxSemester = ''; + $maxMajor = ''; + foreach($course->credits as $credit) { + if($credit->type == 1) { + $singleCredits[] = $credit->hours; + } else if($credit->type == 2) { + $minRange = $credit->hours; + } else if($credit->type == 3) { + $maxRange = $credit->hours; + } else if($credit->type == 4) { + $maxSemester = $credit->hours; + } else if($credit->type == 5) { + $maxMajor = $credit->hours; + } + } + $creditListings = array(); + if(count($singleCredits) > 0) { + $creditListings[] = implode(' or ', $singleCredits) . ' cr'; + } + if($minRange != '' && $maxRange != '') { + $creditListings[] = $minRange . '-' . $maxRange . ' cr'; + } + if($maxSemester != '') { + $creditListings[] = $maxSemester . ' cr per sem'; + } + if($maxMajor != '') { + $creditListings[] = $maxMajor . ' max'; + } + + if(count($course->termsOffered) > 0 && count($course->termsOffered) < 3) { + $termsOffered = implode(',', $course->termsOffered); + $termsOffered = strtr($termsOffered, array('Fall' => 'I', 'Spring' => 'II', 'Summer' => 'III')); + } + + if(count($creditListings) > 0) { + echo '(' . implode(', ', $creditListings); + if($termsOffered != '') { + echo ' ' . $termsOffered; + } + echo ')'; + } else if($termsOffered != '') { + echo '(' . $termsOffered . ')'; + } + ?> + + <?php + // activities + $activityListing = array(); + foreach($course->activities as $activity) { + $newActivityListing = ucfirst($activity->type); + if($activity->hours != '' && $activity->hours != '0') { + $newActivityListing .= ' ' . $activity->hours; + } + $activityListing[] = $newActivityListing; + } + if(count($activityListing) > 0) { + echo implode(', ', $activityListing) . '.'; + } + + ?> + <?php if($course->prerequisite != '') { ?> + Prereq: <?php echo $course->prerequisite; ?> + <?php } ?> + <em><?php echo $course->notes; ?></em> +</div> + +<?php echo $course->description; ?> + + +</div> + +<?php } __bulletinPreview($course); ?> diff --git a/application/views/request/course_found.xhtml b/application/views/request/course_found.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..3b131906cacee68bfaca6a285c35afaafadc2bbe --- /dev/null +++ b/application/views/request/course_found.xhtml @@ -0,0 +1,55 @@ +<div id="announcements" class="sidebar_titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Course Request Process:</h2> + <h3>Search for course</h3> + <ul> + <li>Course ID</li> + <li>Credit Hours</li> + <li>Time, Locations Taught</li> + <li>Graduate Tie-in</li> + <li>Supportave Material</li> + <li>Additional Course Information</li> + <li>Submit Request</li> + </ul> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <h2> + The Course <?php echo $this->subject , ' ' + , $this->courseNumber + , $this->courseLetter; ?> Already Exists. + You may: + </h2> + <ul> + <li> + <a href="/NewRequest/Create/ChangeCourse/<?php echo $this->subject + . '/' . $this->courseNumber + . '/' . $this->courseLetter; ?>"> + Request a <b>change</b> to this course + </a> + </li> + <li> + <a href="/NewRequest/Create/AddISToCourse/<?php echo $this->subject + . '/' . $this->courseNumber + . '/' . $this->courseLetter; ?>"> + Request <b>Integrated Studies</b> status for this course + </a> + </li> + <li> + <a href="/NewRequest/Create/RemoveCourse/<?php echo $this->subject + . '/' . $this->courseNumber + . '/' . $this->courseLetter; ?>"> + Request that this course be <b>removed</b> + </a> + </li> + <li> + <a href="/NewRequest/Search"> + Return to Search + </a> + </li> + </ul> + </div> +</div> diff --git a/application/views/request/course_id.xhtml b/application/views/request/course_id.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..6694849dddf08c02ab55cfd37730edcd4ef16fcf --- /dev/null +++ b/application/views/request/course_id.xhtml @@ -0,0 +1,25 @@ +<fieldset class="two_column"> + <label> + <h2>Subject</h2> + <input type="text" name="subject" value="<?php echo htmlentities($this->course->subject); ?>" /> + </label> + <label> + <h2>Course Number</h2> + <input type="text" name="courseNumber" value="<?php echo htmlentities($this->course->courseNumber); ?>" /> + </label> + <label> + <h2>Alpha Suffix (opt.)</h2> + <input type="text" name="courseLetter" value="<?php echo htmlentities($this->course->courseLetter); ?>" /> + </label> + <label> + <h2>Title</h2> + <input type="text" name="title" value="<?php echo htmlentities($this->course->title); ?>" /> + </label> +</fieldset> + +<fieldset> + <label> + <h2>Prerequisites (text)</h2> + <textarea name="prerequisite" class="mceEditor"><?php echo $this->course->prerequisite; ?></textarea> + </label> +</fieldset> \ No newline at end of file diff --git a/application/views/request/create_new_course_ask.xhtml b/application/views/request/create_new_course_ask.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..348882878708cca1710460378a0d30a78256bd93 --- /dev/null +++ b/application/views/request/create_new_course_ask.xhtml @@ -0,0 +1,47 @@ +<div id="announcements" class="sidebar_titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Course Request Process:</h2> + <h3>Search for course</h3> + <ul> + <li>Course ID</li> + <li>Credit Hours</li> + <li>Time, Locations Taught</li> + <li>Graduate Tie-in</li> + <li>Supportave Material</li> + <li>Additional Course Information</li> + <li>Submit Request</li> + </ul> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <h2>The course <?php echo $this->subject , ' ' + , $this->courseNumber + , $this->courseLetter; ?> + does not yet exist. + You may:</h2> + <ul> + <li> + <a href="/NewRequest/Create/NewCourse/<?php echo $this->subject + . '/' . $this->courseNumber + . '/' . $this->courseLetter; ?>"> + Request a <b>new course</b> + </a> + </li> + <li> + <a href="/NewRequest/Create/NewCourseWithIS/<?php echo $this->subject + . '/' . $this->courseNumber + . '/' . $this->courseLetter; ?>"> + Request a <b>new course</b> with <b>Integrated Studies</b> status + </a> + </li> + <li> + <a href="/NewRequest/Search"> + Return to Search + </a> + </li> + </ul> + </div> +</div> diff --git a/application/views/request/credit_hours.xhtml b/application/views/request/credit_hours.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..bdb1328ab5139a423317d86373d07ce89d156cad --- /dev/null +++ b/application/views/request/credit_hours.xhtml @@ -0,0 +1,242 @@ +<h2>Crosslistings</h2> +<fieldset class="three_column"> + <table> + <tr> + <th>Subject</th> + <th>Course Number</th> + <th>Course Letter</th> + <th>Remove</th> + </tr> + <?php $hasTieIn = false; + foreach($this->course->crosslistings as $key => $crosslist) { + if($crosslist->type == 'grad tie-in') { $hasTieIn = true; } + if($crosslist->type != 'home listing') { ?> + <tr <?php if($crosslist->type == 'grad tie-in') { ?>class="grad_tie_in_row"<?php } ?>> + <td> <input type="text" + name="crosslistings[<?php echo $key; ?>][subject]" + value="<?php echo $crosslist->subject; ?>" + <?php if($crosslist->type == 'grad tie-in') { ?>readonly=""<?php } ?>/> </td> + <td> <input type="text" + name="crosslistings[<?php echo $key; ?>][courseNumber]" + value="<?php echo $crosslist->courseNumber; ?>" + <?php if($crosslist->type == 'grad tie-in') { ?>readonly=""<?php } ?> /> </td> + <td> <input type="text" + name="crosslistings[<?php echo $key; ?>][courseLetter]" + value="<?php echo $crosslist->courseLetter; ?>" + <?php if($crosslist->type == 'grad tie-in') { ?>readonly=""<?php } ?> /> </td> + <td class="hidden"> + <input type="hidden" + name="crosslistings[<?php echo $key; ?>][type]" + value="<?php echo $crosslist->type; ?>" /> + </td> + <td> <input type="checkbox" + name="crosslistings[<?php echo $key; ?>][delete]" + value="yes" /> </td> + </tr> + <?php } } ?> + <tr class="hidden_new_record"> + <td> <input disabled="disabled" type="text" name="crosslistings[__key__][subject]" /> </td> + <td> <input disabled="disabled" type="text" name="crosslistings[__key__][courseNumber]" /> </td> + <td> <input disabled="disabled" type="text" name="crosslistings[__key__][courseLetter]" /> </td> + <td class="hidden"> <input disabled="disabled" type="hidden" name="crosslistings[__key__][type]" value="crosslisting" /> </td> + <td> <a href="#" class="remove_record_button">-</a> </td> + </tr> + <tr> + <td colspan="4"> + <a href="#" class="add_record_button">Add Crosslisting</a> + <?php if(!$hasTieIn) { ?> + <a href="#" + class="add_record_button" + id="add_tie_in_button_<?php echo $this->course->subject + . '_' . $this->course->courseNumber + . '_' . $this->course->courseLetter; ?>" + > + Add Graduate Tie-In + </a> + <?php } ?> + </td> + </tr> + </table> +</fieldset> + +<h2>Credit (leave blank if not defined)</h2> +<fieldset id="credits"> + <div> + <label> + Single Values + </label> + <input type="text" + name="credits[1]" + id="creditsSingleValues" + value="<?php echo $this->creditsSingleValues; ?>" /> + </div> + <div> + <label>Range</label> + <input type="text" + name="credits[2]" + value="<?php echo $this->creditsRangeMin; ?>" /> - + <input type="text" + name="credits[3]" + value="<?php echo $this->creditsRangeMax; ?>" /> + </div> + <div> + <label> + Max per Semester + </label> + <input type="text" + name="credits[4]" + value="<?php echo $this->creditsMaxPerSemester; ?>" /> + </div> + <div> + <label> + Max per Degree + </label> + <input type="text" + name="credits[5]" + value="<?php echo $this->creditsMaxPerDegree; ?>" /> + </div> +</fieldset> + +<h2>Terms Offered (Remove terms never taught)</h2> +<fieldset class="three_column"> + <label> + Fall + <input type="checkbox" + name="termsOffered[]" + value="Fall" + <?php if(in_array('Fall', $this->course->termsOffered)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Spring + <input type="checkbox" + name="termsOffered[]" + value="Spring" + <?php if(in_array('Spring', $this->course->termsOffered)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Summer + <input type="checkbox" + name="termsOffered[]" + value="Summer" + <?php if(in_array('Summer', $this->course->termsOffered)) { ?> + checked="checked" + <?php } ?> + /> + </label> +</fieldset> + +<h2>Activity</h2> +<fieldset class="two_of_three_column"> + <table> + <tr> + <th>Type</th> + <th>Hours per week</th> + <th>Remove</th> + </tr> + <?php foreach($this->course->activities as $key => $activity) { ?> + <tr> + <td> + <select name="activities[<?php echo $key; ?>][type]"> + <option value="-1">--Select One--</option> + <option value="lec" + <?php if($activity->type == 'lec') { ?>selected="selected"<?php } ?> + >Lecture</option> + <option value="lab" + <?php if($activity->type == 'lab') { ?>selected="selected"<?php } ?> + >Lab</option> + <option value="quz" + <?php if($activity->type == 'quz') { ?>selected="selected"<?php } ?> + >Quiz</option> + <option value="rct" + <?php if($activity->type == 'rct') { ?>selected="selected"<?php } ?> + >Recitation</option> + <option value="stu" + <?php if($activity->type == 'stu') { ?>selected="selected"<?php } ?> + >Studio</option> + <option value="fld" + <?php if($activity->type == 'fld') { ?>selected="selected"<?php } ?> + >Field</option> + <option value="ind" + <?php if($activity->type == 'ind') { ?>selected="selected"<?php } ?> + >Independent Study</option> + <option value="psi" + <?php if($activity->type == 'psi') { ?>selected="selected"<?php } ?> + >P.S.I.</option> + </select> + </td> + <td> <input type="text" + name="activities[<?php echo $key; ?>][hours]" + value="<?php echo $activity->hours; ?>" /> </td> + <td> <input type="checkbox" + name="activities[<?php echo $key; ?>][delete]" + value="yes" /> </td> + </tr> + <?php } ?> + <tr class="hidden_new_record"> + <td> + <select disabled="disabled" name="activities[__key__][type]"> + <option value="-1">--Select One--</option> + <option value="lec">Lecture</option> + <option value="lab">Lab</option> + <option value="quz">Quiz</option> + <option value="rct">Recitation</option> + <option value="stu">Studio</option> + <option value="fld">Field</option> + <option value="ind">Independent Study</option> + <option value="psi">P.S.I.</option> + </select> + </td> + <td> <input disabled="disabled" type="text" name="activities[__key__][hours]" /> </td> + <td> <a href="#" class="remove_record_button">-</a> </td> + </tr> + <tr> + <td colspan="3"> + <a href="#" class="add_record_button">Add Activity</a> + </td> + </tr> + </table> +</fieldset> + +<h2>Grading</h2> +<fieldset class="three_column"> + <label> + Unrestricted + <input type="radio" + class="radio" + name="gradingType" + value="unrestricted" + <?php if($this->course->gradingType == 'unrestricted') { ?> + checked="checked" + <?php } ?> + /> + </label> + + <label> + Letter Grade Only + <input type="radio" + class="radio" + name="gradingType" + value="letter grade only" + <?php if($this->course->gradingType == 'letter grade only') { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Pass / No Pass Only + <input type="radio" + class="radio" + name="gradingType" + value="pass/no pass only" + <?php if($this->course->gradingType == 'pass/no pass only') { ?> + checked="checked" + <?php } ?> + /> + </label> +</fieldset> diff --git a/application/views/request/edit_wrapper.xhtml b/application/views/request/edit_wrapper.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..305642d360a4c83cc6b0aea7f907ecc5e7657783 --- /dev/null +++ b/application/views/request/edit_wrapper.xhtml @@ -0,0 +1,44 @@ +<div id="announcements" class="sidebar_titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Course Request Process:</h2> + <h3>Search for course</h3> + <ul> + <li class="completed"> + <a href="/NewRequest/courseID">Course ID</a> + </li> + <li> + <a href="/NewRequest/CreditHours">Credit Hours</a> + </li> + <li> + <a href="/NewRequest/TimeLocation">Time, Locations Taught</a> + </li> + <li> + <a href="/NewRequest/GraduateTieIn">Graduate Tie-in</a> + </li> + <li> + <a href="/NewRequest/SupportiveMaterial">Supportive Material</a> + </li> + <li> + <!-- <a href="/NewRequest/AdditionalInformation">Additional Course Information</a> --> + </li> + <li> + <a href="/NewRequest/SubmitRequest">Submit Request</a> + </li> + </ul> + + <div id="bulletin_preview"> + <?php $course = $this->course; include('bulletinEntry.xhtml'); ?> + </div> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <form action="/newrequest/update" method="post" enctype="multipart/form-data"> + <?php @include('' . $this->requestPage . '.xhtml'); ?> + <input id="prev_button" type="submit" name="submit" value="< Prev" /> + <input id="next_button" type="submit" name="submit" value="Next >" /> + </form> + </div> +</div> diff --git a/application/views/request/graduate_tie_in.xhtml b/application/views/request/graduate_tie_in.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..053ac5bc9885e8ebb20f32edbbf9236086efb08f --- /dev/null +++ b/application/views/request/graduate_tie_in.xhtml @@ -0,0 +1,34 @@ +<fieldset> + <label> + <h2>Notes (will appear in italics)</h2> + <textarea name="notes" class="mceEditor"><?php echo $this->course->notes; ?></textarea> + </label> + <label> + <h2>Description</h2> + <textarea name="description" class="mceEditor"><?php echo $this->course->description; ?></textarea> + </label> +</fieldset> + +<?php if($this->hasGradTieIn) { ?> +<fieldset> + <h2>Graduate Tie-in</h2> + <label> + <h3>Credits</h3> + <input type="text" name="gradTieIn[credits]" value ="<?php echo $this->course->gradTieIn->credits; ?>" /> + </label> + <label> + <h3>Notes</h3> + <textarea name="gradTieIn[notes]" class="mceEditor"><?php echo $this->course->gradTieIn->notes; ?></textarea> + </label> +</fieldset> + +<fieldset> + <label> + <h2>Prerequisites (text)</h2> + <textarea name="gradTieIn[prerequisites]" class="mceEditor"><?php echo $this->course->gradTieIn->prerequisites; ?></textarea> + </label> +</fieldset> + +<?php } else { ?> +<h2>No Graduate Tie-In Defined.</h2> +<?php } ?> \ No newline at end of file diff --git a/application/views/request/search.xhtml b/application/views/request/search.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..1e7db33e647781e53e22ec7287c08fef20a67d15 --- /dev/null +++ b/application/views/request/search.xhtml @@ -0,0 +1,27 @@ +<div id="announcements" class="sidebar_titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Course Request Process:</h2> + <h3>Search for course</h3> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <form id="search_form" action="/newrequest/search" method="get"> + <fieldset> + <label>Subject Area</label> + <input type="text" id="subject" name="subject" /> + </fieldset> + <fieldset> + <label>Course Number (UG level only)</label> + <input type="text" id="course_number" name="course_number" /> + </fieldset> + <fieldset> + <label>Alpha Suffix (optional)</label> + <input type="text" id="course_letter" name="course_letter" /> + </fieldset> + <input type="submit" class="submit_button" value="Submit" /> + </form> + </div> +</div> diff --git a/application/views/request/select_course.xhtml b/application/views/request/select_course.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..d347bb5f9662d6c7e231ffa5c42e4d2e47fe52de --- /dev/null +++ b/application/views/request/select_course.xhtml @@ -0,0 +1,90 @@ +<div id="announcements" class="sidebar_titled_box"> + <div class="box_shadow_2"> + <div class="tr"></div> + <div class="tl"> + <h2>Course Request Process:</h2> + <h3>Edit existing course</h3> + <ul> + <li>Course ID</li> + <li>Credit Hours</li> + <li>Time, Locations Taught</li> + <li>Graduate Tie-in</li> + <li>Supportave Material</li> + <li>Additional Course Information</li> + <li>Submit Request</li> + </ul> + </div> + <div class="bl"></div> + </div> + <div class="content"> + <h2>Your search returned the following course(s). To edit or view, select the corresponding check box and click "Submit".</h2> + <form action="/request/new/search" method="get"> + <table class="course_list"> + <tr> + <th id="check"> </th> + <th id="course">Course</th> + <th id="college">College</th> + <th id="type">Type</th> + <th id="status">Status</th> + <th id="view_edit">View/Edit</th> + </tr> + <tr class="odd"> + <td><input type="checkbox" /></td> + <td>AGRO 825</td> + <td>NONC</td> + <td>New Course</td> + <td><select><option>Submission</option></select></td> + <td>View/Edit</td> + </tr> + <tr> + <td><input type="checkbox" /></td> + <td>AGRO 825</td> + <td>NONC</td> + <td>New Course/Is Proposal</td> + <td><select><option>Submission</option></select></td> + <td>View/Edit</td> + </tr> + <tr class="odd"> + <td><input type="checkbox" /></td> + <td>AGRO 825</td> + <td>NONC</td> + <td>IS Proposal</td> + <td><select><option>Submission</option></select></td> + <td>View/Edit</td> + </tr> + <tr> + <td><input type="checkbox" /></td> + <td>AGRO 825</td> + <td>NONC</td> + <td>Change Course</td> + <td><select><option>Submission</option></select></td> + <td>View/Edit</td> + </tr> + <tr class="odd"> + <td><input type="checkbox" /></td> + <td>AGRO 825</td> + <td>NONC</td> + <td>Delete Course</td> + <td><select><option>Submission</option></select></td> + <td>View/Edit</td> + </tr> + <tr> + <td><input type="checkbox" /></td> + <td>AGRO 825</td> + <td>NONC</td> + <td>New Course</td> + <td><select><option>Submission</option></select></td> + <td>View/Edit</td> + </tr> + <tr class="odd"> + <td><input type="checkbox" /></td> + <td>AGRO 825</td> + <td>NONC</td> + <td>Change</td> + <td><select><option>Submission</option></select></td> + <td>View/Edit</td> + </tr> + </table> + </form> + </div> +</div> diff --git a/application/views/request/submit.xhtml b/application/views/request/submit.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..b867e8bafd48ec103831e9ae5a4fdcf952760406 --- /dev/null +++ b/application/views/request/submit.xhtml @@ -0,0 +1,14 @@ +<h2> + You have finished all sections. + Click "submit" below to complete curriculum request. +</h2> + +<h2>or...</h2> + +<h2> + Please return to "credits" and complete required information + to finish your request. +</h2> + +<input id="submit_request" type="submit" name="submit" value="Submit" /> +<input id="save_request" type="submit" name="submit" value="Save for Later Submission" /> \ No newline at end of file diff --git a/application/views/request/supportive_material.xhtml b/application/views/request/supportive_material.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..c4774f0496f145dd9e040cc45bc15f18dd273f86 --- /dev/null +++ b/application/views/request/supportive_material.xhtml @@ -0,0 +1,39 @@ +<fieldset> + <label> + <h2>Justification</h2> + <textarea name="request[justification]" class="mceEditor"><?php echo $this->request->justification; ?></textarea> + </label> +</fieldset> + +<fieldset> + <label> + <h2>Syllabus</h2> + <?php echo $this->request->getFileByType(RequestFile::SYLLABUS_TYPE)->title; ?> + <input type="file" name="request[<?php echo RequestFile::SYLLABUS_TYPE; ?>]" /> + </label> +</fieldset> + +<fieldset> + <label> + <h2>Crosslist Memo</h2> + <?php echo $this->request->getFileByType(RequestFile::CROSSLIST_MEMO_TYPE)->title; ?> + <input type="file" name="request[<?php echo RequestFile::CROSSLIST_MEMO_TYPE; ?>]" /> + </label> +</fieldset> + +<?php if($this->request->type == 5) { ?> +<fieldset> + <label> + <h2>IS Narrative Documentation</h2> + <?php echo $this->request->getFileByType(RequestFile::IS_NARRATIVE_TYPE)->title; ?> + <input type="file" name="request[<?php echo RequestFile::IS_NARRATIVE_TYPE; ?>]" /> + </label> +</fieldset> +<?php } ?> + +<fieldset> + <label> + <h2>Additional Documentation (opt.)</h2> + <input type="file" name="request[additionalDocumentation]" /> + </label> +</fieldset> diff --git a/application/views/request/time_location.xhtml b/application/views/request/time_location.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..851b1bf35be9b152d7ba89b02247b0680c30aa13 --- /dev/null +++ b/application/views/request/time_location.xhtml @@ -0,0 +1,77 @@ +<h2>Delivery Method(s)</h2> +<fieldset class="three_column"> + <label> + Classroom + <input type="checkbox" + name="deliveryMethods[]" + value="Classroom" + <?php if(in_array('Classroom', $this->course->deliveryMethods)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Web + <input type="checkbox" + name="deliveryMethods[]" + value="Web" + <?php if(in_array('Web', $this->course->deliveryMethods)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + Correspondence + <input type="checkbox" + name="deliveryMethods[]" + value="Correspondence" + <?php if(in_array('Correspondence', $this->course->deliveryMethods)) { ?> + checked="checked" + <?php } ?> + /> + </label> +</fieldset> + +<h2>Campus(es)</h2> +<fieldset class="three_column"> + <label> + UNL + <input type="checkbox" + name="campuses[]" + value="UNL" + <?php if(in_array('UNL', $this->course->campuses)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + UNO + <input type="checkbox" + name="campuses[]" + value="UNO" + <?php if(in_array('UNO', $this->course->campuses)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + UNMC + <input type="checkbox" + name="campuses[]" + value="UNMC" + <?php if(in_array('UNMC', $this->course->campuses)) { ?> + checked="checked" + <?php } ?> + /> + </label> + <label> + UNK + <input type="checkbox" + name="campuses[]" + value="UNK" + <?php if(in_array('UNK', $this->course->campuses)) { ?> + checked="checked" + <?php } ?> + /> + </label> +</fieldset> \ No newline at end of file diff --git a/application/views/unl_index.xhtml b/application/views/unl_index.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..a5f7830c4292cf6797a8266fa37a4c297b41789b --- /dev/null +++ b/application/views/unl_index.xhtml @@ -0,0 +1,71 @@ +<?php + +if(isset($this->location)) +{ + header('Location: ' . $this->location); +} + +if($this->refresh != '') +{ + $this->page = 'refresh'; + header('Refresh: 0; URL=' . $this->refresh); + $this->assign('css_files', array_merge($this->css_files, array('css/refresh.css'))); +} + +if(strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false) { + $browser = 'MSIE'; +} else if(strpos( $_SERVER['HTTP_USER_AGENT'], 'Safari' ) !== false) { + $browser = 'Safari'; +} + +if(!in_array($browser, array('MSIE'))) +{ + header( 'Content-Type: application/xhtml+xml; charset=UTF-8' ); + echo( '<?xml version=\'1.0\' encoding=\'UTF-8\'?>' . "\n" ); +} +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> + <head> + <title><?php echo $this->title; ?></title> +<?php if(is_array($this->js_files)) { foreach($this->js_files as $js_file) { ?> + <script language="javascript" type="text/javascript" src="<?php echo $js_file; ?>"></script> +<?php } } ?> +<?php if(is_array($this->css_files)) { + foreach($this->css_files as $css_file) { ?> + <link rel='stylesheet' type='text/css' href='<?php echo $css_file ?>' /> +<?php } +} +if(is_array($this->alternate_css_files)) { + foreach($this->alternate_css_files as $css_file) { ?> + <link rel='alternate stylesheet' title="Alternate" type='text/css' href='<?php echo $css_file ?>' /> +<?php } +}?> + </head> + <body onload="handleOnLoad();"> + <div id="outer_wrapper"> + <div id="index_header"> + <img src='/images/title_red_n.png' alt='red n' /> + <?php echo $this->title; ?> + </div> + <div id="index_content"> + <?php @include $this->page . '.xhtml'; ?> + <div id="index_content_end"></div> + </div> + <div id="index_footer"> + <a href="http://www.unl.edu/" title="The University of Nebraska-Lincoln is an equal opportunity educator and employer with a comprehensive plan for diversity"><img alt="N Icon" src="http://www.unl.edu/unlpub/templatedependents/templategraphics/nicon.gif" /></a> + © 2006 University of Nebraska-Lincoln | Lincoln, NE 68588 | 402-472-7211 | <a href="http://www.unl.edu/unlpub/comments.shtml">comments?</a> + <a id="w3_valid_xhtml" href="http://validator.w3.org/check?uri=referer"> + <img + src="http://www.w3.org/Icons/valid-xhtml10" + alt="Valid XHTML 1.0 Transitional" height="31" width="88" /> + </a> + <a id="w3_valid_css" href="http://jigsaw.w3.org/css-validator/"> + <img style="border:0;width:88px;height:31px" + src="http://jigsaw.w3.org/css-validator/images/vcss" + alt="Valid CSS!" /> + </a> + </div> + </div> + </body> +</html> diff --git a/application/views/user_admin.xhtml b/application/views/user_admin.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..51d5c12c91529fcc3ecbad194a5851125a6aac9e --- /dev/null +++ b/application/views/user_admin.xhtml @@ -0,0 +1,88 @@ +<?php function list_group(Group $group, $depth = 0) { ?> +<h3> + <a href="/UserAdmin/EditGroup/<?php echo $group->id; ?>"> + <?php echo $group->name; ?> + </a> +</h3> +<ul> + <?php foreach($group->getUsers(false) as $user) { ?> + <li> + <a href="/UserAdmin/EditUser/<?php echo $user->id; ?>"> + <?php echo $user->userName; ?> + </a> + </li> + <?php } ?> + + <?php foreach($group->getGroups(false) as $group2) { ?> + <li> + <?php list_group($group2, $depth+1); ?> + </li> + <?php } ?> +</ul> +<?php } ?> + +<div id="admin_list"> + <h2>Groups</h2> + <ul> + <li> + <a href="/UserAdmin/EditGroup/-1"> + <h3>--Create New Group--</h3> + </a> + </li> + <?php foreach($this->groups as $group) { ?> + <li> + <?php if($group->isRootGroup()) {list_group($group);} ?> + </li> + <?php } ?> + </ul> +</div> + +<?php if($this->user) { ?> +<div id="edit_user" class="edit_pane"> + <h2>Editing User: <?php echo $this->user->userName; ?></h2> + <form action="/UserAdmin/EditUser/<?php echo $this->user->id; ?>" method="post"> + <label for="firstName">First Name:</label> + <?php echo $this->formText('firstName', + $this->user->firstName, + array('size' => 32)); ?> + <label for="lastName">Last Name:</label> + <?php echo $this->formText('lastName', + $this->user->lastName, + array('size' => 32)); ?> + <label for="groups">Groups:</label> + <?php echo $this->formSelect('groups', + $this->user->getGroups(false)->columnToArray('id'), + array('multiple' => 'multiple'), + $this->groups->columnToArray('name', 'id')); ?> + <?php echo $this->formSubmit('Submit', 'Submit'); ?> + </form> +</div> +<?php } ?> + +<?php if($this->group) { ?> +<div id="edit_group" class="edit_pane"> + <h2>Editing Group: <?php echo $this->group->name; ?></h2> + <form action="/UserAdmin/EditGroup/<?php echo $this->group->id; ?>" method="post"> + <label for="delete"> + Delete: <?php echo $this->formCheckBox('delete', null, array('id' => 'delete')); ?> + </label> + <label for="name">Name:</label> + <?php echo $this->formText('name', $this->group->name, array('size' => 32)); ?> + <label for="description">Description:</label> + <?php echo $this->formTextArea('description', + $this->group->description, + array('rows' => 5, 'cols' => 50)); ?> + <label for="groups">Groups:</label> + <?php echo $this->formSelect('groups', + $this->group->getGroups(false)->columnToArray('id'), + array('multiple' => 'multiple'), + $this->groups->columnToArray('name', 'id')); ?> + <label for="users">Users:</label> + <?php echo $this->formSelect('users', + $this->group->getUsers(false)->columnToArray('id'), + array('multiple' => 'multiple'), + $this->users->columnToArray('userName', 'id')); ?> + <?php echo $this->formSubmit('Submit', 'Submit'); ?> + </form> +</div> +<?php } ?> \ No newline at end of file diff --git a/application/views/viewAddress.xhtml b/application/views/viewAddress.xhtml new file mode 100644 index 0000000000000000000000000000000000000000..b8f3e0e511d44f11c4ddbb96cde36b442ee1a00b --- /dev/null +++ b/application/views/viewAddress.xhtml @@ -0,0 +1,10 @@ +First Name:<br /> +<?php echo $this->record->firstName; ?><br /> +Last Name:<br /> +<?php echo $this->record->lastName; ?><br /> +Phone:<br /> +<?php echo $this->record->phone; ?><br /> +Address:<br /> +<?php echo $this->record->address; ?><br /> +Zip Code:<br /> +<?php echo $this->record->zip; ?><br /> \ No newline at end of file diff --git a/document_root/.htaccess b/document_root/.htaccess new file mode 100644 index 0000000000000000000000000000000000000000..4170493926cbcbc77f481b44962081233d8d4ed3 --- /dev/null +++ b/document_root/.htaccess @@ -0,0 +1,4 @@ +Options FollowSymLinks +RewriteEngine On +RewriteRule ^tinymce - [L] +RewriteRule !(\.(js|ico|gif|jpg|png|css|oss|swf|mov)|index.php|phpinfo.php)$ index.php diff --git a/document_root/css/approval_body_admin.css b/document_root/css/approval_body_admin.css new file mode 100644 index 0000000000000000000000000000000000000000..22419919f24d2433c48f92e9ad1eca4cdf4702f4 --- /dev/null +++ b/document_root/css/approval_body_admin.css @@ -0,0 +1,2 @@ + +@import url(user_admin.css); diff --git a/document_root/css/common.css b/document_root/css/common.css new file mode 100644 index 0000000000000000000000000000000000000000..a8dcd85959d3ac980f9abcfda95a456e1673e5dd --- /dev/null +++ b/document_root/css/common.css @@ -0,0 +1,273 @@ +/******************************************************************************\ +* general styles that can be used anywhere * +\******************************************************************************/ + +.clear { + clear: both; +}ul.horizontal_menu{display:block;list-style: none; + height: 15px; +} +ul.horizontal_menu li { + display: block; + float: left; + position: relative; + padding-left: 0.5em; + padding-right: 0.5em; + border-left-width: 1px; + border-left-style: solid; +} +ul.horizontal_menu > li:first-child { + border-left-width: 0px; + padding-left: 0px; +} +ul.horizontal_menu li a { + display: block; + color: inherit; + text-decoration: none; +} +ul.horizontal_menu li a:hover { + cursor: pointer; + background-color: #888; +} + + +ul.horizontal_menu ul { + display: none; + position: absolute; + top: 12px; + left: -5px; + + list-style: none; + background-color: #4b4b4b; + white-space: nowrap; + z-index: 100; +} +ul.horizontal_menu li:hover ul { + display: block; +} +ul.horizontal_menu > li:first-child ul { + left: -10px; +} +ul.horizontal_menu ul li { + display: block; + float: none; + padding: 0.5em 1em; + border-width: 0px; + min-width: 10em; +} + + +.box_shadow, +.box_shadow .tr, +.box_shadow .bl, +.box_shadow .tl { + background-image: url(/images/box_shadow.png); + background-color: #fff; +} + +.box_shadow { + background-position: bottom right; + padding-bottom: 10px; + position: relative; +} +.box_shadow .tr { + position: absolute; + top: 0px; + right: 0px; + width: 3px; + height: 0px; + background-position: top right; +} +.box_shadow .bl { + position: absolute; + bottom: 0px; + left: 0px; + width: 3px; + height: 10px; + background-position: bottom left; +} +.box_shadow .tl { + margin-right: 3px; + padding: 0px 0px 0px 3px; + background-position: top left; +} + +.box_shadow_2, +.box_shadow_2 .tr, +.box_shadow_2 .bl, +.box_shadow_2 .tl { + background-image: url(/images/box_shadow_2.png); + background-color: #fff; +} + +.box_shadow_2 { + background-position: bottom right; + padding-bottom: 5px; + position: relative; +} +.box_shadow_2 .tr { + position: absolute; + top: 0px; + right: 0px; + width: 3px; + height: 0px; + background-position: top right; +} +.box_shadow_2 .bl { + position: absolute; + bottom: 0px; + left: 0px; + width: 3px; + height: 5px; + background-position: bottom left; +} +.box_shadow_2 .tl { + margin-right: 3px; + padding: 1px 0px 0px 3px; + background-position: top left; +} + + +.titled_box h2 { + background-color: #e3e3e3; + color: #343434; + font-family: URWGroteskTLig, sans-serif; + font-weight: normal; + font-size: 14px; + padding: 5px; +} +.titled_box h3 { + position: absolute; + right: 10px; + top: 6px; + font-family: URWGroteskTLig, sans-serif; + font-weight: normal; + font-size: 14px; + color: #343434; +} +.titled_box h3 em { + font-size: 14px; +} +.titled_box .content { + position: relative; + top: -5px; + margin-left: 2px; + margin-right: 2px; + padding-top: 5px; + z-index: 1; + padding: 10px; + + border: 1px solid #999999; + border-top-width: 0px; +} + + + + +.sidebar_titled_box div.box_shadow_2 { + position: absolute; + left: 30px; + top: 5px; + width: 200px; +} + +.sidebar_titled_box h2 { + background-color: #e3e3e3; + color: #343434; + font-family: URWGroteskTLig, sans-serif; + font-weight: normal; + font-style: oblique; + font-size: 14px; + padding: 5px; +} +.sidebar_titled_box h3 { + position: absolute; + top: 35px; + left: 30px; + width: 160px; + + text-align: center; + font-family: URWGroteskTLig, sans-serif; + font-size: 12px; + color: #595959; +} +.sidebar_titled_box h3 em { + font-size: 14px; +} +.sidebar_titled_box .content { + position: relative; + margin-left: 242px; + margin-right: 30px; + z-index: 1; + padding: 20px; + + height: 450px; + height: auto !important; + min-height: 450px; + + border: 1px solid #999999; +} +.sidebar_titled_box fieldset { + border: none; + margin-bottom: 10px; +} +.sidebar_titled_box label { + display: block; + color: #343434; + font-size: 16px; +} +.sidebar_titled_box input, +.sidebar_titled_box select +{ + width: 200px; + font-size: 16px; +} +.sidebar_titled_box .submit_button { + position: absolute; + bottom: 5px; + right: 5px; + width: 115px; + font-size: 14px; +} + + +.course_list table { + width: 100%; +} + +.course_list th { + color: #8a8a82; + text-align: left; + font-family: URWGroteskTReg, sans-serif; +} +.course_list th#check { + width: 25px; +} +.course_list th#course { +} +.course_list th#college { + width: 85px; +} +.course_list th#type { + width: 150px; +} +.course_list th#status { + width: 200px; +} +.course_list td select { + width: 100%; +} +.course_list th#view_edit { + width: 80px +} + +.course_list tr.odd { + background-color: #e3e3e3; +} + +.course_list td { + color: #323232; + font-family: URWGroteskTReg, sans-serif; + padding: 1px 3px; + vertical-align: middle; +} diff --git a/document_root/css/common.oss b/document_root/css/common.oss new file mode 100644 index 0000000000000000000000000000000000000000..577f0a03eb7f99d7bb315b3bfdd224babc9d2855 --- /dev/null +++ b/document_root/css/common.oss @@ -0,0 +1,301 @@ +/******************************************************************************\ +* general styles that can be used anywhere * +\******************************************************************************/ + +input[type="text"], +input[type="password"], +textarea, +select { + padding: 1px 2px; + border: 1px solid #999; + background-image: url(/images/text_input_shadow.png); +} + +.clear { + clear: both; +} + +ul.horizontal_menu { + display: block; + list-style: none; + height: 15px; + margin: 0px; + padding: 0px; + + li { + display: block; + float: left; + position: relative; + padding-left: 0.5em; + padding-right: 0.5em; + border-left-width: 1px; + border-left-style: solid; + + a { + display: block; + color: inherit; + text-decoration: none; + } + + a:hover { + cursor: pointer; + background-color: #888; + } + } + + > li:first-child { + border-left-width: 0px; + padding-left: 0px; + + ul { + left: -10px; + } + } + + li:hover ul { + display: block; + } + + ul { + display: none; + position: absolute; + top: 12px; + left: -5px; + + list-style: none; + background-color: #4b4b4b; + white-space: nowrap; + z-index: 100; + + li { + display: block; + float: none; + padding: 0.5em 1em; + border-width: 0px; + min-width: 10em; + } + } +} + + +.box_shadow, +.box_shadow .tr, +.box_shadow .bl, +.box_shadow .tl { + background-image: url(/images/box_shadow.png); + background-color: #fff; +} + +.box_shadow { + background-position: bottom right; + padding-bottom: 10px; + position: relative; + + .tr { + position: absolute; + top: 0px; + right: 0px; + width: 3px; + height: 0px; + background-position: top right; + } + + .bl { + position: absolute; + bottom: 0px; + left: 0px; + width: 3px; + height: 10px; + background-position: bottom left; + } + + .tl { + margin-right: 3px; + padding: 0px 0px 0px 3px; + background-position: top left; + } +} + +.box_shadow_2, +.box_shadow_2 .tr, +.box_shadow_2 .bl, +.box_shadow_2 .tl { + background-image: url(/images/box_shadow_2.png); + background-color: #fff; +} + +.box_shadow_2 @extends .box_shadow { + padding-bottom: 5px; + + .bl { + height: 5px; + } + + .tl { + padding: 1px 0px 0px 3px; + } +} + + +.titled_box { + .tl { + h2 { + background-color: #e3e3e3; + color: #343434; + font-family: URWGroteskTLig, sans-serif; + font-weight: normal; + font-size: 14px; + padding: 5px; + } + + h3 { + position: absolute; + right: 10px; + top: 6px; + font-family: URWGroteskTLig, sans-serif; + font-weight: normal; + font-size: 14px; + color: #343434; + + em { + font-size: 14px; + } + } + } + + .content { + position: relative; + top: -5px; + margin-left: 2px; + margin-right: 2px; + padding-top: 5px; + z-index: 1; + padding: 10px; + + border: 1px solid #999999; + border-top-width: 0px; + } +} + + + +.sidebar_titled_box @extends .titled_box { + div.box_shadow_2 { + position: absolute; + left: 30px; + top: 5px; + width: 200px; + } + + .tl { + h2 { + font-style: oblique; + } + + h3 { + top: 35px; + left: 30px; + width: 160px; + + text-align: center; + font-size: 12px; + color: #595959; + } + + ul { + position: absolute; + top: 60px; + + list-style: none; + text-align: right; + + li { + padding-right: 10px; + background-image: url(/images/incomplete_icon.png); + background-position: center right; + background-repeat: no-repeat; + } + li.completed { + background-image: url(/images/complete_icon.png); + } + } + } + + .content { + top: 0px; + margin-left: 242px; + margin-right: 30px; + padding: 20px; + + height: 450px; + height: auto !important; + min-height: 450px; + + border-top-width: 1px; + + h2 { + background-color: transparent; + font-weight: bold; + font-style: normal; + padding: 0px; + } + } + + .submit_button { + position: absolute; + bottom: 5px; + right: 5px; + width: 115px; + font-size: 14px; + } +} + +.course_list { + table { + width: 100%; + } + + th { + color: #8a8a82; + text-align: left; + font-family: URWGroteskTReg, sans-serif; + } + + th#check { + width: 25px; + } + + th#course { + } + + th#college { + width: 85px; + } + + th#type { + width: 150px; + } + + th#status { + width: 200px; + } + + th#view_edit { + width: 80px + } + + tr.odd { + background-color: #e3e3e3; + } + + td { + color: #323232; + font-family: URWGroteskTReg, sans-serif; + padding: 1px 3px; + vertical-align: middle; + + select { + width: 100%; + } + } +} diff --git a/document_root/css/conflict.css b/document_root/css/conflict.css new file mode 100644 index 0000000000000000000000000000000000000000..a606479e5fc29f8dd042593053538cbe2c10f8c6 --- /dev/null +++ b/document_root/css/conflict.css @@ -0,0 +1,57 @@ +#index_content li { + display: block; + width: 360px; + float: left; + margin: 0px 25px; + padding: 5px; + + border: 4px dashed #000; +} + +h2#conflicted_course_code { + text-align: center; + font-size: 24px; +} + +#skip_link, #delete_both_link { + display: block; + clear: both; + margin: 1em auto; + width: 10em; + padding: 0.5em; + text-align: center; + + text-decoration: none; + font-size: 18px; + font-family: sans-serif; +} +#skip_link { + color: #088; + border: 2px dashed #088; +} +#delete_both_link { + color: #a00; + border: 2px dashed #a00; + position: relative; + top: 1.0em; +} + +.choices { + text-align: center; +} + +#index_content .choices a { + font-size: 24px; + text-decoration: none; + margin: 10px; + color: #aa0; + font-weight: bold; +} + +#index_content .choices a.delete:hover { + color: #c00; +} + +#index_content .choices a.edit:hover { + color: #0a0; +} \ No newline at end of file diff --git a/document_root/css/edit_course.css b/document_root/css/edit_course.css new file mode 100644 index 0000000000000000000000000000000000000000..1eeccecd4fb80f73c73f9e59fae90ebd6a059ff8 --- /dev/null +++ b/document_root/css/edit_course.css @@ -0,0 +1,75 @@ +form { + font-size: 14px; +} +h2 { + font-size: 16px; +} + +fieldset { + border-width: 0px; + margin-bottom: 10px; +} +fieldset fieldset { + margin-bottom: 0px; +} + +fieldset.three_column label { + width: 30%; + display: block; + float: left; +} + +textarea { + width: 750px; + height: 4em; +} + +.hidden_new_record { + display: none; +} + +#credits input { + width: 25px; +} + +#credits div { + height: 2em; +} + +#credits label { + display: block; + width: 150px; + float: left; + clear: both; +} + +input#creditsSingleValues { + width: 100px; +} + +tr.grad_tie_in_row input { + color: #111; + background-color: #eee; +} + +.hidden { + display: none; +} + +#delete_course { + width: 12em; + margin: 1em auto; + padding: 0.5em; + border: 3px solid #000; + background-image: url(../images/warning_background.png); + text-align: center; +} + +#delete_course label { + display: block; + font-weight: bold; +} + +#submit_delete { + margin-top: 0.5em; +} diff --git a/document_root/css/index.css b/document_root/css/index.css new file mode 100644 index 0000000000000000000000000000000000000000..b13db408fae2ac10938ddfe2911d686f884ecf6d --- /dev/null +++ b/document_root/css/index.css @@ -0,0 +1,99 @@ +@import url(/ooss/common); + +* { + margin: 0px; + padding: 0px; + font-size: 12px; + /* font-family: URWGroteskTReg, URWGroteskELig, "Arial Narrow", Arial, Helvetica, sans-serif; */ + /* font-family: Clearface, Georgia, "Minion Web", Palatino, "Times New Roman", Times, serif; */ +} + +body { + color: #000; + background-color: #fff; +} + +/******************************************************************************\ +* styles for index page wrapper * +\******************************************************************************/ + +#index_wrapper { + position: relative; + width: 860px; + margin-top: 45px; + margin-left: auto; + margin-right: auto; + padding-left: 30px; + padding-right: 30px; +} + +#index_header h1 { + display: table-cell; + vertical-align: middle; + height: 37px; + + color: #8a8a82; + font-family: URWGroteskTLig, sans-serif; + font-size: 24px; + font-weight: normal; + background-image: url(/images/unl_logo.png); + background-repeat: no-repeat; + padding-left: 50px; +} + +#site_menu { + display: block; + margin-top: -0.5em; + float: right; +} +#index_menu_bar { + clear: both; +} +#menu_bar_wrapper > #menu_bar { + background-image: url(/images/menu_grad.png); +} +#menu_bar { + color: #fff; + background-color: #000; + padding: 4px 15px; +} +#menu_bar h2 { + font-size: 14px; + font-style: oblique; +} + +#task_menu { + +} + +#index_content { + position: relative; + + height: 500px; + height: auto !important; + min-height: 500px; + padding-top: 5px; + padding-bottom: 5px; +} + +#index_footer { + border-top: 3px solid #A60D0F; + font-size: 11px; + padding: 8px; +} +#index_footer_wrapper { + border-top: 2px solid #464646; + background-color: #595959; + color: #fff; +} + +#w3_valid_xhtml, #w3_valid_css { + position: absolute; + bottom: 0px; +} +#w3_valid_xhtml { + right: 100px; +} +#w3_valid_css { + right: 0px; +} diff --git a/document_root/css/login.css b/document_root/css/login.css new file mode 100644 index 0000000000000000000000000000000000000000..b4504bb006d93eb74ff0369935eef99783ddda83 --- /dev/null +++ b/document_root/css/login.css @@ -0,0 +1,8 @@ +#login_pane { + float: left; + width: 200px; +} + +#notes { + margin-left: 225px; +} \ No newline at end of file diff --git a/document_root/css/my_home.css b/document_root/css/my_home.css new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/document_root/css/public_search.css b/document_root/css/public_search.css new file mode 100644 index 0000000000000000000000000000000000000000..a5d204bee8e6bde16d1850e4cac4834fad4f93b1 --- /dev/null +++ b/document_root/css/public_search.css @@ -0,0 +1,8 @@ +#side_bar { + width: 200px; + float: left; +} + +#main_window { + margin-left: 225px; +} \ No newline at end of file diff --git a/document_root/css/request/course_id.css b/document_root/css/request/course_id.css new file mode 100644 index 0000000000000000000000000000000000000000..19b47dae0dd11ff65bb67f2de974ab9271c0c1b5 --- /dev/null +++ b/document_root/css/request/course_id.css @@ -0,0 +1,3 @@ +#prev_button { + display: none; +} \ No newline at end of file diff --git a/document_root/css/request/credit_hours.css b/document_root/css/request/credit_hours.css new file mode 100644 index 0000000000000000000000000000000000000000..696c7da2dec537628b770227156b20a0f69ec099 --- /dev/null +++ b/document_root/css/request/credit_hours.css @@ -0,0 +1,27 @@ +#credits input { + width: 25px; +} + +#credits div { + height: 2em; +} + +#credits label { + display: block; + width: 150px; + float: left; + clear: both; +} + +input#creditsSingleValues { + width: 100px; +} + +tr.grad_tie_in_row input { + color: #111; + background-color: #eee; +} + +.hidden { + display: none; +} \ No newline at end of file diff --git a/document_root/css/request/edit_wrapper.css b/document_root/css/request/edit_wrapper.css new file mode 100644 index 0000000000000000000000000000000000000000..39c6607cfe4a1c38540e018aa9a8803cef44a310 --- /dev/null +++ b/document_root/css/request/edit_wrapper.css @@ -0,0 +1,100 @@ +#next_button, +#prev_button { + position: absolute; + bottom: 5px; +} +#next_button { + right: 5px; +} +#prev_button { + left: 5px; +} + + +li a { + color: inherit; + text-decoration: none; +} + +.hidden_new_record { + display: none; +} + +.content form h2 { + color: #343434; + font-family: URWGroteskTReg, sans-serif; + font-size: 16px; + font-weight: normal; +} + +.content form h3 { + color: #343434; + font-family: URWGroteskTReg, sans-serif; + font-size: 14px; + font-weight: normal; +} + +fieldset { + clear: both; + border: none; + margin-bottom: 10px; +} + +fieldset th { + text-align: left; +} +fieldset td { + width: 150px; +} + +label { + display: block; +} + +fieldset th, +label { + font-family: URWGroteskTReg, sans-serif; + color: #343434; + font-size: 14px; +} + +label select { + width: 100%; +} + +textarea { + height: 10em; + width: 100%; +} + +fieldset.two_column label { + width: 49%; + float: left; + padding-right: 1%; +} +fieldset.two_of_three_column { + width: 66%; +} +fieldset.two_of_three_column label { + display: block; + float: left; + + width: 49%; + height: 3em; + padding-right: 1%; +} +fieldset.three_column label { + width: 32%; + float: left; + padding-right: 1%; +} +fieldset.two_column label input[type="text"], +fieldset.three_column label input[type="text"] { + width: 90%; +} + +#bulletin_preview { + position: absolute; + top: 200px; + left: -50px; +} \ No newline at end of file diff --git a/document_root/css/request/submit.css b/document_root/css/request/submit.css new file mode 100644 index 0000000000000000000000000000000000000000..6174a3c766fe1081477c5292cb1f431c2af6d857 --- /dev/null +++ b/document_root/css/request/submit.css @@ -0,0 +1,3 @@ +#next_button { + display: none; +} \ No newline at end of file diff --git a/document_root/css/test.oss b/document_root/css/test.oss new file mode 100644 index 0000000000000000000000000000000000000000..399387b21c193fe8a8e66c0725645400aba9c21b --- /dev/null +++ b/document_root/css/test.oss @@ -0,0 +1,33 @@ +@define unl-background: #d00; + +.foo, a { + background-color: unl-background; + font-weight: bold; + font-size: 12px; + + #bar { + text-decoration: none; + float: right; + } + + color: #f0f; + + table { + margin-left: auto; + margin-right: auto; + color: #abc; + } + + marign-top: 10px; +} + +#child @extends .foo { + color: #0aa; + table { + color: #000; + } +} + +#gentwo @extends #child { + color: unl-background; +} \ No newline at end of file diff --git a/document_root/css/unl_index.css b/document_root/css/unl_index.css new file mode 100644 index 0000000000000000000000000000000000000000..8c59443d7c4da3a85690969a44b1cb8390809fcd --- /dev/null +++ b/document_root/css/unl_index.css @@ -0,0 +1,61 @@ +* { + margin: 0px; + padding: 0px; + /* font-family: URWGroteskTLig, URWGroteskELig, "Arial Narrow", Arial, Helvetica, sans-serif; */ + /* font-family: Clearface, Georgia, "Minion Web", Palatino, "Times New Roman", Times, serif; */ +} + +#outer_wrapper { + position: relative; + width: 800px; + margin-left: auto; + margin-right: auto; +} + +#index_header { + height: 34px; + background-image: url(http://www.unl.edu/unlpub/templatedependents/templategraphics/shad_pop.gif); + background-repeat: repeat-x; + background-color: #fff; + + color: #999; + line-height: 30px; +} + +#index_header img { + float: left; + padding-right: 10px; +} + +#index_content { + position: relative; + background-color: #fff; + + height: 500px; + height: auto !important; + min-height: 500px; + padding: 5px; +} + +#index_content_end { + clear: both; +} + +#index_footer { + background-image: url(http://www.unl.edu/unlpub/templatedependents/templategraphics/shad_grey_pop_bot.gif); + color: #fff; + font-size: 9px; + padding: 5px; + height: 30px; +} + +#w3_valid_xhtml, #w3_valid_css { + position: absolute; + bottom: 0px; +} +#w3_valid_xhtml { + right: 100px; +} +#w3_valid_css { + right: 0px; +} diff --git a/document_root/css/user_admin.css b/document_root/css/user_admin.css new file mode 100644 index 0000000000000000000000000000000000000000..660c3f0ce546c8dd66c5bb277128c46259cfeb2e --- /dev/null +++ b/document_root/css/user_admin.css @@ -0,0 +1,38 @@ +#admin_list ul { + margin-left: 1em; + list-style: none; +} + +div#admin_list { + float: left; +} + +div.edit_pane { + margin-left: 150px; +} + +div.edit_pane h2 { + font-size: 110%; + margin-bottom: 1em; +} + +label, input, textarea, select { + display: block; +} + +label { + margin-top: 0.5em; +} + +label input { + display: inline; + margin-bottom: 0px; +} + +input, textarea, select { + margin-bottom: 0.5em; +} + +fieldset { + border-width: 0px +} \ No newline at end of file diff --git a/document_root/images/box_shadow.png b/document_root/images/box_shadow.png new file mode 100644 index 0000000000000000000000000000000000000000..ebc1f08be5ee2b3350eeb4ff0e0b305a777e8d2a Binary files /dev/null and b/document_root/images/box_shadow.png differ diff --git a/document_root/images/box_shadow_2.png b/document_root/images/box_shadow_2.png new file mode 100644 index 0000000000000000000000000000000000000000..05066798d68f0ceddfc65a76cf473d3df6e96fde Binary files /dev/null and b/document_root/images/box_shadow_2.png differ diff --git a/document_root/images/box_shadow_tl.png b/document_root/images/box_shadow_tl.png new file mode 100644 index 0000000000000000000000000000000000000000..cd7c8245edd57afaf73fbb0cd1f2077ba19786ba Binary files /dev/null and b/document_root/images/box_shadow_tl.png differ diff --git a/document_root/images/complete_icon.png b/document_root/images/complete_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..5d22a29c1a112385a217d0c0e3819eb8feaaf71a Binary files /dev/null and b/document_root/images/complete_icon.png differ diff --git a/document_root/images/incomplete_icon.png b/document_root/images/incomplete_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fc5cc01a088aa889f36180de8f5c6c893e768d46 Binary files /dev/null and b/document_root/images/incomplete_icon.png differ diff --git a/document_root/images/menu_grad.png b/document_root/images/menu_grad.png new file mode 100644 index 0000000000000000000000000000000000000000..5a7bcb42a873bbf30ca37595e42589d86a4f6247 Binary files /dev/null and b/document_root/images/menu_grad.png differ diff --git a/document_root/images/text_input_shadow.png b/document_root/images/text_input_shadow.png new file mode 100644 index 0000000000000000000000000000000000000000..e93a2157f51c6f99b70b0f3d85b9e37b079183a7 Binary files /dev/null and b/document_root/images/text_input_shadow.png differ diff --git a/document_root/images/title_red_n.png b/document_root/images/title_red_n.png new file mode 100644 index 0000000000000000000000000000000000000000..4156ba4e5d0d203b221041b285cbd9f7b0110d1f Binary files /dev/null and b/document_root/images/title_red_n.png differ diff --git a/document_root/images/unl_logo.jpg b/document_root/images/unl_logo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6d5663de7ffd639acfcae48e5fbe6eef48c76a9f Binary files /dev/null and b/document_root/images/unl_logo.jpg differ diff --git a/document_root/images/unl_logo.png b/document_root/images/unl_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..556a41be0e34831ed5bc5d319e58fa16fc7f57c3 Binary files /dev/null and b/document_root/images/unl_logo.png differ diff --git a/document_root/images/warning_background.png b/document_root/images/warning_background.png new file mode 100644 index 0000000000000000000000000000000000000000..2212ba0ec071af467259ec08fed7355c3c76775e Binary files /dev/null and b/document_root/images/warning_background.png differ diff --git a/document_root/index.php b/document_root/index.php new file mode 100644 index 0000000000000000000000000000000000000000..9f230f27023210c2b27a0e6ab5c77aafdf753463 --- /dev/null +++ b/document_root/index.php @@ -0,0 +1,32 @@ +<?php + +require('./config.php'); +set_include_path(LIBRARY_PATH); +set_include_path(get_include_path() . PATH_SEPARATOR . APPLICATION_PATH); +set_include_path(get_include_path() . PATH_SEPARATOR . APPLICATION_PATH . '/library'); +set_include_path(get_include_path() . PATH_SEPARATOR . APPLICATION_PATH . '/models/rows'); +set_include_path(get_include_path() . PATH_SEPARATOR . APPLICATION_PATH . '/models/tables'); +require_once('Zend.php'); +spl_autoload_register(array('Zend', 'loadClass')); +//$_SERVER['REQUEST_URI'] = substr($_SERVER['REQUEST_URI'], strlen(dirname($_SERVER['PHP_SELF']))); + +//$appReg = Nmc_Registry_Application::getInstance(); +$db_config = array('host' => $db_host, + 'username' => $db_user, + 'password' => $db_pass, + 'dbname' => $db_name); + +$db = Zend_Db::factory('PDO_MYSQL', $db_config); +Zend_Db_Table::setDefaultAdapter($db); +Zend::register('db', $db); + +$router = new Zend_Controller_RewriteRouter(); +$router->addRoute('compat_params', ':controller/:action/:0/:1/:2/:3/:4/:5/:6/:7/:8/:9/:10/:11/:12'); + +$controller = Zend_Controller_Front::getInstance(); +$controller->setRouter($router); +$controller->setControllerDirectory(APPLICATION_PATH . '/controllers'); +$controller->registerPlugin(new Nmc_Controller_Plugin_Http()); +$controller->dispatch(); + +?> diff --git a/document_root/javascript/edit_course.js b/document_root/javascript/edit_course.js new file mode 100644 index 0000000000000000000000000000000000000000..7994dc72a31353f0ce490c69dd4d0bb16f88cbeb --- /dev/null +++ b/document_root/javascript/edit_course.js @@ -0,0 +1,88 @@ +addLoadEvent(onEditWrapperLoad); + +function onEditWrapperLoad() +{ + + var addButtons = getElementsByClass('add_record_button'); + for(var i = 0; i < addButtons.length; i++) { + addButtons[i].onclick = handleAddRecord; + } + + var removeButtons = getElementsByClass('remove_record_button'); + for(var i = 0; i < removeButtons.length; i++) { + removeButtons[i].onclick = handleRemoveRecord; + } + + document.getElementById('enable_delete').onchange = handleToggleDelete; +} + +function handleAddRecord() +{ + var currentTR = this.parentNode.parentNode; + var currentTable = currentTR.parentNode; + var hiddenTR = currentTR.previousSibling.previousSibling; + var currentIndex = currentTable.getElementsByTagName('tr').length - 2; + + var newNode = hiddenTR.cloneNode(true); + for(var i = 1; i < newNode.childNodes.length; i+=2) { + var inputElement = newNode.childNodes[i].childNodes[1]; + inputElement.disabled = false; + var keyIndex = inputElement.name.indexOf('__key__'); + if(keyIndex > 0) { + inputElement.name = inputElement.name.substr(0, keyIndex) + '-' + currentIndex + inputElement.name.substr(keyIndex + 7); + } + } + newNode.childNodes[newNode.childNodes.length - 2].childNodes[1].onclick = handleRemoveRecord; + currentTable.insertBefore(newNode, hiddenTR); + newNode.className = ''; + + if(this.id.substr(0, 17) == 'add_tie_in_button') { + var courseId = this.id.substr(18).split('_'); + var subjectCode = courseId[0]; + var courseNumber = courseId[1]; + var courseLetter = courseId[2]; + var removeButtonId = 'remove' + this.id.substr(3); + + courseNumber = '8' + courseNumber.substr(1); + + this.style.display = 'none'; + newNode.childNodes[1].childNodes[1].value = subjectCode; + newNode.childNodes[1].childNodes[1].readOnly = true; + newNode.childNodes[3].childNodes[1].value = courseNumber; + newNode.childNodes[3].childNodes[1].readOnly = true; + newNode.childNodes[5].childNodes[1].value = courseLetter; + newNode.childNodes[5].childNodes[1].readOnly = true; + newNode.childNodes[7].childNodes[1].value = 'grad tie-in'; + newNode.childNodes[7].childNodes[1].readOnly = true; + newNode.childNodes[9].childNodes[1].id = removeButtonId; + newNode.className = 'grad_tie_in_row'; + } + + return false; +} + +function handleRemoveRecord() +{ + var currentTR = this.parentNode.parentNode; + var currentTable = currentTR.parentNode; + + if(this.id.substr(0, 20) == 'remove_tie_in_button') { + var addButtonId = 'add' + this.id.substr(6); + document.getElementById(addButtonId).style.display = 'inline'; + } + + currentTable.removeChild(currentTR); + + return false; +} + +function handleToggleDelete() +{ + if(this.checked) { + document.getElementById('delete_course').style.borderColor = '#f00'; + document.getElementById('submit_delete').disabled = false; + } else { + document.getElementById('delete_course').style.borderColor = '#000'; + document.getElementById('submit_delete').disabled = true; + } +} diff --git a/document_root/javascript/index.js b/document_root/javascript/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e0c48b7823f229998927e87cdd3b7c7a855144d5 --- /dev/null +++ b/document_root/javascript/index.js @@ -0,0 +1,47 @@ +var _GET = new Array(); +function handleOnLoad() +{ + var qs = window.location.search.substr(1).split('&'); + for(var i = 0; i < qs.length; i++) { + qs[i] = qs[i].split('='); + _GET[qs[i][0]] = qs[i][1]; + } + + for(var i = 0; i < loadEvents.length; i++) { + loadEvents[i](); + } +} + +var loadEvents = Array(); +function addLoadEvent(func) { + loadEvents[loadEvents.length] = func; +} + +//borrowed from http://codestore.net/store.nsf/unid/BLOG-20060313 +String.prototype.trim = function() { + a = this.replace(/^\s+/, ''); + return a.replace(/\s+$/, ''); +}; +//end borrowed code + +// getElementsByClass borrowed from http://www.dustindiaz.com/top-ten-javascript/ +// written by Dustin Diaz +function getElementsByClass(searchClass,node,tag) { + var classElements = new Array(); + if ( node == null ) + node = document; + if ( tag == null ) + tag = '*'; + var els = node.getElementsByTagName(tag); + var elsLen = els.length; + + var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)"); + for (i = 0, j = 0; i < elsLen; i++) { + if ( pattern.test(els[i].className) ) { + classElements[j] = els[i]; + j++; + } + } + return classElements; +} +//end borrowed code diff --git a/document_root/javascript/login.js b/document_root/javascript/login.js new file mode 100644 index 0000000000000000000000000000000000000000..0b1c9f41a1db92aaeb4e17c09b3664abef5413af --- /dev/null +++ b/document_root/javascript/login.js @@ -0,0 +1,11 @@ +addLoadEvent(onLoadHelloWorld); + +function onLoadHelloWorld() +{ + document.getElementById('main_heading').onclick = handleHeadingClick; +} + +function handleHeadingClick() +{ + alert("That tickles!"); +} \ No newline at end of file diff --git a/document_root/javascript/mce.js b/document_root/javascript/mce.js new file mode 100644 index 0000000000000000000000000000000000000000..8975f7710b3d6b0438f8cc0f93044e495ddaa20a --- /dev/null +++ b/document_root/javascript/mce.js @@ -0,0 +1,11 @@ +tinyMCE.init({ + mode : "textareas", + theme : "advanced", + plugins : "spellchecker, prereq", + editor_selector : "mceEditor", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "left", + theme_advanced_buttons1 : "bold, italic, underline, sub, sup, prereq, spellchecker", + theme_advanced_buttons2 : "", + theme_advanced_buttons3 : "" +}); \ No newline at end of file diff --git a/document_root/javascript/request/edit_wrapper.js b/document_root/javascript/request/edit_wrapper.js new file mode 100644 index 0000000000000000000000000000000000000000..3de6c5139aa0ce8ef617b2fa4e6527b5dd3fd612 --- /dev/null +++ b/document_root/javascript/request/edit_wrapper.js @@ -0,0 +1,75 @@ +addLoadEvent(onEditWrapperLoad); + +function onEditWrapperLoad() +{ + + var addButtons = getElementsByClass('add_record_button'); + for(var i = 0; i < addButtons.length; i++) { + addButtons[i].onclick = handleAddRecord; + } + + var removeButtons = getElementsByClass('remove_record_button'); + for(var i = 0; i < removeButtons.length; i++) { + removeButtons[i].onclick = handleRemoveRecord; + } +} + +function handleAddRecord() +{ + var currentTR = this.parentNode.parentNode; + var currentTable = currentTR.parentNode; + var hiddenTR = currentTR.previousSibling.previousSibling; + var currentIndex = currentTable.getElementsByTagName('tr').length - 2; + + var newNode = hiddenTR.cloneNode(true); + for(var i = 1; i < newNode.childNodes.length; i+=2) { + var inputElement = newNode.childNodes[i].childNodes[1]; + inputElement.disabled = false; + var keyIndex = inputElement.name.indexOf('__key__'); + if(keyIndex > 0) { + inputElement.name = inputElement.name.substr(0, keyIndex) + '-' + currentIndex + inputElement.name.substr(keyIndex + 7); + } + } + newNode.childNodes[newNode.childNodes.length - 2].childNodes[1].onclick = handleRemoveRecord; + currentTable.insertBefore(newNode, hiddenTR); + newNode.className = ''; + + if(this.id.substr(0, 17) == 'add_tie_in_button') { + var courseId = this.id.substr(18).split('_'); + var subjectCode = courseId[0]; + var courseNumber = courseId[1]; + var courseLetter = courseId[2]; + var removeButtonId = 'remove' + this.id.substr(3); + + courseNumber = '8' + courseNumber.substr(1); + + this.style.display = 'none'; + newNode.childNodes[1].childNodes[1].value = subjectCode; + newNode.childNodes[1].childNodes[1].readOnly = true; + newNode.childNodes[3].childNodes[1].value = courseNumber; + newNode.childNodes[3].childNodes[1].readOnly = true; + newNode.childNodes[5].childNodes[1].value = courseLetter; + newNode.childNodes[5].childNodes[1].readOnly = true; + newNode.childNodes[7].childNodes[1].value = 'grad tie-in'; + newNode.childNodes[7].childNodes[1].readOnly = true; + newNode.childNodes[9].childNodes[1].id = removeButtonId; + newNode.className = 'grad_tie_in_row'; + } + + return false; +} + +function handleRemoveRecord() +{ + var currentTR = this.parentNode.parentNode; + var currentTable = currentTR.parentNode; + + if(this.id.substr(0, 20) == 'remove_tie_in_button') { + var addButtonId = 'add' + this.id.substr(6); + document.getElementById(addButtonId).style.display = 'inline'; + } + + currentTable.removeChild(currentTR); + + return false; +} diff --git a/document_root/javascript/request/search.js b/document_root/javascript/request/search.js new file mode 100644 index 0000000000000000000000000000000000000000..3de5d789bac9c1cf47e87cec2dfdf3868b3e5f52 --- /dev/null +++ b/document_root/javascript/request/search.js @@ -0,0 +1,15 @@ +addLoadEvent(onRequestSearchLoad); + +function onRequestSearchLoad() +{ + document.getElementById('search_form').onsubmit = handleSearch; +} + +function handleSearch() +{ + url = document.getElementById('subject').value + '/' + + document.getElementById('course_number').value + '/' + + document.getElementById('course_letter').value; + location.href += '/' + url; + return false; +} \ No newline at end of file diff --git a/document_root/javascript/test.js b/document_root/javascript/test.js new file mode 100644 index 0000000000000000000000000000000000000000..e62aabd73a40f5f37958884f239cd99c96de6373 --- /dev/null +++ b/document_root/javascript/test.js @@ -0,0 +1,14 @@ +addLoadEvent( onLoadTest ); + +function onLoadTest() +{ + var selections = document.getElementById('selections').getElementsByTagName('li'); + for(var i = 0; i < selections.length; i++) { + selections[i].onclick = handleRemoval; + } +} + +function handleRemoval() +{ + // +} \ No newline at end of file diff --git a/document_root/javascript/user_admin.js b/document_root/javascript/user_admin.js new file mode 100644 index 0000000000000000000000000000000000000000..47291e0cf416be903d8efaefe8a84c52c606acec --- /dev/null +++ b/document_root/javascript/user_admin.js @@ -0,0 +1,48 @@ +addLoadEvent(onLoadUserAdmin); + +function onLoadUserAdmin() +{ + document.getElementById('delete').onclick = onClickDelete; +} + +function onClickDelete() +{ + var setDisable; + + if(this.checked) { + setDisable = true; + } else { + setDisable = false; + } + + var formElements = this.parentNode.parentNode.getElementsByTagName('input'); + for(i = 0; i < formElements.length; i++) { + if(formElements[i].id == 'delete') { + continue; + } + if(formElements[i].type == 'submit') { + continue; + } + formElements[i].disabled = setDisable; + } + formElements = this.parentNode.parentNode.getElementsByTagName('select'); + for(i = 0; i < formElements.length; i++) { + if(formElements[i].id == 'delete') { + continue; + } + if(formElements[i].type == 'submit') { + continue; + } + formElements[i].disabled = setDisable; + } + formElements = this.parentNode.parentNode.getElementsByTagName('textarea'); + for(i = 0; i < formElements.length; i++) { + if(formElements[i].id == 'delete') { + continue; + } + if(formElements[i].type == 'submit') { + continue; + } + formElements[i].disabled = setDisable; + } +} \ No newline at end of file