tazbug rev 81

web: fix new bug creation
author Christophe Lincoln <pankso@slitaz.org>
date Mon Feb 17 22:58:22 2014 +0100 (2014-02-17)
parents 7426a4db30d3
children 2808fc73ac9f
files web/bugs.cgi web/plugins/pkgs/pkgs.cgi web/plugins/pkgs/pkgs.conf
line diff
     1.1 --- a/web/bugs.cgi	Wed Feb 05 21:57:37 2014 +0100
     1.2 +++ b/web/bugs.cgi	Mon Feb 17 22:58:22 2014 +0100
     1.3 @@ -238,13 +238,12 @@
     1.4  	id="$1"
     1.5  	. ${bugdir}/${id}/bug.conf
     1.6  	[ -f "${PEOPLE}/${CREATOR}/account.conf" ] && \
     1.7 -		. ${PEOPLE}/${CREATOR}/account.conf
     1.8 +	. ${PEOPLE}/${CREATOR}/account.conf
     1.9  	cat << EOT
    1.10  <a href="?user=$USER">$(get_gravatar "$MAIL" 24)</a> \
    1.11  ID: $id <a href="?id=$id">$BUG</a> <span class="date">$DATE</span>
    1.12  EOT
    1.13  	unset CREATOR USER MAIL
    1.14 -		
    1.15  }
    1.16  
    1.17  # Usage: list_bugs STATUS
    1.18 @@ -374,9 +373,9 @@
    1.19  	rm -f $bugdir/$id/msg.$count.tmp
    1.20  }
    1.21  
    1.22 -# Create a new Bug
    1.23 +# Create a new Bug. ID is set by counting dirs in bug/ including bug/0
    1.24  new_bug() {
    1.25 -	count=$(ls -1 $bugdir | wc -l)
    1.26 +	count=$(ls $bugdir | wc -l)
    1.27  	date=$(date "+%Y-%m-%d %H:%M")
    1.28  	# Sanity check, JS may be disabled.
    1.29  	[ ! "$(GET bug)" ] && echo "Missing bug title" && exit 1
    1.30 @@ -397,8 +396,8 @@
    1.31  
    1.32  DESC="$(GETfiltered desc)"
    1.33  EOT
    1.34 -	fold -s -w 80 $bugdir/$bug/bug.tmp > $bugdir/$bug/bug.conf
    1.35 -	rm -f $bugdir/$bug/bug.tmp
    1.36 +	fold -s -w 80 $bugdir/$count/bug.tmp > $bugdir/$count/bug.conf
    1.37 +	rm -f $bugdir/$count/bug.tmp
    1.38  }
    1.39  
    1.40  # New bug page for the web interface
    1.41 @@ -465,7 +464,7 @@
    1.42  save_bug() {
    1.43  	bug="$(GET bug)"
    1.44  	content="$(GET bugconf)"
    1.45 -	sed "s|\"|'|" | fold -s | sed "s/$(echo -en '\r') /\n/g" > $bugdir/$bug/bug.tmp << EOT
    1.46 +	sed "s|\"|'|" | sed "s/$(echo -en '\r') /\n/g" > $bugdir/$bug/bug.tmp << EOT
    1.47  $content
    1.48  EOT
    1.49  	fold -s -w 80 $bugdir/$bug/bug.tmp > $bugdir/$bug/bug.conf
     2.1 --- a/web/plugins/pkgs/pkgs.cgi	Wed Feb 05 21:57:37 2014 +0100
     2.2 +++ b/web/plugins/pkgs/pkgs.cgi	Mon Feb 17 22:58:22 2014 +0100
     2.3 @@ -2,9 +2,8 @@
     2.4  #
     2.5  # TinyCM/TazBug Plugin - Skeleton
     2.6  #
     2.7 -. /usr/lib/slitaz/httphelper
     2.8  
     2.9 -if [ "$(GET pkgs)" ] || [ "$(GET pkg)" ]; then
    2.10 +if [ "$(GET packages)" ] || [ "$(GET pkg)" ]; then
    2.11  	d="Skel"
    2.12  	header
    2.13  	html_header
     3.1 --- a/web/plugins/pkgs/pkgs.conf	Wed Feb 05 21:57:37 2014 +0100
     3.2 +++ b/web/plugins/pkgs/pkgs.conf	Mon Feb 17 22:58:22 2014 +0100
     3.3 @@ -5,7 +5,7 @@
     3.4  MAINTAINER="devel@slitaz.org"
     3.5  
     3.6  # All users
     3.7 -BUGS_TOOLS="${BUGS_TOOLS} <a href='?pkgs'>Buggy packages</a>"
     3.8 +BUGS_TOOLS="${BUGS_TOOLS} <a href='?packages'>Buggy packages</a>"
     3.9  
    3.10  # Authenticated users
    3.11  PLUGINS_TOOLS="${PLUGINS_TOOLS}"