= $project->getName(); ?>
+= implode($project->getDescription(), "
"); ?>
Prosjektledelse
+Prosjekteier
+= $project->getOwner() ?>
+= $project->getOwnerUName(); ?>
+= $project->getOwnerEmail(); ?>
+diff --git a/dist/pvv_mysql.sql b/dist/pvv_mysql.sql index 7951c1c..dd051e8 100644 --- a/dist/pvv_mysql.sql +++ b/dist/pvv_mysql.sql @@ -13,6 +13,7 @@ CREATE TABLE projects ( `name` TEXT, `owner` TEXT, `owneruname` TEXT, +`owneremail` TEXT, `description` TEXT, `active` BOOLEAN ); diff --git a/pvv.sql b/pvv.sql index cc6a70c..f944b63 100644 --- a/pvv.sql +++ b/pvv.sql @@ -13,6 +13,7 @@ CREATE TABLE "projects" ( "name" TEXT, "owner" TEXT, "owneruname" TEXT, +"owneremail" TEXT, "description" TEXT, "active" BOOLEAN ); diff --git a/src/pvv/side/project.php b/src/pvv/side/project.php index e46a6ce..f9a9455 100644 --- a/src/pvv/side/project.php +++ b/src/pvv/side/project.php @@ -2,14 +2,15 @@ namespace pvv\side; class Project{ - private $id, $name, $owner, $owneruname, $descr, $active; + private $id, $name, $owner, $owneruname, $owneremail, $descr, $active; - public function __construct($id, $name, $descr, $owner, $owneruname, $active){ + public function __construct($id, $name, $descr, $owner, $owneruname, $owneremail, $active){ $this->id = $id; $this->name = $name; $this->descr = explode("\n", $descr); $this->owner = $owner; $this->owneruname = $owneruname; + $this->owneremail = $owneremail; $this->active = $active; } @@ -33,6 +34,10 @@ class Project{ return $this->owneruname; } + public function getOwnerEmail(){ + return $this->owneremail; + } + public function getActive(){ return $this->active; } diff --git a/src/pvv/side/projectmanager.php b/src/pvv/side/projectmanager.php index 79e9132..db4bab0 100644 --- a/src/pvv/side/projectmanager.php +++ b/src/pvv/side/projectmanager.php @@ -23,6 +23,7 @@ class ProjectManager{ $dbProj['description'], $dbProj['owner'], $dbProj['owneruname'], + $dbProj['owneremail'], $dbProj['active'] ); $projects[] = $project; @@ -44,6 +45,7 @@ class ProjectManager{ $dbProj['description'], $dbProj['owner'], $dbProj['owneruname'], + $dbProj['owneremail'], $dbProj['active'] ); @@ -64,6 +66,7 @@ class ProjectManager{ $dbProj['description'], $dbProj['owner'], $dbProj['owneruname'], + $dbproj['owneremail'], $dbProj['active'] ); $projects[] = $project; diff --git a/www/admin/prosjekter/edit.php b/www/admin/prosjekter/edit.php index 374c83e..b509ce7 100644 --- a/www/admin/prosjekter/edit.php +++ b/www/admin/prosjekter/edit.php @@ -42,6 +42,7 @@ $project = new \pvv\side\Project( '', 'kåre knoll', 'pvvadmin', + 'drift@pvv.ntnu.no', 0 ); if($new == 0){ @@ -86,6 +87,9 @@ if($new == 0){
Prosjektleder (Navn)
= '' ?> +Prosjektleder E-post
+ = '' ?>Aktiv
= 'getActive() ? 'checked' : '') . ' name="active"/>' ?> diff --git a/www/admin/prosjekter/update.php b/www/admin/prosjekter/update.php index 69eadc3..8bde074 100644 --- a/www/admin/prosjekter/update.php +++ b/www/admin/prosjekter/update.php @@ -32,26 +32,29 @@ $title = $_POST['title']; $desc = $_POST['desc']; $owner = $_POST['organisername']; $uname = $_POST['organiser']; +$email = $_POST['organiseremail']; $active = (isset($_POST['active']) ? $_POST['active'] : 0); $statement; if($id == 0){ - $query = 'INSERT INTO projects (name, owner, owneruname, description, active) VALUES (:title, :owner, :uname, :desc, :active)'; + $query = 'INSERT INTO projects (name, owner, owneruname, owneremail, description, active) VALUES (:title, :owner, :uname, :email, :desc, :active)'; $statement = $pdo->prepare($query); $statement->bindParam(':title', $title, PDO::PARAM_STR); $statement->bindParam(':desc', $desc, PDO::PARAM_STR); $statement->bindParam(':owner', $owner, PDO::PARAM_STR); $statement->bindParam(':uname', $uname, PDO::PARAM_STR); + $statement->bindParam(':email', $email, PDO::PARAM_STR); $statement->bindParam(':active', $active, PDO::PARAM_INT); }else{ - $query = 'UPDATE projects SET name=:title, owner=:owner, owneruname=:uname, description=:desc, active=:active WHERE id=:id'; + $query = 'UPDATE projects SET name=:title, owner=:owner, owneruname=:uname, owneremail=:email, description=:desc, active=:active WHERE id=:id'; $statement = $pdo->prepare($query); $statement->bindParam(':title', $title, PDO::PARAM_STR); $statement->bindParam(':desc', $desc, PDO::PARAM_STR); $statement->bindParam(':owner', $owner, PDO::PARAM_STR); $statement->bindParam(':uname', $uname, PDO::PARAM_STR); + $statement->bindParam(':email', $email, PDO::PARAM_STR); $statement->bindParam(':active', $active, PDO::PARAM_INT); $statement->bindParam(':id', $id, PDO::PARAM_INT); } diff --git a/www/css/projects.css b/www/css/projects.css index 098f81e..f66f8a3 100644 --- a/www/css/projects.css +++ b/www/css/projects.css @@ -51,6 +51,52 @@ margin-bottom: 2em; } +.contentsplit { + display: grid; + grid-template-columns: 1.3fr 2.7fr; +} + +.gridl { + padding: 0 1em 0 1em; + box-shadow: 0 2px 10px 0 rgba(0,0,0,0.2); +} + +.gridr { + border-left: 0; +} + +.projectowner { + padding: 0 .5em 0 .5em; + overflow: hidden; + border-left: 4px solid #35a; +} + +.projectowner p { + margin: 0; +} + +.projectowner p { + font-size: .8em; +} + +.projectowner p:first-child { + font-size: 1em; + margin-bottom: .2em; +} + +.owneruname, .owneremail { + display: inline-block; + color: #888; +} + +.owneruname { + float: left; +} + +.owneremail { + float: right; +} + @media screen and (max-width: 50rem) { .projects { display: inline-block; diff --git a/www/prosjekt/edit.php b/www/prosjekt/edit.php index 84bfdd2..f6a83bb 100644 --- a/www/prosjekt/edit.php +++ b/www/prosjekt/edit.php @@ -33,6 +33,7 @@ $project = new \pvv\side\Project( '', $attrs["cn"][0], $attrs["uid"][0], + $attrs["email"][0] 1 ); if($new == 0){ diff --git a/www/prosjekt/info.php b/www/prosjekt/info.php new file mode 100644 index 0000000..a042323 --- /dev/null +++ b/www/prosjekt/info.php @@ -0,0 +1,50 @@ +getByID($projectID); +?> + + + + + + + + + + + + += implode($project->getDescription(), "
"); ?>
Prosjekteier
+= $project->getOwner() ?>
+= $project->getOwnerUName(); ?>
+= $project->getOwnerEmail(); ?>
+= implode($project->getDescription()); ?>
+= implode($project->getDescription(), "
"); ?>