More library display enhancements

This commit is contained in:
Deon George
2011-06-26 22:20:12 +10:00
parent 214bc39648
commit 9cfd1dc3df
11 changed files with 313 additions and 28 deletions

View File

@@ -22,5 +22,23 @@ class Model_STGPOOL extends ORMTSM {
protected $_has_many = array(
'VOLUME'=>array('foreign_key'=>'STGPOOL_NAME','far_key'=>'STGPOOL_NAME'),
);
// Return a list of volumes
// @param $inout IN|OUT of the library
// @param $status volume status FULL|FILLING|PENDING|EMPTY
public function libvolstype($inout,$status) {
$inout = strtolower($inout);
$status = strtoupper($status);
$result = array();
if (! isset($result[$inout]))
foreach ($this->VOLUME->find_all() as $vo) {
$state = ($vo->MEDIA->STATE == 'MOUNTABLEINLIB') ? 'in' : 'out';
$result[$state][$vo->STATUS][] = $vo;
}
return isset($result[$inout][$status]) ? $result[$inout][$status] : array();
}
}
?>