Fixed Typo: They're spelled "interments"

git-svn-id: https://rosehill.googlecode.com/svn/branches/php@10 100bd78a-fc82-11de-b5bc-ffd2847a4b57
This commit is contained in:
inghamn 2009-12-18 17:40:05 +00:00
parent ace118bc0a
commit 997d26ec8b
12 changed files with 142 additions and 142 deletions

View File

@ -19,7 +19,7 @@ foreach ($roles as $role) {
*/ */
$ZEND_ACL->add(new Zend_Acl_Resource('Users')); $ZEND_ACL->add(new Zend_Acl_Resource('Users'));
$ZEND_ACL->add(new Zend_Acl_Resource('Deeds')); $ZEND_ACL->add(new Zend_Acl_Resource('Deeds'));
$ZEND_ACL->add(new Zend_Acl_Resource('Internments')); $ZEND_ACL->add(new Zend_Acl_Resource('Interments'));
$ZEND_ACL->add(new Zend_Acl_Resource('Cemeteries')); $ZEND_ACL->add(new Zend_Acl_Resource('Cemeteries'));
@ -30,4 +30,4 @@ $ZEND_ACL->add(new Zend_Acl_Resource('Cemeteries'));
$ZEND_ACL->allow('Administrator'); $ZEND_ACL->allow('Administrator');
$ZEND_ACL->allow('Editor','Deeds'); $ZEND_ACL->allow('Editor','Deeds');
$ZEND_ACL->allow('Editor','Internments'); $ZEND_ACL->allow('Editor','Interments');

View File

@ -5,55 +5,55 @@
* @author Cliff Ingham <inghamn@bloomington.in.gov> * @author Cliff Ingham <inghamn@bloomington.in.gov>
*/ */
?> ?>
<h1>Add Internment</h1> <h1>Add Interment</h1>
<form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>"> <form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>">
<fieldset><legend>Internment Info</legend> <fieldset><legend>Interment Info</legend>
<table> <table>
<tr><td><label for="internment-section">Section</label></td> <tr><td><label for="interment-section">Section</label></td>
<td><input name="internment[section]" id="internment-section" <td><input name="interment[section]" id="interment-section"
size="5" maxlength="5" /> size="5" maxlength="5" />
<label for="internment-lot">Lot</label> <label for="interment-lot">Lot</label>
<input name="internment[lot]" id="internment-lot" <input name="interment[lot]" id="interment-lot"
size="5" maxlength="5" /> size="5" maxlength="5" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-book">Book</label></td> <tr><td><label for="interment-book">Book</label></td>
<td><input name="internment[book]" id="internment-book" <td><input name="interment[book]" id="interment-book"
size="4" maxlength="4" /> size="4" maxlength="4" />
<label for="internment-pageNumber">Page</label> <label for="interment-pageNumber">Page</label>
<input name="internment[pageNumber]" id="internment-pageNumber" <input name="interment[pageNumber]" id="interment-pageNumber"
size="5" maxlength="5" /> size="5" maxlength="5" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-firstname">Name</label></td> <tr><td><label for="interment-firstname">Name</label></td>
<td><label for="internment-firstname">First</label> <td><label for="interment-firstname">First</label>
<input name="internment[firstname]" id="internment-firstname" /> <input name="interment[firstname]" id="interment-firstname" />
<label for="internment-middleInitial">MI</label> <label for="interment-middleInitial">MI</label>
<input name="internment[middleInitial]" id="internment-middleInitial" /> <input name="interment[middleInitial]" id="interment-middleInitial" />
<label for="internment-lastname">Last</label> <label for="interment-lastname">Last</label>
<input name="internment[lastname]" id="internment-lastname" /> <input name="interment[lastname]" id="interment-lastname" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-birthPlace">Place of Birth</label></td> <tr><td><label for="interment-birthPlace">Place of Birth</label></td>
<td><input name="internment[birthPlace]" id="internment-birthPlace" /> <td><input name="interment[birthPlace]" id="interment-birthPlace" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-lastResidence">Last Residence</label></td> <tr><td><label for="interment-lastResidence">Last Residence</label></td>
<td><input name="internment[lastResidence]" id="internment-lastResidence" /> <td><input name="interment[lastResidence]" id="interment-lastResidence" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-deceasedDate">Date of Death</label></td> <tr><td><label for="interment-deceasedDate">Date of Death</label></td>
<td><input name="internment[deceasedDate]" id="internment-deceasedDate" size="10" /> <td><input name="interment[deceasedDate]" id="interment-deceasedDate" size="10" />
<label for="internment-age">Age</label> <label for="interment-age">Age</label>
<input name="internment[age]" id="internment-age" size="3" maxlength="3" /> <input name="interment[age]" id="interment-age" size="3" maxlength="3" />
<label for="internment-sex">Gender</label> <label for="interment-sex">Gender</label>
<select name="internment[sex]" id="internment-sex"> <select name="interment[sex]" id="interment-sex">
<option></option> <option></option>
<option>M</option> <option>M</option>
<option>F</option> <option>F</option>
@ -61,8 +61,8 @@
</td> </td>
</tr> </tr>
<tr><td><label for="internment-cemetery_id">Cemetery</label></td> <tr><td><label for="interment-cemetery_id">Cemetery</label></td>
<td><select name="internment[cemetery_id]" id="internment-cemetery_id"> <td><select name="interment[cemetery_id]" id="interment-cemetery_id">
<option></option> <option></option>
<?php <?php
$list = new CemeteryList(); $list = new CemeteryList();
@ -76,8 +76,8 @@
</td> </td>
</tr> </tr>
<tr><td><label for="internment-notes">Notes</label></td> <tr><td><label for="interment-notes">Notes</label></td>
<td><textarea name="internment[notes]" id="internment-notes" rows="3" cols="60"></textarea> <td><textarea name="interment[notes]" id="interment-notes" rows="3" cols="60"></textarea>
</td> </td>
</tr> </tr>
@ -85,7 +85,7 @@
</table> </table>
<button type="submit" class="submit">Submit</button> <button type="submit" class="submit">Submit</button>
<button type="button" class="cancel" onclick="document.location.href='<?php echo BASE_URL; ?>/internments';"> <button type="button" class="cancel" onclick="document.location.href='<?php echo BASE_URL; ?>/interments';">
Cancel Cancel
</button> </button>
</fieldset> </fieldset>

View File

@ -6,7 +6,7 @@
*/ */
?> ?>
<h1>Search Burial Records</h1> <h1>Search Burial Records</h1>
<form method="get" action="<?php echo BASE_URL; ?>/internments"> <form method="get" action="<?php echo BASE_URL; ?>/interments">
<table> <table>
<tr><td><label for="lastname">Last Name</label></td> <tr><td><label for="lastname">Last Name</label></td>
<td><input name="lastname" id="lastname" <td><input name="lastname" id="lastname"

View File

@ -3,21 +3,21 @@
* @copyright 2009 City of Bloomington, Indiana * @copyright 2009 City of Bloomington, Indiana
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* @author Cliff Ingham <inghamn@bloomington.in.gov> * @author Cliff Ingham <inghamn@bloomington.in.gov>
* @param InternmentList $this->internmentList * @param IntermentList $this->intermentList
*/ */
?> ?>
<div class="interfaceBox"> <div class="interfaceBox">
<h1> <h1>
<?php <?php
if (userIsAllowed('Internments')) { if (userIsAllowed('Interments')) {
echo " echo "
<button type=\"button\" class=\"add\" onclick=\"document.location.href='".BASE_URL."/internments/addInternment.php';\"> <button type=\"button\" class=\"add\" onclick=\"document.location.href='".BASE_URL."/interments/addInterment.php';\">
Add Add
</button> </button>
"; ";
} }
?> ?>
Internments Interments
</h1> </h1>
<table> <table>
<thead> <thead>
@ -31,28 +31,28 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
foreach ($this->internmentList as $internment) { foreach ($this->intermentList as $interment) {
$editButton = ''; $editButton = '';
if (userIsAllowed('Internments')) { if (userIsAllowed('Interments')) {
$url = new URL(BASE_URL.'/internments/updateInternment.php'); $url = new URL(BASE_URL.'/interments/updateInterment.php');
$url->internment_id = $internment->getId(); $url->interment_id = $interment->getId();
$editButton = " $editButton = "
<button type=\"button\" class=\"edit\" onclick=\"document.location.href='$url';\"> <button type=\"button\" class=\"edit\" onclick=\"document.location.href='$url';\">
Edit Edit
</button> </button>
"; ";
} }
$last = View::escape($internment->getLastname()); $last = View::escape($interment->getLastname());
$first = View::escape($internment->getFirstname()); $first = View::escape($interment->getFirstname());
$date = $internment->getDeceasedDate('n/j/Y'); $date = $interment->getDeceasedDate('n/j/Y');
$cemetery = View::escape($internment->getCemetery()); $cemetery = View::escape($interment->getCemetery());
$section_lot = array(); $section_lot = array();
if ($internment->getSection()) { if ($interment->getSection()) {
$section_lot[] = $internment->getSection(); $section_lot[] = $interment->getSection();
} }
if ($internment->getLot()) { if ($interment->getLot()) {
$section_lot[] = $internment->getLot(); $section_lot[] = $interment->getLot();
} }
$section_lot = View::escape(implode(', ',$section_lot)); $section_lot = View::escape(implode(', ',$section_lot));
@ -71,9 +71,9 @@
</table> </table>
</div> </div>
<?php <?php
if ($this->internmentList->getPaginator()) { if ($this->intermentList->getPaginator()) {
$pageNavigation = new Block('pageNavigation.inc', $pageNavigation = new Block('pageNavigation.inc',
array('pages'=>$this->internmentList->getPaginator()->getPages())); array('pages'=>$this->intermentList->getPaginator()->getPages()));
echo $pageNavigation->render('html'); echo $pageNavigation->render('html');
} }
?> ?>

View File

@ -3,91 +3,91 @@
* @copyright 2009 City of Bloomington, Indiana * @copyright 2009 City of Bloomington, Indiana
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* @author Cliff Ingham <inghamn@bloomington.in.gov> * @author Cliff Ingham <inghamn@bloomington.in.gov>
* @param Internment $this->internment * @param Interment $this->interment
*/ */
?> ?>
<h1>Update Internment</h1> <h1>Update Interment</h1>
<form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>"> <form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>">
<fieldset><legend>Internment Info</legend> <fieldset><legend>Interment Info</legend>
<input name="internment_id" type="hidden" value="<?php echo $this->internment->getId(); ?>" /> <input name="interment_id" type="hidden" value="<?php echo $this->interment->getId(); ?>" />
<table> <table>
<tr><td><label for="internment-section">Section</label></td> <tr><td><label for="interment-section">Section</label></td>
<td><input name="internment[section]" id="internment-section" <td><input name="interment[section]" id="interment-section"
size="5" maxlength="5" size="5" maxlength="5"
value="<?php echo View::escape($this->internment->getSection()); ?>" /> value="<?php echo View::escape($this->interment->getSection()); ?>" />
<label for="internment-lot">Lot</label> <label for="interment-lot">Lot</label>
<input name="internment[lot]" id="internment-lot" <input name="interment[lot]" id="interment-lot"
size="5" maxlength="5" size="5" maxlength="5"
value="<?php echo View::escape($this->internment->getLot()); ?>" /> value="<?php echo View::escape($this->interment->getLot()); ?>" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-book">Book</label></td> <tr><td><label for="interment-book">Book</label></td>
<td><input name="internment[book]" id="internment-book" <td><input name="interment[book]" id="interment-book"
size="4" maxlength="4" size="4" maxlength="4"
value="<?php echo View::escape($this->internment->getBook()); ?>" /> value="<?php echo View::escape($this->interment->getBook()); ?>" />
<label for="internment-pageNumber">Page</label> <label for="interment-pageNumber">Page</label>
<input name="internment[pageNumber]" id="internment-pageNumber" <input name="interment[pageNumber]" id="interment-pageNumber"
size="5" maxlength="5" size="5" maxlength="5"
value="<?php echo View::escape($this->internment->getPageNumber()); ?>" /> value="<?php echo View::escape($this->interment->getPageNumber()); ?>" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-firstname">Name</label></td> <tr><td><label for="interment-firstname">Name</label></td>
<td><label for="internment-firstname">First</label> <td><label for="interment-firstname">First</label>
<input name="internment[firstname]" id="internment-firstname" <input name="interment[firstname]" id="interment-firstname"
value="<?php echo View::escape($this->internment->getFirstname()); ?>" /> value="<?php echo View::escape($this->interment->getFirstname()); ?>" />
<label for="internment-middleInitial">MI</label> <label for="interment-middleInitial">MI</label>
<input name="internment[middleInitial]" id="internment-middleInitial" <input name="interment[middleInitial]" id="interment-middleInitial"
value="<?php echo View::escape($this->internment->getMiddleInitial()); ?>" /> value="<?php echo View::escape($this->interment->getMiddleInitial()); ?>" />
<label for="internment-lastname">Last</label> <label for="interment-lastname">Last</label>
<input name="internment[lastname]" id="internment-lastname" <input name="interment[lastname]" id="interment-lastname"
value="<?php echo View::escape($this->internment->getLastname()); ?>" /> value="<?php echo View::escape($this->interment->getLastname()); ?>" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-birthPlace">Place of Birth</label></td> <tr><td><label for="interment-birthPlace">Place of Birth</label></td>
<td><input name="internment[birthPlace]" id="internment-birthPlace" <td><input name="interment[birthPlace]" id="interment-birthPlace"
value="<?php echo View::escape($this->internment->getBirthPlace()); ?>" /> value="<?php echo View::escape($this->interment->getBirthPlace()); ?>" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-lastResidence">Last Residence</label></td> <tr><td><label for="interment-lastResidence">Last Residence</label></td>
<td><input name="internment[lastResidence]" id="internment-lastResidence" <td><input name="interment[lastResidence]" id="interment-lastResidence"
value="<?php echo View::escape($this->internment->getLastResidence()); ?>" /> value="<?php echo View::escape($this->interment->getLastResidence()); ?>" />
</td> </td>
</tr> </tr>
<tr><td><label for="internment-deceasedDate">Date of Death</label></td> <tr><td><label for="interment-deceasedDate">Date of Death</label></td>
<td><input name="internment[deceasedDate]" id="internment-deceasedDate" <td><input name="interment[deceasedDate]" id="interment-deceasedDate"
size="10" value="<?php echo $this->internment->getDeceasedDate('n/j/Y'); ?>" /> size="10" value="<?php echo $this->interment->getDeceasedDate('n/j/Y'); ?>" />
<label for="internment-age">Age</label> <label for="interment-age">Age</label>
<input name="internment[age]" id="internment-age" <input name="interment[age]" id="interment-age"
size="3" maxlength="3" size="3" maxlength="3"
value="<?php echo View::escape($this->internment->getAge()); ?>" /> value="<?php echo View::escape($this->interment->getAge()); ?>" />
<label for="internment-sex">Gender</label> <label for="interment-sex">Gender</label>
<select name="internment[sex]" id="internment-sex"> <select name="interment[sex]" id="interment-sex">
<option></option> <option></option>
<option value="M" <?php echo $this->internment->getSex()=='M' ? 'selected="selected"' : ''; ?>> <option value="M" <?php echo $this->interment->getSex()=='M' ? 'selected="selected"' : ''; ?>>
M M
</option> </option>
<option value="F" <?php echo $this->internment->getSex()=='F' ? 'selected="selected"' : ''; ?>> <option value="F" <?php echo $this->interment->getSex()=='F' ? 'selected="selected"' : ''; ?>>
F F
</option> </option>
</select> </select>
</td> </td>
</tr> </tr>
<tr><td><label for="internment-cemetery_id">Cemetery</label></td> <tr><td><label for="interment-cemetery_id">Cemetery</label></td>
<td><select name="internment[cemetery_id]" id="internment-cemetery_id"> <td><select name="interment[cemetery_id]" id="interment-cemetery_id">
<option></option> <option></option>
<?php <?php
$list = new CemeteryList(); $list = new CemeteryList();
$list->find(); $list->find();
foreach ($list as $cemetery) { foreach ($list as $cemetery) {
$name = View::escape($cemetery->getName()); $name = View::escape($cemetery->getName());
$selected = $this->internment->getCemetery_id()==$cemetery->getId() $selected = $this->interment->getCemetery_id()==$cemetery->getId()
? 'selected="selected"' ? 'selected="selected"'
: ''; : '';
echo "<option value=\"{$cemetery->getId()}\" $selected>$name</option>"; echo "<option value=\"{$cemetery->getId()}\" $selected>$name</option>";
@ -97,15 +97,15 @@
</td> </td>
</tr> </tr>
<tr><td><label for="internment-notes">Notes</label></td> <tr><td><label for="interment-notes">Notes</label></td>
<td><textarea name="internment[notes]" id="internment-notes" rows="3" cols="60"><?php echo View::escape($this->internment->getNotes()); ?></textarea> <td><textarea name="interment[notes]" id="interment-notes" rows="3" cols="60"><?php echo View::escape($this->interment->getNotes()); ?></textarea>
</td> </td>
</tr> </tr>
</table> </table>
<button type="submit" class="submit">Submit</button> <button type="submit" class="submit">Submit</button>
<button type="button" class="cancel" onclick="document.location.href='<?php echo BASE_URL; ?>/internments';"> <button type="button" class="cancel" onclick="document.location.href='<?php echo BASE_URL; ?>/interments';">
Cancel Cancel
</button> </button>
</fieldset> </fieldset>

View File

@ -147,6 +147,6 @@ class Cemetery
*/ */
public function getSections() public function getSections()
{ {
return Internment::getSections($this); return Interment::getSections($this);
} }
} }

View File

@ -4,7 +4,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* @author Cliff Ingham <inghamn@bloomington.in.gov> * @author Cliff Ingham <inghamn@bloomington.in.gov>
*/ */
class Internment class Interment
{ {
private $id; private $id;
private $section; private $section;
@ -45,7 +45,7 @@ class Internment
} }
else { else {
$zend_db = Database::getConnection(); $zend_db = Database::getConnection();
$sql = 'select * from internments where id=?'; $sql = 'select * from interments where id=?';
$result = $zend_db->fetchRow($sql,array($id)); $result = $zend_db->fetchRow($sql,array($id));
} }
@ -60,7 +60,7 @@ class Internment
} }
} }
else { else {
throw new Exception('internments/unknownInternment'); throw new Exception('interments/unknownInterment');
} }
} }
else { else {
@ -114,14 +114,14 @@ class Internment
private function update($data) private function update($data)
{ {
$zend_db = Database::getConnection(); $zend_db = Database::getConnection();
$zend_db->update('internments',$data,"id='{$this->id}'"); $zend_db->update('interments',$data,"id='{$this->id}'");
} }
private function insert($data) private function insert($data)
{ {
$zend_db = Database::getConnection(); $zend_db = Database::getConnection();
$zend_db->insert('internments',$data); $zend_db->insert('interments',$data);
$this->id = $zend_db->lastInsertId('internments','id'); $this->id = $zend_db->lastInsertId('interments','id');
} }
//---------------------------------------------------------------- //----------------------------------------------------------------
@ -441,7 +441,7 @@ class Internment
{ {
$zend_db = Database::getConnection(); $zend_db = Database::getConnection();
$select = new Zend_Db_Select($zend_db); $select = new Zend_Db_Select($zend_db);
$select->distinct()->from('internments','section'); $select->distinct()->from('interments','section');
$select->where('section is not null'); $select->where('section is not null');
if ($cemetery) { if ($cemetery) {
$select->where('cemetery_id=?',$cemetery->getId()); $select->where('cemetery_id=?',$cemetery->getId());

View File

@ -1,12 +1,12 @@
<?php <?php
/** /**
* A collection class for Internment objects * A collection class for Interment objects
* *
* This class creates a zend_db select statement. * This class creates a zend_db select statement.
* ZendDbResultIterator handles iterating and paginating those results. * ZendDbResultIterator handles iterating and paginating those results.
* As the results are iterated over, ZendDbResultIterator will pass each desired * As the results are iterated over, ZendDbResultIterator will pass each desired
* row back to this class's loadResult() which will be responsible for hydrating * row back to this class's loadResult() which will be responsible for hydrating
* each Internment object * each Interment object
* *
* Beyond the basic $fields handled, you will need to write your own handling * Beyond the basic $fields handled, you will need to write your own handling
* of whatever extra $fields you need * of whatever extra $fields you need
@ -15,7 +15,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* @author Cliff Ingham <inghamn@bloomington.in.gov> * @author Cliff Ingham <inghamn@bloomington.in.gov>
*/ */
class InternmentList extends ZendDbResultIterator class IntermentList extends ZendDbResultIterator
{ {
/** /**
* Creates a basic select statement for the collection. * Creates a basic select statement for the collection.
@ -46,9 +46,9 @@ class InternmentList extends ZendDbResultIterator
*/ */
public function find($fields=null,$order='id',$limit=null,$groupBy=null) public function find($fields=null,$order='id',$limit=null,$groupBy=null)
{ {
$this->select->from('internments'); $this->select->from('interments');
// Finding on fields from the internments table is handled here // Finding on fields from the interments table is handled here
if (count($fields)) { if (count($fields)) {
foreach ($fields as $key=>$value) { foreach ($fields as $key=>$value) {
switch ($key) { switch ($key) {
@ -65,7 +65,7 @@ class InternmentList extends ZendDbResultIterator
// Finding on fields from other tables requires joining those tables. // Finding on fields from other tables requires joining those tables.
// You can handle fields from other tables by adding the joins here // You can handle fields from other tables by adding the joins here
// If you add more joins you probably want to make sure that the // If you add more joins you probably want to make sure that the
// above foreach only handles fields from the internments table. // above foreach only handles fields from the interments table.
$this->select->order($order); $this->select->order($order);
if ($limit) { if ($limit) {
@ -78,16 +78,16 @@ class InternmentList extends ZendDbResultIterator
} }
/** /**
* Hydrates all the Internment objects from a database result set * Hydrates all the Interment objects from a database result set
* *
* This is a callback function, called from ZendDbResultIterator. It is * This is a callback function, called from ZendDbResultIterator. It is
* called once per row of the result. * called once per row of the result.
* *
* @param int $key The index of the result row to load * @param int $key The index of the result row to load
* @return Internment * @return Interment
*/ */
protected function loadResult($key) protected function loadResult($key)
{ {
return new Internment($this->result[$key]); return new Interment($this->result[$key]);
} }
} }

View File

@ -5,22 +5,22 @@
* @author Cliff Ingham <inghamn@bloomington.in.gov> * @author Cliff Ingham <inghamn@bloomington.in.gov>
*/ */
if (!userIsAllowed('Internments')) { if (!userIsAllowed('Interments')) {
$_SESSION['errorMessages'][] = new Exception('noAccessAllowed'); $_SESSION['errorMessages'][] = new Exception('noAccessAllowed');
header('Location: '.BASE_URL.'/internments'); header('Location: '.BASE_URL.'/interments');
exit(); exit();
} }
if (isset($_POST['internment'])) { if (isset($_POST['interment'])) {
$internment = new Internment(); $interment = new Interment();
foreach ($_POST['internment'] as $field=>$value) { foreach ($_POST['interment'] as $field=>$value) {
$set = 'set'.ucfirst($field); $set = 'set'.ucfirst($field);
$internment->$set($value); $interment->$set($value);
} }
try { try {
$internment->save(); $interment->save();
header('Location: '.BASE_URL.'/internments'); header('Location: '.BASE_URL.'/interments');
exit(); exit();
} }
catch(Exception $e) { catch(Exception $e) {
@ -29,5 +29,5 @@ if (isset($_POST['internment'])) {
} }
$template = new Template(); $template = new Template();
$template->blocks[] = new Block('internments/addInternmentForm.inc'); $template->blocks[] = new Block('interments/addIntermentForm.inc');
echo $template->render(); echo $template->render();

View File

@ -29,14 +29,14 @@ foreach ($_GET as $field=>$value) {
} }
if (count($search)) { if (count($search)) {
$internmentList = new InternmentList($search,20,$currentPage); $intermentList = new IntermentList($search,20,$currentPage);
} }
$template = new Template(); $template = new Template();
$template->blocks[] = new Block('internments/findForm.inc'); $template->blocks[] = new Block('interments/findForm.inc');
if (isset($internmentList)) { if (isset($intermentList)) {
$template->blocks[] = new Block('internments/internmentList.inc', $template->blocks[] = new Block('interments/intermentList.inc',
array('internmentList'=>$internmentList)); array('intermentList'=>$intermentList));
} }
echo $template->render(); echo $template->render();

View File

@ -4,22 +4,22 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* @author Cliff Ingham <inghamn@bloomington.in.gov> * @author Cliff Ingham <inghamn@bloomington.in.gov>
*/ */
if (!userIsAllowed('Internments')) { if (!userIsAllowed('Interments')) {
$_SESSION['errorMessages'][] = new Exception('noAccessAllowed'); $_SESSION['errorMessages'][] = new Exception('noAccessAllowed');
header('Location: '.BASE_URL.'/internments'); header('Location: '.BASE_URL.'/interments');
exit(); exit();
} }
$internment = new Internment($_REQUEST['internment_id']); $interment = new Interment($_REQUEST['interment_id']);
if (isset($_POST['internment'])) { if (isset($_POST['interment'])) {
foreach ($_POST['internment'] as $field=>$value) { foreach ($_POST['interment'] as $field=>$value) {
$set = 'set'.ucfirst($field); $set = 'set'.ucfirst($field);
$internment->$set($value); $interment->$set($value);
} }
try { try {
$internment->save(); $interment->save();
header('Location: '.BASE_URL.'/internments'); header('Location: '.BASE_URL.'/interments');
exit(); exit();
} }
catch (Exception $e) { catch (Exception $e) {
@ -28,5 +28,5 @@ if (isset($_POST['internment'])) {
} }
$template = new Template(); $template = new Template();
$template->blocks[] = new Block('internments/updateInternmentForm.inc',array('internment'=>$internment)); $template->blocks[] = new Block('interments/updateIntermentForm.inc',array('interment'=>$interment));
echo $template->render(); echo $template->render();

View File

@ -1,5 +1,5 @@
<div class="menuBar"> <div class="menuBar">
<ul><li><a href="<?php echo BASE_URL; ?>/internments">Internments</a></li> <ul><li><a href="<?php echo BASE_URL; ?>/interments">Interments</a></li>
<?php <?php
if (userIsAllowed('Cemeteries')) { if (userIsAllowed('Cemeteries')) {
echo "<li><a href=\"".BASE_URL."/cemeteries\">Cemeteries</a></li>"; echo "<li><a href=\"".BASE_URL."/cemeteries\">Cemeteries</a></li>";