Fix erole always showing some roles, never showing project only, by checking for read-only, and fix copy/paste error

This commit is contained in:
Nathan Gray 2013-11-06 21:03:33 +00:00
parent f8026cf624
commit c21dcc5e4a

View File

@ -46,19 +46,21 @@ class etemplate_widget_projectmanager extends etemplate_widget_transformer
if ($this->type)
{
$pm_widget = new projectmanager_widget();
// Go direct to get full erole list
$eroles = new projectmanager_eroles_bo();
foreach((array)$eroles->search(array(),false,'role_title ASC','','',false,'AND',false,array('pm_id'=>array(0,$this->pm_id))) as $erole)
if($this->is_readonly($cname, $form_name))
{
self::$request->sel_options[$form_name][$erole['role_id']] = array(
'label' => $erole['role_description'],
'title' => lang('Element role title').': '.$erole['role_title'].$eroles->get_info($erole['role_id']),
);
// Go direct to get full erole list
$eroles = new projectmanager_eroles_bo();
foreach((array)$eroles->search(array(),false,'role_title ASC','','',false,'AND',false,array('pm_id'=>array(0,$eroles->pm_id))) as $erole)
{
self::$request->sel_options[$form_name][$erole['role_id']] = array(
'label' => $erole['role_description'],
'title' => lang('Element role title').': '.$erole['role_title'].$eroles->get_info($erole['role_id']),
);
}
}
$cell = $this->attrs;
$cell['type']=$this->type;
$cell['readonly'] = false; // Send not read-only to get full list
$cell['readonly'] = false;
$pm_widget->pre_process($form_name, self::get_array(self::$request->content, $form_name),
$cell,
$garbage,