Index: edit =================================================================== RCS file: /cvsroot/twiki/twiki/bin/edit,v retrieving revision 1.64 diff -u -r1.64 edit --- edit 5 Jan 2003 02:38:11 -0000 1.64 +++ edit 19 Mar 2003 04:34:05 -0000 @@ -39,7 +39,7 @@ sub writeDebug { my( $text ) = @_; - #TWiki::writeDebug( $text ); + TWiki::writeDebug( $text ); } sub writeDebugTimes @@ -76,6 +76,35 @@ return; } +# +# Allow for dynamic topic creation if it contains a string of 10 x's XXXXXX +# +#SVEN - use sequential numbers :) + if ( $topic =~ /XXXXXXXXXX/o ) { +# $topic =~ s|X{10}X*|substr(int($$) . int(rand(100000)) . int(time), 0, 10)|e; + + my ($bugCount) = 0; + my ($tempTopic) = $topic; + $topic =~ s|X{10}X*|$bugCount|e; + my( $lockUser, $lockTime ) = &TWiki::Store::topicIsLockedBy( $webName, $topic ); +writeDebug($webName . "." . $topic . "lock(". $lockUser ."..." . $lockTime); + + my $lockFilename = "$TWiki::dataDir/$webName/$topic.lock"; + + while ( (&TWiki::Store::topicExists( $webName, $topic )) || + ( -e "$lockFilename" ) || + ( $lockUser ) ) { + $bugCount = $bugCount + 1; + $topic = $tempTopic; + $topic =~ s|X{10}X*|$bugCount|e; + ( $lockUser, $lockTime ) = &TWiki::Store::topicIsLockedBy( $webName, $topic ); + $lockFilename = "$TWiki::dataDir/$webName/$topic.lock"; +writeDebug($webName . "." . $topic . "lock(". $lockUser ."..." . $lockTime . ") " . $lockFilename); + } + } +#SVEN - end +writeDebug("sven - $webName . $topic"); + my( $mirrorSiteName, $mirrorViewURL ) = &TWiki::readOnlyMirrorWeb( $webName ); if( $mirrorSiteName ) { my $url = &TWiki::getOopsUrl( $webName, $topic, "oopsmirror", $mirrorSiteName, $mirrorViewURL ); @@ -178,6 +207,17 @@ } $tmpl =~ s/%TOPICPARENT%/$theParent/; +#SVEN - don'e show standard editbox if there is a HIDETEXTAREA tag on the page +# this is used for our Bug system + if ( $topic eq $formTemplate ) { + } else { + if (( $text =~ /HIDETEXTAREA/ )) { + $tmpl =~ s/document.main.text(.*)//; + $tmpl =~ s/