Added volume reporting, improved overall configuration view

This commit is contained in:
Deon George
2012-11-30 13:03:26 +11:00
parent 4b51fc2727
commit d0095bb159
12 changed files with 217 additions and 248 deletions

View File

@@ -10,63 +10,9 @@
* @copyright (c) 2010 phpTSMadmin Development Team
* @license http://phptsmadmin.sf.net/license.html
*/
class Controller_Stgpool extends Controller_TemplateDefault {
/**
* Default Index for Controller
*/
public function action_index() {
$so = ORM::factory('STGPOOL');
$output = '';
$output .= sprintf(_('This server has <b>%s</b> stgpool pools.'),$so->count_all());
$output .= '<br/>';
$output .= '<br/>';
$select = array();
$select[NULL] = '';
foreach ($so->find_all() as $stgpool)
$select[$stgpool->STGPOOL_NAME] = $stgpool->STGPOOL_NAME;
$output .= Form::open('/stgpool/detail',array('id'=>'stgpool_detail'));
$output .= sprintf('%s: %s',_('Choose a storage pool to view'),Form::select('stgpool_name',$select,NULL,array('id'=>'stgpool_name')));
$output .= Form::submit('form_submit',_('Go'));
$output .= Form::close();
Block::add(array(
'title'=>_('TSM Storage Pools'),
'body'=>$output,
));
}
public function action_detail() {
$stgpool = $this->request->param('id');
if (is_null($stgpool) AND (empty($_POST['stgpool_name']) OR ! $stgpool = $_POST['stgpool_name'])) {
SystemMessage::add(array(
'title'=>_('STGPOOL_NAME is required'),
'type'=>'error',
'body'=>_('The stgpool pool name is required.'),
));
HTTP::redirect('stgpool');
}
$so = ORM::factory('STGPOOL',$stgpool);
if (! $so->loaded()) {
SystemMessage::add(array(
'title'=>_('Unknown STGPOOL_NAME'),
'type'=>'error',
'body'=>sprintf(_('The stgpool pool [%s] does not exist?.'),$stgpool),
));
HTTP::redirect('stgpool');
}
Block::add(array(
'title'=>sprintf(_('Storage Pool Information for %s'),$so->STGPOOL_NAME),
'body'=>View::factory('stgpool/detail')->set('o',$so)
));
}
class Controller_Stgpool extends Controller_TemplateDefault_View {
protected $index_title = 'TSM Storage Pools';
protected $detail_title = 'Information on Storage Pool';
protected $orm = 'STGPOOL';
}
?>