summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Kindströmmer <me@brolaugh.com>2016-04-28 08:59:29 +0200
committerHannes Kindströmmer <me@brolaugh.com>2016-04-28 08:59:29 +0200
commit22ddbd384bab55b1e5f54f51cd2c1c37902b102d (patch)
treeb8c9eb8fd328535b52074383b83a6dff6b5b0f44
parent5cf32f6476fd2e5abdc7b7bae29fc591997f69cc (diff)
downloadtasklist-php-22ddbd384bab55b1e5f54f51cd2c1c37902b102d.zip
tasklist-php-22ddbd384bab55b1e5f54f51cd2c1c37902b102d.tar.gz
tasklist-php-22ddbd384bab55b1e5f54f51cd2c1c37902b102d.tar.bz2
CodeDump: think git bugged out
-rw-r--r--.htaccess2
-rw-r--r--App/ajax/gettask.php56
-rw-r--r--App/ajax/gettask_inner.php54
-rw-r--r--App/ajax/gettasks.php35
-rw-r--r--App/ajax/lasttask.php52
-rw-r--r--App/database/Insert.php4
-rw-r--r--App/database/Select.php79
-rw-r--r--App/database/dbSetup.php6
-rw-r--r--App/formhandler/add_listitem.php2
-rw-r--r--App/pages/dashboard.php76
-rw-r--r--App/pages/uppvisning.php9
-rw-r--r--js/master.js84
12 files changed, 369 insertions, 90 deletions
diff --git a/.htaccess b/.htaccess
index bd3e865..932d1d6 100644
--- a/.htaccess
+++ b/.htaccess
@@ -3,8 +3,8 @@ RewriteEngine on
RewriteRule ^404 index.php?page=404 [NC,L]
RewriteRule ^dashboard index.php?page=dashboard [NC,L]
+RewriteRule ^uppvisning index.php?page=uppvisning [NC,L]
RewriteRule ^image/([0-9a-zA-Z]+) index.php?view=image&id=$1 [NC,L]
RewriteRule ^tag/([0-9a-zA-Z\-]+) index.php?view=tag&tag=$1 [NC,L]
RewriteRule ^tag index.php?page=tagSelect [NC,L]
-
diff --git a/App/ajax/gettask.php b/App/ajax/gettask.php
new file mode 100644
index 0000000..2f386c1
--- /dev/null
+++ b/App/ajax/gettask.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: brolaugh
+ * Date: 3/1/16
+ * Time: 9:03 PM
+ */
+
+
+chdir("../..");
+include_once 'Helper.php';
+
+//$statuses = $_POST['statuses'];
+if(!isset($_POST['task'])){
+ exit();
+}
+ $s = new Select();
+ $task = $s->getAllTaskWithStatus($_POST['task']);
+ $tl = $s->getAllStatusLevels();
+ ?>
+ <div class="well well-xs">
+ <h3>
+ <span class="pull-left"><?php echo $task->title; ?></span>
+ <div class="btn-group">
+ <div class="btn-toolbar">
+ <div class="btn-group">
+ <a href="bootstrap-elements.html" data-target="#" class="btn btn-raised btn-<?php echo $task->style_class;?> dropdown-toggle"
+ data-toggle="dropdown">
+ <?php echo $task->level ;?>
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <?php
+ foreach ($status_level as $tl) {
+ if ($task->level != $tl->plain_text) {
+ ?>
+ <li><a
+ href="<?php echo ROOT . "/App/formhandler/changestatus.php?task=" . $task->id . "&status=" . $tl->id; ?>"><span
+ class="text-<?php echo $tl->style_class; ?>"><?php echo $tl->plain_text; ?></span></a></li>
+ <?php
+ }
+ }
+
+ ?>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </h3>
+ <p class="text-primary">
+ <?php echo $task->description; ?>
+ </p>
+ <p class="text-muted small">
+ Uppdaterad <?php echo $task->stamp . " av " . $task->user;?>
+ </p>
+ </div>
diff --git a/App/ajax/gettask_inner.php b/App/ajax/gettask_inner.php
new file mode 100644
index 0000000..5bdb5c4
--- /dev/null
+++ b/App/ajax/gettask_inner.php
@@ -0,0 +1,54 @@
+<?php
+/**
+* Created by PhpStorm.
+* User: brolaugh
+* Date: 3/1/16
+* Time: 9:03 PM
+*/
+
+
+chdir("../..");
+include_once 'Helper.php';
+
+//$statuses = $_POST['statuses'];
+if(!isset($_POST['task'])){
+ exit();
+}
+$s = new \App\database\Select();
+$task = $s->getTaskWithStatus($_POST['task']);
+$status_level = $s->getAllStatusLevels();
+?>
+<h3>
+ <span ><?php echo $task->title; ?></span>
+ <div class="btn-group">
+ <div class="btn-toolbar">
+ <div class="btn-group">
+ <a href="bootstrap-elements.html" data-target="#" class="btn btn-raised btn-<?php echo $task->style_class;?> dropdown-toggle"
+ data-toggle="dropdown">
+ <?php echo $task->level ;?>
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <?php
+ foreach ($status_level as $tl) {
+ if ($task->level != $tl->plain_text) {
+ ?>
+ <li data-toggle="modal" data-target="#statusmodal" onclick="javascript:modalFix(<?php echo $task->id . "," . $tl->id . ",'" . $task->title."'";?>)">
+ <span class="text<?php echo $tl->style_class; ?>"><?php echo $tl->plain_text; ?></span>
+ </li>
+ <?php
+ }
+ }
+
+ ?>
+ </ul>
+ </div>
+ </div>
+ </div>
+</h3>
+<p class="text-primary">
+ <?php echo $task->description; ?>
+</p>
+<p class="text-muted small">
+ Uppdaterad <?php echo $task->stamp . " av " . $task->user;?>
+</p>
diff --git a/App/ajax/gettasks.php b/App/ajax/gettasks.php
index 89bd705..b6b5740 100644
--- a/App/ajax/gettasks.php
+++ b/App/ajax/gettasks.php
@@ -9,22 +9,37 @@
chdir("../..");
include_once 'Helper.php';
-
//$statuses = $_POST['statuses'];
-
+$a = array();
+if(isset($_POST['done']) && $_POST['done'] == true){
+ $a[] = 1;
+}
+if(isset($_POST['undone']) && $_POST['undone'] == true){
+ $a[] = 2;
+}
+if(isset($_POST['indev']) && $_POST['indev'] == true){
+ $a[] = 3;
+}
+if(isset($_POST['prio1']) && $_POST['prio1'] == true){
+ $a[] = 4;
+}
$s = new \App\database\Select();
-$tasks = $s->getTasksWithFollowingStatus(array(1,2,3));
+if(count($a) > 0)
+ $tasks = $s->getTasksWithFollowingStatus($a);
+else
+ $tasks = $s->getTasksWithFollowingStatus();
+
$status_level = $s->getAllStatusLevels();
foreach ($tasks as $task) {
?>
- <div class="well well-xs">
+ <div class="well well-xs status-<?php echo $task->level;?>">
<h3>
- <span class="pull-left"><?php echo $task->title; ?></span>
+ <span ><?php echo $task->title; ?></span>
<div class="btn-group">
<div class="btn-toolbar">
<div class="btn-group">
<a href="bootstrap-elements.html" data-target="#" class="btn btn-raised btn-<?php echo $task->style_class;?> dropdown-toggle"
- data-toggle="dropdown">
+ data-toggle="dropdown">
<?php echo $task->level ;?>
<span class="caret"></span>
</a>
@@ -33,9 +48,9 @@ foreach ($tasks as $task) {
foreach ($status_level as $tl) {
if ($task->level != $tl->plain_text) {
?>
- <li><a
- href="<?php echo ROOT . "/App/formhandler/changestatus.php?task=" . $task->id . "&status=" . $tl->id; ?>"><span
- class="text-<?php echo $tl->style_class; ?>"><?php echo $tl->plain_text; ?></span></a></li>
+ <li data-toggle="modal" data-target="#statusmodal" onclick="javascript:modalFix(<?php echo $task->id . "," . $tl->id . ",'" . $task->title."'";?>)">
+ <span class="text-<?php echo $tl->style_class; ?>"><?php echo $tl->plain_text; ?></span>
+ </li>
<?php
}
}
@@ -47,7 +62,7 @@ foreach ($tasks as $task) {
</div>
</h3>
<p class="text-primary">
- <?php echo $task->description; ?>
+ <?php echo $task->description; ?>
</p>
</div>
<?php
diff --git a/App/ajax/lasttask.php b/App/ajax/lasttask.php
new file mode 100644
index 0000000..a844af5
--- /dev/null
+++ b/App/ajax/lasttask.php
@@ -0,0 +1,52 @@
+<?php
+/**
+* Created by PhpStorm.
+* User: brolaugh
+* Date: 3/1/16
+* Time: 9:03 PM
+*/
+
+
+chdir("../..");
+include_once 'Helper.php';
+
+$s = new \App\database\Select();
+$task = $s->getLastTask();
+$status_level = $s->getAllStatusLevels();
+?>
+<div class="well well-xs status-<?php echo $task->level;?>">
+ <h3>
+ <span ><?php echo $task->title; ?></span>
+ <div class="btn-group">
+ <div class="btn-toolbar">
+ <div class="btn-group">
+ <a href="bootstrap-elements.html" data-target="#" class="btn btn-raised btn-<?php echo $task->style_class;?> dropdown-toggle"
+ data-toggle="dropdown">
+ <?php echo $task->level ;?>
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <?php
+ foreach ($status_level as $tl) {
+ if ($task->level != $tl->plain_text) {
+ ?>
+ <li data-toggle="modal" data-target="#statusmodal" onclick="javascript:modalFix(<?php echo $task->id . "," . $tl->id . ",'" . $task->title."'";?>)">
+ <span class="text-<?php echo $tl->style_class; ?>"><?php echo $tl->plain_text; ?></span>
+ </li>
+ <?php
+ }
+ }
+
+ ?>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </h3>
+ <p class="text-primary">
+ <?php echo $task->description; ?>
+ </p>
+ <p class="text-muted small">
+ Uppdaterad <?php echo $task->stamp . " av " . $task->user;?>
+ </p>
+</div>
diff --git a/App/database/Insert.php b/App/database/Insert.php
index 5640263..9c4428d 100644
--- a/App/database/Insert.php
+++ b/App/database/Insert.php
@@ -31,10 +31,10 @@ class Insert extends dbSetup{
* @param String $user
*/
public function addStatus($task, $status_level, $user="Unkown"){
- $stmt = $this->getDb()->prepare("INSERT INTO status(task, status_level, user) values(?,?,?)");
+ $stmt = $this->getDb()->prepare("INSERT INTO status(task, status_level, user, stamp) values(?,?,?, now())");
$stmt->bind_param('iis', $task, $status_level, $user);
$stmt->execute();
$stmt->close();
}
-} \ No newline at end of file
+}
diff --git a/App/database/Select.php b/App/database/Select.php
index a7c1f8d..4720549 100644
--- a/App/database/Select.php
+++ b/App/database/Select.php
@@ -11,58 +11,34 @@ namespace App\database;
class Select extends dbSetup
{
-
- /**
- * @return array
- */
- public function getAllTasks()
+ public function __destruct() {
+ parent::__destruct();
+ }
+ public function getTaskWithStatus($taskID)
{
- $stmt = $this->getDb()->prepare("SELECT * FROM task");
+ $stmt = $this->getDb()->prepare("SELECT * FROM task_with_status WHERE id = ?");
+ $stmt->bind_param('i', $taskID);
$stmt->execute();
$res = $stmt->get_result();
- $a = array();
- while ($row = $res->fetch_object()) {
- array_push($a, $row);
- }
+ $retval = $res->fetch_object();
$stmt->close();
- return $a;
+ return $retval;
}
+ public function getLastTask(){
- /**
- * @return array
- */
- public function getAllUnFinishedTasks()
- {
- $stmt = $this->getDb()->prepare("SELECT * FROM status");
+ $stmt = $this->getDb()->prepare("SELECT * FROM last_task_with_status");
$stmt->execute();
$res = $stmt->get_result();
- $a = array();
- while ($row = $res->fetch_object()) {
- array_push($a, $row);
- }
+ $retval = $res->fetch_object();
$stmt->close();
- return $a;
+ return $retval;
}
-
- public function getAllDoneTasks()
- {
- $stmt = $this->getDb()->prepare("");
- $stmt->execute();
- $res = $stmt->get_result();
- $a = array();
- while ($row = $res->fetch_object()) {
- array_push($a, $row);
- }
- $stmt->close();
- return $a;
- }
-
/**
* @return object array
*/
public function getAllTasksWithStatus()
{
- $stmt = $this->getDb()->prepare("SELECT * FROM task_with_status");
+ $stmt = $this->getDb()->prepare("SELECT * FROM task_with_status ORDER BY stamp desc");
$stmt->execute();
$res = $stmt->get_result();
$a = array();
@@ -89,22 +65,25 @@ class Select extends dbSetup
/**
* @param int array $taskID
*/
- public function getTasksWithFollowingStatus($taskID=array(1))
- {
- $query = "SELECT task_with_status.id as id, title, description, user, level, stamp, task_with_status.style_class as style_class, status_level.id as level_id FROM `task_with_status` LEFT JOIN status_level ON task_with_status.level=status_level.plain_text";
+ public function getTasksWithFollowingStatus($taskID=array(1)){
+ $query = "SELECT task_with_status.id as id, title, description, user, level, stamp, task_with_status.style_class as style_class, status_level.id as level_id FROM `task_with_status` LEFT JOIN status_level ON task_with_status.level=status_level.plain_text ";
$param = "";
$secondParam = $taskID;
if (count($taskID) > 0) {
$query .= " WHERE status_level.id IN(";
for ($i = 0; $i < count($taskID); $i++) {
- if ($i != count($taskID) - 1)
+ if ($i != (count($taskID) - 1)){
$query .= "?,";
- else
+ $param .= "i";
+ }
+ else{
$query .= "?";
- $param .= "i";
+ $param .= "i";
+ }
+
}
- $query .= ")";
+ $query .= ") ORDER BY stamp desc";
}
array_unshift($secondParam, $param);
$stmt = $this->getDb()->prepare($query);
@@ -117,4 +96,16 @@ class Select extends dbSetup
}
return $a;
}
+ public function getTaskStatusHistory($taskID){
+ $stmt = $this->getDb()->prepare("SELECT user, stamp, plain_text, style_class FROM task_history WHERE task = ?");
+ $stmt->bind_param('i', $taskID);
+ $stmt->execute();
+
+ $res = $stmt->get_result();
+ $a = [];
+ while($row = $res->fetch_object){
+ $a[] = $row;
+ }
+ return $a;
+ }
}
diff --git a/App/database/dbSetup.php b/App/database/dbSetup.php
index 4bf183d..71fdc78 100644
--- a/App/database/dbSetup.php
+++ b/App/database/dbSetup.php
@@ -14,7 +14,7 @@ class dbSetup
private $db;
private $server = "rickardhforslund.se";
private $username = "brolaugh";
- private $password = "hannes";
+ private $password = "rickardh";
private $database = "brolaugh_tasklist";
@@ -28,7 +28,9 @@ class dbSetup
exit();
}
}
-
+ public function __destruct() {
+ $this->db->close();
+ }
/**
* @return Mysqli
*/
diff --git a/App/formhandler/add_listitem.php b/App/formhandler/add_listitem.php
index c88c0a5..10f58be 100644
--- a/App/formhandler/add_listitem.php
+++ b/App/formhandler/add_listitem.php
@@ -17,4 +17,4 @@ if(!isset($_POST['tasktitle'])){
$insert = new \App\database\Insert();
$insert->AddCompleteListEntry($_POST['tasktitle'], $_POST['taskbody'], $_POST['taskperson']);
-header("Location:../../dashboard"); \ No newline at end of file
+//header("Location:../../dashboard");
diff --git a/App/pages/dashboard.php b/App/pages/dashboard.php
index 7440e43..26fa860 100644
--- a/App/pages/dashboard.php
+++ b/App/pages/dashboard.php
@@ -1,16 +1,16 @@
<?php
/**
- * Created by PhpStorm.
- * User: brolaugh
- * Date: 2/25/16
- * Time: 9:54 PM
- */
+* Created by PhpStorm.
+* User: brolaugh
+* Date: 2/25/16
+* Time: 9:54 PM
+*/
?>
<div class="row">
<div class="col-md-3">
<div class="well">
<h3>Alternativ</h3>
- <form class="form-horizontal" action="javascript:getFeedArguments()" method="post">
+ <form class="form-horizontal" action="javascript:applyFilter();" method="post">
<div class="form-group">
<div class="togglebutton">
<label>
@@ -55,25 +55,25 @@
</div>
<div class="col-md-6">
<div class="well">
- <form class="form-horizontal" role="form" action="App/formhandler/add_listitem.php" method="post">
+ <form class="form-horizontal" action="javascript:addTask()" method="post">
<fieldset>
<div class="form-group">
<label for="tasktitle" class="control-label col-md-2">Uppgift</label>
<div class="col-md-10">
- <input type="text" name="tasktitle" placeholder="Uppgiftstitel" class="form-control" required="required">
+ <input type="text" name="tasktitle" id="tasktitle" placeholder="Uppgiftstitel" class="form-control" required="required">
</div>
</div>
<div class="form-group">
<label for="taskbody" class="control-label col-md-2">Detalj</label>
<div class="col-md-10">
- <textarea name="taskbody" rows="3" class="col-md-10 col-sm-10 col-xs-12"
- placeholder="Detaljer"></textarea>
+ <textarea name="taskbody" id="taskbody" rows="5" class="col-md-10 col-sm-10 col-xs-12 form-control"
+ placeholder="Detaljer"></textarea>
</div>
</div>
<div class="form-group">
<label for="person" class="control-label col-md-2">Person</label>
<div class="col-md-10">
- <input type="text" name="taskperson" placeholder="Person" class="form-control" required="required">
+ <input type="text" name="taskperson" id="taskperson" placeholder="Person" class="form-control" required="required">
</div>
</div>
<div class="form-group col-md-offset-2 col-md-10">
@@ -85,21 +85,21 @@
</div>
</div>
<div class="row">
- <div class="col-md-6 col-md-offset-3">
+ <div class="col-md-6 col-md-offset-3" id="feed">
<?php
$s = new \App\database\Select();
$t = $s->getAllTasksWithStatus();
$status_level = $s->getAllStatusLevels();
foreach ($t as $task) {
?>
- <div class="well well-xs">
+ <div class="well well-xs status-<?php echo $task->level;?>" id="task_nr_<?php echo $task->id;?>">
<h3>
- <span class="pull-left"><?php echo $task->title; ?></span>
+ <span ><?php echo $task->title; ?></span>
<div class="btn-group">
<div class="btn-toolbar">
<div class="btn-group">
<a href="bootstrap-elements.html" data-target="#" class="btn btn-raised btn-<?php echo $task->style_class;?> dropdown-toggle"
- data-toggle="dropdown">
+ data-toggle="dropdown">
<?php echo $task->level ;?>
<span class="caret"></span>
</a>
@@ -108,9 +108,9 @@
foreach ($status_level as $tl) {
if ($task->level != $tl->plain_text) {
?>
- <li><a
- href="<?php echo ROOT . "/App/formhandler/changestatus.php?task=" . $task->id . "&status=" . $tl->id; ?>"><span
- class="text-<?php echo $tl->style_class; ?>"><?php echo $tl->plain_text; ?></span></a></li>
+ <li data-toggle="modal" data-target="#statusmodal" onclick="javascript:modalFix(<?php echo $task->id . "," . $tl->id . ",'" . $task->title."'";?>)">
+ <span class="text-<?php echo $tl->style_class; ?>"><?php echo $tl->plain_text; ?></span>
+ </li>
<?php
}
}
@@ -122,11 +122,49 @@
</div>
</h3>
<p class="text-primary">
- <?php echo $task->description; ?>
+ <?php echo $task->description; ?>
</p>
+ <p class="text-muted small">
+ Uppdaterad <?php echo $task->stamp . " av " . $task->user;?>
+ </p>
+
</div>
<?php
}
?>
+ <!-- Modal -->
+ <div id="statusmodal" class="modal fade" role="dialog">
+ <div class="modal-dialog">
+
+ <!-- Modal content-->
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h4 class="modal-title" id="modal-title">Ändra status</h4>
+
+ </div>
+ <div class="modal-body">
+ <form class="form-horizontal" action="javascript:changeStatus()" method="post">
+ <fieldset>
+ <input type="hidden" name="task" value="" id="modaltask">
+ <input type="hidden" name="status" value="" id="modalstatus">
+ <div class="form-group">
+ <label for="modalname" class="col-md-2 text-primary">Namn</label>
+ <div class="col-md-10">
+ <input type="text" name="name" value="" id="modalname" class="form-control" placeholder="Namn">
+ </div>
+ </div>
+ </fieldset>
+ </form>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-primary" onclick="changeStatus();">Ändra status</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+ </div>
+ </div>
+
+ </div>
+ </div>
+
</div>
</div>
diff --git a/App/pages/uppvisning.php b/App/pages/uppvisning.php
new file mode 100644
index 0000000..aa773b1
--- /dev/null
+++ b/App/pages/uppvisning.php
@@ -0,0 +1,9 @@
+<div class="row">
+ <h2>Färgalternativ</h2>
+ <a href="javascript:void(0)" class="btn btn-raised btn-default">Default</a>
+ <a href="javascript:void(0)" class="btn btn-raised btn-primary">Primary</a>
+ <a href="javascript:void(0)" class="btn btn-raised btn-success">Success</a>
+ <a href="javascript:void(0)" class="btn btn-raised btn-info">Info</a>
+ <a href="javascript:void(0)" class="btn btn-raised btn-warning">Warning</a>
+ <a href="javascript:void(0)" class="btn btn-raised btn-danger">Danger</a>
+</div>
diff --git a/js/master.js b/js/master.js
index edcf397..0590e5a 100644
--- a/js/master.js
+++ b/js/master.js
@@ -1,19 +1,81 @@
+var title, status, task;
+function modalFix(task_s, status_s, title_s){
+ document.getElementById("modal-title").value = title_s;
+ title = title_s;
+ document.getElementById("modalstatus").value = status_s;
+ status = status_s;
+ document.getElementById("modaltask").value = task_s;
+ task = task_s;
+ console.log("modalFix");
+
+}
function addTask(){
+ var xmlhttp = new XMLHttpRequest();
+ var tasktitle = document.getElementById("tasktitle").value;
+ var taskbody = document.getElementById("taskbody").value;
+ var taskperson = document.getElementById("taskperson").value;
+ xmlhttp.onreadystatechange = function() {
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+ document.getElementById("tasktitle").value = "";
+ document.getElementById("taskbody").value = "";
+ document.getElementById("taskperson").value = "";
+ getLastTask();
+ }
+ };
+ xmlhttp.open("POST", "App/formhandler/add_listitem.php", true);
+ xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ xmlhttp.send("tasktitle="+tasktitle+"&taskbody="+taskperson+"&taskperson="+taskperson);
+}
+function getLastTask(){
+ var xmlhttp = new XMLHttpRequest();
+ console.log("Häre är jag!");
+ xmlhttp.onreadystatechange = function() {
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+ $("#feed").prepend(xmlhttp.responseText);
+ }
+ };
+ xmlhttp.open("POST", "App/ajax/lasttask.php", true);
+ xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ xmlhttp.send();
}
function changeStatus(){
-
+ var xmlhttp = new XMLHttpRequest();
+ var user = document.getElementById("modalname").value;
+ xmlhttp.onreadystatechange = function() {
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+ $('#statusmodal').modal('hide');
+ UpdateTaskVisuals(task);
+ }
+ };
+ xmlhttp.open("POST", "App/formhandler/changestatus.php", true);
+ xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ xmlhttp.send("task="+task+"&status="+status+"&user"+user);
}
-function updateFeed(){
-
+function UpdateTaskVisuals(taskID){
+ var xmlhttp = new XMLHttpRequest();
+ var user = document.getElementById("modalname").value;
+ xmlhttp.onreadystatechange = function() {
+ if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+ document.getElementById("task_nr_"+taskID).innerHTML = xmlhttp.responseText;
+ }
+ };
+ xmlhttp.open("POST", "App/ajax/gettask_inner.php", true);
+ xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ xmlhttp.send("task="+taskID);
+}
+function getStatusHistory(task){
}
-function getFeedArguments(){
- var arguments = [];
- arguments.push(document.getElementById("done").value);
- arguments.push(document.getElementById("undone").value);
- arguments.push(document.getElementById("indev").value);
- arguments.push(document.getElementById("prio1").value);
- console.debug(arguments);
- //updateFeed(arguments);
+
+function applyFilter(){
+ var status_options = ["done","indev","prio1"];
+ for(var i = 0; i < status_options.length;i++){
+ console.log("Häre är jag!");
+ if(document.getElementById(status_options[i]).checked){
+ $(".status-"+status_options[i]).hide();
+ }else{
+ $(".status-"+status_options[i]).show();
+ }
+ }
}