Skip to content
Snippets Groups Projects
Commit 4797bd6d authored by aydreeihn's avatar aydreeihn
Browse files

code cleanup

parent e8acb6f1
No related branches found
No related tags found
No related merge requests found
...@@ -548,8 +548,7 @@ implements TemplateVariable { ...@@ -548,8 +548,7 @@ implements TemplateVariable {
$query->order_by('name') $query->order_by('name')
->values('id', 'pid', 'flags', 'name', 'parent'); ->values('id', 'pid', 'flags', 'name', 'parent');
foreach ($query as $row) foreach ($query as $row) {
{
$display = ($row['flags'] & self::FLAG_ACTIVE); $display = ($row['flags'] & self::FLAG_ACTIVE);
$depts[$row['id']] = array('id' => $row['id'], 'pid'=>$row['pid'], 'name'=>$row['name'], $depts[$row['id']] = array('id' => $row['id'], 'pid'=>$row['pid'], 'name'=>$row['name'],
......
...@@ -457,8 +457,7 @@ class Filter { ...@@ -457,8 +457,7 @@ class Filter {
} }
function save($id,$vars,&$errors) { function save($id,$vars,&$errors) {
if ($this) if ($this) {
{
foreach ($this->getActions() as $A) { foreach ($this->getActions() as $A) {
if ($A->type == 'dept') if ($A->type == 'dept')
$dept = Dept::lookup($A->parseConfiguration($vars)['dept_id']); $dept = Dept::lookup($A->parseConfiguration($vars)['dept_id']);
......
...@@ -240,8 +240,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -240,8 +240,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
if ($filter) { foreach ($filter->getActions() as $A) { if ($filter) { foreach ($filter->getActions() as $A) {
$_warn = ''; $_warn = '';
$existing[] = $A->type; $existing[] = $A->type;
if($A->type == 'dept') if($A->type == 'dept') {
{
$errors['topic_id'] = ''; $errors['topic_id'] = '';
// $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); // $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
$dept_config = $A->parseConfiguration($_POST); $dept_config = $A->parseConfiguration($_POST);
...@@ -249,8 +248,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info); ...@@ -249,8 +248,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
if($dept && !$dept->isActive()) if($dept && !$dept->isActive())
$_warn = sprintf(__('%s must be active'), __('Department')); $_warn = sprintf(__('%s must be active'), __('Department'));
} }
elseif($A->type == 'topic') elseif($A->type == 'topic') {
{
$errors['dept_id'] = ''; $errors['dept_id'] = '';
$topic_config = $A->parseConfiguration($_POST); $topic_config = $A->parseConfiguration($_POST);
$topic = Topic::lookup($topic_config['topic_id']); $topic = Topic::lookup($topic_config['topic_id']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment