Skip to content
Snippets Groups Projects
Commit a4879c86 authored by Demian Katz's avatar Demian Katz
Browse files

Make NoILS driver play nicely with course reserves.

- Resolves VUFIND-1232.
parent 1e2f06d3
Branches
Tags
No related merge requests found
...@@ -379,4 +379,68 @@ class NoILS extends AbstractBase implements TranslatorAwareInterface ...@@ -379,4 +379,68 @@ class NoILS extends AbstractBase implements TranslatorAwareInterface
// Block authentication: // Block authentication:
return null; return null;
} }
/**
* Get Departments
*
* Obtain a list of departments for use in limiting the reserves list.
*
* @throws ILSException
* @return array An associative array with key = dept. ID, value = dept. name.
*/
public function getDepartments()
{
// Does not work while ILS offline:
return [];
}
/**
* Get Instructors
*
* Obtain a list of instructors for use in limiting the reserves list.
*
* @throws ILSException
* @return array An associative array with key = ID, value = name.
*/
public function getInstructors()
{
// Does not work while ILS offline:
return [];
}
/**
* Get Courses
*
* Obtain a list of courses for use in limiting the reserves list.
*
* @throws ILSException
* @return array An associative array with key = ID, value = name.
*/
public function getCourses()
{
// Does not work while ILS offline:
return [];
}
/**
* Find Reserves
*
* Obtain information on course reserves.
*
* This version of findReserves was contributed by Matthew Hooper and includes
* support for electronic reserves (though eReserve support is still a work in
* progress).
*
* @param string $course ID from getCourses (empty string to match all)
* @param string $inst ID from getInstructors (empty string to match all)
* @param string $dept ID from getDepartments (empty string to match all)
*
* @throws ILSException
* @return array An array of associative arrays representing reserve items.
*/
public function findReserves($course, $inst, $dept)
{
// Does not work while ILS offline:
return [];
}
} }
...@@ -4,45 +4,52 @@ ...@@ -4,45 +4,52 @@
// Set up breadcrumbs: // Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li class="active">' . $this->transEsc('Reserves') . '</li>'; $this->layout()->breadcrumbs = '<li class="active">' . $this->transEsc('Reserves') . '</li>';
// Convenience variable:
$offlineMode = $this->ils()->getOfflineMode();
?> ?>
<h2><?=$this->transEsc('Search For Items on Reserve')?></h2> <? if ($offlineMode == "ils-offline"): ?>
<form method="get" name="searchForm" class="form-search-reserves"> <?=$this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_holdings_message'])?>
<? if (is_array($this->courseList)): ?> <? else: ?>
<div class="form-group"> <h2><?=$this->transEsc('Search For Items on Reserve')?></h2>
<label for="reserves_by_course" class="control-label"><?=$this->transEsc('By Course')?>:</label> <form method="get" name="searchForm" class="form-search-reserves">
<select name="course" id="reserves_by_course" class="form-control"> <? if (is_array($this->courseList)): ?>
<option></option> <div class="form-group">
<? foreach ($this->courseList as $courseId => $courseName): ?> <label for="reserves_by_course" class="control-label"><?=$this->transEsc('By Course')?>:</label>
<option value="<?=$this->escapeHtmlAttr($courseId)?>"><?=$this->escapeHtml($courseName)?></option> <select name="course" id="reserves_by_course" class="form-control">
<? endforeach; ?> <option></option>
</select> <? foreach ($this->courseList as $courseId => $courseName): ?>
<input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/> <option value="<?=$this->escapeHtmlAttr($courseId)?>"><?=$this->escapeHtml($courseName)?></option>
</div> <? endforeach; ?>
<? endif; ?> </select>
<input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/>
</div>
<? endif; ?>
<? if (is_array($this->instList)): ?> <? if (is_array($this->instList)): ?>
<div class="form-group"> <div class="form-group">
<label for="reserves_by_inst" class="control-label"><?=$this->transEsc('By Instructor')?>:</label> <label for="reserves_by_inst" class="control-label"><?=$this->transEsc('By Instructor')?>:</label>
<select name="inst" id="reserves_by_inst" class="form-control"> <select name="inst" id="reserves_by_inst" class="form-control">
<option></option> <option></option>
<? foreach ($this->instList as $instId => $instName): ?> <? foreach ($this->instList as $instId => $instName): ?>
<option value="<?=$this->escapeHtmlAttr($instId)?>"><?=$this->escapeHtml($instName)?></option> <option value="<?=$this->escapeHtmlAttr($instId)?>"><?=$this->escapeHtml($instName)?></option>
<? endforeach; ?> <? endforeach; ?>
</select> </select>
<input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/> <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/>
</div> </div>
<? endif; ?> <? endif; ?>
<? if (is_array($this->deptList)): ?> <? if (is_array($this->deptList)): ?>
<div class="form-group"> <div class="form-group">
<label for="reserves_by_dept" class="control-label"><?=$this->transEsc('By Department')?>:</label> <label for="reserves_by_dept" class="control-label"><?=$this->transEsc('By Department')?>:</label>
<select name="dept" id="reserves_by_dept" class="form-control"> <select name="dept" id="reserves_by_dept" class="form-control">
<option></option> <option></option>
<? foreach ($this->deptList as $deptId => $deptName): ?> <? foreach ($this->deptList as $deptId => $deptName): ?>
<option value="<?=$this->escapeHtmlAttr($deptId)?>"><?=$this->escapeHtml($deptName)?></option> <option value="<?=$this->escapeHtmlAttr($deptId)?>"><?=$this->escapeHtml($deptName)?></option>
<? endforeach; ?> <? endforeach; ?>
</select> </select>
<input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/> <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Find')?>"/>
</div> </div>
<? endif; ?> <? endif; ?>
</form> </form>
<? endif; ?>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment