From: xf0r3m Date: Tue, 12 Mar 2024 09:06:17 +0000 (+0100) Subject: Synchronizacja public -> priv X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=062905efbb77866c4ac93eaef4bd9b94fb68da8c;p=bugtrack.git Synchronizacja public -> priv --- diff --git a/btcli b/btcli index b19fc57..d2ba5a8 100755 --- a/btcli +++ b/btcli @@ -13,6 +13,8 @@ $whereValue = "1=1"; } else if ( $type_of == "user" ) { $whereValue = "state < 3"; + } else if ( $type_of == "saved" ) { + $whereValue = "state = 5"; } } $result = dbQuery($connection, $tableName, $columnScheme, $whereValue); @@ -36,7 +38,7 @@ echo $compName . "\t"; echo $row[3] . "\t" . $row[4] . "\t" . $row[5] . "\t"; - $stateTbl = array("Przyjęty", "Potwierdzony", "W trakcie", "Zakończony", "Odrzucony"); + $stateTbl = array("Przyjęty", "Potwierdzony", "W trakcie", "Zakończony", "Odrzucony", "Zachowany"); $index = $row[6]; $state=$stateTbl[$index]; @@ -155,7 +157,7 @@ function show_states($state="all") { if ( isset($state) ) { - $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'); if ( $state == "all" ) { for ( $i=0; $i < count($stateTbl); $i++ ) { echo $i . "\t" . $stateTbl[$i] . "\n\n"; @@ -168,9 +170,9 @@ function change_state($connection, $bugId, $newState) { - if ( ( $newState < 0 ) || ( $newState > 5 ) ) { + if ( ( $newState < 0 ) || ( $newState > 6 ) ) { return false; - } else if ( $newState == 5 ) { + } else if ( $newState == 6 ) { $tableName = 'comment'; $whereValue = 'bugId = ' . intval($bugId); $resultk = dbDel($connection, $tableName, $whereValue); @@ -220,9 +222,21 @@ $whereValue = "bugId = " . intval($bugId); $result = dbQuery($connection,$tableName,$columnScheme,$whereValue); if ( mysqli_num_rows($result) > 0 ) { + $count=1; + echo "==============================================================" . "\n\n"; while( $row = mysqli_fetch_row($result) ) { echo $row[0] . ", " . $row[1] . " pisze...\n"; - echo $row[2] . "\n\n"; + $msg = $row[2]; + $msg = str_replace("
", "\n", $msg); + $msg = str_replace("","\e[1;37m", $msg); + $msg = str_replace("","\e[0m", $msg); + echo $msg . "\n\n"; + if ( $count == 1 ) { + echo "==============================================================" . "\n\n"; + } else { + echo "--------------------------------------------------------------" . "\n\n"; + } + $count++; } } } @@ -295,6 +309,7 @@ if ( isset($argv[1]) ) { if ( $argv[1] == 'lb-all' ) { list_of_bugs($connection); } if ( $argv[1] == 'lb-user' ) { list_of_bugs($connection, 'user'); } + if ( $argv[1] == 'lb-saved' ) { list_of_bugs($connection, 'saved'); } if ( $argv[1] == 'lp' ) { list_of_products($connection); } if ( $argv[1] == 'lc' ) { list_of_components($connection, $argv[2]); } if ( $argv[1] == 'sb' ) { submit_bug($connection, $argv[2], $argv[3], $argv[4], $argv[5], $argv[6]); } @@ -320,7 +335,8 @@ echo "This script requires running instance of BugTrack\n"; echo "Options:\n"; echo "\tlb-all - prints all submitted requests\n\n"; - echo "\tlb-user - prints submitted request except done or rejected tasks\n\n"; + echo "\tlb-user - prints submitted requests except done or rejected tasks\n\n"; + echo "\tlb-saved - prints only saved requests\n\n"; echo "\tlp - prints all products defined on the platform\n\n"; echo "\tlc - prints all components related with given product\n\n"; echo "\tsb - submiting bug or \n\tenchancement request\n\n"; @@ -334,8 +350,8 @@ echo "\tdp - removes give product with all related components\n\n"; echo "\tcp - setting new password for given user\n\n"; echo "Request removing:\n"; - echo "To remove some request just set them state 5, which means 'To delete'\n"; - echo "Setting state 5, causing request deletion\n"; + echo "To remove some request just set them state 6, which means 'To delete'\n"; + echo "Setting state 6, causing request deletion\n"; } else { include($ROOT . '/403.php'); }