[show modes: view edit comment complete] /* Note to self: this is entry #231 */ [begin mode abbr] <span style="float: right"> [ if($_priority == "0") {TRIV}; if($_priority == "1") {MIN}; if($_priority == "2") {MOD}; if($_priority == "3") {MAJ}; if($_priority == "4") {NEW}; if($_priority == "5") {CRI}; ]</span> [$_id]. <b><a href="?id=[$_id]">[ if(getv("fixed") == 1) {<strike>}; $_title; if(getv("fixed") == 1) {</strike>}; ]</a></b> ([$_date])<br> [end mode abbr] [begin mode view] [ if(getv("fixed") == 1) {<strike>}; $_title; if(getv("fixed") == 1) {</strike>}; ] <style type="text/css"> table tr td, table, tr { border-collapse: collapse; margin: 0px; padding: 0px; } </style> <table width="100%"> <tr><td><b>ID</b>: [$_id]</td><td><b>Owner</b>: [page("link", $_owner.profile_id);]</td></tr> <tr><td><b>Date</b>: [$_date]</td><td><b>Priority</b>: [ if($_priority == "0") {Trivial/Cosmetic}; if($_priority == "1") {Minor}; if($_priority == "2") {Moderate}; if($_priority == "3") {Major}; if($_priority == "4") {Unconfirmed/New}; if($_priority == "5") {Critical}; ]</td></tr></table> <b>Product/Component</b>: <a href="/?id=[$_parent]">[replace(get_title($_parent), " Bugfest", "")]</a> [msg_start(); _num2link(replace(replace(replace(getv("desc"), chr(10), "<br>"), " ", " "), chr(9), " ")); msg_end();] <center> [ if(can_comment()) {<a href="?id=[$_id]&mode=comment">Comment on Bug</a> }; if(can_edit()) {<a href="?id=[$_id]&mode=edit">Edit this Bug</a> }; if(can_edit()) {<a href="?id=[$_id]&mode=complete"> [iif(getv("fixed") == 1, {Reopen Bug}, {Close Bug});]</a> }; ] </center> [children("view", $_id);] [end mode view] [begin mode edit] <form method="post" action="/" width="100%"> <input type="hidden" name="id" value="[$_id]"> <input type="hidden" name="mode" value="submit"> <table width="100%"><tr><th>Name:</th><td> <input type="textbox" class="textbox" name="title" value="[edit_display($_title)]"></td></tr> <tr><th>Owner:</th><td> [users_dropdown("author", $_author)]</td></tr> <tr><th>Priority:</th><td> [ $pris = {0<!>0 - Trivial/Cosmetic 1<!>1 - Low 2<!>2 - Moderate 3<!>3 - Major 4<!>4 - Unconfirmed/New 5<!>5 - Critical}; _select($_priority, $pris, "priority"); ] </td></tr> <tr><th>Description:</th><td> <textarea name="desc" rows="15" class="textbox">[edit_display(getv("desc"))]</textarea><br> <span class="buttonbox"><input type="submit" value="Update"> </td></tr> </table> </form> [end mode edit] [begin mode submit] [ $_title = $_params.title; $_author = $_params.author; $_priority = $_params.priority; putv("desc", replace($_params.desc, "<br>", chr(13) & chr(10))); ] [msg_start();] <p>Bug updated. <a href="?id=[$_id]">Return to it.</a></p> [msg_end();] [end mode submit] [begin mode comment] [msg_start();] <form method="post" action="/"> <input type="hidden" name="mode" value="comment_submit"> <input type="hidden" name="id" value="[$_id]"> <textarea class="textbox" rows="15" name="body"></textarea> <p><span class="buttonbox"><input type="submit" value="Post Comment"></span></p> </form> [msg_end();] [end mode comment] [begin mode comment_submit] [$title = {Comment on [$_title] at [now()] by [$_viewer.ip]}; $e = new_page($title, $_id); if($e) {[ set_body($e, $_params.body); set_template($e, title2id("Generic Comment")); msg_start();] Commented successfully! <a href="/?id=[$_id]">Return to the bug.</a> [msg_end(); ]} else {[ msg_start();] Couldn't comment. Maybe you don't have permissions? Are you logged in? <a href="/?id=[$_id]">Return to the bug.</a> [msg_end(); ]}; ] [end mode comment_submit] [begin mode complete] [if(getv("fixed") == 1) {[ putv("fixed", 0); msg_start(); {<p>The bug was fixed. Now it is not. <a href="?id=[$_id]">Return to it.</a></p>}; msg_end(); ]} else {[ putv("fixed", 1); msg_start(); {<p>Hooray! Another victory. <a href="?id=[$_id]">Return to it.</a></p>}; msg_end(); ]};] [end mode complete]