diff --git a/dist/pvv.sql b/dist/pvv.sql index 1b8eb04..8d43130 100644 --- a/dist/pvv.sql +++ b/dist/pvv.sql @@ -11,13 +11,20 @@ CREATE TABLE "events" ( CREATE TABLE "projects" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "name" TEXT, +"description" TEXT, "owner" TEXT, "owneruname" TEXT, "owneremail" TEXT, -"description" TEXT, "active" BOOLEAN ); +CREATE TABLE "projectmembers" ( +"projectid" INTEGER, +"membername" TEXT, +"memberuname" TEXT, +"role" TEXT +) + CREATE TABLE "users" ( "uname" TEXT, "groups" INT DEFAULT 0 diff --git a/dist/pvv_mysql.sql b/dist/pvv_mysql.sql index dd051e8..66084ab 100644 --- a/dist/pvv_mysql.sql +++ b/dist/pvv_mysql.sql @@ -11,13 +11,20 @@ CREATE TABLE events ( CREATE TABLE projects ( `id` INTEGER PRIMARY KEY AUTO_INCREMENT, `name` TEXT, +`description` TEXT, `owner` TEXT, `owneruname` TEXT, `owneremail` TEXT, -`description` TEXT, `active` BOOLEAN ); +CREATE TABLE projectmembers ( +`projectid` INTEGER, +`name` TEXT, +`uname` TEXT, +`role` TEXT +) + CREATE TABLE users ( `uname` TEXT, `groups` INT DEFAULT 0 diff --git a/src/pvv/side/projectmanager.php b/src/pvv/side/projectmanager.php index db4bab0..38996a3 100644 --- a/src/pvv/side/projectmanager.php +++ b/src/pvv/side/projectmanager.php @@ -74,4 +74,18 @@ class ProjectManager{ return $projects; } + + public function getProjectMembers($id){ + $query = 'SELECT * FROM projectmembers WHERE projectid=:id'; + $statement = $this->pdo->prepare($query); + $statement->bindParam(':id', $id, PDO::PARAM_STR); + $statement->execute(); + + $members = []; + foreach($statement->fetchAll() as $dbUsr){ + $members[] = ['name' => $dbUsr['name'], 'uname' => $dbUsr['uname'], 'role' => $dbUsr['role']]; + } + + return $members; + } } \ No newline at end of file diff --git a/www/css/projects.css b/www/css/projects.css index f66f8a3..31c168d 100644 --- a/www/css/projects.css +++ b/www/css/projects.css @@ -65,35 +65,36 @@ border-left: 0; } -.projectowner { +.projectmember { + margin-bottom: 1em; padding: 0 .5em 0 .5em; overflow: hidden; border-left: 4px solid #35a; } -.projectowner p { +.projectmember p { margin: 0; } -.projectowner p { +.projectmember p { font-size: .8em; } -.projectowner p:first-child { +.projectmember p:first-child { font-size: 1em; margin-bottom: .2em; } -.owneruname, .owneremail { +.memberuname, .memberemail { display: inline-block; color: #888; } -.owneruname { +.memberuname { float: left; } -.owneremail { +.memberemail { float: right; } diff --git a/www/prosjekt/edit.php b/www/prosjekt/edit.php index f6a83bb..4ab9a40 100644 --- a/www/prosjekt/edit.php +++ b/www/prosjekt/edit.php @@ -75,6 +75,7 @@ if($new == 0){ = '' ?> +
Prosjekteier
-= $project->getOwner() ?>
-= $project->getOwnerUName(); ?>
-= $project->getOwnerEmail(); ?>
+= $project->getOwner() ?>
+= $project->getOwnerUName(); ?>
+= $project->getOwnerEmail(); ?>
= $data['role'] ?>
+= $data['name'] ?>
+= $data['uname'] ?>
+