From f2e9d8de0d3f331bee78491cdcb86cad83c2e7e6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 11 May 2013 08:36:44 +0000 Subject: [PATCH] removed not (longer) used bocategories object --- preferences/inc/class.bocategories.inc.php | 155 --------------------- 1 file changed, 155 deletions(-) delete mode 100644 preferences/inc/class.bocategories.inc.php diff --git a/preferences/inc/class.bocategories.inc.php b/preferences/inc/class.bocategories.inc.php deleted file mode 100644 index 7b3ee30344..0000000000 --- a/preferences/inc/class.bocategories.inc.php +++ /dev/null @@ -1,155 +0,0 @@ -cats =& CreateObject('phpgwapi.categories','',$cats_app); - - $this->read_sessiondata($cats_app); - - $start = $_POST['start'] ? $_POST['start'] : $_GET['start']; - $query = $_POST['query'] ? $_POST['query'] : $_GET['query']; - $sort = $_POST['sort'] ? $_POST['sort'] : $_GET['sort']; - $order = $_POST['order'] ? $_POST['order'] : $_GET['order']; - - if(!empty($start) || $start == '0' || $start == 0) - { - $this->start = $start; - } - if((empty($query) && !empty($this->query)) || !empty($query)) - { - $this->query = $query; - } - - if(isset($sort) && !empty($sort)) - { - $this->sort = $sort; - } - if(isset($order) && !empty($order)) - { - $this->order = $order; - } - } - - function save_sessiondata($data, $cats_app) - { - $GLOBALS['egw']->session->appsession($cats_app . '_cats','preferences',$data); - } - - function read_sessiondata($cats_app) - { - $data = $GLOBALS['egw']->session->appsession($cats_app . '_cats','preferences'); - - $this->start = $data['start']; - $this->query = $data['query']; - $this->sort = $data['sort']; - $this->order = $data['order']; - $this->referer = $data['referer']; - } - - function get_list($global_cats) - { - return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,$global_cats); - } - - function save_cat($values) - { - if ($values['access']) - { - $values['access'] = 'private'; - } - else - { - $values['access'] = 'public'; - } - - if ($values['id'] && $values['id'] != 0) - { - return $this->cats->edit($values); - } - else - { - return $this->cats->add($values); - } - } - - function exists($data) - { - $data['type'] = $data['type'] ? $data['type'] : ''; - $data['cat_id'] = $data['cat_id'] ? $data['cat_id'] : ''; - return $this->cats->exists($data['type'],$data['cat_name'],$data['type'] == 'subs' ? 0 : $data['cat_id'],$data['type'] != 'subs' ? 0 : $data['cat_id']); - } - - function formatted_list($format,$type,$cat_parent,$global_cats) - { - return $this->cats->formatted_list($format,$type,$cat_parent,$global_cats); - } - - function delete($cat_id,$subs) - { - return $this->cats->delete($cat_id,$subs,!$subs); // either delete the subs or modify them - } - - function check_values($values) - { - if (strlen($values['descr']) >= 255) - { - $error[] = lang('Description can not exceed 255 characters in length !'); - } - - if (!$values['name']) - { - $error[] = lang('Please enter a name'); - } - else - { - if (!$values['parent']) - { - $exists = $this->exists(array - ( - 'type' => 'appandmains', - 'cat_name' => $values['name'], - 'cat_id' => $values['id'] - )); - } - else - { - $exists = $this->exists(array - ( - 'type' => 'appandsubs', - 'cat_name' => $values['name'], - 'cat_id' => $values['id'] - )); - } - - if ($exists == True) - { - $error[] = lang('This name has been used already'); - } - } - - if (is_array($error)) - { - return $error; - } - } - }