From b8fa0246803dab40cf57d40b45984c53046f2d55 Mon Sep 17 00:00:00 2001 From: "Dzial Techniczny WMW Projekt s.c" Date: Tue, 10 Dec 2019 11:34:53 +0100 Subject: Plugins directory and local modifications --- .../Controller/AdvancedSearchController.php | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 plugins/KanboardSearchPlugin/Controller/AdvancedSearchController.php (limited to 'plugins/KanboardSearchPlugin/Controller/AdvancedSearchController.php') diff --git a/plugins/KanboardSearchPlugin/Controller/AdvancedSearchController.php b/plugins/KanboardSearchPlugin/Controller/AdvancedSearchController.php new file mode 100644 index 00000000..73930fec --- /dev/null +++ b/plugins/KanboardSearchPlugin/Controller/AdvancedSearchController.php @@ -0,0 +1,54 @@ +response->html($this->helper->layout->config('KanboardSearchPlugin:config/advanced-search-filter', array( + 'db_size' => $this->configModel->getDatabaseSize(), + 'db_version' => $this->db->getDriver()->getDatabaseVersion(), + 'user_agent' => $this->request->getServerVariable('HTTP_USER_AGENT'), + 'title' => t('Settings').' > '.t('Advanced Search Filter'), + ))); + } + + /** + * Save settings + * + */ + public function save() + { + $values = $this->request->getValues(); + $redirect = $this->request->getStringParam('redirect', 'index'); + switch ($redirect) { + case 'index': + $values += array( + 'comment_search' => 0, + 'title_search' => 0, + 'description_search' => 0, + 'subtask_search' => 0, + 'attachment_search' => 0 + ); + break; + } + + if ($this->configModel->save($values)) { + $this->languageModel->loadCurrentLanguage(); + $this->flash->success(t('Settings saved successfully.')); + } else { + $this->flash->failure(t('Unable to save your settings.')); + } + $this->response->redirect($this->helper->url->to('AdvancedSearchController', 'index', array('plugin' => 'KanboardSearchPlugin'))); + } +} -- cgit v1.2.3