From ab48a09f0d674b703467975b376c5ac7352670ae Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 28 May 2016 11:31:54 -0400 Subject: Rename controllers --- app/Controller/AvatarFile.php | 94 ------------ app/Controller/AvatarFileController.php | 94 ++++++++++++ app/Controller/Captcha.php | 29 ---- app/Controller/CaptchaController.php | 29 ++++ app/Controller/Config.php | 198 ------------------------- app/Controller/ConfigController.php | 198 +++++++++++++++++++++++++ app/Controller/Currency.php | 71 --------- app/Controller/CurrencyController.php | 71 +++++++++ app/Controller/Doc.php | 92 ------------ app/Controller/DocumentationController.php | 92 ++++++++++++ app/Controller/Feed.php | 55 ------- app/Controller/FeedController.php | 55 +++++++ app/Controller/ICalendarController.php | 101 +++++++++++++ app/Controller/Ical.php | 101 ------------- app/Controller/Search.php | 67 --------- app/Controller/SearchController.php | 67 +++++++++ app/Helper/UrlHelper.php | 2 +- app/ServiceProvider/AuthenticationProvider.php | 12 +- app/ServiceProvider/RouteProvider.php | 38 ++--- app/Template/activity/project.php | 6 +- app/Template/auth/index.php | 4 +- app/Template/avatar_file/show.php | 4 +- app/Template/config/about.php | 4 +- app/Template/config/api.php | 4 +- app/Template/config/application.php | 2 +- app/Template/config/board.php | 2 +- app/Template/config/calendar.php | 2 +- app/Template/config/integrations.php | 2 +- app/Template/config/project.php | 2 +- app/Template/config/sidebar.php | 36 ++--- app/Template/config/webhook.php | 4 +- app/Template/currency/index.php | 4 +- app/Template/dashboard/layout.php | 2 +- app/Template/dashboard/show.php | 2 +- app/Template/doc/show.php | 4 +- app/Template/feed/project.php | 4 +- app/Template/feed/user.php | 4 +- app/Template/header.php | 4 +- app/Template/layout.php | 2 +- app/Template/password_reset/create.php | 4 +- app/Template/project_overview/information.php | 4 +- app/Template/project_view/share.php | 4 +- app/Template/project_view/show.php | 4 +- app/Template/search/activity.php | 4 +- app/Template/search/index.php | 4 +- app/Template/user_view/share.php | 4 +- app/Template/user_view/show.php | 4 +- app/Template/user_view/sidebar.php | 2 +- app/User/Avatar/AvatarFileProvider.php | 2 +- 49 files changed, 800 insertions(+), 800 deletions(-) delete mode 100644 app/Controller/AvatarFile.php create mode 100644 app/Controller/AvatarFileController.php delete mode 100644 app/Controller/Captcha.php create mode 100644 app/Controller/CaptchaController.php delete mode 100644 app/Controller/Config.php create mode 100644 app/Controller/ConfigController.php delete mode 100644 app/Controller/Currency.php create mode 100644 app/Controller/CurrencyController.php delete mode 100644 app/Controller/Doc.php create mode 100644 app/Controller/DocumentationController.php delete mode 100644 app/Controller/Feed.php create mode 100644 app/Controller/FeedController.php create mode 100644 app/Controller/ICalendarController.php delete mode 100644 app/Controller/Ical.php delete mode 100644 app/Controller/Search.php create mode 100644 app/Controller/SearchController.php (limited to 'app') diff --git a/app/Controller/AvatarFile.php b/app/Controller/AvatarFile.php deleted file mode 100644 index 1891a2fc..00000000 --- a/app/Controller/AvatarFile.php +++ /dev/null @@ -1,94 +0,0 @@ -getUser(); - - $this->response->html($this->helper->layout->user('avatar_file/show', array( - 'user' => $user, - ))); - } - - /** - * Upload Avatar - */ - public function upload() - { - $user = $this->getUser(); - - if (! $this->avatarFile->uploadImageFile($user['id'], $this->request->getFileInfo('avatar'))) { - $this->flash->failure(t('Unable to upload the file.')); - } - - $this->response->redirect($this->helper->url->to('AvatarFile', 'show', array('user_id' => $user['id']))); - } - - /** - * Remove Avatar image - */ - public function remove() - { - $this->checkCSRFParam(); - $user = $this->getUser(); - $this->avatarFile->remove($user['id']); - $this->userSession->refresh($user['id']); - $this->response->redirect($this->helper->url->to('AvatarFile', 'show', array('user_id' => $user['id']))); - } - - /** - * Show Avatar image (public) - */ - public function image() - { - $user_id = $this->request->getIntegerParam('user_id'); - $size = $this->request->getStringParam('size', 48); - $filename = $this->avatarFile->getFilename($user_id); - $etag = md5($filename.$size); - - $this->response->withCache(365 * 86400, $etag); - $this->response->withContentType('image/jpeg'); - - if ($this->request->getHeader('If-None-Match') !== '"'.$etag.'"') { - $this->response->send(); - $this->render($filename, $size); - } else { - $this->response->status(304); - } - } - - /** - * Render thumbnail from object storage - * - * @access private - * @param string $filename - * @param integer $size - */ - private function render($filename, $size) - { - try { - $blob = $this->objectStorage->get($filename); - - Thumbnail::createFromString($blob) - ->resize($size, $size) - ->toOutput(); - } catch (ObjectStorageException $e) { - $this->logger->error($e->getMessage()); - } - } -} diff --git a/app/Controller/AvatarFileController.php b/app/Controller/AvatarFileController.php new file mode 100644 index 00000000..0e2ed1bb --- /dev/null +++ b/app/Controller/AvatarFileController.php @@ -0,0 +1,94 @@ +getUser(); + + $this->response->html($this->helper->layout->user('avatar_file/show', array( + 'user' => $user, + ))); + } + + /** + * Upload Avatar + */ + public function upload() + { + $user = $this->getUser(); + + if (! $this->avatarFile->uploadImageFile($user['id'], $this->request->getFileInfo('avatar'))) { + $this->flash->failure(t('Unable to upload the file.')); + } + + $this->response->redirect($this->helper->url->to('AvatarFileController', 'show', array('user_id' => $user['id']))); + } + + /** + * Remove Avatar image + */ + public function remove() + { + $this->checkCSRFParam(); + $user = $this->getUser(); + $this->avatarFile->remove($user['id']); + $this->userSession->refresh($user['id']); + $this->response->redirect($this->helper->url->to('AvatarFileController', 'show', array('user_id' => $user['id']))); + } + + /** + * Show Avatar image (public) + */ + public function image() + { + $user_id = $this->request->getIntegerParam('user_id'); + $size = $this->request->getStringParam('size', 48); + $filename = $this->avatarFile->getFilename($user_id); + $etag = md5($filename.$size); + + $this->response->withCache(365 * 86400, $etag); + $this->response->withContentType('image/jpeg'); + + if ($this->request->getHeader('If-None-Match') !== '"'.$etag.'"') { + $this->response->send(); + $this->render($filename, $size); + } else { + $this->response->status(304); + } + } + + /** + * Render thumbnail from object storage + * + * @access private + * @param string $filename + * @param integer $size + */ + private function render($filename, $size) + { + try { + $blob = $this->objectStorage->get($filename); + + Thumbnail::createFromString($blob) + ->resize($size, $size) + ->toOutput(); + } catch (ObjectStorageException $e) { + $this->logger->error($e->getMessage()); + } + } +} diff --git a/app/Controller/Captcha.php b/app/Controller/Captcha.php deleted file mode 100644 index f6c717b3..00000000 --- a/app/Controller/Captcha.php +++ /dev/null @@ -1,29 +0,0 @@ -response->withContentType('image/jpeg')->send(); - - $builder = new CaptchaBuilder; - $builder->build(); - $this->sessionStorage->captcha = $builder->getPhrase(); - $builder->output(); - } -} diff --git a/app/Controller/CaptchaController.php b/app/Controller/CaptchaController.php new file mode 100644 index 00000000..43b2f823 --- /dev/null +++ b/app/Controller/CaptchaController.php @@ -0,0 +1,29 @@ +response->withContentType('image/jpeg')->send(); + + $builder = new CaptchaBuilder; + $builder->build(); + $this->sessionStorage->captcha = $builder->getPhrase(); + $builder->output(); + } +} diff --git a/app/Controller/Config.php b/app/Controller/Config.php deleted file mode 100644 index abf6565c..00000000 --- a/app/Controller/Config.php +++ /dev/null @@ -1,198 +0,0 @@ -response->html($this->helper->layout->config('config/about', array( - 'db_size' => $this->config->getDatabaseSize(), - 'db_version' => $this->db->getDriver()->getDatabaseVersion(), - 'user_agent' => $this->request->getServerVariable('HTTP_USER_AGENT'), - 'title' => t('Settings').' > '.t('About'), - ))); - } - - /** - * Save settings - * - */ - public function save() - { - $values = $this->request->getValues(); - $redirect = $this->request->getStringParam('redirect', 'application'); - - switch ($redirect) { - case 'application': - $values += array('password_reset' => 0); - break; - case 'project': - $values += array( - 'subtask_restriction' => 0, - 'subtask_time_tracking' => 0, - 'cfd_include_closed_tasks' => 0, - 'disable_private_project' => 0, - ); - break; - case 'integrations': - $values += array('integration_gravatar' => 0); - break; - case 'calendar': - $values += array('calendar_user_subtasks_time_tracking' => 0); - break; - } - - if ($this->config->save($values)) { - $this->language->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('config', $redirect)); - } - - /** - * Display the application settings page - * - * @access public - */ - public function application() - { - $this->response->html($this->helper->layout->config('config/application', array( - 'languages' => $this->language->getLanguages(), - 'timezones' => $this->timezone->getTimezones(), - 'date_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateFormats()), - 'datetime_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateTimeFormats()), - 'time_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getTimeFormats()), - 'title' => t('Settings').' > '.t('Application settings'), - ))); - } - - /** - * Display the project settings page - * - * @access public - */ - public function project() - { - $this->response->html($this->helper->layout->config('config/project', array( - 'colors' => $this->color->getList(), - 'default_columns' => implode(', ', $this->board->getDefaultColumns()), - 'title' => t('Settings').' > '.t('Project settings'), - ))); - } - - /** - * Display the board settings page - * - * @access public - */ - public function board() - { - $this->response->html($this->helper->layout->config('config/board', array( - 'title' => t('Settings').' > '.t('Board settings'), - ))); - } - - /** - * Display the calendar settings page - * - * @access public - */ - public function calendar() - { - $this->response->html($this->helper->layout->config('config/calendar', array( - 'title' => t('Settings').' > '.t('Calendar settings'), - ))); - } - - /** - * Display the integration settings page - * - * @access public - */ - public function integrations() - { - $this->response->html($this->helper->layout->config('config/integrations', array( - 'title' => t('Settings').' > '.t('Integrations'), - ))); - } - - /** - * Display the webhook settings page - * - * @access public - */ - public function webhook() - { - $this->response->html($this->helper->layout->config('config/webhook', array( - 'title' => t('Settings').' > '.t('Webhook settings'), - ))); - } - - /** - * Display the api settings page - * - * @access public - */ - public function api() - { - $this->response->html($this->helper->layout->config('config/api', array( - 'title' => t('Settings').' > '.t('API'), - ))); - } - - /** - * Download the Sqlite database - * - * @access public - */ - public function downloadDb() - { - $this->checkCSRFParam(); - $this->response->withFileDownload('db.sqlite.gz'); - $this->response->binary($this->config->downloadDatabase()); - } - - /** - * Optimize the Sqlite database - * - * @access public - */ - public function optimizeDb() - { - $this->checkCSRFParam(); - $this->config->optimizeDatabase(); - $this->flash->success(t('Database optimization done.')); - $this->response->redirect($this->helper->url->to('config', 'index')); - } - - /** - * Regenerate webhook token - * - * @access public - */ - public function token() - { - $type = $this->request->getStringParam('type'); - - $this->checkCSRFParam(); - $this->config->regenerateToken($type.'_token'); - - $this->flash->success(t('Token regenerated.')); - $this->response->redirect($this->helper->url->to('config', $type)); - } -} diff --git a/app/Controller/ConfigController.php b/app/Controller/ConfigController.php new file mode 100644 index 00000000..a5af0246 --- /dev/null +++ b/app/Controller/ConfigController.php @@ -0,0 +1,198 @@ +response->html($this->helper->layout->config('config/about', array( + 'db_size' => $this->config->getDatabaseSize(), + 'db_version' => $this->db->getDriver()->getDatabaseVersion(), + 'user_agent' => $this->request->getServerVariable('HTTP_USER_AGENT'), + 'title' => t('Settings').' > '.t('About'), + ))); + } + + /** + * Save settings + * + */ + public function save() + { + $values = $this->request->getValues(); + $redirect = $this->request->getStringParam('redirect', 'application'); + + switch ($redirect) { + case 'application': + $values += array('password_reset' => 0); + break; + case 'project': + $values += array( + 'subtask_restriction' => 0, + 'subtask_time_tracking' => 0, + 'cfd_include_closed_tasks' => 0, + 'disable_private_project' => 0, + ); + break; + case 'integrations': + $values += array('integration_gravatar' => 0); + break; + case 'calendar': + $values += array('calendar_user_subtasks_time_tracking' => 0); + break; + } + + if ($this->config->save($values)) { + $this->language->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('ConfigController', $redirect)); + } + + /** + * Display the application settings page + * + * @access public + */ + public function application() + { + $this->response->html($this->helper->layout->config('config/application', array( + 'languages' => $this->language->getLanguages(), + 'timezones' => $this->timezone->getTimezones(), + 'date_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateFormats()), + 'datetime_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getDateTimeFormats()), + 'time_formats' => $this->dateParser->getAvailableFormats($this->dateParser->getTimeFormats()), + 'title' => t('Settings').' > '.t('Application settings'), + ))); + } + + /** + * Display the project settings page + * + * @access public + */ + public function project() + { + $this->response->html($this->helper->layout->config('config/project', array( + 'colors' => $this->color->getList(), + 'default_columns' => implode(', ', $this->board->getDefaultColumns()), + 'title' => t('Settings').' > '.t('Project settings'), + ))); + } + + /** + * Display the board settings page + * + * @access public + */ + public function board() + { + $this->response->html($this->helper->layout->config('config/board', array( + 'title' => t('Settings').' > '.t('Board settings'), + ))); + } + + /** + * Display the calendar settings page + * + * @access public + */ + public function calendar() + { + $this->response->html($this->helper->layout->config('config/calendar', array( + 'title' => t('Settings').' > '.t('Calendar settings'), + ))); + } + + /** + * Display the integration settings page + * + * @access public + */ + public function integrations() + { + $this->response->html($this->helper->layout->config('config/integrations', array( + 'title' => t('Settings').' > '.t('Integrations'), + ))); + } + + /** + * Display the webhook settings page + * + * @access public + */ + public function webhook() + { + $this->response->html($this->helper->layout->config('config/webhook', array( + 'title' => t('Settings').' > '.t('Webhook settings'), + ))); + } + + /** + * Display the api settings page + * + * @access public + */ + public function api() + { + $this->response->html($this->helper->layout->config('config/api', array( + 'title' => t('Settings').' > '.t('API'), + ))); + } + + /** + * Download the Sqlite database + * + * @access public + */ + public function downloadDb() + { + $this->checkCSRFParam(); + $this->response->withFileDownload('db.sqlite.gz'); + $this->response->binary($this->config->downloadDatabase()); + } + + /** + * Optimize the Sqlite database + * + * @access public + */ + public function optimizeDb() + { + $this->checkCSRFParam(); + $this->config->optimizeDatabase(); + $this->flash->success(t('Database optimization done.')); + $this->response->redirect($this->helper->url->to('ConfigController', 'index')); + } + + /** + * Regenerate webhook token + * + * @access public + */ + public function token() + { + $type = $this->request->getStringParam('type'); + + $this->checkCSRFParam(); + $this->config->regenerateToken($type.'_token'); + + $this->flash->success(t('Token regenerated.')); + $this->response->redirect($this->helper->url->to('ConfigController', $type)); + } +} diff --git a/app/Controller/Currency.php b/app/Controller/Currency.php deleted file mode 100644 index 872d6929..00000000 --- a/app/Controller/Currency.php +++ /dev/null @@ -1,71 +0,0 @@ -response->html($this->helper->layout->config('currency/index', array( - 'config_values' => array('application_currency' => $this->config->get('application_currency')), - 'values' => $values, - 'errors' => $errors, - 'rates' => $this->currency->getAll(), - 'currencies' => $this->currency->getCurrencies(), - 'title' => t('Settings').' > '.t('Currency rates'), - ))); - } - - /** - * Validate and save a new currency rate - * - * @access public - */ - public function create() - { - $values = $this->request->getValues(); - list($valid, $errors) = $this->currencyValidator->validateCreation($values); - - if ($valid) { - if ($this->currency->create($values['currency'], $values['rate'])) { - $this->flash->success(t('The currency rate have been added successfully.')); - return $this->response->redirect($this->helper->url->to('currency', 'index')); - } else { - $this->flash->failure(t('Unable to add this currency rate.')); - } - } - - return $this->index($values, $errors); - } - - /** - * Save reference currency - * - * @access public - */ - public function reference() - { - $values = $this->request->getValues(); - - if ($this->config->save($values)) { - $this->flash->success(t('Settings saved successfully.')); - } else { - $this->flash->failure(t('Unable to save your settings.')); - } - - $this->response->redirect($this->helper->url->to('currency', 'index')); - } -} diff --git a/app/Controller/CurrencyController.php b/app/Controller/CurrencyController.php new file mode 100644 index 00000000..5a0fac37 --- /dev/null +++ b/app/Controller/CurrencyController.php @@ -0,0 +1,71 @@ +response->html($this->helper->layout->config('currency/index', array( + 'config_values' => array('application_currency' => $this->config->get('application_currency')), + 'values' => $values, + 'errors' => $errors, + 'rates' => $this->currency->getAll(), + 'currencies' => $this->currency->getCurrencies(), + 'title' => t('Settings').' > '.t('Currency rates'), + ))); + } + + /** + * Validate and save a new currency rate + * + * @access public + */ + public function create() + { + $values = $this->request->getValues(); + list($valid, $errors) = $this->currencyValidator->validateCreation($values); + + if ($valid) { + if ($this->currency->create($values['currency'], $values['rate'])) { + $this->flash->success(t('The currency rate have been added successfully.')); + return $this->response->redirect($this->helper->url->to('CurrencyController', 'index')); + } else { + $this->flash->failure(t('Unable to add this currency rate.')); + } + } + + return $this->index($values, $errors); + } + + /** + * Save reference currency + * + * @access public + */ + public function reference() + { + $values = $this->request->getValues(); + + if ($this->config->save($values)) { + $this->flash->success(t('Settings saved successfully.')); + } else { + $this->flash->failure(t('Unable to save your settings.')); + } + + $this->response->redirect($this->helper->url->to('CurrencyController', 'index')); + } +} diff --git a/app/Controller/Doc.php b/app/Controller/Doc.php deleted file mode 100644 index 5caf5f5f..00000000 --- a/app/Controller/Doc.php +++ /dev/null @@ -1,92 +0,0 @@ -request->getStringParam('file', 'index'); - - if (!preg_match('/^[a-z0-9\-]+/', $page)) { - $page = 'index'; - } - - if ($this->language->getCurrentLanguage() === 'fr_FR') { - $filename = __DIR__.'/../../doc/fr/' . $page . '.markdown'; - } else { - $filename = __DIR__ . '/../../doc/' . $page . '.markdown'; - } - - if (!file_exists($filename)) { - $filename = __DIR__.'/../../doc/index.markdown'; - } - - $this->response->html($this->helper->layout->app('doc/show', $this->render($filename))); - } - - /** - * Display keyboard shortcut - */ - public function shortcuts() - { - $this->response->html($this->template->render('config/keyboard_shortcuts')); - } - - /** - * Prepare Markdown file - * - * @access private - * @param string $filename - * @return array - */ - private function render($filename) - { - $data = file_get_contents($filename); - $content = preg_replace_callback('/\((.*.markdown)\)/', array($this, 'replaceMarkdownUrl'), $data); - $content = preg_replace_callback('/\((screenshots.*\.png)\)/', array($this, 'replaceImageUrl'), $content); - - list($title, ) = explode("\n", $data, 2); - - return array( - 'content' => Parsedown::instance()->text($content), - 'title' => $title !== 'Documentation' ? t('Documentation: %s', $title) : $title, - ); - } - - /** - * Regex callback to replace Markdown links - * - * @access public - * @param array $matches - * @return string - */ - public function replaceMarkdownUrl(array $matches) - { - return '('.$this->helper->url->to('doc', 'show', array('file' => str_replace('.markdown', '', $matches[1]))).')'; - } - - /** - * Regex callback to replace image links - * - * @access public - * @param array $matches - * @return string - */ - public function replaceImageUrl(array $matches) - { - if ($this->language->getCurrentLanguage() === 'fr_FR') { - return '('.$this->helper->url->base().'doc/fr/'.$matches[1].')'; - } - - return '('.$this->helper->url->base().'doc/'.$matches[1].')'; - } -} diff --git a/app/Controller/DocumentationController.php b/app/Controller/DocumentationController.php new file mode 100644 index 00000000..379e3dab --- /dev/null +++ b/app/Controller/DocumentationController.php @@ -0,0 +1,92 @@ +request->getStringParam('file', 'index'); + + if (!preg_match('/^[a-z0-9\-]+/', $page)) { + $page = 'index'; + } + + if ($this->language->getCurrentLanguage() === 'fr_FR') { + $filename = __DIR__.'/../../doc/fr/' . $page . '.markdown'; + } else { + $filename = __DIR__ . '/../../doc/' . $page . '.markdown'; + } + + if (!file_exists($filename)) { + $filename = __DIR__.'/../../doc/index.markdown'; + } + + $this->response->html($this->helper->layout->app('doc/show', $this->render($filename))); + } + + /** + * Display keyboard shortcut + */ + public function shortcuts() + { + $this->response->html($this->template->render('config/keyboard_shortcuts')); + } + + /** + * Prepare Markdown file + * + * @access private + * @param string $filename + * @return array + */ + private function render($filename) + { + $data = file_get_contents($filename); + $content = preg_replace_callback('/\((.*.markdown)\)/', array($this, 'replaceMarkdownUrl'), $data); + $content = preg_replace_callback('/\((screenshots.*\.png)\)/', array($this, 'replaceImageUrl'), $content); + + list($title, ) = explode("\n", $data, 2); + + return array( + 'content' => Parsedown::instance()->text($content), + 'title' => $title !== 'Documentation' ? t('Documentation: %s', $title) : $title, + ); + } + + /** + * Regex callback to replace Markdown links + * + * @access public + * @param array $matches + * @return string + */ + public function replaceMarkdownUrl(array $matches) + { + return '('.$this->helper->url->to('DocumentationController', 'show', array('file' => str_replace('.markdown', '', $matches[1]))).')'; + } + + /** + * Regex callback to replace image links + * + * @access public + * @param array $matches + * @return string + */ + public function replaceImageUrl(array $matches) + { + if ($this->language->getCurrentLanguage() === 'fr_FR') { + return '('.$this->helper->url->base().'doc/fr/'.$matches[1].')'; + } + + return '('.$this->helper->url->base().'doc/'.$matches[1].')'; + } +} diff --git a/app/Controller/Feed.php b/app/Controller/Feed.php deleted file mode 100644 index 7554a499..00000000 --- a/app/Controller/Feed.php +++ /dev/null @@ -1,55 +0,0 @@ -request->getStringParam('token'); - $user = $this->user->getByToken($token); - - // Token verification - if (empty($user)) { - throw AccessForbiddenException::getInstance()->withoutLayout(); - } - - $this->response->xml($this->template->render('feed/user', array( - 'events' => $this->helper->projectActivity->getProjectsEvents($this->projectPermission->getActiveProjectIds($user['id'])), - 'user' => $user, - ))); - } - - /** - * RSS feed for a project - * - * @access public - */ - public function project() - { - $token = $this->request->getStringParam('token'); - $project = $this->project->getByToken($token); - - if (empty($project)) { - throw AccessForbiddenException::getInstance()->withoutLayout(); - } - - $this->response->xml($this->template->render('feed/project', array( - 'events' => $this->helper->projectActivity->getProjectEvents($project['id']), - 'project' => $project, - ))); - } -} diff --git a/app/Controller/FeedController.php b/app/Controller/FeedController.php new file mode 100644 index 00000000..e453ecb9 --- /dev/null +++ b/app/Controller/FeedController.php @@ -0,0 +1,55 @@ +request->getStringParam('token'); + $user = $this->user->getByToken($token); + + // Token verification + if (empty($user)) { + throw AccessForbiddenException::getInstance()->withoutLayout(); + } + + $this->response->xml($this->template->render('feed/user', array( + 'events' => $this->helper->projectActivity->getProjectsEvents($this->projectPermission->getActiveProjectIds($user['id'])), + 'user' => $user, + ))); + } + + /** + * RSS feed for a project + * + * @access public + */ + public function project() + { + $token = $this->request->getStringParam('token'); + $project = $this->project->getByToken($token); + + if (empty($project)) { + throw AccessForbiddenException::getInstance()->withoutLayout(); + } + + $this->response->xml($this->template->render('feed/project', array( + 'events' => $this->helper->projectActivity->getProjectEvents($project['id']), + 'project' => $project, + ))); + } +} diff --git a/app/Controller/ICalendarController.php b/app/Controller/ICalendarController.php new file mode 100644 index 00000000..78ea4d67 --- /dev/null +++ b/app/Controller/ICalendarController.php @@ -0,0 +1,101 @@ +request->getStringParam('token'); + $user = $this->user->getByToken($token); + + // Token verification + if (empty($user)) { + throw AccessForbiddenException::getInstance()->withoutLayout(); + } + + // Common filter + $queryBuilder = new QueryBuilder(); + $queryBuilder + ->withQuery($this->taskFinder->getICalQuery()) + ->withFilter(new TaskStatusFilter(TaskModel::STATUS_OPEN)) + ->withFilter(new TaskAssigneeFilter($user['id'])); + + // Calendar properties + $calendar = new iCalendar('Kanboard'); + $calendar->setName($user['name'] ?: $user['username']); + $calendar->setDescription($user['name'] ?: $user['username']); + $calendar->setPublishedTTL('PT1H'); + + $this->renderCalendar($queryBuilder, $calendar); + } + + /** + * Get project iCalendar + * + * @access public + */ + public function project() + { + $token = $this->request->getStringParam('token'); + $project = $this->project->getByToken($token); + + // Token verification + if (empty($project)) { + throw AccessForbiddenException::getInstance()->withoutLayout(); + } + + // Common filter + $queryBuilder = new QueryBuilder(); + $queryBuilder + ->withQuery($this->taskFinder->getICalQuery()) + ->withFilter(new TaskStatusFilter(TaskModel::STATUS_OPEN)) + ->withFilter(new TaskProjectFilter($project['id'])); + + // Calendar properties + $calendar = new iCalendar('Kanboard'); + $calendar->setName($project['name']); + $calendar->setDescription($project['name']); + $calendar->setPublishedTTL('PT1H'); + + $this->renderCalendar($queryBuilder, $calendar); + } + + /** + * Common method to render iCal events + * + * @access private + * @param QueryBuilder $queryBuilder + * @param iCalendar $calendar + */ + private function renderCalendar(QueryBuilder $queryBuilder, iCalendar $calendar) + { + $start = $this->request->getStringParam('start', strtotime('-2 month')); + $end = $this->request->getStringParam('end', strtotime('+6 months')); + + $this->helper->ical->addTaskDateDueEvents($queryBuilder, $calendar, $start, $end); + + $formatter = new TaskICalFormatter($this->container); + $this->response->ical($formatter->setCalendar($calendar)->format()); + } +} diff --git a/app/Controller/Ical.php b/app/Controller/Ical.php deleted file mode 100644 index 091ea5f4..00000000 --- a/app/Controller/Ical.php +++ /dev/null @@ -1,101 +0,0 @@ -request->getStringParam('token'); - $user = $this->user->getByToken($token); - - // Token verification - if (empty($user)) { - throw AccessForbiddenException::getInstance()->withoutLayout(); - } - - // Common filter - $queryBuilder = new QueryBuilder(); - $queryBuilder - ->withQuery($this->taskFinder->getICalQuery()) - ->withFilter(new TaskStatusFilter(TaskModel::STATUS_OPEN)) - ->withFilter(new TaskAssigneeFilter($user['id'])); - - // Calendar properties - $calendar = new iCalendar('Kanboard'); - $calendar->setName($user['name'] ?: $user['username']); - $calendar->setDescription($user['name'] ?: $user['username']); - $calendar->setPublishedTTL('PT1H'); - - $this->renderCalendar($queryBuilder, $calendar); - } - - /** - * Get project iCalendar - * - * @access public - */ - public function project() - { - $token = $this->request->getStringParam('token'); - $project = $this->project->getByToken($token); - - // Token verification - if (empty($project)) { - throw AccessForbiddenException::getInstance()->withoutLayout(); - } - - // Common filter - $queryBuilder = new QueryBuilder(); - $queryBuilder - ->withQuery($this->taskFinder->getICalQuery()) - ->withFilter(new TaskStatusFilter(TaskModel::STATUS_OPEN)) - ->withFilter(new TaskProjectFilter($project['id'])); - - // Calendar properties - $calendar = new iCalendar('Kanboard'); - $calendar->setName($project['name']); - $calendar->setDescription($project['name']); - $calendar->setPublishedTTL('PT1H'); - - $this->renderCalendar($queryBuilder, $calendar); - } - - /** - * Common method to render iCal events - * - * @access private - * @param QueryBuilder $queryBuilder - * @param iCalendar $calendar - */ - private function renderCalendar(QueryBuilder $queryBuilder, iCalendar $calendar) - { - $start = $this->request->getStringParam('start', strtotime('-2 month')); - $end = $this->request->getStringParam('end', strtotime('+6 months')); - - $this->helper->ical->addTaskDateDueEvents($queryBuilder, $calendar, $start, $end); - - $formatter = new TaskICalFormatter($this->container); - $this->response->ical($formatter->setCalendar($calendar)->format()); - } -} diff --git a/app/Controller/Search.php b/app/Controller/Search.php deleted file mode 100644 index a092cba6..00000000 --- a/app/Controller/Search.php +++ /dev/null @@ -1,67 +0,0 @@ -projectUserRole->getProjectsByUser($this->userSession->getId()); - $search = urldecode($this->request->getStringParam('search')); - $nb_tasks = 0; - - $paginator = $this->paginator - ->setUrl('search', 'index', array('search' => $search)) - ->setMax(30) - ->setOrder('tasks.id') - ->setDirection('DESC'); - - if ($search !== '' && ! empty($projects)) { - $paginator - ->setQuery($this->taskLexer - ->build($search) - ->withFilter(new TaskProjectsFilter(array_keys($projects))) - ->getQuery() - ) - ->calculate(); - - $nb_tasks = $paginator->getTotal(); - } - - $this->response->html($this->helper->layout->app('search/index', array( - 'values' => array( - 'search' => $search, - 'controller' => 'search', - 'action' => 'index', - ), - 'paginator' => $paginator, - 'title' => t('Search tasks').($nb_tasks > 0 ? ' ('.$nb_tasks.')' : '') - ))); - } - - public function activity() - { - $search = urldecode($this->request->getStringParam('search')); - $events = $this->helper->projectActivity->searchEvents($search); - $nb_events = count($events); - - $this->response->html($this->helper->layout->app('search/activity', array( - 'values' => array( - 'search' => $search, - 'controller' => 'search', - 'action' => 'activity', - ), - 'title' => t('Search in activity stream').($nb_events > 0 ? ' ('.$nb_events.')' : ''), - 'nb_events' => $nb_events, - 'events' => $events, - ))); - } -} diff --git a/app/Controller/SearchController.php b/app/Controller/SearchController.php new file mode 100644 index 00000000..88718cf7 --- /dev/null +++ b/app/Controller/SearchController.php @@ -0,0 +1,67 @@ +projectUserRole->getProjectsByUser($this->userSession->getId()); + $search = urldecode($this->request->getStringParam('search')); + $nb_tasks = 0; + + $paginator = $this->paginator + ->setUrl('SearchController', 'index', array('search' => $search)) + ->setMax(30) + ->setOrder('tasks.id') + ->setDirection('DESC'); + + if ($search !== '' && ! empty($projects)) { + $paginator + ->setQuery($this->taskLexer + ->build($search) + ->withFilter(new TaskProjectsFilter(array_keys($projects))) + ->getQuery() + ) + ->calculate(); + + $nb_tasks = $paginator->getTotal(); + } + + $this->response->html($this->helper->layout->app('search/index', array( + 'values' => array( + 'search' => $search, + 'controller' => 'SearchController', + 'action' => 'index', + ), + 'paginator' => $paginator, + 'title' => t('Search tasks').($nb_tasks > 0 ? ' ('.$nb_tasks.')' : '') + ))); + } + + public function activity() + { + $search = urldecode($this->request->getStringParam('search')); + $events = $this->helper->projectActivity->searchEvents($search); + $nb_events = count($events); + + $this->response->html($this->helper->layout->app('search/activity', array( + 'values' => array( + 'search' => $search, + 'controller' => 'SearchController', + 'action' => 'activity', + ), + 'title' => t('Search in activity stream').($nb_events > 0 ? ' ('.$nb_events.')' : ''), + 'nb_events' => $nb_events, + 'events' => $events, + ))); + } +} diff --git a/app/Helper/UrlHelper.php b/app/Helper/UrlHelper.php index 095c4af4..ab642c62 100644 --- a/app/Helper/UrlHelper.php +++ b/app/Helper/UrlHelper.php @@ -25,7 +25,7 @@ class UrlHelper extends Base */ public function doc($label, $file) { - return $this->link($label, 'doc', 'show', array('file' => $file), false, '', '', true); + return $this->link($label, 'DocumentationController', 'show', array('file' => $file), false, '', '', true); } /** diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php index 759ec168..3d4c7f6b 100644 --- a/app/ServiceProvider/AuthenticationProvider.php +++ b/app/ServiceProvider/AuthenticationProvider.php @@ -121,18 +121,18 @@ class AuthenticationProvider implements ServiceProviderInterface $acl->setRoleHierarchy(Role::APP_USER, array(Role::APP_PUBLIC)); $acl->add('Auth', array('login', 'check'), Role::APP_PUBLIC); - $acl->add('Captcha', '*', Role::APP_PUBLIC); + $acl->add('CaptchaController', '*', Role::APP_PUBLIC); $acl->add('PasswordReset', '*', Role::APP_PUBLIC); $acl->add('Webhook', '*', Role::APP_PUBLIC); $acl->add('TaskViewController', 'readonly', Role::APP_PUBLIC); $acl->add('Board', 'readonly', Role::APP_PUBLIC); - $acl->add('Ical', '*', Role::APP_PUBLIC); - $acl->add('Feed', '*', Role::APP_PUBLIC); - $acl->add('AvatarFile', 'show', Role::APP_PUBLIC); + $acl->add('ICalendarController', '*', Role::APP_PUBLIC); + $acl->add('FeedController', '*', Role::APP_PUBLIC); + $acl->add('AvatarFileController', 'show', Role::APP_PUBLIC); - $acl->add('Config', '*', Role::APP_ADMIN); + $acl->add('ConfigController', '*', Role::APP_ADMIN); $acl->add('PluginController', '*', Role::APP_ADMIN); - $acl->add('Currency', '*', Role::APP_ADMIN); + $acl->add('CurrencyController', '*', Role::APP_ADMIN); $acl->add('Gantt', array('projects', 'saveProjectDate'), Role::APP_MANAGER); $acl->add('GroupListController', '*', Role::APP_ADMIN); $acl->add('GroupCreationController', '*', Role::APP_ADMIN); diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php index 61f43ae6..c30c1574 100644 --- a/app/ServiceProvider/RouteProvider.php +++ b/app/ServiceProvider/RouteProvider.php @@ -41,8 +41,8 @@ class RouteProvider implements ServiceProviderInterface $container['route']->addRoute('dashboard/:user_id/notifications', 'DashboardController', 'notifications'); // Search routes - $container['route']->addRoute('search', 'search', 'index'); - $container['route']->addRoute('search/activity', 'search', 'activity'); + $container['route']->addRoute('search', 'SearchController', 'index'); + $container['route']->addRoute('search/activity', 'SearchController', 'activity'); // ProjectCreation routes $container['route']->addRoute('project/create', 'ProjectCreation', 'create'); @@ -132,12 +132,12 @@ class RouteProvider implements ServiceProviderInterface $container['route']->addRoute('gantt/:project_id/sort/:sorting', 'gantt', 'project'); // Feed routes - $container['route']->addRoute('feed/project/:token', 'feed', 'project'); - $container['route']->addRoute('feed/user/:token', 'feed', 'user'); + $container['route']->addRoute('feed/project/:token', 'FeedController', 'project'); + $container['route']->addRoute('feed/user/:token', 'FeedController', 'user'); // Ical routes - $container['route']->addRoute('ical/project/:token', 'ical', 'project'); - $container['route']->addRoute('ical/user/:token', 'ical', 'user'); + $container['route']->addRoute('ical/project/:token', 'ICalendarController', 'project'); + $container['route']->addRoute('ical/user/:token', 'ICalendarController', 'user'); // Users $container['route']->addRoute('users', 'UserListController', 'show'); @@ -154,32 +154,32 @@ class RouteProvider implements ServiceProviderInterface $container['route']->addRoute('user/:user_id/integrations', 'UserViewController', 'integrations'); $container['route']->addRoute('user/:user_id/authentication', 'UserCredentialController', 'changeAuthentication'); $container['route']->addRoute('user/:user_id/2fa', 'TwoFactorController', 'index'); - $container['route']->addRoute('user/:user_id/avatar', 'AvatarFile', 'show'); + $container['route']->addRoute('user/:user_id/avatar', 'AvatarFileController', 'show'); // Groups $container['route']->addRoute('groups', 'GroupListController', 'index'); $container['route']->addRoute('group/:group_id/members', 'GroupListController', 'users'); // Config - $container['route']->addRoute('settings', 'config', 'index'); - $container['route']->addRoute('settings/application', 'config', 'application'); - $container['route']->addRoute('settings/project', 'config', 'project'); - $container['route']->addRoute('settings/project', 'config', 'project'); - $container['route']->addRoute('settings/board', 'config', 'board'); - $container['route']->addRoute('settings/calendar', 'config', 'calendar'); - $container['route']->addRoute('settings/integrations', 'config', 'integrations'); - $container['route']->addRoute('settings/webhook', 'config', 'webhook'); - $container['route']->addRoute('settings/api', 'config', 'api'); + $container['route']->addRoute('settings', 'ConfigController', 'index'); + $container['route']->addRoute('settings/application', 'ConfigController', 'application'); + $container['route']->addRoute('settings/project', 'ConfigController', 'project'); + $container['route']->addRoute('settings/project', 'ConfigController', 'project'); + $container['route']->addRoute('settings/board', 'ConfigController', 'board'); + $container['route']->addRoute('settings/calendar', 'ConfigController', 'calendar'); + $container['route']->addRoute('settings/integrations', 'ConfigController', 'integrations'); + $container['route']->addRoute('settings/webhook', 'ConfigController', 'webhook'); + $container['route']->addRoute('settings/api', 'ConfigController', 'api'); $container['route']->addRoute('settings/links', 'link', 'index'); - $container['route']->addRoute('settings/currencies', 'currency', 'index'); + $container['route']->addRoute('settings/currencies', 'CurrencyController', 'index'); // Plugins $container['route']->addRoute('extensions', 'PluginController', 'show'); $container['route']->addRoute('extensions/directory', 'PluginController', 'directory'); // Doc - $container['route']->addRoute('documentation/:file', 'doc', 'show'); - $container['route']->addRoute('documentation', 'doc', 'show'); + $container['route']->addRoute('documentation/:file', 'DocumentationController', 'show'); + $container['route']->addRoute('documentation', 'DocumentationController', 'show'); // Auth routes $container['route']->addRoute('login', 'auth', 'login'); diff --git a/app/Template/activity/project.php b/app/Template/activity/project.php index 176d9b99..70235cfc 100644 --- a/app/Template/activity/project.php +++ b/app/Template/activity/project.php @@ -4,11 +4,11 @@ render('event/events', array('events' => $events)) ?> - \ No newline at end of file + diff --git a/app/Template/auth/index.php b/app/Template/auth/index.php index cc562170..0f5129bd 100644 --- a/app/Template/auth/index.php +++ b/app/Template/auth/index.php @@ -19,7 +19,7 @@ form->label(t('Enter the text below'), 'captcha') ?> - + Captcha form->text('captcha', array(), $errors, array('required')) ?> @@ -39,4 +39,4 @@ hook->render('template:auth:login-form:after') ?> - \ No newline at end of file + diff --git a/app/Template/avatar_file/show.php b/app/Template/avatar_file/show.php index 9f19a1ab..37c56cec 100644 --- a/app/Template/avatar_file/show.php +++ b/app/Template/avatar_file/show.php @@ -6,14 +6,14 @@
- url->link(t('Remove my image'), 'AvatarFile', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?> + url->link(t('Remove my image'), 'AvatarFileController', 'remove', array('user_id' => $user['id']), true, 'btn btn-red') ?>

-
+ form->csrf() ?> form->file('avatar') ?> diff --git a/app/Template/config/about.php b/app/Template/config/about.php index 7c599ef7..8e2d1325 100644 --- a/app/Template/config/about.php +++ b/app/Template/config/about.php @@ -65,11 +65,11 @@ text->bytes($db_size) ?>
  • - url->link(t('Download the database'), 'config', 'downloadDb', array(), true) ?>  + url->link(t('Download the database'), 'ConfigController', 'downloadDb', array(), true) ?> 
  • - url->link(t('Optimize the database'), 'config', 'optimizeDb', array(), true) ?>  + url->link(t('Optimize the database'), 'ConfigController', 'optimizeDb', array(), true) ?> 
  • diff --git a/app/Template/config/api.php b/app/Template/config/api.php index 3ebbb956..95f77355 100644 --- a/app/Template/config/api.php +++ b/app/Template/config/api.php @@ -12,7 +12,7 @@
  • - url->link(t('Reset token'), 'config', 'token', array('type' => 'api'), true) ?> + url->link(t('Reset token'), 'ConfigController', 'token', array('type' => 'api'), true) ?>
  • - \ No newline at end of file + diff --git a/app/Template/config/application.php b/app/Template/config/application.php index ee0e147b..0f842f6e 100644 --- a/app/Template/config/application.php +++ b/app/Template/config/application.php @@ -1,7 +1,7 @@ - + form->csrf() ?> diff --git a/app/Template/config/board.php b/app/Template/config/board.php index 75cd40ef..62a736e7 100644 --- a/app/Template/config/board.php +++ b/app/Template/config/board.php @@ -1,7 +1,7 @@ - + form->csrf() ?> diff --git a/app/Template/config/calendar.php b/app/Template/config/calendar.php index 37084a8b..90e034e9 100644 --- a/app/Template/config/calendar.php +++ b/app/Template/config/calendar.php @@ -2,7 +2,7 @@

    - + form->csrf() ?> diff --git a/app/Template/config/integrations.php b/app/Template/config/integrations.php index 2a29b358..3ba4e865 100644 --- a/app/Template/config/integrations.php +++ b/app/Template/config/integrations.php @@ -2,7 +2,7 @@

    - + form->csrf() ?> hook->render('template:config:integrations', array('values' => $values)) ?> diff --git a/app/Template/config/project.php b/app/Template/config/project.php index b0112773..6d8d131a 100644 --- a/app/Template/config/project.php +++ b/app/Template/config/project.php @@ -1,7 +1,7 @@ - + form->csrf() ?> diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php index a2a5a6cb..e6b4631d 100644 --- a/app/Template/config/sidebar.php +++ b/app/Template/config/sidebar.php @@ -1,35 +1,35 @@
    - + form->csrf() ?> @@ -25,7 +25,7 @@ text->e($values['webhook_token']) ?>
  • - url->link(t('Reset token'), 'config', 'token', array('type' => 'webhook'), true) ?> + url->link(t('Reset token'), 'ConfigController', 'token', array('type' => 'webhook'), true) ?>
  • diff --git a/app/Template/currency/index.php b/app/Template/currency/index.php index d35ac459..9881cee5 100644 --- a/app/Template/currency/index.php +++ b/app/Template/currency/index.php @@ -24,7 +24,7 @@

    - + form->csrf() ?> @@ -38,7 +38,7 @@

    - + form->csrf() ?> diff --git a/app/Template/dashboard/layout.php b/app/Template/dashboard/layout.php index 187f7f42..f73e02b5 100644 --- a/app/Template/dashboard/layout.php +++ b/app/Template/dashboard/layout.php @@ -15,7 +15,7 @@
  • - url->link(t('Search'), 'search', 'index') ?> + url->link(t('Search'), 'SearchController', 'index') ?>
  • diff --git a/app/Template/dashboard/show.php b/app/Template/dashboard/show.php index bc4e2952..917a6651 100644 --- a/app/Template/dashboard/show.php +++ b/app/Template/dashboard/show.php @@ -2,7 +2,7 @@ form->hidden('controller', array('controller' => 'search')) ?> form->hidden('action', array('action' => 'index')) ?> - form->text('search', array(), array(), array('placeholder="'.t('Search').'"'), 'form-input-large') ?> + form->text('SearchController', array(), array(), array('placeholder="'.t('Search').'"'), 'form-input-large') ?> render('app/filters_helper') ?>
  • diff --git a/app/Template/doc/show.php b/app/Template/doc/show.php index 8fbadc93..a8dbd762 100644 --- a/app/Template/doc/show.php +++ b/app/Template/doc/show.php @@ -3,11 +3,11 @@
    • - url->link(t('Table of contents'), 'doc', 'show', array('file' => 'index')) ?> + url->link(t('Table of contents'), 'DocumentationController', 'show', array('file' => 'index')) ?>
    -
    \ No newline at end of file + diff --git a/app/Template/feed/project.php b/app/Template/feed/project.php index eae41c92..213a04d4 100644 --- a/app/Template/feed/project.php +++ b/app/Template/feed/project.php @@ -2,9 +2,9 @@ <?= t('%s\'s activity', $project['name']) ?> - + - url->href('feed', 'project', array('token' => $project['token']), false, '', true) ?> + url->href('FeedController', 'project', array('token' => $project['token']), false, '', true) ?> url->base() ?>assets/img/favicon.png diff --git a/app/Template/feed/user.php b/app/Template/feed/user.php index 483cf7cd..0c45f03c 100644 --- a/app/Template/feed/user.php +++ b/app/Template/feed/user.php @@ -2,9 +2,9 @@ <?= t('Project activities for %s', $user['name'] ?: $user['username']) ?> - + - url->href('feed', 'user', array('token' => $user['token']), false, '', true) ?> + url->href('FeedController', 'user', array('token' => $user['token']), false, '', true) ?> url->base() ?>assets/img/favicon.png diff --git a/app/Template/header.php b/app/Template/header.php index 1ff8bf33..300df76d 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -88,12 +88,12 @@
  • - url->link(t('Settings'), 'config', 'index') ?> + url->link(t('Settings'), 'ConfigController', 'index') ?>
  • - url->link(t('Documentation'), 'doc', 'show') ?> + url->link(t('Documentation'), 'DocumentationController', 'show') ?>
  • diff --git a/app/Template/layout.php b/app/Template/layout.php index ff29e18f..6c02de91 100644 --- a/app/Template/layout.php +++ b/app/Template/layout.php @@ -46,7 +46,7 @@ diff --git a/app/Template/password_reset/create.php b/app/Template/password_reset/create.php index 918a0eb4..f1877aa7 100644 --- a/app/Template/password_reset/create.php +++ b/app/Template/password_reset/create.php @@ -7,11 +7,11 @@ form->text('username', $values, $errors, array('autofocus', 'required')) ?> form->label(t('Enter the text below'), 'captcha') ?> - + Captcha form->text('captcha', array(), $errors, array('required')) ?>
    - \ No newline at end of file + diff --git a/app/Template/project_overview/information.php b/app/Template/project_overview/information.php index 2032ed28..f49133bd 100644 --- a/app/Template/project_overview/information.php +++ b/app/Template/project_overview/information.php @@ -30,8 +30,8 @@
  • url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
  • -
  • url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?>
  • -
  • url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?>
  • +
  • url->link(t('RSS feed'), 'FeedController', 'project', array('token' => $project['token']), false, '', '', true) ?>
  • +
  • url->link(t('iCal feed'), 'ICalendarController', 'project', array('token' => $project['token'])) ?>
  • diff --git a/app/Template/project_view/share.php b/app/Template/project_view/share.php index 6161faa9..f8cfc0eb 100644 --- a/app/Template/project_view/share.php +++ b/app/Template/project_view/share.php @@ -7,8 +7,8 @@
    • url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
    • -
    • url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?>
    • -
    • url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token']), false, '', '', true) ?>
    • +
    • url->link(t('RSS feed'), 'FeedController', 'project', array('token' => $project['token']), false, '', '', true) ?>
    • +
    • url->link(t('iCal feed'), 'ICalendarController', 'project', array('token' => $project['token']), false, '', '', true) ?>
    diff --git a/app/Template/project_view/show.php b/app/Template/project_view/show.php index 4aba4919..3a0d7f03 100644 --- a/app/Template/project_view/show.php +++ b/app/Template/project_view/show.php @@ -14,8 +14,8 @@
  • url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
  • -
  • url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?>
  • -
  • url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?>
  • +
  • url->link(t('RSS feed'), 'FeedController', 'project', array('token' => $project['token']), false, '', '', true) ?>
  • +
  • url->link(t('iCal feed'), 'ICalendarController', 'project', array('token' => $project['token'])) ?>
  • diff --git a/app/Template/search/activity.php b/app/Template/search/activity.php index 60362215..9abc7d7e 100644 --- a/app/Template/search/activity.php +++ b/app/Template/search/activity.php @@ -3,7 +3,7 @@
    • - url->link(t('Search tasks'), 'search', 'index') ?> + url->link(t('Search tasks'), 'SearchController', 'index') ?>
    @@ -36,4 +36,4 @@ render('event/events', array('events' => $events)) ?> - \ No newline at end of file + diff --git a/app/Template/search/index.php b/app/Template/search/index.php index d5d07ed6..bc528af7 100644 --- a/app/Template/search/index.php +++ b/app/Template/search/index.php @@ -3,7 +3,7 @@
    • - url->link(t('Activity stream search'), 'search', 'activity') ?> + url->link(t('Activity stream search'), 'SearchController', 'activity') ?>
    @@ -40,4 +40,4 @@ )) ?> - \ No newline at end of file + diff --git a/app/Template/user_view/share.php b/app/Template/user_view/share.php index 9ef150e8..570b766e 100644 --- a/app/Template/user_view/share.php +++ b/app/Template/user_view/share.php @@ -5,8 +5,8 @@
      -
    • url->link(t('RSS feed'), 'feed', 'user', array('token' => $user['token']), false, '', '', true) ?>
    • -
    • url->link(t('iCal feed'), 'ical', 'user', array('token' => $user['token']), false, '', '', true) ?>
    • +
    • url->link(t('RSS feed'), 'FeedController', 'user', array('token' => $user['token']), false, '', '', true) ?>
    • +
    • url->link(t('iCal feed'), 'ICalendarController', 'user', array('token' => $user['token']), false, '', '', true) ?>
    url->link(t('Disable public access'), 'UserViewController', 'share', array('user_id' => $user['id'], 'switch' => 'disable'), true, 'btn btn-red') ?> diff --git a/app/Template/user_view/show.php b/app/Template/user_view/show.php index 390a1e45..fc11f8a1 100644 --- a/app/Template/user_view/show.php +++ b/app/Template/user_view/show.php @@ -37,8 +37,8 @@
      -
    • url->link(t('RSS feed'), 'feed', 'user', array('token' => $user['token']), false, '', '', true) ?>
    • -
    • url->link(t('iCal feed'), 'ical', 'user', array('token' => $user['token']), false, '', '', true) ?>
    • +
    • url->link(t('RSS feed'), 'FeedController', 'user', array('token' => $user['token']), false, '', '', true) ?>
    • +
    • url->link(t('iCal feed'), 'ICalendarController', 'user', array('token' => $user['token']), false, '', '', true) ?>
    diff --git a/app/Template/user_view/sidebar.php b/app/Template/user_view/sidebar.php index 0f2f3569..d200a7f5 100644 --- a/app/Template/user_view/sidebar.php +++ b/app/Template/user_view/sidebar.php @@ -38,7 +38,7 @@ url->link(t('Edit profile'), 'UserModificationController', 'show', array('user_id' => $user['id'])) ?>
  • app->checkMenuSelection('AvatarFile') ?>> - url->link(t('Avatar'), 'AvatarFile', 'show', array('user_id' => $user['id'])) ?> + url->link(t('Avatar'), 'AvatarFileController', 'show', array('user_id' => $user['id'])) ?>
  • diff --git a/app/User/Avatar/AvatarFileProvider.php b/app/User/Avatar/AvatarFileProvider.php index eea565f0..790245a4 100644 --- a/app/User/Avatar/AvatarFileProvider.php +++ b/app/User/Avatar/AvatarFileProvider.php @@ -23,7 +23,7 @@ class AvatarFileProvider extends Base implements AvatarProviderInterface */ public function render(array $user, $size) { - $url = $this->helper->url->href('AvatarFile', 'image', array('user_id' => $user['id'], 'size' => $size)); + $url = $this->helper->url->href('AvatarFileController', 'image', array('user_id' => $user['id'], 'size' => $size)); $title = $this->helper->text->e($user['name'] ?: $user['username']); return '' . $title . ''; } -- cgit v1.2.3