diff --git a/src/bootstrap.php b/src/bootstrap.php index 8474106..c395df6 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -33,6 +33,7 @@ case 'PanaceaControllerFactory': case 'PanaceaWikiController': case 'PanaceaDefaultController': + case 'PanaceaTrackerController': $file = "$path/lib/controllers/$className.php"; break; @@ -46,6 +47,7 @@ //views case 'WikiViewFactory': case 'PanaceaViewFactory': + case 'TrackerViewFactory': $file = "$path/lib/views/$className.php"; break; @@ -63,6 +65,11 @@ $file = "$path/lib/views/wiki/$className.php"; break; + //tracker views + case 'TrackerView': + $file = "$path/lib/views/tracker/$className.php"; + break; + //system views case 'PanaceaView': case 'PanaceaHomeView': @@ -72,9 +79,16 @@ case 'PanaceaLogoView': case 'PanaceaMenuView': case 'PanaceaFooterView': - case 'PanaceaWelcomeView': $file = "$path/lib/views/system/$className.php"; break; + + //default views + case 'PanaceaContactView': + case 'PanaceaWelcomeView': + case 'PanaceaCreditsView': + case 'PanaceaAboutView': + $file = "$path/lib/views/default/$className.php"; + break; } if (!empty($file) && is_file($file)) { diff --git a/src/lib/controllers/PanaceaDefaultController.php b/src/lib/controllers/PanaceaDefaultController.php index 3582195..73b0cce 100644 --- a/src/lib/controllers/PanaceaDefaultController.php +++ b/src/lib/controllers/PanaceaDefaultController.php @@ -69,7 +69,7 @@ } try { - $title = (empty($this->page) || $this->page === 'Home') ? 'It doesn\'t suck' : $this->page; + $title = (empty($this->page) || $this->page === 'Home') ? 'It doesn\'t suck' : ucfirst($this->page); $templateView = new PanaceaTemplateView($title); $templateView->mainView->addView($this->viewFactory->getView($this->page)); return $templateView; diff --git a/src/lib/controllers/PanaceaTrackerController.php b/src/lib/controllers/PanaceaTrackerController.php new file mode 100644 index 0000000..fcb9c25 --- /dev/null +++ b/src/lib/controllers/PanaceaTrackerController.php @@ -0,0 +1,77 @@ +viewFactory = TrackerViewFactory::getInstance(); + } + + /** + * {@inheritdoc} + * + * @author Tommy Montgomery + * @since 2008-10-26 + * + * @return string + */ + public static function getDefaultPageName() { + return 'Hello Bug Tracker'; + } + + /** + * {@inheritdoc} + * + * @author Tommy Montgomery + * @since 2008-10-26 + * @uses Request::create() + * @uses HttpUtil::getRequestMethod() + * @todo Remove the hardcoded database connection + * + * @throws {@link InvalidRequestException} if a {@link View} cannot be created + * @return PanaceaTemplateView + */ + public function handleRequest(Request $request = null) { + if (!($request instanceof Request)) { + $request = Request::create(HttpUtil::getRequestMethod()); + } + + //handle request metadata + if ($request->method === HttpUtil::HTTP_METHOD_POST) { + $postHandler = PanaceaPostHandlerFactory::getInstance()->getPostHandler($request->body); + $lastInsertId = $postHandler->execute($mysql); + } + + try { + $templateView = new PanaceaTemplateView('Bug Tracker :: ' . $this->page); + $templateView->mainView->addView($this->viewFactory->getView($this->page)); + + return $templateView; + } + catch (ClassNotFoundException $e) { + throw new InvalidRequestException($request); + } + } + + } + +?> \ No newline at end of file diff --git a/src/lib/views/TrackerViewFactory.php b/src/lib/views/TrackerViewFactory.php new file mode 100644 index 0000000..469c430 --- /dev/null +++ b/src/lib/views/TrackerViewFactory.php @@ -0,0 +1,61 @@ + \ No newline at end of file diff --git a/src/lib/views/default/PanaceaAboutView.php b/src/lib/views/default/PanaceaAboutView.php new file mode 100644 index 0000000..1ed8eb0 --- /dev/null +++ b/src/lib/views/default/PanaceaAboutView.php @@ -0,0 +1,43 @@ + + +
+ This application was built entirely by + Tommy Montgomery. He wrote it + using PHP. Obviously, + Trac was a big inspiration. +
++ Yes, this entire thing was developed on gasp! Windows. + Macs are for suckers and Linux is for sadists. Of course, I relied + heavily on the use of Cygwin… +
+ ++ These are mentioned because I sometimes referred to them while + developing Panacea. +
+Welcome to Panacea, a web-based application that - doesn't suck. It's aimed at software developers, - software development managers, QA professionals, - and people who like using wikis - (which should be everybody, unless you're a robot). + doesn't suck.
Panacea is modeled after Trac, which is a fantastic application very similar to this one. Panacea - aims to ease integration, configuration and installation. That is not to say - that Panacea is simple; it is in fact just the opposite. Panacea is - infintely complex and extensible; it is well documented and well-written; it - is a panacea to all your software development troubles; it's also a lot of - fun, in the sense that there's a lot of crap to mess around with. + aims to ease integration, configuration and installation.
More information about the technology and reason for Panacea can be - viewed at the about page. + viewed at the about page.
diff --git a/src/lib/views/system/PanaceaFooterView.php b/src/lib/views/system/PanaceaFooterView.php index 51f66cf..71e8200 100644 --- a/src/lib/views/system/PanaceaFooterView.php +++ b/src/lib/views/system/PanaceaFooterView.php @@ -13,7 +13,7 @@ require_once 'NowhereConcave/bootstrap.php'; /** - * View for standard Panacea pages + * Footer view * * @package Panacea * @subpackage Views @@ -36,7 +36,6 @@ diff --git a/src/lib/views/tracker/TrackerView.php b/src/lib/views/tracker/TrackerView.php new file mode 100644 index 0000000..53907f9 --- /dev/null +++ b/src/lib/views/tracker/TrackerView.php @@ -0,0 +1,39 @@ + \ No newline at end of file