CVSTrac Legacy Code

Check-in [64a9390abe]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:(#231) ditch the opaque class names like "border2" and "bkgnd1" and replace with more meaningful class names, and related cleanups.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 64a9390abeed8d9a50249c81773ca4bc07a56751
User & Date: cpb 2009-03-07 00:42:24
Context
2009-03-08
00:14
(#791) allow individual pages to have their own RSS feeds

This means we need to allow generic RSS substitutions in the header. To that end, we add %R for the URL and %F for the title (a distinct feed needs a distinct title).

Figuring out whether a page has its own RSS feed is done by looking for an "RSS" entry in the action bar. The title is built from the project name and the current page title.

Then, to override the default (timeline) RSS feed on any given page, it's just a matter of doing something like:

common_add_action_item(mprintf("tkthistory.rss?tn=%d",tn), "RSS");

and the header output logic will just pick it up. check-in: c72535f17c user: cpb tags: trunk

2009-03-07
00:42
(#231) ditch the opaque class names like "border2" and "bkgnd1" and replace with more meaningful class names, and related cleanups. check-in: 64a9390abe user: cpb tags: trunk
2009-03-06
03:06
(#177) makes HTML entities _work_ in wiki markup and (maybe) other places

In order to allow it to work in both normal web browsing and the encoding needed for RSS (where we _need_ to encode even entities), I modified htmlize (%h) to take an "allow entities" flag, and added a new %R formatting option which disables this flag. %R is used by the RSS formatter to do the final content generation. This means anywhere wiki content is allowed someone can write é and, apparently, it works.

Keep in mind that I don't normally use anything except ASCII in my day-to-day environment, so someone who cares about this stuff should maybe test it out a bit more than myself. check-in: 14e235cdd5 user: cpb tags: trunk

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to browse.c.

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
...
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
...
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
...
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
                  "WHERE filename='%q' AND filechng.cn=chng.cn "
                  "ORDER BY date DESC", zName);
  }

  common_header("History for /%h", zName);
  output_breadcrumb(zName, 0);

  @ <table class="rlog" cellpadding=0 cellspacing=0 border=0>
  for(i=0; az[i]; i+=9){
    time_t t;
    struct tm *pTm;
    char zDate[100];

    t = atoi(az[i+1]);
    pTm = localtime(&t);
................................................................................
  int set = (zFld==zField[0]);
  int desc = P("desc")!=0;
  const char *zDesc = set ? (desc ? "" : "&desc" ) : "";

  /* Clicking same column header 3 times in a row resets any sorting.
  */
  if(set && desc){
    @ <th align="left" bgcolor="%s(BG1)" class="bkgnd1">
    @   <a href="dirview?d=%T(zNameNS)">%h(zColumn)</a></th>
    return;
  }
  if(set){
    @ <th align="left" bgcolor="%s(BG1)" class="bkgnd1"><a
  }else{
    @ <th align="left"><a
  }
  @     href="dirview?d=%T(zNameNS)&amp;o=%s(zField)%h(zDesc)">%h(zColumn)</a></th>
}

/*
................................................................................
static void row_content(
  const char *zName,
  const char *zSortUrl,
  int nCol,
  char **az
){
  if( (nCol%2)==0 ){
    @ <tr bgcolor="%s(BG4)" class="bkgnd4">
  }else{
    @ <tr>
  }
  
  if( atoi(az[0])==1 ){
    @ <td colspan="3">
    @ <a href="dirview?d=%T(zName)%T(az[1])&amp;%h(zSortUrl)">
    common_icon("dir");
    @ %h(az[1])/</a></td>
................................................................................
    "ORDER BY %s",
    zNameNS, zNameNS, zOrderBy
  );
  
  common_header("Directory /%h", zName);
  output_breadcrumb(zName, 1);

  @ <table width="100%%" border=0 cellspacing=0 cellpadding=3>
  @ <tr>
  column_header(zNameNS,zFld,"file","File");
  column_header(zNameNS,zFld,"vers","Vers");
  column_header(zNameNS,zFld,"user","By");
  column_header(zNameNS,zFld,"date","Age");
  column_header(zNameNS,zFld,"msg","Check-in");
  @ </tr>







|







 







|




|







 







|

|







 







|







106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
...
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
...
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
...
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
                  "WHERE filename='%q' AND filechng.cn=chng.cn "
                  "ORDER BY date DESC", zName);
  }

  common_header("History for /%h", zName);
  output_breadcrumb(zName, 0);

  @ <table class="rlog">
  for(i=0; az[i]; i+=9){
    time_t t;
    struct tm *pTm;
    char zDate[100];

    t = atoi(az[i+1]);
    pTm = localtime(&t);
................................................................................
  int set = (zFld==zField[0]);
  int desc = P("desc")!=0;
  const char *zDesc = set ? (desc ? "" : "&desc" ) : "";

  /* Clicking same column header 3 times in a row resets any sorting.
  */
  if(set && desc){
    @ <th align="left" class="desc">
    @   <a href="dirview?d=%T(zNameNS)">%h(zColumn)</a></th>
    return;
  }
  if(set){
    @ <th align="left" class="asc"><a
  }else{
    @ <th align="left"><a
  }
  @     href="dirview?d=%T(zNameNS)&amp;o=%s(zField)%h(zDesc)">%h(zColumn)</a></th>
}

/*
................................................................................
static void row_content(
  const char *zName,
  const char *zSortUrl,
  int nCol,
  char **az
){
  if( (nCol%2)==0 ){
    @ <tr>
  }else{
    @ <tr class="odd">
  }
  
  if( atoi(az[0])==1 ){
    @ <td colspan="3">
    @ <a href="dirview?d=%T(zName)%T(az[1])&amp;%h(zSortUrl)">
    common_icon("dir");
    @ %h(az[1])/</a></td>
................................................................................
    "ORDER BY %s",
    zNameNS, zNameNS, zOrderBy
  );
  
  common_header("Directory /%h", zName);
  output_breadcrumb(zName, 1);

  @ <table class="dirview" cellspacing=0 cellpadding=3>
  @ <tr>
  column_header(zNameNS,zFld,"file","File");
  column_header(zNameNS,zFld,"vers","Vers");
  column_header(zNameNS,zFld,"user","By");
  column_header(zNameNS,zFld,"date","Age");
  column_header(zNameNS,zFld,"msg","Check-in");
  @ </tr>

Changes to config.h.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* MinGW headers have no consts so producing warnings "discards qualifiers" */
char *crypt(const char *key, const char *salt);
#include <process.h>
#include <direct.h>
#include <io.h>
#endif

/*
** Standard colors.  These colors can also be changed using a stylesheet.
*/

/* A blue border and background.  Used for the title bar and for dates
** in a timeline.
*/
#define BORDER1       "#a0b5f4"      /* Stylesheet class: border1 */
#define BG1           "#d0d9f4"      /* Stylesheet class: bkgnd1 */

/* A red border and background.  Use for releases in the timeline.
*/
#define BORDER2       "#ec9898"      /* Stylesheet class: border2 */
#define BG2           "#f7c0c0"      /* Stylesheet class: bkgnd2 */

/* A gray background.  Used for column headers in the Wiki Table of Contents
** and to highlight ticket properties.
*/
#define BG3           "#d0d0d0"      /* Stylesheet class: bkgnd3 */

/* A light-gray background.  Used for title bar, menus, and rlog alternation
*/
#define BG4           "#f0f0f0"      /* Stylesheet class: bkgnd4 */

/* A deeper gray background.  Used for branches
*/
#define BG5           "#dddddd"      /* Stylesheet class: bkgnd5 */

/* Default HTML page header */
#define HEADER "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" \
               "<html>\n" \
               "<head>\n" \
               "<link rel=\"stylesheet\" title=\"CVSTrac Stylesheet\"\n" \
               "      type=\"text/css\" href=\"%B/cvstrac.css\">\n" \
               "<link rel=\"alternate stylesheet\"\n" \







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







16
17
18
19
20
21
22




























23
24
25
26
27
28
29
/* MinGW headers have no consts so producing warnings "discards qualifiers" */
char *crypt(const char *key, const char *salt);
#include <process.h>
#include <direct.h>
#include <io.h>
#endif





























/* Default HTML page header */
#define HEADER "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" \
               "<html>\n" \
               "<head>\n" \
               "<link rel=\"stylesheet\" title=\"CVSTrac Stylesheet\"\n" \
               "      type=\"text/css\" href=\"%B/cvstrac.css\">\n" \
               "<link rel=\"alternate stylesheet\"\n" \

Changes to cvstrac.css.

271
272
273
274
275
276
277



















.nowrap {white-space: nowrap;}
.wrapvirtual {overflow: auto; white-space: nowrap;}
.wrapphysical {overflow: auto; white-space: pre-wrap;}

/* error messages */
blockquote.error, p.error, td.error {font-size: 1.17em; color: red}



























>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
.nowrap {white-space: nowrap;}
.wrapvirtual {overflow: auto; white-space: nowrap;}
.wrapphysical {overflow: auto; white-space: pre-wrap;}

/* error messages */
blockquote.error, p.error, td.error {font-size: 1.17em; color: red}

.dirview {width: 100%; border-width: 0;}
.report {border: 1px #d0d9f4 solid;}
.report td {border: 1px #d0d9f4 solid;}

/* sorted column header - formerly bkgnd1 */
tr .asc, tr .desc {background: #d0d9f4;}

/* long directory row - formerly bkgnd4 */
.dirview .odd {background: #f0f0f0;}

.tktfield  {background: #d0d0d0;}
.tktappend {background: #d0d9f4;
            border: 2px #a0b5f4 solid;
            text-align: right;
            right: 1em;
            position: absolute;
            padding: 2px;
            margin: 0px;
           }

Changes to ticket.c.

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
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
...
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
  common_header("Ticket #%d", tn);
  @ <h2>Ticket #%d(tn): %h(az[11])</h2>
  @ <blockquote>
  output_formatted(az[12], zPage);
  @ </blockquote>
  @
  if( g.okWrite ){
    @ <table align="right" style="margin: 0 10px;" cellpadding=2 border=0>
    @ <tr><td bgcolor="%h(BORDER1)" class="border1">
    @ <table width="100%%" border=0 cellpadding=4 cellspacing=0>
    @ <tr bgcolor="%h(BG1)" class="bkgnd1">
    @ <td valign="top" align="left">
    if( az[13][0]==0 ){
      @ [<a href="tktappend?tn=%h(zTn)">Add remarks</a>]
    } else {
      @ [<a href="tktappend?tn=%h(zTn)">Append remarks</a>]
    }
    @ </td></tr></table></td></tr></table>
  }
  @ <h3>Remarks:</h3>
  @ <blockquote>
  output_formatted(az[13], zPage);
  @ </blockquote>

  if( g.okWrite && (az[13][0]!=0) ){
    @ <table align="right" style="margin: 0 10px;" cellpadding=2 border=0>
    @ <tr><td bgcolor="%h(BORDER1)" class="border1">
    @ <table width="100%%" border=0 cellpadding=4 cellspacing=0>
    @ <tr bgcolor="%h(BG1)" class="bkgnd1">
    @ <td valign="top" align="left">
    @ [<a href="tktappend?tn=%h(zTn)">Append remarks</a>]
    @ </td></tr></table></td></tr></table>
    @

  }

  @
  @ <h3>Properties:</h3>
  @ 
  @ <blockquote>
  @ <table>
  @ <tr>
  @   <td align="right">Type:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[0])&nbsp;</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Version:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[5])&nbsp;</b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Status:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[1])</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Created:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[2])</b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Severity:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[7])&nbsp;</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Last&nbsp;Change:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[3])</b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Priority:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[8])&nbsp;</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Subsystem:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[9])&nbsp;</b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Assigned&nbsp;To:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[6])&nbsp;</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Derived From:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>
  z = extract_integer(az[4]);
  if( z && z[0] ){
    z = mprintf("#%s",z);
    output_formatted(z,zPage);
  }else{
    @   &nbsp;
  }
  @   </b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Creator:</td>
  @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[10])&nbsp;</b></td>
  if( g.okWrite && !g.isAnon ){
    @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    @   <td align="right">Contact:</td>
    if( strchr(az[14],'@') ){
      @   <td bgcolor="%h(BG3)" class="bkgnd3"><b><a href="mailto:%h(az[14])">
      @        %h(az[14])</a>&nbsp;</b></td>
    }else{
      @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[14])&nbsp;</b></td>
    }
    @ </tr>
    j = 0;
  } else {
    j = 1;
  }
  for(i=0; i<5; i++){
................................................................................
    if( azExtra[i]==0 ) continue;
    if( j==0 ){
      @ <tr>
    }else{
      @ <td></td>
    }
    @   <td align="right">%h(azExtra[i]):</td>
    @   <td bgcolor="%h(BG3)" class="bkgnd3"><b>%h(az[15+i])&nbsp;</b></td>
    if( j==0 ){
      j = 1;
    }else{
      @ </tr>
      j = 0;
    }
  }







|
<
<
<
<





|







|
<
<
<
<

<
<
>









|


|



|


|



|


|



|


|



|


|











|




|


|







 







|







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
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
...
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
  common_header("Ticket #%d", tn);
  @ <h2>Ticket #%d(tn): %h(az[11])</h2>
  @ <blockquote>
  output_formatted(az[12], zPage);
  @ </blockquote>
  @
  if( g.okWrite ){
    @ <div class="tktappend">




    if( az[13][0]==0 ){
      @ [<a href="tktappend?tn=%h(zTn)">Add remarks</a>]
    } else {
      @ [<a href="tktappend?tn=%h(zTn)">Append remarks</a>]
    }
    @ </div>
  }
  @ <h3>Remarks:</h3>
  @ <blockquote>
  output_formatted(az[13], zPage);
  @ </blockquote>

  if( g.okWrite && (az[13][0]!=0) ){
    @ <div class="tktappend">




    @ [<a href="tktappend?tn=%h(zTn)">Append remarks</a>]


    @ </div>
  }

  @
  @ <h3>Properties:</h3>
  @ 
  @ <blockquote>
  @ <table>
  @ <tr>
  @   <td align="right">Type:</td>
  @   <td class="tktfield"><b>%h(az[0])&nbsp;</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Version:</td>
  @   <td class="tktfield"><b>%h(az[5])&nbsp;</b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Status:</td>
  @   <td class="tktfield"><b>%h(az[1])</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Created:</td>
  @   <td class="tktfield"><b>%h(az[2])</b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Severity:</td>
  @   <td class="tktfield"><b>%h(az[7])&nbsp;</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Last&nbsp;Change:</td>
  @   <td class="tktfield"><b>%h(az[3])</b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Priority:</td>
  @   <td class="tktfield"><b>%h(az[8])&nbsp;</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Subsystem:</td>
  @   <td class="tktfield"><b>%h(az[9])&nbsp;</b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Assigned&nbsp;To:</td>
  @   <td class="tktfield"><b>%h(az[6])&nbsp;</b></td>
  @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  @   <td align="right">Derived From:</td>
  @   <td class="tktfield"><b>
  z = extract_integer(az[4]);
  if( z && z[0] ){
    z = mprintf("#%s",z);
    output_formatted(z,zPage);
  }else{
    @   &nbsp;
  }
  @   </b></td>
  @ </tr>
  @ <tr>
  @   <td align="right">Creator:</td>
  @   <td class="tktfield"><b>%h(az[10])&nbsp;</b></td>
  if( g.okWrite && !g.isAnon ){
    @ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    @   <td align="right">Contact:</td>
    if( strchr(az[14],'@') ){
      @   <td class="tktfield"><b><a href="mailto:%h(az[14])">
      @        %h(az[14])</a>&nbsp;</b></td>
    }else{
      @   <td class="tktfield"><b>%h(az[14])&nbsp;</b></td>
    }
    @ </tr>
    j = 0;
  } else {
    j = 1;
  }
  for(i=0; i<5; i++){
................................................................................
    if( azExtra[i]==0 ) continue;
    if( j==0 ){
      @ <tr>
    }else{
      @ <td></td>
    }
    @   <td align="right">%h(azExtra[i]):</td>
    @   <td class="tktfield"><b>%h(az[15+i])&nbsp;</b></td>
    if( j==0 ){
      j = 1;
    }else{
      @ </tr>
      j = 0;
    }
  }

Changes to view.c.

731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
....
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
....
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
  /*
  ** Clicking same column header 3 times in a row resets any sorting.
  ** Note that we link to rptview, which means embedded reports will get
  ** sent to the actual report view page as soon as a user tries to do
  ** any sorting. I don't see that as a Bad Thing.
  */
  if(set && desc){
    @ <th bgcolor="%s(BG1)" class="bkgnd1">
    @   <a href="rptview?rn=%d(rn)%s(zExtra)">%h(zCol)</a></th>
  }else{
    if(set){
      @ <th bgcolor="%s(BG1)" class="bkgnd1"><a
    }else{
      @ <th><a
    }
    @ href="rptview?rn=%d(rn)&amp;order_by=%d(nCol)&amp;\
    @ order_dir=%s(desc?"ASC":"DESC")\
    @ %s(zExtra)">%h(zCol)</a></th>
  }
................................................................................
    zCaption = zTitle;
  }
  zSql = az[1];
  zClrKey = az[3];
  db_execute("PRAGMA empty_result_callbacks=ON");
  /* output_color_key(zClrKey, 1, "border=0 cellpadding=3 cellspacing=0"); */
  @ <div>
  @ <table border=1 cellpadding=2 cellspacing=0
  @        summary="%h(zTitle)" %s(zTableOpts?zTableOpts:"")>
  @ <caption>
  @   <a href="rptview?rn=%d(rn)" rel="nofollow"
  @      title="%h(zTitle)">%h(zCaption)</a>
  @ </caption>
  db_restrict_access(1);
  sState.rn = rn;
................................................................................
    common_header("%s", zTitle);
    if( zDesc && zDesc[0] ){
      @ <div class="wiki">
      output_formatted(zDesc,0);
      @ </div>
    }
    output_color_key(zClrKey, 1, "border=0 cellpadding=3 cellspacing=0 class=\"report\"");
    @ <table border=1 cellpadding=2 cellspacing=0 class="report">
    db_restrict_access(1);
    sState.rn = rn;
    sState.nCount = 0;
    db_callback_query(generate_html, &sState, "%s", zSql);
    db_restrict_access(0);
    @ </table>
    @ <div id="rowcount" align="right">







|



|







 







|







 







|







731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
....
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
....
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
  /*
  ** Clicking same column header 3 times in a row resets any sorting.
  ** Note that we link to rptview, which means embedded reports will get
  ** sent to the actual report view page as soon as a user tries to do
  ** any sorting. I don't see that as a Bad Thing.
  */
  if(set && desc){
    @ <th class="desc">
    @   <a href="rptview?rn=%d(rn)%s(zExtra)">%h(zCol)</a></th>
  }else{
    if(set){
      @ <th class="asc"><a
    }else{
      @ <th><a
    }
    @ href="rptview?rn=%d(rn)&amp;order_by=%d(nCol)&amp;\
    @ order_dir=%s(desc?"ASC":"DESC")\
    @ %s(zExtra)">%h(zCol)</a></th>
  }
................................................................................
    zCaption = zTitle;
  }
  zSql = az[1];
  zClrKey = az[3];
  db_execute("PRAGMA empty_result_callbacks=ON");
  /* output_color_key(zClrKey, 1, "border=0 cellpadding=3 cellspacing=0"); */
  @ <div>
  @ <table class="report" cellpadding=2 cellspacing=0
  @        summary="%h(zTitle)" %s(zTableOpts?zTableOpts:"")>
  @ <caption>
  @   <a href="rptview?rn=%d(rn)" rel="nofollow"
  @      title="%h(zTitle)">%h(zCaption)</a>
  @ </caption>
  db_restrict_access(1);
  sState.rn = rn;
................................................................................
    common_header("%s", zTitle);
    if( zDesc && zDesc[0] ){
      @ <div class="wiki">
      output_formatted(zDesc,0);
      @ </div>
    }
    output_color_key(zClrKey, 1, "border=0 cellpadding=3 cellspacing=0 class=\"report\"");
    @ <table class="report" cellpadding=2 cellspacing=0>
    db_restrict_access(1);
    sState.rn = rn;
    sState.nCount = 0;
    db_callback_query(generate_html, &sState, "%s", zSql);
    db_restrict_access(0);
    @ </table>
    @ <div id="rowcount" align="right">