diff --git a/client/static/js/main.js b/client/static/js/main.js index 539cc9bd4808c454ab17e44b6e2b491fc03a3bfd..513dfccf12dfa74563d617dcc889d2cc9a7312bf 100644 --- a/client/static/js/main.js +++ b/client/static/js/main.js @@ -11,7 +11,7 @@ $(document).ready(function() //getting the next element var $content = $header.next(); - //open up the content needed - toggle the slide- if visible, slide up, if not slidedown. + //open up the content needed - toggle the slide- if visible, slide up, if not slide down. $content.slideToggle(200); }); @@ -33,21 +33,6 @@ $(document).ready(function() }); } - $('.button-save-milestone').click(function() - { - editMilestone(this.dataset.id, this.dataset.roadmapid); - }); - - $('.button-save-task').click(function() - { - editTask(this.dataset.id, this.dataset.milestoneid); - }); - - $('.button-save-subtask').click(function() - { - editSubtask(this.dataset.id, this.dataset.taskid); - }); - $('.button-delete-roadmap').click(function() { var response = confirm("Do you really want to delete this roadmap?"); @@ -108,11 +93,6 @@ $(document).ready(function() formatSubmit: 'yyyy-mm-dd' }); - $('#button-mark-all-as-done').click(function() - { - markAllTasksAsDone(this.dataset.milestoneid); - }); - createTrainMap(); }); @@ -123,7 +103,7 @@ function isNull(object) function hideElement(element, value) { - if(value == true) + if(value === true) { element.classList.add("hide"); } @@ -236,24 +216,3 @@ function validateNewTaskForm() return true; } - -function markAllTasksAsDone(milestone_ID) -{ - $.post('../admin/helper/mark-all-tasks-as-done.php', - { - "milestoneID": milestone_ID - - }, function(data, error) - { - data = data.toString().trim(); - - if(data != "error" && data != "bad_login") - { - window.location.href = "../admin/admin-tasks.php?id=" + milestone_ID; - } - else - { - alert('An error occurred while marking all tasks as done'); - } - }); -} diff --git a/php/admin/admin-edit-subtask.php b/php/admin/admin-edit-subtask.php deleted file mode 100644 index 8edd0181b86befb3aefc35f302b0cafa8c3f125a..0000000000000000000000000000000000000000 --- a/php/admin/admin-edit-subtask.php +++ /dev/null @@ -1,154 +0,0 @@ -<!DOCTYPE html> - -<?php -if(!isset($_SESSION)) -{ - session_start(); -} -if(!isset($_SESSION['loggedIn'])) -{ - header('Location: login.php'); -} - -include_once('../getLanguageJSON.php'); -include_once('../database.php'); - -if(!isset($_GET['taskID'])) -{ - header('Location: ../error.php?message=error_param_missing'); - exit; -} - -$taskID = $_GET['taskID']; -if(!is_numeric($taskID) || $taskID < 1) -{ - header('Location: ../error.php?message=error_param_invalid'); - exit; -} - - -if(!isset($_GET['edit'])) -{ - $_GET['edit'] = "false"; - - $ID = 0; - - $db = new DB(); - $db->createTables(); -} -else -{ - if(!isset($_GET['id'])) - { - header('Location: ../error.php?message=error_param_missing'); - exit; - } - - $ID = $_GET['id']; - if(!is_numeric($ID) || $ID < 1) - { - header('Location: ../error.php?message=error_param_invalid'); - exit; - } - - $db = new DB(); - $db->createTables(); - - $subtask = $db->getSubtask($ID); - if($subtask == false) - { - header('Location: ../error.php?message=error_subtask_not_existing'); - exit; - } -} -?> -<html xmlns="http://www.w3.org/1999/html"> - <head> - <meta charset="UTF-8"/> - <?php - if($_GET['edit'] == "false") - { - echo '<title>New Subtask</title>'; - } - else - { - echo '<title>Edit Subtask</title>'; - } - ?> - <!--Import Google Icon Font--> - <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> - <!--Import materialize.css--> - <link type="text/css" rel="stylesheet" href="../../materialize/css/materialize.min.css" media="screen,projection"/> - <link type="text/css" rel="stylesheet" href="../../css/style.css"/> - - <!--Import jQuery before materialize.js--> - <script type="text/javascript" src="../../js/jquery-2.2.4.min.js"></script> - <script type="text/javascript" src="../../materialize/js/materialize.min.js"></script> - <script type="text/javascript" src="../../js/main.js"></script> - <script type="text/javascript" src="../../js/ResizeSensor.js"></script> - <script type="text/javascript" src="../../js/ElementQueries.js"></script> - - <!--Let browser know website is optimized for mobile--> - <meta name="viewport" content="width=device-width, initial-scale=1.0"/> - </head> - - <body class="grey lighten-3"> - <div class="hide" id="edit"><?php echo $_GET['edit'];?></div> - <div id="main"> - <div class="container"> - <?php - if($_GET['edit'] == "false") - { - echo '<h2 class="center-align" id="headline">New Subtask</h2>'; - } - else - { - echo '<h2 class="center-align" id="headline">Edit Subtask</h2>'; - } - ?> - - <div class="row center-align"> - <div class="col s12 m8 offset-m2 l6 offset-l3"> - <div class="input-field col s12"> - <input id="title" name="title" type="text" value="<?php if(isset($subtask)){echo $subtask['Title'];}?>"> - <label for="title">Title</label> - </div> - </div> - </div> - <div class="row center-align"> - <div class="col s12 m8 offset-m2 l6 offset-l3"> - <div class="input-field col s12"> - <input id="description" name="description" type="text" value="<?php if(isset($subtask)){echo $subtask['Description'];}?>"> - <label for="description">Description</label> - </div> - </div> - </div> - <div class="row center-align"> - <div class="col s12 m8 offset-m2 l6 offset-l3"> - <div class="col s12 left-align"> - <input type="checkbox" id="checkbox-done" - <?php - if(isset($subtask)) - { - if($subtask['Status'] == "1") - { - echo "checked"; - } - } - ?> - /> - <label for="checkbox-done">Done</label> - </div> - </div> - </div> - - <div class="row center-align margin-top"> - <div class="col s12 m8 offset-m2 l6 offset-l3"> - <a class="waves-effect waves-light btn blue darken-3" href="admin-subtasks.php?id=<?php echo $taskID;?>"><i class="material-icons left">arrow_back</i>Back</a> - <a class="waves-effect waves-light btn blue darken-3 margin-left button-save-subtask" data-id="<?php echo $ID;?>" data-taskid="<?php echo $taskID;?>"><i class="material-icons left">save</i>Save</a> - </div> - </div> - </div> - </div> - </body> -</html> \ No newline at end of file diff --git a/php/admin/admin-subtasks.php b/php/admin/admin-subtasks.php deleted file mode 100644 index 6a413f6fa35c4dead6acc01b96dd373e7d4f43ea..0000000000000000000000000000000000000000 --- a/php/admin/admin-subtasks.php +++ /dev/null @@ -1,128 +0,0 @@ -<!DOCTYPE html> - -<?php -if(!isset($_SESSION)) -{ - session_start(); -} -if(!isset($_SESSION['loggedIn'])) -{ - header('Location: login.php'); -} - -include_once('../getLanguageJSON.php'); -include_once('../database.php'); - -if(!isset($_GET['id'])) -{ - header('Location: ../error.php?message=error_param_missing'); - exit; -} - -$ID = $_GET['id']; -if(!is_numeric($ID) || $ID < 1) -{ - header('Location: ../error.php?message=error_param_invalid'); - exit; -} - -$db = new DB(); -$db->createTables(); - -$task = $db->getTask($ID); -if($task == false) -{ - header('Location: ../error.php?message=error_subtask_not_existing'); - exit; -} - -?> -<html xmlns="http://www.w3.org/1999/html"> -<head> - <meta charset="UTF-8"/> - <title>Subtasks - Adminarea</title> - <!--Import Google Icon Font--> - <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> - <!--Import materialize.css--> - <link type="text/css" rel="stylesheet" href="../../materialize/css/materialize.min.css" media="screen,projection"/> - <link type="text/css" rel="stylesheet" href="../../css/style.css"/> - - <!--Import jQuery before materialize.js--> - <script type="text/javascript" src="../../js/jquery-2.2.4.min.js"></script> - <script type="text/javascript" src="../../materialize/js/materialize.min.js"></script> - <script type="text/javascript" src="../../js/main.js"></script> - <script type="text/javascript" src="../../js/ResizeSensor.js"></script> - <script type="text/javascript" src="../../js/ElementQueries.js"></script> - - <!--Let browser know website is optimized for mobile--> - <meta name="viewport" content="width=device-width, initial-scale=1.0"/> -</head> - -<body class="grey lighten-3"> -<a class="waves-effect waves-light btn blue darken-3" href="admin-tasks.php?id=<?php echo $task['MilestoneID'];?>"><i class="material-icons left">arrow_back</i>Back</a> -<a class="waves-effect waves-light btn blue darken-3 right" href="logout.php"><i class="material-icons left">lock</i>Logout</a> -<div id="main"> - <div class="container"> - <h2 class="center-align truncate" id="headline"><?php echo $task['Title'];?></h2> - <h4 class="center-align" id="headline">Subtasks</h4> - - <div class="row"> - <div class="col s12 m8 offset-m2 l6 offset-l3 center-align"> - <a class="waves-effect waves-light btn blue darken-3" href="admin-edit-subtask.php?taskID=<?php echo $ID;?>"><i - class="material-icons left">add</i>New</a> - </div> - </div> - <div class="row"> - <div class="col s12 m10 offset-m1 l8 offset-l2"> - <table class="bordered"> - <thead> - <tr> - <th data-field="id">ID</th> - <th data-field="project-name">Title</th> - <th data-field="project-name">Status</th> - </tr> - </thead> - - <tbody> - <?php - $tasks = $db->getSubtasks($ID); - - if($tasks == false) - { - echo '<td colspan="6" class="center-align">No Subtasks</td>'; - exit; - } - else - { - for($i = 0; $i < sizeof($tasks); $i++) - { - $status = $tasks[$i]['Status']; - echo '<tr>' . - '<td>' . $tasks[$i]['ID'] . '</td>' . - '<td>' . $tasks[$i]['Title'] . '</td>'; - - if($status == "0") - { - echo '<td><i class="material-icons red-text">build</i></td>'; - } - else - { - echo '<td><i class="material-icons green-text">check</i></td>'; - } - - echo '<td class="right-align">' . - '<a class="btn-flat no-padding tooltipped" href="admin-edit-subtask.php?id=' . $tasks[$i]['ID'] . '&taskID='. $ID .'&edit=true" data-position="bottom" data-delay="50" data-tooltip="Edit"><i class="material-icons left">edit</i></a>' . - '<a class="btn-flat button-delete-subtask no-padding tooltipped" data-id="' . $tasks[$i]['ID'] . '" data-taskid="' . $ID . '" data-position="bottom" data-delay="50" data-tooltip="Delete"><i class="material-icons left">delete</i></a>' . - '</td>' . - '</tr>'; - } - } - ?> - </tbody> - </table> - </div> - </div> - </div> -</div> -</body> -</html> \ No newline at end of file diff --git a/php/admin/helper/checkLogin.php b/php/admin/helper/checkLogin.php deleted file mode 100644 index 72827608708e18481e68cc4b0b12964e33da7e31..0000000000000000000000000000000000000000 --- a/php/admin/helper/checkLogin.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -require_once('settings.php'); - -if(!isset($_SESSION)) -{ - session_start(); -} - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(isset($_POST['password'])) - { - if($_POST['password'] == $admin_password) - { - $_SESSION['loggedIn'] = 'true'; - echo "success"; - } - else - { - echo "bad_login"; - } - } - else - { - echo "error"; - } -} -else -{ - echo "error"; -} \ No newline at end of file diff --git a/php/admin/helper/delete-milestone.php b/php/admin/helper/delete-milestone.php deleted file mode 100644 index 3f13922d7742f0f811e1e471a71d1d6490fc8e40..0000000000000000000000000000000000000000 --- a/php/admin/helper/delete-milestone.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -include_once('../../database.php'); - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(!isset($_POST['milestone_ID'])) - { - echo "error"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($db->deleteMilestone($_POST['milestone_ID']) == false) - { - echo "error"; - exit; - } - else - { - echo "success"; - exit; - } -} -else -{ - echo "error"; - exit; -} \ No newline at end of file diff --git a/php/admin/helper/delete-roadmap.php b/php/admin/helper/delete-roadmap.php deleted file mode 100644 index 5458faa4dcfba3a853525ee2dc0644f32a60a9dd..0000000000000000000000000000000000000000 --- a/php/admin/helper/delete-roadmap.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -include_once('../../database.php'); - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(!isset($_POST['roadmap_ID'])) - { - echo "error"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($db->deleteRoadmap($_POST['roadmap_ID']) == false) - { - echo "error"; - exit; - } - else - { - echo "success"; - exit; - } -} -else -{ - echo "error"; - exit; -} \ No newline at end of file diff --git a/php/admin/helper/delete-subtask.php b/php/admin/helper/delete-subtask.php deleted file mode 100644 index 0e154891dd15cb51e96cff862ab970d1e5855937..0000000000000000000000000000000000000000 --- a/php/admin/helper/delete-subtask.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -include_once('../../database.php'); - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(!isset($_POST['subtask_ID'])) - { - echo "error"; - exit; - } - - if(!isset($_POST['task_ID'])) - { - echo "error"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($db->deleteSubtask($_POST['subtask_ID'], $_POST['task_ID']) == false) - { - echo "error"; - exit; - } - else - { - echo "success"; - exit; - } -} -else -{ - echo "error"; - exit; -} \ No newline at end of file diff --git a/php/admin/helper/delete-task.php b/php/admin/helper/delete-task.php deleted file mode 100644 index 181dbb9e3600c6f847c174b6b42b4762da9b7b59..0000000000000000000000000000000000000000 --- a/php/admin/helper/delete-task.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -include_once('../../database.php'); - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(!isset($_POST['task_ID'])) - { - echo "error"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($db->deleteTask($_POST['task_ID']) == false) - { - echo "error"; - exit; - } - else - { - echo "success"; - exit; - } -} -else -{ - echo "error"; - exit; -} \ No newline at end of file diff --git a/php/admin/helper/edit-milestone.php b/php/admin/helper/edit-milestone.php deleted file mode 100644 index 55eed6039bcb82fd0b5a923707770b9311351368..0000000000000000000000000000000000000000 --- a/php/admin/helper/edit-milestone.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -include_once('../../database.php'); - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(!isset($_POST['edit'])) - { - echo "error"; - exit; - } - - if(!isset($_POST['ID'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['roadmap-ID'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['version-name'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['version-code'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['title'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['due-date'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['done-date'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['done'])) - { - echo "error-edit"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($_POST['edit'] == "true") - { - if($db->updateMilestone($_POST['ID'], $_POST['version-code'], $_POST['version-name'], $_POST['title'], $_POST['due-date'], $_POST['done-date'], $_POST['done']) == false) - { - echo "error-edit"; - exit; - } - else - { - echo "success"; - exit; - } - } - else - { - if($db->insertMilestone($_POST['roadmap-ID'], $_POST['version-code'], $_POST['version-name'], $_POST['title'], $_POST['due-date'], $_POST['done-date'], $_POST['done']) == false) - { - echo "error-insert"; - exit; - } - else - { - echo "success"; - exit; - } - } -} -else -{ - echo "error"; - exit; -} \ No newline at end of file diff --git a/php/admin/helper/edit-roadmap.php b/php/admin/helper/edit-roadmap.php deleted file mode 100644 index 3c74d7ab13fec3321e6b8b49374ef2e7fc097dd3..0000000000000000000000000000000000000000 --- a/php/admin/helper/edit-roadmap.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -include_once('../../database.php'); - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(!isset($_POST['edit'])) - { - echo "error"; - exit; - } - - if($_POST['edit'] == "true") - { - if(!isset($_POST['ID'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['project-name'])) - { - echo "error-edit"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($db->updateRoadmap($_POST['ID'], $_POST['project-name']) == false) - { - echo "error-edit"; - exit; - } - else - { - echo "success"; - exit; - } - } - else - { - if(!isset($_POST['project-name'])) - { - echo "error-insert"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($db->insertRoadmap($_POST['project-name']) == false) - { - echo "error-insert"; - exit; - } - else - { - echo "success"; - exit; - } - } -} -else -{ - echo "error"; - exit; -} \ No newline at end of file diff --git a/php/admin/helper/edit-subtask.php b/php/admin/helper/edit-subtask.php deleted file mode 100644 index 2be94bb94f13341100fbbdf27eeee753e9329284..0000000000000000000000000000000000000000 --- a/php/admin/helper/edit-subtask.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -include_once('../../database.php'); - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(!isset($_POST['edit'])) - { - echo "error"; - exit; - } - - if(!isset($_POST['ID'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['task-ID'])) - { - echo "error-edit"; - exit; - } - - - if(!isset($_POST['title'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['description'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['done'])) - { - echo "error-edit"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($_POST['edit'] == "true") - { - if($db->updateSubtask($_POST['ID'], $_POST['task-ID'], $_POST['title'], $_POST['description'], $_POST['done']) == false) - { - echo "error-edit"; - exit; - } - else - { - echo "success"; - exit; - } - } - else - { - if($db->insertSubtask($_POST['task-ID'], $_POST['title'], $_POST['description'], $_POST['done']) == false) - { - echo "error-insert"; - exit; - } - else - { - echo "success"; - exit; - } - } -} -else -{ - echo "error"; - exit; -} \ No newline at end of file diff --git a/php/admin/helper/edit-task.php b/php/admin/helper/edit-task.php deleted file mode 100644 index 9e9922cb6778f06d9a61fa684e1eb90cdb460b4d..0000000000000000000000000000000000000000 --- a/php/admin/helper/edit-task.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -include_once('../../database.php'); - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(!isset($_POST['edit'])) - { - echo "error"; - exit; - } - - if(!isset($_POST['ID'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['milestone-ID'])) - { - echo "error-edit"; - exit; - } - - - if(!isset($_POST['title'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['description'])) - { - echo "error-edit"; - exit; - } - - if(!isset($_POST['done'])) - { - echo "error-edit"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($_POST['edit'] == "true") - { - if($db->updateTask($_POST['ID'], $_POST['milestone-ID'], $_POST['title'], $_POST['description'], $_POST['done']) == false) - { - echo "error-edit"; - exit; - } - else - { - echo "success"; - exit; - } - } - else - { - if($db->insertTask($_POST['milestone-ID'], $_POST['title'], $_POST['description'], $_POST['done']) == false) - { - echo "error-insert"; - exit; - } - else - { - echo "success"; - exit; - } - } -} -else -{ - echo "error"; - exit; -} \ No newline at end of file diff --git a/php/admin/helper/mark-all-tasks-as-done.php b/php/admin/helper/mark-all-tasks-as-done.php deleted file mode 100644 index 1a56e448024b089d39b3e20ac3cdfa6428a4a669..0000000000000000000000000000000000000000 --- a/php/admin/helper/mark-all-tasks-as-done.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -include_once('../../database.php'); - -if($_SERVER['REQUEST_METHOD'] == 'POST') -{ - if(!isset($_POST['milestoneID'])) - { - echo "error"; - exit; - } - - $db = new DB(); - $db->createTables(); - - if($db->markAllTasksAsDone($_POST['milestoneID']) == false) - { - echo "error"; - exit; - } - else - { - echo "success"; - exit; - } -} -else -{ - echo "error"; - exit; -} \ No newline at end of file diff --git a/php/admin/helper/settings-template.php b/php/admin/helper/settings-template.php deleted file mode 100644 index 1e8bfe89d8500c56c99c988a7d6ba07e5db7d637..0000000000000000000000000000000000000000 --- a/php/admin/helper/settings-template.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php -// mysql or pgsql -$database_type = "mysql"; -$database_name=""; -$database_user=""; -$database_password=""; - -$admin_password="123"; -