]> gitweb.morketsmerke.org Git - bugtrack.git/commitdiff
Dodanie możliwości zapisania zgłoszeń (Zachowane zgłoszenia) w taki sposób aby nie...
authorxf0r3m <jakubstasinski@protonmail.com>
Fri, 11 Aug 2023 08:59:07 +0000 (10:59 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Fri, 11 Aug 2023 08:59:07 +0000 (10:59 +0200)
bugs.php
forms/chbugstate.php
history.php [new file with mode: 0644]
index.php
library.php
modules/chbugstate.php
navbar.php

index 9cbdef142f20191311a1d02131eaf0290b03daa4..d3c942adaa742f67f4a95d3de0fb736581c5bcc9 100644 (file)
--- a/bugs.php
+++ b/bugs.php
@@ -16,7 +16,7 @@
   </div>
   <div class="card-body">
 <?php
-  $cond = "state >= 3 ORDER BY id DESC";
+  $cond = "state >= 3 AND state < 5 ORDER BY id DESC";
   presentListBugs($connection, $cond);
 ?>
   </div>
index 5244cbfe6717b5772a59eac886f7ced9b740be49..a7226c7841cb498c95aef3954bf72a4c81489a0f 100644 (file)
@@ -4,7 +4,7 @@
     <div class="col">
       <select class="form-select" name="chBugState">
         <?php
-        $stateTbl = array('Przyjęty', 'Potwierdzony', 'W trakcie', 'Zakończony', 'Odrzucony', 'Do usunięcia');
+        $stateTbl = array('Przyjęty', 'Potwierdzony', 'W trakcie', 'Zakończony', 'Odrzucony', 'Zachowany', 'Do usunięcia');
         $tableName = 'bug';
         $columnScheme = "state";
         $whereValue = "id = " . intval($row[0]);
diff --git a/history.php b/history.php
new file mode 100644 (file)
index 0000000..41a3b67
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+  if ( session_status() != 2 ) {
+    session_start();
+  }
+  if ( isset($_SESSION["username"]) ) {
+?>
+<div class="card card-spacer">
+  <div class="card-header">
+    <h4>Zgłoszenia zachowane:</h4>
+  </div>
+  <div class="card-body">
+<?php
+  $cond = "state = 5 ORDER BY id DESC";
+  presentListBugs($connection, $cond);
+?>
+  </div>
+</div>
+<?php
+  } else {
+    include('403.php');
+  }
+?>
index 2c889bc9db4eb8fd0503258ec311b7ffebaac799..16a29ccfc9a50511d82ae123c82ca7ef38654a41 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -53,6 +53,8 @@
               include('changelog.php');
             } else if ($_GET["p"] == "viewchlog") {
               include('viewchlog.php');
+            } else if ($_GET["p"] == "history") {
+              include('history.php');
             } else {
               include('404.php');
             }
index 3df56dceb291118e82e3db11b489adbbf70de8f5..81312eae0ded3fb43cc560d8adf95666f86a6f01 100644 (file)
@@ -108,7 +108,7 @@ function presentListBugs($connection, $cond) {
   $columnScheme = "*";
   $whereValue = $cond;
   $result = dbQuery($connection, $tableName, $columnScheme, $whereValue);
-  if ( mysqli_num_rows($result) > 0 ) {
+  if ( isset($result) && mysqli_num_rows($result) > 0 ) {
     echo "<table class=\"table\">";
     echo "<thead><tr><th scope=\"col\">#Lp.</th><th scope=\"col\">#id</th><th scope=\"col\">Produkt</th><th scope=\"col\">Komponent</th>";
     echo "<th scope=\"col\">Rodzaj zgłosz.</th><th scope=\"col\">Temat zgłosz.</th><th scope=\"col\">Opis zgłosz.</th>";
@@ -130,7 +130,7 @@ function presentListBugs($connection, $cond) {
       echo getFieldValue($result3);
       echo "</th><td>" . $row[3] . "</td><td>" . $row[4] . "</td><td>" . nl2br($row[5]) . "</td>";
       echo "<td>";
-      $stateTbl = array("Przyjęty", "Potwierdzony", "W trakcie", "Zakończony", "Odrzucony");
+      $stateTbl = array("Przyjęty", "Potwierdzony", "W trakcie", "Zakończony", "Odrzucony", "Zachowany");
       $index = $row[6];
       echo $stateTbl[$index]; 
       echo "</td>";
index e0f1ba729ddedf3bac40f9375d96df7d1704f9b5..8828d3845d5352491b64d8c0670039c8f2969b2e 100644 (file)
@@ -3,7 +3,7 @@
   $columnScheme = "state";
   $whereValue = "id = " . intval($_POST["bugId"]);
   $newStateId = intval($_POST["chBugState"]);
-  if ( $newStateId == 5 ) {
+  if ( $newStateId == 6 ) {
     $tableName = 'comment';
     $whereValue = "bugId = " . intval($_POST["bugId"]);
     $result = dbDel($connection, $tableName, $whereValue);
@@ -35,7 +35,7 @@
       echo "<div class=\"alert alert-danger\" role=\"alert\">Status zgłoszenia nie został zmieniony</div>";
     }
 
-    $stateTbl = array("Przyjęty", "Potwierdzony", "W trakcie", "Zakończony", "Odrzucony");
+    $stateTbl = array("Przyjęty", "Potwierdzony", "W trakcie", "Zakończony", "Odrzucony", "Zachowany");
 
     $newState = $stateTbl[$newStateId];
     $oldState = $stateTbl[$oldStateId]; 
index 28f0ef7b94205f93f7403b40b64c848d09dd599c..64139bbbb1400591285fa1559ece8029a560f123 100755 (executable)
@@ -15,6 +15,7 @@
             <?php
               session_start();
               if ( isset($_SESSION["username"]) ) {
+                echo "<li class=\"nav-item\"><a class=\"nav-link frontpage-link\" href=\"?p=history\">Zachowane zgłoszenia</a></li>";
                 echo "<li class=\"nav-item\"><a class=\"nav-link frontpage-link\" href=\"?p=siteListProducts&site=changelog\">Lista zmian</a></li>";
                 echo "<li class=\"nav-item\"><a class=\"nav-link frontpage-link\" href=\"?p=settings\">Ustawienia</a></li>";
                 echo "<li class=\"nav-item\"><span class=\"nav-link navbar-greetings\">Witaj, " . $_SESSION["username"] . "! (<a class=\"frontpage-link\" href=\"?p=logout\">Wyloguj się</a>)</span></li>";