From: hickert Date: Tue, 7 Sep 2010 09:53:39 +0000 (+0000) Subject: added extra remove buttons for each action/condition X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d1c75158bfa155e30795d453a21449750c5883de;p=gosa.git added extra remove buttons for each action/condition git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19544 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc index 54f91d56d..e561b8d1a 100644 --- a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc +++ b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc @@ -106,15 +106,15 @@ class filterEditor extends plugin if(!in_array($cond['COMPARATOR'], array('is in addressbook','is not in addressbook','is empty','is not empty'))){ $str .= ""; } + if(count($filter['CONDITIONS']) >= 2){ + $str .= " "; + } $cnt --; $str .= ""; # if($cnt) $str .= $this->types[$filter['TYPE']]; } $str .= ""; $str .= " "; - if(count($filter['CONDITIONS']) >= 2){ - $str .= " "; - } $str .= "
"; $str .= "

"._("Filter actions")."

"; @@ -131,14 +131,14 @@ class filterEditor extends plugin if(!in_array($action['ACTION'], array('DROP'))){ $str .= ""; } + + if(count($filter['ACTION']) >= 2){ + $str .= ""; + } $str .= ""; } $str.= ""; - $str .= " "; - if(count($filter['ACTION']) >= 2){ - $str .= " "; - } return($str); } @@ -161,6 +161,9 @@ class filterEditor extends plugin $this->filter['CONDITIONS'][$id][$name] = get_post($post.$id); } } + if(isset($_POST['removeCondition_'.$id]) && count($this->filter['CONDITIONS']) >= 2){ + unset($this->filter['CONDITIONS'][$id]); + } } // Get Action modifications @@ -170,24 +173,21 @@ class filterEditor extends plugin $this->filter['ACTION'][$id][$name] = get_post($post.$id); } } + if(isset($_POST['removeAction_'.$id]) && count($this->filter['ACTION']) >= 2){ + unset($this->filter['ACTION'][$id]); + } } // Get NAME and DESC if posted if(isset($_POST['NAME'])) $this->filter['NAME'] = get_post('NAME'); if(isset($_POST['DESC'])) $this->filter['DESC'] = get_post('DESC'); - // Add / remove conditions - if(isset($_POST['removeCondition']) && count($this->filter['CONDITIONS']) >= 2){ - array_pop($this->filter['CONDITIONS']); - } + // Add conditions if(isset($_POST['addCondition'])){ $this->filter['CONDITIONS'][] = array('FIELD' => key($this->fields),'COMPARATOR' => key($this->comparators), 'MATCH' => ''); } - // Add / remove actions - if(isset($_POST['removeAction']) && count($this->filter['ACTION']) >= 2){ - array_pop($this->filter['ACTION']); - } + // Add actions if(isset($_POST['addAction'])){ $this->filter['ACTION'][] = array('ACTION' => 'MOVE', 'VALUE' => ''); }