# HG changeset patch # User Christophe Lincoln # Date 1486734889 -3600 # Node ID 60234e42d5c4dcacfb1648cee4bd5d089058cb96 # Parent 8c3d1f530e15be9b1a1c718707bdb4e3a8b0272a Use desc.txt for bug description diff -r 8c3d1f530e15 -r 60234e42d5c4 web/bugs.cgi --- a/web/bugs.cgi Thu Feb 09 18:35:56 2017 +0100 +++ b/web/bugs.cgi Fri Feb 10 14:54:49 2017 +0100 @@ -2,7 +2,7 @@ # # TazBug Web interface # -# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License +# Copyright (C) 2012-2017 SliTaz GNU/Linux - BSD License # . /usr/lib/slitaz/httphelper @@ -299,7 +299,7 @@

-$(echo "$DESC" | wiki_parser)
+$(cat $bugdir/$id/desc.txt | wiki_parser)
 
@@ -385,7 +385,8 @@ USER="$user" fi mkdir -p $bugdir/$count - sed "s/$(echo -en '\r') /\n/g" > $bugdir/$count/bug.tmp << EOT + # bug.conf + sed "s/$(echo -en '\r') /\n/g" > $bugdir/$count/bug.conf << EOT # SliTaz Bug configuration BUG="$(GETfiltered bug)" @@ -394,11 +395,13 @@ CREATOR="$USER" DATE="$date" PKGS="$(GETfiltered pkgs)" - -DESC="$(GETfiltered desc)" EOT - fold -s -w 80 $bugdir/$count/bug.tmp > $bugdir/$count/bug.conf - rm -f $bugdir/$count/bug.tmp + # desc.txt + sed "s/$(echo -en '\r') /\n/g" > $bugdir/$count/desc.tmp << EOT +$(GETfiltered desc) +EOT + fold -s -w 80 $bugdir/$count/desc.tmp > $bugdir/$count/desc.txt + rm -f $bugdir/$count/*.tmp } # New bug page for the web interface @@ -446,16 +449,45 @@ } -# Edit/Save a bug configuration file +# Edit/Save a bug edit_bug() { + . $bugdir/$id/bug.conf cat << EOT

$(eval_gettext 'Edit Bug $bug')

- - - + + + + + + + + + + + + + + + + + + + + + + + +
$(gettext "Bug title")
$(gettext "Description")
$(gettext "Packages")
$(gettext "Priority") + + +
@@ -463,13 +495,24 @@ } save_bug() { - bug="$(GET bug)" - content="$(GET bugconf)" - sed "s|\"|'|" | sed "s/$(echo -en '\r') /\n/g" > $bugdir/$bug/bug.tmp << EOT -$content + id="$(GET id)" + # bug.conf + sed "s/$(echo -en '\r') /\n/g" > $bugdir/$id/bug.conf << EOT +# SliTaz Bug configuration + +BUG="$(GETfiltered bug)" +STATUS="OPEN" +PRIORITY="$(GET priority)" +CREATOR="$(GET creator)" +DATE="$(GET date)" +PKGS="$(GETfiltered pkgs)" EOT - fold -s -w 80 $bugdir/$bug/bug.tmp > $bugdir/$bug/bug.conf - rm -f $bugdir/$bug/bug.tmp + # desc.txt + sed "s/$(echo -en '\r') /\n/g" > $bugdir/$id/desc.tmp << EOT +$(GETfiltered desc) +EOT + fold -s -w 80 $bugdir/$id/desc.tmp > $bugdir/$id/desc.txt + rm -f $bugdir/$id/*.tmp } # Close a fixed bug @@ -660,7 +703,7 @@ fi html_footer ;; *\ newbug\ *) - # Add a bug from web interface. + # Create a bug from web interface. header html_header user_box @@ -671,7 +714,7 @@ fi html_footer ;; *\ addbug\ *) - # Add a bug from web interface. + # Save a new bug from web interface. header html_header if check_auth; then @@ -679,18 +722,19 @@ js_redirection_to "$script?id=$count" fi ;; *\ edit\ *) - bug="$(GET edit)" + # Edit existing bug + id="$(GET edit)" header html_header user_box edit_bug html_footer ;; - *\ bugconf\ *) + *\ savebug\ *) header html_header if check_auth; then save_bug - js_redirection_to "$script?id=$bug" + js_redirection_to "$script?id=$id" fi ;; *\ id\ *) # Empty deleted messages to keep msg count working.