| ︙ | | |
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
-
+
|
login_check_credentials();
if( !g.perm.Setup ){
login_needed(0);
return;
}
style_set_current_feature("tktsetup");
if( PB("setup") ){
if( P("setup") ){
cgi_redirect("tktsetup");
}
isSubmit = P("submit")!=0;
z = P("x");
if( z==0 ){
z = db_get(zDbField, zDfltValue);
}
|
| ︙ | | |
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
+
|
@ </p></blockquote>
@ </div></form>
@ <hr>
@ <h2>Default %s(zTitle)</h2>
@ <blockquote><pre>
@ %h(zDfltValue)
@ </pre></blockquote>
style_submenu_element("Back", "%R/tktsetup");
style_finish_page();
}
/*
** WEBPAGE: tktsetup_tab
** Administrative page for defining the "ticket" table used
** to hold ticket information.
|
| ︙ | | |
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
|
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
|
@ $<resolution>
@ </td></tr>
@ <tr><td class="tktDspLabel">Last Modified:</td><td class="tktDspValue">
@ <th1>
@ if {[info exists tkt_datetime]} {
@ html $tkt_datetime
@ }
@ if {[info exists tkt_mage]} {
@ html "<br>$tkt_mage"
@ }
@ </th1>
@ </td>
@ <td class="tktDspLabel">Created:</td><td class="tktDspValue">
@ <th1>
@ if {[info exists tkt_datetime_creation]} {
@ html $tkt_datetime_creation
@ }
@ if {[info exists tkt_cage]} {
@ html "<br>$tkt_cage"
@ }
@ </th1>
@ </td></tr>
@ <th1>enable_output [hascap e]</th1>
@ <tr>
@ <td class="tktDspLabel">Contact:</td><td class="tktDspValue">
@ <td class="tktDspLabel">Contact:</td><td class="tktDspValue" colspan="3">
@ $<private_contact>
@ </td>
@ </tr>
@ <th1>enable_output 1</th1>
@ </tr>
@ <tr><td class="tktDspLabel">Version Found In:</td>
@ <td colspan="3" valign="top" class="tktDspValue">
@ <th1>
@ set versionlink ""
@ set urlfoundin [httpize $foundin]
@ set tagpattern {^[-0-9A-Za-z_\\.]+$}
@ if [regexp $tagpattern $foundin] {
@ query {SELECT count(*) AS match FROM tag
@ WHERE tagname=concat('sym-',$foundin)} {
@ if {$match} {set versionlink "/timeline?t=$urlfoundin"}
@ }
@ }
@ set hashpattern {^[0-9a-f]+$}
@ if [regexp $hashpattern $foundin] {
@ set pattern $foundin*
@ query {SELECT count(*) AS match FROM blob WHERE uuid GLOB $pattern} {
@ if {$match} {set versionlink "/info/$urlfoundin"}
@ }
@ }
@ if {$versionlink eq ""} {
@ $<foundin>
@ puts $foundin
@ } else {
@ html "<a href=\""
@ puts $versionlink
@ html "\">"
@ puts $foundin
@ html "</a>"
@ }
@ </th1>
@ </td></tr>
@ </table>
@
@ <th1>
@ wiki_assoc "ticket" $tkt_uuid
@ </th1>
@
|
| ︙ | | |
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
|
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
|
-
+
+
|
@ mimetype as xmimetype, icomment AS xcomment,
@ username AS xusername
@ FROM ticketchng
@ WHERE tkt_id=$tkt_id AND length(icomment)>0} {
@ if {$seenRow} {
@ html "<hr>\n"
@ } else {
@ html "<tr><td class='tktDspLabel' style='text-align:left'>User Comments:</td></tr>\n"
@ html "<tr><td class='tktDspLabel' style='text-align:left'>\n"
@ html "User Comments:</td></tr>\n"
@ html "<tr><td colspan='5' class='tktDspValue'>\n"
@ set seenRow 1
@ }
@ html "<span class='tktDspCommenter'>"
@ html "[htmlize $xlogin]"
@ if {$xlogin ne $xusername && [string length $xusername]>0} {
@ html " (claiming to be [htmlize $xusername])"
|
| ︙ | | |
739
740
741
742
743
744
745
746
747
748
749
750
751
752
|
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
@ <tr>
@ <td align="right">
@ <input type="submit" name="cancel" value="Cancel">
@ </td>
@ <td>Abandon this edit</td>
@ </tr>
@
@ <th1>
@ set seenRow 0
@ set alwaysPlaintext [info exists plaintext]
@ query {SELECT datetime(tkt_mtime) AS xdate, login AS xlogin,
@ mimetype as xmimetype, icomment AS xcomment,
@ username AS xusername
@ FROM ticketchng
@ WHERE tkt_id=$tkt_id AND length(icomment)>0} {
@ if {$seenRow} {
@ html "<hr>\n"
@ } else {
@ html "<tr><td colspan='2'><hr></td></tr>\n"
@ html "<tr><td colspan='2' class='tktDspLabel' style='text-align:left'>\n"
@ html "Previous User Comments:</td></tr>\n"
@ html "<tr><td colspan='2' class='tktDspValue'>\n"
@ set seenRow 1
@ }
@ html "<span class='tktDspCommenter'>"
@ html "[htmlize $xlogin]"
@ if {$xlogin ne $xusername && [string length $xusername]>0} {
@ html " (claiming to be [htmlize $xusername])"
@ }
@ html " added on $xdate:"
@ html "</span>\n"
@ if {$alwaysPlaintext || $xmimetype eq "text/plain"} {
@ set r [randhex]
@ if {$xmimetype ne "text/plain"} {html "([htmlize $xmimetype])\n"}
@ wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n"
@ } elseif {$xmimetype eq "text/x-fossil-wiki"} {
@ wiki "<p>\n[string trimright $xcomment]\n</p>\n"
@ } elseif {$xmimetype eq "text/x-markdown"} {
@ html [lindex [markdown $xcomment] 1]
@ } elseif {$xmimetype eq "text/html"} {
@ wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n"
@ } else {
@ set r [randhex]
@ wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n"
@ }
@ }
@ if {$seenRow} {html "</td></tr>\n"}
@ </th1>
@
@ </table>
;
/*
** Return the code used to generate the edit ticket page
*/
const char *ticket_editpage_code(void){
|
| ︙ | | |
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
|
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
|
+
-
+
|
@ CASE WHEN status IN ('Open','Verified') THEN '#f2dcdc'
@ WHEN status='Review' THEN '#e8e8e8'
@ WHEN status='Fixed' THEN '#cfe8bd'
@ WHEN status='Tested' THEN '#bde5d6'
@ WHEN status='Deferred' THEN '#cacae5'
@ ELSE '#c8c8c8' END AS 'bgcolor',
@ substr(tkt_uuid,1,10) AS '#',
@ datetime(tkt_ctime) AS 'created',
@ datetime(tkt_mtime) AS 'mtime',
@ datetime(tkt_mtime) AS 'modified',
@ type,
@ status,
@ subsystem,
@ title,
@ comment AS '_comments'
@ FROM ticket
;
|
| ︙ | | |
971
972
973
974
975
976
977
978
979
980
|
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
|
+
|
@ <hr>
@ <p>
@ <input type="submit" name="submit" value="Apply Changes">
@ <input type="submit" name="setup" value="Cancel">
@ </p>
@ </div></form>
db_end_transaction(0);
style_submenu_element("Back", "%R/tktsetup");
style_finish_page();
}
|