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

@@ -11,7 +11,7 @@
*/
class Model_LIBVOLUME extends ORMTSM {
protected $_table_name = 'LIBVOLUMES';
protected $_primary_key = 'VOLUME_NAME';
protected $_primary_key = 'HOME_ELEMENT';
protected $_sorting = array(
'VOLUME_NAME'=>'ASC',
);
@@ -32,16 +32,19 @@ class Model_LIBVOLUME extends ORMTSM {
case 'data':
return strtolower($this->LAST_USE);
default: return 'unknown';
default: return ($this->VOLUME->STATUS == 'EMPTY') ? 'empty' : 'unknown';
}
default: return 'notcheckedin';
}
}
public function volusage() {
switch ($this->usage()) {
case 'scratch': return _('Scratch');
case 'data':
case 'empty': return $this->VOLUME->STGPOOL_NAME;
case 'dbbackup': return $this->VOLHISTORY->lastuse()->TYPE;
case 'data': return $this->VOLUME->STGPOOL_NAME;
case 'notcheckedin': return _('Not Checked In');
case 'scratch': return _('Scratch');
default: return _('Unknown');
}
@@ -51,27 +54,26 @@ class Model_LIBVOLUME extends ORMTSM {
switch ($this->usage()) {
case 'data': return sprintf('%s/%s',$this->VOLUME->display('STATUS'),$this->VOLUME->display('ACCESS'));
case 'dbbackup': return $this->VOLHISTORY->lastuse()->backupid();
case 'empty': return _('Empty');
default: return '';
}
}
public function access() {
switch ($this->usage()) {
case 'data':
case 'dbbackup':
return sprintf('%s/%s',$this->display('STATUS'),$this->display('OWNER'));
default: return '';
}
if ($this->usage() == 'scratch')
return '';
elseif ($this->STATUS)
return sprintf('%s/%s',$this->display('STATUS'),$this->display('OWNER'));
else
return '';
}
public function lastwrite() {
switch ($this->usage()) {
case 'data':
return $this->VOLUME->display('LAST_WRITE_DATE');
case 'dbbackup':
return $this->VOLHISTORY->lastuse()->display('DATE_TIME');
case 'empty': return $this->VOLUME->display('LAST_WRITE_DATE');
case 'dbbackup': return $this->VOLHISTORY->lastuse()->display('DATE_TIME');
default: return '';
}