Minor fixes for VOLUMEs and NODE

This commit is contained in:
Deon George 2013-01-07 15:37:10 +11:00
parent e7e3e42ba2
commit c4409598be
2 changed files with 9 additions and 2 deletions

View File

@ -30,7 +30,14 @@ abstract class Controller_TemplateDefault_View extends Controller_TemplateDefaul
$select[NULL] = '';
foreach ($o->find_all() as $oo)
$select[$oo->pk()] = $oo->pk();
// For some tables, are ID is base_64 encoded.
switch ($this->orm) {
case 'VOLUME': $select[base64_encode($oo->pk())] = $oo->pk();
break;
default:
$select[$oo->pk()] = $oo->pk();
}
$output .= Form::open(sprintf('%s/detail',strtolower($this->request->controller())),array('id'=>'object_detail'));
$output .= sprintf('%s: %s',_('Choose to view'),Form::select('object_name',$select,NULL,array('id'=>'object_name')));

View File

@ -512,7 +512,7 @@ class Model_NODE extends ORM_TSM {
}
public function file_mediaprotection() {
return (int)$this->file_byptype('COPY')/(int)$this->file_byptype('PRIMARY');
return number_format((int)$this->file_byptype('COPY')/(int)$this->file_byptype('PRIMARY')*100,2);
}
public function fs() {