| ︙ | | | ︙ | |
247
248
249
250
251
252
253
254
255
256
257
258
259
260
|
/*
** Update an entry of the TICKET and TICKETCHNG tables according to the
** information in the ticket artifact given in p. Attempt to create
** the appropriate TICKET table entry if tktid is zero. If tktid is nonzero
** then it will be the ROWID of an existing TICKET entry.
**
** Parameter rid is the recordID for the ticket artifact in the BLOB table.
**
** Return the new rowid of the TICKET table entry.
*/
static int ticket_insert(const Manifest *p, const int rid, int tktid,
Blob *fields){
Blob sql1; /* update or replace TICKET ... */
Blob sql2; /* list of TICKETCHNG's fields that are in the manifest */
|
>
>
>
>
>
>
>
|
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
/*
** Update an entry of the TICKET and TICKETCHNG tables according to the
** information in the ticket artifact given in p. Attempt to create
** the appropriate TICKET table entry if tktid is zero. If tktid is nonzero
** then it will be the ROWID of an existing TICKET entry.
**
** Parameter rid is the recordID for the ticket artifact in the BLOB table.
** Upon assignment of a field this rid is stored into a corresponding
** zBsln integer column (provided that it is defined within TICKET table).
**
** If a field is USEDBY_TICKETCHNG table then back-references within it
** are extracted and inserted into the BACKLINK table; otherwise
** a corresponding blob in the `fields` array is updated so that the
** caller could extract backlinks from the most recent field's values.
**
** Return the new rowid of the TICKET table entry.
*/
static int ticket_insert(const Manifest *p, const int rid, int tktid,
Blob *fields){
Blob sql1; /* update or replace TICKET ... */
Blob sql2; /* list of TICKETCHNG's fields that are in the manifest */
|
| ︙ | | | ︙ | |
814
815
816
817
818
819
820
821
822
823
824
825
826
827
|
}
aField[idx].zAppend = mprintf("%.*s", argl[2], argv[2]);
return TH_OK;
}
/*
** Write a ticket into the repository.
*/
static int ticket_put(
Blob *pTicket, /* The text of the ticket change record */
const char *zTktId, /* The ticket to which this change is applied */
const char *aUsed, /* Indicators for fields' modifications */
int needMod /* True if moderation is needed */
){
|
>
>
|
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
|
}
aField[idx].zAppend = mprintf("%.*s", argl[2], argv[2]);
return TH_OK;
}
/*
** Write a ticket into the repository.
** Upon reassignment of fields try to delta-compress an artifact against
** all artifacts that are referenced in the corresponding zBsln fields.
*/
static int ticket_put(
Blob *pTicket, /* The text of the ticket change record */
const char *zTktId, /* The ticket to which this change is applied */
const char *aUsed, /* Indicators for fields' modifications */
int needMod /* True if moderation is needed */
){
|
| ︙ | | | ︙ | |
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
|
** another way) show a list of artifacts associated with a single ticket.
**
** By default, the artifacts are decoded and formatted. Text fields
** are formatted as text/plain, since in the general case Fossil does
** not have knowledge of the encoding. If the "raw" query parameter
** is present, then the undecoded and unformatted text of each artifact
** is displayed.
*/
void tkthistory_page(void){
Stmt q;
char *zTitle;
const char *zUuid;
int tagid;
int nChng = 0;
Blob *aLastVal = 0;
login_check_credentials();
if( !g.perm.Hyperlink || !g.perm.RdTkt ){
login_needed(g.anon.Hyperlink && g.anon.RdTkt);
return;
}
zUuid = PD("name","");
|
>
>
>
|
|
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
|
** another way) show a list of artifacts associated with a single ticket.
**
** By default, the artifacts are decoded and formatted. Text fields
** are formatted as text/plain, since in the general case Fossil does
** not have knowledge of the encoding. If the "raw" query parameter
** is present, then the undecoded and unformatted text of each artifact
** is displayed.
**
** Reassignments of a field of the TICKET table that has a corresponding
** "baseline for ..." companion if rendered as unified delta.
*/
void tkthistory_page(void){
Stmt q;
char *zTitle;
const char *zUuid;
int tagid;
int nChng = 0;
Blob *aLastVal = 0; /* holds the last rendered value for each field */
login_check_credentials();
if( !g.perm.Hyperlink || !g.perm.RdTkt ){
login_needed(g.anon.Hyperlink && g.anon.RdTkt);
return;
}
zUuid = PD("name","");
|
| ︙ | | | ︙ | |
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
|
}
return 0;
}
/*
** The pTkt object is a ticket change artifact. Output a detailed
** description of this object.
*/
void ticket_output_change_artifact(
Manifest *pTkt, /* Parsed artifact for the ticket change */
const char *zListType, /* Which type of list */
int n, /* Which ticket change is this */
Blob *aLastVal /* Array of latest values for the diffs */
){
int i;
if( zListType==0 ) zListType = "1";
getAllTicketFields();
@ <ol type="%s(zListType)">
for(i=0; i<pTkt->nField; i++){
const char *z = pTkt->aField[i].zName;
|
>
>
>
|
|
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
|
}
return 0;
}
/*
** The pTkt object is a ticket change artifact. Output a detailed
** description of this object.
**
** If `aLastVal` is not NULL then render selected fields as unified diffs
** and update corresponding elements of that array with values from `pTkt`.
*/
void ticket_output_change_artifact(
Manifest *pTkt, /* Parsed artifact for the ticket change */
const char *zListType, /* Which type of list */
int n, /* Which ticket change is this */
Blob *aLastVal /* Array of the latest values for the diffs */
){
int i;
if( zListType==0 ) zListType = "1";
getAllTicketFields();
@ <ol type="%s(zListType)">
for(i=0; i<pTkt->nField; i++){
const char *z = pTkt->aField[i].zName;
|
| ︙ | | | ︙ | |