Added more lock functionality, and fixed a couple bugs

git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@1039 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
Abijah
2014-03-03 06:04:00 +00:00
parent e08afdd8b1
commit ec0363325c
8 changed files with 58 additions and 12 deletions

View File

@@ -2,11 +2,13 @@
// Define the table columns
$cols = array();
$cols['Name'] = array('index' => 'name', 'formatter' => 'longname');
$cols['Quantity'] = array('index' => 'qty', 'formatter' => 'number');
$cols['Key'] = array('index' => 'key', 'formatter' => 'shortname');
$cols['Last Key'] = array('index' => 'last_key', 'formatter' => 'shortname');
$cols['Name'] = array('index' => 'name', 'formatter' => 'name');
$cols['Comment'] = array('index' => 'comment', 'formatter' => 'comment');
$cols['Key'] = array('index' => 'key', 'formatter' => 'number');
$cols['Last Key'] = array('index' => 'last_key', 'formatter' => 'number');
$cols['Quantity'] = array('index' => 'qty', 'formatter' => 'number');
$cols['In Use'] = array('index' => 'inuse', 'formatter' => 'number');
$cols['Available']= array('index' => 'avail', 'formatter' => 'number');
// Render the grid
$grid
@@ -15,4 +17,4 @@ $grid
->defaultFields(array('Name'))
->searchFields(array('Name'))
->render($this, isset($config) ? $config : null,
array_diff(array_keys($cols), array('Comment')));
array_diff(array_keys($cols), array('Last Key')));

View File

@@ -36,8 +36,23 @@ echo $this->element('table',
echo '<div CLASS="detail supporting">' . "\n";
/**********************************************************************
* Unit Entries
*/
echo $this->element('units', array
(// Grid configuration
'config' => array
('caption' => "Units locked by " . $lock['name'],
'filter' => array('Lock.id' => $lock['id']),
'include' => array('Comment'),
'exclude' => array('Size', 'Area', 'Rent'),
)));
/* End "detail supporting" div */
echo '</div>' . "\n";
/* End page div */
echo '</div>' . "\n";

View File

@@ -68,7 +68,7 @@ echo '<div CLASS="detail supporting">' . "\n";
/**********************************************************************
* Ledger Entries
* Unit Entries
*/
echo $this->element('units', array

View File

@@ -135,8 +135,3 @@ echo $form->submit('Cancel', array('name' => 'cancel')) . "\n";
echo $form->end() . "\n";
echo '</div>' . "\n";
echo "\n<PRE>\n";
echo print_r($this->data, true);
echo print_r($this->varstore, true);
echo "\n</PRE>\n";

View File

@@ -13,12 +13,25 @@ $leases = $unit['Lease'];
$current_lease = $unit['CurrentLease'];
$unit_size = $unit['UnitSize'];
if (isset($unit['Lock']))
$locks = $unit['Lock'];
if (isset($unit['Unit']))
$unit = $unit['Unit'];
$rows = array();
$rows[] = array('Name', $unit['name']);
$rows[] = array('Status', $unit['status']);
if (count($locks) > 0) {
$links = array();
foreach ($locks AS $lock) {
$links[] = $html->link($lock['name'],
array('controller' => 'locks',
'action' => 'view',
$lock['id']));
}
$rows[] = array('Locks', count($locks) . ": " . implode(", ", $links));
}
$rows[] = array('Size', $html->link($unit_size['name'],
array('controller' => 'unit_sizes',
'action' => 'view',