First pass at implementing a new lock tracking mechnism. Not complete, but the basics seem to work
git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@1038 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
48
site/views/locks/edit.ctp
Normal file
48
site/views/locks/edit.ctp
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
//pr($this->data);
|
||||
?>
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
|
||||
// Reset the form
|
||||
function newKey(dig) {
|
||||
$('#LockKey').val(("000000000" + Math.floor(Math.random()*(Math.pow(10,dig)))) . slice(-1*dig));
|
||||
}
|
||||
|
||||
--></script>
|
||||
|
||||
<?php
|
||||
; // alignment
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Lock Edit
|
||||
*/
|
||||
|
||||
echo '<div class="lock edit">' . "\n";
|
||||
|
||||
echo $form->create('Lock', array('action' => 'edit')) . "\n";
|
||||
echo $form->input('id') . "\n";
|
||||
|
||||
echo($this->element
|
||||
('form_table',
|
||||
array('class' => 'item lock detail',
|
||||
'caption' => isset($this->data['Lock']) ? 'Edit Lock' : 'New Lock',
|
||||
'fields' => array
|
||||
('name' => array('label_attributes' => array('class' => 'empty'),
|
||||
'after' => ("Name of the Lock Set")),
|
||||
'key' => array('label_attributes' => array('class' => 'empty'),
|
||||
'after' => ('(<A HREF="#" ONCLICK="newKey(4); return false;">New</A>) Key Code / Combination')),
|
||||
'qty' => array('label_attributes' => array('class' => 'empty'),
|
||||
'after' => ("Quantity")),
|
||||
'comment' => array('label_attributes' => array('class' => 'optional empty'),
|
||||
'after' => 'Optional: Comments about this lock set.'),
|
||||
))) . "\n");
|
||||
|
||||
echo $form->submit(isset($this->data['Lock']) ? 'Update' : 'Add New Lock') . "\n";
|
||||
echo $form->submit('Cancel', array('name' => 'cancel')) . "\n";
|
||||
echo $form->end() . "\n";
|
||||
echo '</div>' . "\n";
|
||||
43
site/views/locks/view.ctp
Normal file
43
site/views/locks/view.ctp
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php /* -*- mode:PHP -*- */
|
||||
|
||||
echo '<div class="lock view">' . "\n";
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Lock Detail Main Section
|
||||
*/
|
||||
|
||||
$lock = $lock['Lock'];
|
||||
|
||||
$rows = array();
|
||||
$rows[] = array('Name', $lock['name']);
|
||||
$rows[] = array('Quantity', $lock['qty']);
|
||||
$rows[] = array('Key', $lock['key']);
|
||||
if (!empty($lock['last_key']))
|
||||
$rows[] = array('Last Key', $lock['last_key']);
|
||||
$rows[] = array('Comment', $lock['comment']);
|
||||
|
||||
echo $this->element('table',
|
||||
array('class' => 'item lock detail',
|
||||
'caption' => 'Lock Information',
|
||||
'rows' => $rows,
|
||||
'column_class' => array('field', 'value')));
|
||||
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
* Supporting Elements Section
|
||||
*/
|
||||
|
||||
echo '<div CLASS="detail supporting">' . "\n";
|
||||
|
||||
/* End "detail supporting" div */
|
||||
echo '</div>' . "\n";
|
||||
|
||||
/* End page div */
|
||||
echo '</div>' . "\n";
|
||||
Reference in New Issue
Block a user