tazbug diff web/bugs.cgi @ 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 b73d5d055f8c
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