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

Overview
Comment:fossil ticket show may use report name instead of report number
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wolfgangTicketCmd
Files: files | file ages | folders
SHA1:63d91f0b87b0f68a014c1072e3c2c6d69a8975eb
User & Date: wolfgang 2010-10-05 16:37:40
References
2010-10-05
17:13 Ticket [6c547144] fossil clone is slow status still Open with 1 other change artifact: 0fba58e4 user: wolfgang
Context
2010-10-05
19:23
added ticket list and new quoting option to ticket show check-in: 82559a70 user: wolfgang tags: wolfgangTicketCmd
16:37
fossil ticket show may use report name instead of report number check-in: 63d91f0b user: wolfgang tags: wolfgangTicketCmd
15:44
check for valid UUID on ticket set command check-in: 1e1512f5 user: wolfgang tags: wolfgangTicketCmd
Changes

Changes to src/report.c.

996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011

1012
1013


1014
1015




1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
}

/*
** Generate a report.  The rn query parameter is the report number.
** The output is written to stdout as flat file. The zFilter paramater
** is a full WHERE-condition.
*/
void rptshow( int rn, const char *zSep, const char *zFilter ){
  Stmt q;
  char *zSql;
  char *zTitle;
  char *zOwner;
  char *zClrKey;
  char *zErr1 = 0;
  char *zErr2 = 0;
  int count = 0;


  /* view_add_functions(tabs); */


  db_prepare(&q,
    "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn);




  if( db_step(&q)!=SQLITE_ROW ){
    db_finalize(&q);
    fossil_fatal("unkown report format(%d)!",rn);
  }
  zTitle = db_column_malloc(&q, 0);
  zSql = db_column_malloc(&q, 1);
  zOwner = db_column_malloc(&q, 2);
  zClrKey = db_column_malloc(&q, 3);
  db_finalize(&q);
  if( zFilter ){







|








>

<
>
>
|
|
>
>
>
>


|







996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013

1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
}

/*
** Generate a report.  The rn query parameter is the report number.
** The output is written to stdout as flat file. The zFilter paramater
** is a full WHERE-condition.
*/
void rptshow( const char *zRep, const char *zSep, const char *zFilter ){
  Stmt q;
  char *zSql;
  char *zTitle;
  char *zOwner;
  char *zClrKey;
  char *zErr1 = 0;
  char *zErr2 = 0;
  int count = 0;
  int rn;


  rn = atoi(zRep);
  if( rn ){
    db_prepare(&q,
     "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn);
  }else{
    db_prepare(&q,
     "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE title='%s'", zRep);
  }
  if( db_step(&q)!=SQLITE_ROW ){
    db_finalize(&q);
    fossil_fatal("unkown report format(%s)!",zRep);
  }
  zTitle = db_column_malloc(&q, 0);
  zSql = db_column_malloc(&q, 1);
  zOwner = db_column_malloc(&q, 2);
  zClrKey = db_column_malloc(&q, 3);
  db_finalize(&q);
  if( zFilter ){

Changes to src/tkt.c.

835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851


852
853
854
855
856
857
858
...
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912

/*
** COMMAND: ticket
** Usage: %fossil ticket SUBCOMMAND ...
**
** Run various subcommands to control tickets
**
**     %fossil ticket show REPORTNR ?TICKETFILTER? ?-l|--limit LIMITCHAR?
**
**         Run the the ticket report, identified by the report number
**         used in the gui. The data is written as flat file on stdout,
**         using "," as separator. The seperator "," can be changed using
**         the -l or --limit option.
**         If TICKETFILTER is given on the commandline, the query is
**         limited with a new WHERE-condition.
**           example:  Report lists a column # with the uuid
**                     TICKETFILTER may be [#]='uuuuuuuuu'


**
**     %fossil ticket set TICKETUUID FIELD VALUE ?FIELD VALUE ... ?
**
**         change ticket identified by TICKETUUID and set the value of
**         field FIELD to VALUE. Valid field descriptions are:
**            status, type, severity, priority, resolution,
**            foundin, private_contact, resolution, title or comment
................................................................................
    n = strlen(g.argv[2]);
    if( n==1 && g.argv[2][0]=='s' ){
      usage("ticket show|set|add");
    }else if( strncmp(g.argv[2],"show",n)==0 ){
      if( g.argc==3 ){
        usage("ticket show REPORTNR");
      }else{
        int rn;
        const char *zSep = 0;
        const char *zFilterUuid = 0;

        zSep = find_option("limit","l",1);
        rn = atoi(g.argv[3]);
        if( g.argc>4 ){
          zFilterUuid = g.argv[4];
        }

        rptshow( rn, zSep, zFilterUuid );

      }
    }else{
      enum { set,add,err } eCmd = err;
      int i;
      int rid;
      const char *zTktUuid;







|









>
>







 







|




|




|







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
...
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914

/*
** COMMAND: ticket
** Usage: %fossil ticket SUBCOMMAND ...
**
** Run various subcommands to control tickets
**
**     %fossil ticket show (REPORTNR|REPORTTITLE) ?TICKETFILTER? ?-l|--limit LIMITCHAR?
**
**         Run the the ticket report, identified by the report number
**         used in the gui. The data is written as flat file on stdout,
**         using "," as separator. The seperator "," can be changed using
**         the -l or --limit option.
**         If TICKETFILTER is given on the commandline, the query is
**         limited with a new WHERE-condition.
**           example:  Report lists a column # with the uuid
**                     TICKETFILTER may be [#]='uuuuuuuuu'
**         Instead of the report number its possible to use the report
**         title (please quote the string, if it contains whitespace).
**
**     %fossil ticket set TICKETUUID FIELD VALUE ?FIELD VALUE ... ?
**
**         change ticket identified by TICKETUUID and set the value of
**         field FIELD to VALUE. Valid field descriptions are:
**            status, type, severity, priority, resolution,
**            foundin, private_contact, resolution, title or comment
................................................................................
    n = strlen(g.argv[2]);
    if( n==1 && g.argv[2][0]=='s' ){
      usage("ticket show|set|add");
    }else if( strncmp(g.argv[2],"show",n)==0 ){
      if( g.argc==3 ){
        usage("ticket show REPORTNR");
      }else{
        const char *zRep = 0;
        const char *zSep = 0;
        const char *zFilterUuid = 0;

        zSep = find_option("limit","l",1);
        zRep = g.argv[3];
        if( g.argc>4 ){
          zFilterUuid = g.argv[4];
        }

        rptshow( zRep, zSep, zFilterUuid );

      }
    }else{
      enum { set,add,err } eCmd = err;
      int i;
      int rid;
      const char *zTktUuid;