diff --git a/app/controllers/ProjectController.php b/app/controllers/ProjectController.php
index 322559f..eda40cf 100644
--- a/app/controllers/ProjectController.php
+++ b/app/controllers/ProjectController.php
@@ -7,23 +7,59 @@
// list all projects
public function index($f3){
$this->check_access($f3);
+
+ $db = $f3->get('DB');
+
+ // retrieve projects
+ $projects = $db->exec('SELECT * FROM projects ORDER BY created_at DESC');
+
+ $f3->set('projects', $projects);
+
+
$f3->set('content', '../ui/views/project/index.html');
echo \Template::instance()->render('../ui/templates/layout.html');
+
+ $f3->clear('SESSION.error');
}
// create a new project
public function createForm($f3){
+ $this->check_access($f3);
+ $f3->set('content', '../ui/views/project/create.html');
+ echo \Template::instance()->render('../ui/templates/layout.html');
}
+
public function create($f3){
}
// show project details including links, tickets, events, tasks
- public function view($f3){}
+ public function view($f3){
+ $this->check_access($f3);
+
+ $project_id = $f3->get('PARAMS.id');
+ $db = $f3->get('DB');
+
+ $result = $db->exec(
+ 'SELECT * FROM projects WHERE id = ? LIMIT 1', [$project_id]
+ );
+ $project = $result[0];
+ $f3->set('project', $project);
+
+ $f3->set('content', '../ui/views/project/view.html');
+ echo \Template::instance()->render('../ui/templates/layout.html');
+ }
// update project details
- public function editForm($f3){}
+ public function editForm($f3){
+
+ $this->check_access($f3);
+ $f3->set('content', '../ui/views/project/edit.html');
+ echo \Template::instance()->render('../ui/templates/layout.html');
+
+ }
+
public function update($f3){}
}
\ No newline at end of file
diff --git a/app/extensions/ParsedownHelper.php b/app/extensions/ParsedownHelper.php
index 43e7d08..c6e6b3d 100644
--- a/app/extensions/ParsedownHelper.php
+++ b/app/extensions/ParsedownHelper.php
@@ -16,7 +16,7 @@ class ParsedownHelper extends \Prefab {
}
- return '
'.print_r($args,1).'';
+ // return ''.print_r($args,1).'
';
$content = $args[0];
$content_token = \Template::instance()->token($content);
diff --git a/public/index.php b/public/index.php
index 24c553b..962675e 100644
--- a/public/index.php
+++ b/public/index.php
@@ -43,6 +43,7 @@ $f3->route('GET /dashboard', function($f3){
}
echo 'Welcome to the dashboard' . $f3->get('SESSION.username');
echo 'logout';
+
});
// tickets - CRUD (CREATE, READ, UPDATE, DELETE)
diff --git a/ui/templates/layout.html b/ui/templates/layout.html
index 672f845..75cb4ec 100644
--- a/ui/templates/layout.html
+++ b/ui/templates/layout.html
@@ -42,9 +42,9 @@
diff --git a/ui/views/kb/index.html b/ui/views/kb/index.html
index 9500019..4953f16 100644
--- a/ui/views/kb/index.html
+++ b/ui/views/kb/index.html
@@ -41,7 +41,7 @@
-
+
| id | title | created_at |
|
@@ -50,8 +50,8 @@
- | {{@article.id}} |
- {{@article.title}} |
+ {{@article.id}} |
+ {{@article.title}} |
{{@article.created_at}} |
diff --git a/ui/views/kb/view.html b/ui/views/kb/view.html
index 1bbb100..34cda81 100644
--- a/ui/views/kb/view.html
+++ b/ui/views/kb/view.html
@@ -1,4 +1,6 @@
{{@article.title}}
+edit article
+
{{ @article.content | raw }}
diff --git a/ui/views/project/create.html b/ui/views/project/create.html
new file mode 100644
index 0000000..7c1d2ce
--- /dev/null
+++ b/ui/views/project/create.html
@@ -0,0 +1,3 @@
+
+ TODO: create form.
+
\ No newline at end of file
diff --git a/ui/views/project/edit.html b/ui/views/project/edit.html
new file mode 100644
index 0000000..37973a4
--- /dev/null
+++ b/ui/views/project/edit.html
@@ -0,0 +1,3 @@
+
+ TODO: edit form
+
\ No newline at end of file
diff --git a/ui/views/project/index.html b/ui/views/project/index.html
index 7338736..8ec6fae 100644
--- a/ui/views/project/index.html
+++ b/ui/views/project/index.html
@@ -1,8 +1,9 @@
Projects
-
+ create new project
+
-
+
| ID |
Title |
Requester |
@@ -13,122 +14,16 @@
+
- | {id} |
- {title} |
- {requester} |
- {created_by} |
- {created_at} |
- {start_date} |
- {end_date} |
+ {{ @p.id }} |
+ {{ @p.title }} |
+ {{ @p.requester }} |
+ {{ @p.created_by }} |
+ {{ @p.created_at }} |
+ {{ @p.start_date }} |
+ {{ @p.end_date }} |
+
-
-
-
-
- Project {NAME}
-
-
-
-
-
-
-
-
-
-
-
----
-## View project
-
-A central place to see everything for this project:
-
-- Overview: (title, description, links, start/end dates).
-- related tickets (with status and priorities)
-- events
-- tasks
-- timeline combining events, tickets, milestone dates
-
-## Example Workflow
-
-- create a project - `team manager overview`
--- attach relevant links
-- add tickets - each new request or issue can be a ticket referencing this project
-- add events - quick notes about management meetings, or verbal discussions that don't need ticket overhead
--- meeting on 01 jan to discuss layout
--- teams message on 28 jan clarifying data requirements
-- project tasks - for smaller to do items that don't warrant a full ticket
--- identify location of required data, create initial pq connections, build a mockup layout
-
-## Reporting Timelines
-- timeline view - merge ticket data with project_events sorted by date - chronological Overview
-- status summaries - how many tickets open, on hold, completed
-- progress tracking - sumarries or gantt style charts
-
\ No newline at end of file
diff --git a/ui/views/project/view.html b/ui/views/project/view.html
index e69de29..f560e86 100644
--- a/ui/views/project/view.html
+++ b/ui/views/project/view.html
@@ -0,0 +1,102 @@
+ {{ @project.title }}
+ edit project
+
+
+
+ Overview
+
+ {{ @project.description }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+---
+## View project
+
+A central place to see everything for this project:
+
+- Overview: (title, description, links, start/end dates).
+- related tickets (with status and priorities)
+- events
+- tasks
+- timeline combining events, tickets, milestone dates
+
+## Example Workflow
+
+- create a project - `team manager overview`
+-- attach relevant links
+- add tickets - each new request or issue can be a ticket referencing this project
+- add events - quick notes about management meetings, or verbal discussions that don't need ticket overhead
+-- meeting on 01 jan to discuss layout
+-- teams message on 28 jan clarifying data requirements
+- project tasks - for smaller to do items that don't warrant a full ticket
+-- identify location of required data, create initial pq connections, build a mockup layout
+
+## Reporting Timelines
+- timeline view - merge ticket data with project_events sorted by date - chronological Overview
+- status summaries - how many tickets open, on hold, completed
+- progress tracking - sumarries or gantt style charts
+
\ No newline at end of file
|