38
38
* Date Name Description of modification
39
39
* ------- ---------- -----------------------------------------------------
42
* Revision 6.49 2005/10/18 19:09:40 kans
43
* shorten locale dialog box
45
* Revision 6.48 2005/08/18 14:41:30 kans
46
* include toasn3.h for ExtendGeneFeatIfOnMRNA prototype
48
* Revision 6.47 2005/07/11 16:35:48 bollin
49
* when creating temporary empty sets as containers for descriptors, set
50
* the _class member to BioseqseqSet_class_empty_set to prevent the BioseqSet
51
* from being removed by the DeleteMarkedSeqEntry function in api/gather.c
53
* Revision 6.46 2005/07/05 14:23:15 bollin
54
* "Lookup Relaxed" button should only be available for internal Sequin,
55
* per Linda Yankie's request.
57
* Revision 6.45 2005/06/03 13:24:36 bollin
58
* unregister dialogs for ObjMgr messages when the form is being removed
60
* Revision 6.44 2005/05/23 15:58:33 bollin
61
* improved appearance of publications listed in PublicationListDialog -
62
* don't include the word "citation" at the front of the string, use semicolons
63
* instead of carriage returns.
65
* Revision 6.43 2005/05/23 15:47:56 bollin
66
* added external method for invoking the editor for a publication listed by the
67
* PublicationListDialog
69
* Revision 6.42 2005/05/20 19:12:11 bollin
70
* user can now edit publications from the publication list dialog
72
* Revision 6.41 2005/05/20 14:34:30 bollin
73
* fixed bug in SeqDescrListCopy
75
* Revision 6.40 2005/05/19 20:24:37 bollin
76
* created a new dialog for editing a list of publications. Will be used by
77
* the new Submission Template File Editor dialog. Still needs some work.
79
* Revision 6.39 2005/04/20 19:46:02 kans
80
* fixed ReplaceAllCallback
82
* Revision 6.38 2005/03/03 21:44:05 kans
83
* PubEquivLookupProc takes extra BoolPtr parameter to signal success or failure
85
* Revision 6.37 2004/08/13 16:07:54 kans
86
* warn if changing pub_reftype to sites or lost
88
* Revision 6.36 2004/08/13 15:32:37 kans
89
* restored reftype gui controls on initial publication window
91
* Revision 6.35 2004/08/11 18:50:14 kans
92
* PubdescPtrToPubdescPage looks at imp history, changes pubstatus from electronic to print if hard copy has been published
94
* Revision 6.34 2004/08/09 16:15:13 kans
95
* more informative popup item values for pubstatus
97
* Revision 6.33 2004/07/20 16:04:05 kans
98
* added pubstatus control
100
* Revision 6.32 2004/04/29 13:17:22 bollin
101
* removed scope control (unused) from pub descriptor and pub feature dialogs.
103
* Revision 6.31 2004/04/26 18:48:39 bollin
104
* prevent user from changing from submission to non-submission pub descriptor
106
* Revision 6.30 2004/04/26 18:25:28 kans
107
* always allow Submission to be added, even by non-indexers
109
* Revision 6.29 2003/02/24 14:14:10 kans
110
* removed unnecessary prototypes
112
* Revision 6.28 2002/11/03 21:10:12 kans
113
* do not put standard remark popup in online pub dialog
115
* Revision 6.27 2002/11/03 20:53:11 kans
116
* added support for online publication
118
* Revision 6.26 2002/10/30 18:21:33 kans
119
* strAuthor does not take author_popups, and calls to CreateAuthorDialog now use spacing of 2 instead of -1 to make suffix popup look better
121
* Revision 6.25 2002/08/01 19:47:10 kans
122
* AddConsortiumToAuthList in CitSub
124
* Revision 6.24 2002/07/23 21:31:19 kans
125
* support for consortium
127
* Revision 6.23 2001/11/12 19:54:53 kans
128
* do not allocate year, protect against buffer overflow by -1 value
130
* Revision 6.22 2001/11/08 14:26:38 kans
131
* some protection in relaxed lookup, but server is not handling maxuid parameter in EntrezCreateBooleanRequest
133
* Revision 6.21 2001/10/23 18:57:38 kans
134
* EntrezAddToBooleanRequest has new key parameter
136
* Revision 6.20 2001/09/28 15:55:17 kans
137
* for docsum, extract first author, separate year from month
139
* Revision 6.19 2001/09/10 19:20:06 kans
140
* fixed for new entrez2 spec
142
* Revision 6.18 2001/08/03 23:01:50 kans
143
* import/export primary author dialog
145
* Revision 6.17 2001/05/30 15:10:53 kans
146
* removed medarch and medutil includes
148
* Revision 6.16 2001/05/29 16:31:11 kans
149
* added LaunchRelaxedQuery, written by Hanzhen Sun
151
* Revision 6.15 1999/05/10 23:13:26 kans
152
* separate lookup by muid and pmid in case both are present
154
* Revision 6.14 1999/05/06 19:00:58 kans
155
* enable lookup by pmid button
157
* Revision 6.13 1998/12/14 22:36:21 kans
158
* trim spaces around muid string
160
* Revision 6.12 1998/11/30 17:31:13 kans
161
* kludge to save authors if lookup by article
163
* Revision 6.11 1998/10/20 15:33:59 kans
164
* citsub now allows affil phone, fax, e-mail to be set
166
* Revision 6.10 1998/06/12 00:24:52 kans
167
* fixed problems detected by unix compiler
169
* Revision 6.9 1998/06/02 17:51:02 kans
170
* StdVibrantEditorMsgFunc responds to OM_MSG_DEL
172
* Revision 6.8 1998/04/13 21:07:22 kans
173
* PubdescAcceptFormButtonProc tries to copy ASN.1, on failure aborts attempted save
175
* Revision 6.7 1997/12/01 15:05:03 kuzio
176
* continuing bug fixes for proceedings citation
178
* Revision 6.6 1997/11/26 20:40:11 kuzio
181
* Revision 6.5 1997/11/26 15:49:25 kuzio
182
* 1st fix of proceedings entry bugs
184
* Revision 6.4 1997/11/13 21:33:50 kans
185
* implemented proceedings, proceedings chapter (Kuzio)
187
* Revision 6.3 1997/11/11 23:24:46 kans
188
* Import clears ppp->flagPubDelta
190
* Revision 6.2 1997/10/21 23:02:12 kans
191
* standard remark text popup for indexers
193
* Revision 6.1 1997/09/15 19:05:53 kans
194
* editors call ObjMgrAddUserData to support ItemAlreadyHasEditor
196
* Revision 6.0 1997/08/25 18:22:59 madden
197
* Revision changed to 6.0
199
* Revision 5.23 1997/08/01 15:07:20 kans
200
* ExtendGeneFeatIfOnMRNA only called by indexer version
202
* Revision 5.22 1997/07/30 20:27:31 kans
203
* use of ExtendGeneFeatIfOnMRNA
205
* Revision 5.21 1997/07/22 21:51:15 kans
206
* citbookptr was not being objtained properly from citartptr
208
* Revision 5.20 1997/07/14 13:17:51 kans
209
* CreateIntervalEditorDialogEx takes callback to synchronize feature partial checkbox to 5prime and 3prime partial boxes
211
* Revision 5.19 1997/05/05 15:51:35 kans
212
* no replace authors on new pub
214
* Revision 5.18 1997/05/05 02:07:26 kans
215
* replace authors button in initial form
217
* Revision 5.17 1997/05/02 21:27:32 kans
218
* replace authors implemented
220
* Revision 5.16 1997/05/02 19:18:33 kans
221
* calls SetClosestParentIfDuplicating
223
* Revision 5.15 1997/04/02 22:48:56 kans
224
* changed title_rank to be iso-jta, ml-jta, jta, coden, issn, name, trans
226
* Revision 5.14 1997/04/02 21:19:43 kans
227
* title_old set to 0 at beginning, so cit-art with lower ranked titles
228
* coming after cit-gen with higher ranked titles don't override
230
* Revision 5.13 1997/01/29 19:33:43 kans
231
* changed to StringNCpy_0
233
* Revision 5.12 1996/12/31 21:24:06 kans
234
* calls GetRidOfEmptyFeatsDescStrings
236
* Revision 5.11 1996/12/12 21:20:19 kans
237
* unpublished citations don't force current date if none set
239
* Revision 5.10 1996/12/04 18:17:05 kans
240
* internal indexer version start up on journal page
242
* Revision 5.9 1996/11/01 20:56:00 kans
243
* create dummy date in pub_sub
245
* Revision 5.8 1996/10/25 18:31:42 kans
246
* one more place to make fake imp->date
248
* Revision 5.7 1996/09/12 13:25:43 kans
249
* added cast to memset
251
* Revision 5.6 1996/09/05 16:23:50 kans
252
* cit-sub date initialized to current date
254
* Revision 5.5 1996/07/18 19:46:11 kans
255
* activate slot now in forms structure in vibforms.h
257
* Revision 5.4 1996/07/17 21:52:31 kans
258
* SaveStringFromTextAndStripNewlines for saving from most scroll text boxes
260
* Revision 5.3 1996/07/17 20:53:58 kans
261
* multiple citgen would miss "unpublished" indication
263
* Revision 5.2 1996/06/21 18:38:12 kans
264
* allows switching of reftype in existing pub if descriptor
266
* Revision 5.1 1996/06/13 18:22:32 kans
267
* GetATSub needed to check for csp->imp not NULL before double dereferencing
269
* Revision 5.0 1996/05/28 13:39:11 ostell
270
* Set to revision 5.0
272
* Revision 1.47 1996/05/22 21:50:59 kans
273
* changed OM_MSG_RET_OK to OM_MSG_RET_DONE
275
* Revision 1.46 1996/05/21 20:18:23 kans
276
* don't read or write reftype on import/export
278
* Revision 1.45 1996/05/21 20:05:34 kans
279
* implement import/export of pubdesc, seqloc
281
* Revision 1.44 1996/05/21 18:50:57 kans
282
* put title page(s) before author page, preparation for import/export
284
* Revision 1.43 1996/04/24 19:23:27 kans
285
* internal sequin always shows serial number control
287
* Revision 1.42 1996/04/09 21:37:10 kans
288
* fixed thesis (Kuzio)
290
* Revision 1.41 1996/04/09 16:33:20 kans
291
* added help scrolling, and new pub has accept button instead of replace
293
* Revision 1.40 1996/04/08 14:40:22 kans
294
* added initial support for PubMed IDs (Kuzio)
296
* Revision 1.39 1996/03/21 16:06:18 kans
297
* SetNewFeatureDefaultInterval now used
299
* Revision 1.38 1996/03/12 00:39:39 kans
300
* added support for CitRetract in journal imprint
302
* Revision 1.37 1996/02/29 17:47:28 kans
303
* internal sequin allows new submission citation to be added
305
* Revision 1.36 1996/02/15 23:03:43 kans
306
* remove contact sub-dialog
308
* Revision 1.35 1996/02/14 18:15:48 kans
309
* publication features don't have citations on feature requirement
311
* Revision 1.34 1996/02/07 16:15:20 kans
312
* new pub disables buttons that would allow unimplemented feat/desc switch
314
* Revision 1.33 1996/01/24 22:11:46 kans
315
* if no imp->date, it creates a dummy one to pass the object loader
317
* Revision 1.32 1996/01/24 21:46:30 kans
318
* convert cap to cgp truncated and corrupted title
320
* Revision 1.31 1996/01/02 21:35:24 kans
321
* changed Process to Proceed for initial form button title
323
* Revision 1.30 1996/01/02 19:48:35 kans
324
* uses fallback message callback
326
* Revision 1.29 1996/01/02 17:15:31 kans
327
* replaceThis is in the app property structure, newfeat reftype set properly
329
* Revision 1.28 1995/12/31 02:55:36 kans
330
* REPLACE_THIS needed for separate replace all and replace this buttons
332
* Revision 1.27 1995/12/30 19:50:01 kans
333
* message handler now uses switch statement
335
* Revision 1.26 1995/12/30 04:05:48 kans
336
* editors handle cut/copy/paste/delete etc. messages from menu items
338
* Revision 1.25 1995/12/30 00:51:49 kans
339
* init, enter, reset, redraw dialog/form uses message function
341
* Revision 1.24 1995/12/26 14:57:21 kans
342
* added NULL clearProc parameter to CreateStdEditorFormMenus
344
* Revision 1.23 1995/12/25 21:48:12 kans
345
* calls CreateStdEditorFormMenus
347
* Revision 1.22 1995/12/24 15:58:54 kans
348
* SetSerialNumber was testing cgp->serial_number instead of serial_number
350
* Revision 1.21 1995/12/23 21:18:11 kans
351
* moved MedArch pre- and post-processing into pubdesc
353
* Revision 1.20 1995/12/21 20:40:39 kans
354
* accept buttons now update minimal cits on feats
356
* Revision 1.19 1995/12/20 22:22:37 kans
357
* code center cleanup (Kuzio)
359
* Revision 1.18 1995/12/20 21:01:53 kans
360
* support for remote MedArch services
362
* Revision 1.17 1995/12/20 20:22:08 kans
363
* implements most of replace all function (except minimal cits on feats)
365
* Revision 1.16 1995/12/20 16:04:10 kans
366
* Update called when switching folder tabs
368
* Revision 1.15 1995/12/19 22:16:57 kans
369
* *** empty log message ***
371
* Revision 1.14 1995/12/15 00:51:53 kans
372
* all author pages now use subfolders for names, affil, and contact
374
* Revision 1.13 1995/12/12 23:34:22 kans
375
* uses extra folder tab appearance parameters
377
* Revision 1.12 1995/12/12 22:36:32 kans
378
* cannot change feat/desc type of existing pubdesc (Kuzio)
380
* Revision 1.11 1995/12/09 01:55:16 kans
381
* changes to cit-sub and cit-pat (the other JAK)
383
* Revision 1.10 1995/12/08 03:22:26 kans
384
* second round of cosmetic changes
386
* Revision 1.9 1995/12/08 01:48:08 kans
387
* first round of cosmetic changes
389
* Revision 1.8 1995/12/07 22:51:39 kans
390
* maximum folder tab per line now set for all publication types
392
* Revision 1.7 1995/12/07 01:00:33 kans
393
* new parameters to CreateFolderTabs
395
* Revision 1.6 1995/12/05 22:55:05 kans
396
* major internal simplification (Kuzio)
398
* Revision 1.5 1995/12/02 23:36:38 kans
399
* functional on existing features and descriptors
401
* Revision 1.4 1995/12/01 23:38:35 kans
402
* *** empty log message ***
404
* Revision 1.3 1995/11/08 23:37:52 kans
405
* edit block moved out of vibrant
407
* Revision 1.2 1995/09/25 21:13:26 kans
408
* *** empty log message ***
410
* Revision 1.1 1995/07/28 18:01:31 kans
414
41
* ==========================================================================
4842
4737
EntrezAddToBooleanRequest (e2rp, NULL, 0, "PAGE",term, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4845
static void AddYear(Entrez2RequestPtr e2rp, CharPtr term, Boolean is_1st)
4740
static void AddYear(Entrez2RequestPtr e2rp, CharPtr term, Boolean is_1st, Boolean expand)
4847
4744
if (StringHasNoText (term)) return;
4849
4746
EntrezAddToBooleanRequest (e2rp, NULL, ENTREZ_OP_AND, NULL, NULL, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4851
EntrezAddToBooleanRequest (e2rp, NULL, 0, "DP", term, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4751
EntrezAddToBooleanRequest (e2rp, NULL, ENTREZ_OP_LEFT_PAREN, NULL, NULL, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4752
sprintf (year_buf, "%d", year - 1);
4753
EntrezAddToBooleanRequest (e2rp, NULL, 0, "EDAT", year_buf, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4754
EntrezAddToBooleanRequest (e2rp, NULL, ENTREZ_OP_OR, NULL, NULL, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4755
sprintf (year_buf, "%d", year);
4756
EntrezAddToBooleanRequest (e2rp, NULL, 0, "EDAT", year_buf, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4757
EntrezAddToBooleanRequest (e2rp, NULL, ENTREZ_OP_OR, NULL, NULL, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4758
sprintf (year_buf, "%d", year + 1);
4759
EntrezAddToBooleanRequest (e2rp, NULL, 0, "EDAT", year_buf, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4760
EntrezAddToBooleanRequest (e2rp, NULL, ENTREZ_OP_RIGHT_PAREN, NULL, NULL, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4762
EntrezAddToBooleanRequest (e2rp, NULL, 0, "EDAT", term, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4765
EntrezAddToBooleanRequest (e2rp, NULL, 0, "EDAT", term, NULL, 0, 0, NULL, NULL, FALSE, FALSE);
4854
4769
static void AddAll(Entrez2RequestPtr e2rp, CharPtr term, Boolean is_1st)
4866
/*****************************************************************************
4868
* Function: FormDefaultQuery
4869
* constructs entrez2 query from information passed in, execute
4870
* the query, and get back the uids from entrezReplyPtr.
4871
********************************pass uids back as bs of caipp. returns void.
4872
* Argument: CitArtInPressPtr
4876
*****************************************************************************/
4877
static void FormDefaultQuery (Entrez2RequestPtr e2rp, CitArtInPressPtr caipp) {
4881
if (caipp->year != -1) {
4882
sprintf(year, "%d", (int) caipp->year);
4885
/* add all available fields as indicated by rank*/
4886
if (caipp->rank == 10) { /* add title, page, vol */
4888
AddJournal(e2rp, caipp->jour_title, TRUE); /* add first term*/
4889
AddVolume(e2rp, caipp->jour_volume, FALSE);
4890
AddPage(e2rp, caipp->jour_page, FALSE);
4895
if (caipp->rank > 4) { /* add author in all cases*/
4897
/***** term can be capital letter or lower case, (ENTREZ_OP_NONE is 0) */
4898
AddAuthor(e2rp, caipp->f_last_name, TRUE); /* add first term */
4900
if(StringCmp(caipp->l_last_name, "null") && StringCmp(caipp->l_last_name, caipp->f_last_name)) {
4901
AddAuthor(e2rp, caipp->l_last_name, FALSE);
4905
if (caipp->rank == 6) { /* add year, takes StringSave(year-1900)?? */
4906
AddYear(e2rp, year, FALSE);
4909
if (caipp->rank > 6) { /* add jour_title */
4910
AddJournal(e2rp, caipp->jour_title, FALSE); /* NOT first term*/
4913
if (caipp->rank == 9) { /* add vol and year */
4914
AddVolume(e2rp, caipp->jour_volume, FALSE);
4915
AddYear(e2rp, year, FALSE);
4918
if (caipp->rank == 8) { /* add year or volume */
4920
if (caipp->year != -1) {
4921
AddYear(e2rp, year, FALSE);
4924
AddVolume(e2rp, caipp->jour_volume, FALSE);
4779
static Entrez2RequestPtr QueryFromForm (CitationUpdateFormPtr cufp, Boolean use_all)
4781
Entrez2RequestPtr e2rp = NULL;
4782
Boolean is_first_term = TRUE;
4785
if (cufp == NULL) return NULL;
4787
/* for new term in query, add to [all], then automatically go through Term mapping*/
4788
/* add exta term (user supplied) as ALL, no specific field */
4789
/* debug: assuming this is a well-formed query string, let the add func. parse it*/
4790
if ( !TextHasNoText (cufp->extra_term_text) && (use_all || GetStatus (cufp->Extra_Term))) {
4791
GetTitle (cufp->extra_term_text, val_str, sizeof (val_str));
4792
e2rp = EntrezCreateBooleanRequest (TRUE, FALSE, "PubMed", val_str, 0, 0, NULL, 20, 0);
4793
is_first_term = FALSE;
4795
e2rp = EntrezCreateBooleanRequest (TRUE, FALSE, "PubMed", NULL, 0, 0, NULL, 20, 0);
4798
if ( ! TextHasNoText (cufp->f_auth_text) && (use_all || GetStatus (cufp->First_Author))) {
4799
GetTitle (cufp->f_auth_text, val_str, sizeof (val_str));
4800
AddAuthor(e2rp, val_str, is_first_term);
4801
is_first_term = FALSE;
4804
if ( !TextHasNoText (cufp->l_auth_text) && (use_all || GetStatus (cufp->Last_Author))) {
4805
GetTitle (cufp->l_auth_text, val_str, sizeof (val_str));
4806
AddAuthor(e2rp, val_str, is_first_term);
4807
is_first_term = FALSE;
4810
if ( !TextHasNoText (cufp->journal_text) && (use_all || GetStatus (cufp->Journal))) {
4811
GetTitle (cufp->journal_text, val_str, sizeof (val_str));
4812
AddJournal(e2rp, val_str, is_first_term);
4813
is_first_term = FALSE;
4816
if ( !TextHasNoText (cufp->volume_text) && (use_all || GetStatus (cufp->Volume))) {
4817
GetTitle (cufp->volume_text, val_str, sizeof (val_str));
4818
AddVolume(e2rp, val_str, is_first_term);
4819
is_first_term = FALSE;
4822
if ( !TextHasNoText (cufp->page_text) && (use_all || GetStatus (cufp->Page))) {
4823
GetTitle (cufp->page_text, val_str, sizeof (val_str));
4824
AddPage(e2rp, val_str, is_first_term);
4825
is_first_term = FALSE;
4828
if ( !TextHasNoText (cufp->year_text) && (use_all || GetStatus (cufp->Year))) {
4829
GetTitle (cufp->year_text, val_str, sizeof (val_str));
4830
AddYear(e2rp, val_str, is_first_term, GetStatus (cufp->expand_year));
4831
is_first_term = FALSE;
4932
4837
/*****************************************************************************
4976
4870
/*** trick: must make sure to add Op : AND, after the first term, can't
4977
4871
add one before!! */
4979
if (choice == 1) { /* precess default query*/
4981
e2rp = EntrezCreateBooleanRequest (TRUE, FALSE, "PubMed", NULL, 0, 0, NULL, 20, 0);
4983
FormDefaultQuery (e2rp, caipp);
4986
/* add exta term (user supplied) as ALL, no specific field */
4987
if ( GetStatus (cufp->Extra_Term) ) {
4988
GetTitle (cufp->extra_term_text, new_term, sizeof (f_auth));
4989
AddAll(e2rp, new_term, FALSE);
4990
is_first_term = FALSE;
4994
if (choice == 2) { /*user specify query*/
4996
/* for new term in query, add to [all], then automatically go through Term mapping*/
4997
/* add exta term (user supplied) as ALL, no specific field */
4998
/* debug: assuming this is a well-formed query string, let the add func. parse it*/
4999
if ( GetStatus (cufp->Extra_Term) ) {
5000
GetTitle (cufp->extra_term_text, new_term, sizeof (f_auth));
5001
e2rp = EntrezCreateBooleanRequest (TRUE, FALSE, "PubMed", new_term, 0, 0, NULL, 20, 0);
5002
is_first_term = FALSE;
5005
e2rp = EntrezCreateBooleanRequest (TRUE, FALSE, "PubMed", NULL, 0, 0, NULL, 20, 0);
5008
if ( GetStatus (cufp->First_Author) ) {
5009
GetTitle (cufp->f_auth_text, f_auth, sizeof (f_auth));
5010
AddAuthor(e2rp, f_auth, is_first_term);
5011
is_first_term = FALSE;
5014
if ( GetStatus (cufp->Last_Author) ) {
5015
GetTitle (cufp->l_auth_text, l_auth, sizeof (l_auth));
5016
AddAuthor(e2rp, l_auth, is_first_term);
5017
is_first_term = FALSE;
5020
if ( GetStatus (cufp->Journal) ) {
5021
GetTitle (cufp->journal_text, journal, sizeof (journal));
5022
AddJournal(e2rp, journal, is_first_term);
5023
is_first_term = FALSE;
5026
if ( GetStatus (cufp->Volume) ) {
5027
GetTitle (cufp->volume_text, volume, sizeof (volume));
5028
AddVolume(e2rp, volume, is_first_term);
5029
is_first_term = FALSE;
5032
if ( GetStatus (cufp->Page) ) {
5033
GetTitle (cufp->page_text, volume, sizeof (page));
5034
AddPage(e2rp, page, is_first_term);
5035
is_first_term = FALSE;
5038
if ( GetStatus (cufp->Year) ) {
5039
GetTitle (cufp->year_text, year, sizeof (year));
5040
AddYear(e2rp, year, is_first_term);
5041
is_first_term = FALSE;
5045
SetValue (cufp->new_query, 2); /* reset the popup list to display customize item*/
4873
e2rp = QueryFromForm (cufp, choice == 1);
5048
4875
/* process query, get Uids, populate the caipp field*/
5049
4876
GetUidListFromE2Request (caipp, e2rp, cufp->rdoc);
5252
5099
authors = HiddenGroup (cit_fields, 4, 0, NULL);
5253
5100
SetGroupSpacing (authors, 5, 3);
5255
cufp->First_Author = CheckBox (authors, "First Author", NULL);
5102
cufp->First_Author = CheckBox (authors, "First Author", SetRequestType);
5103
SetObjectExtra (cufp->First_Author, cufp, NULL);
5256
5104
cufp->f_auth_text = DialogText (authors, "", 12, NULL);
5258
cufp->Last_Author = CheckBox (authors, "Last Author", NULL);
5106
cufp->Last_Author = CheckBox (authors, "Last Author", SetRequestType);
5107
SetObjectExtra (cufp->Last_Author, cufp, NULL);
5259
5108
cufp->l_auth_text = DialogText (authors, "", 12, NULL);
5261
5110
journal = HiddenGroup (cit_fields, 2, 0, NULL);
5262
5111
SetGroupSpacing (journal, 5, 3);
5264
cufp->Journal = CheckBox (journal, "Journal", NULL);
5113
cufp->Journal = CheckBox (journal, "Journal", SetRequestType);
5114
SetObjectExtra (cufp->Journal, cufp, NULL);
5265
5115
cufp->journal_text = DialogText (journal, "", 30, NULL);
5267
imprint = HiddenGroup (cit_fields, 6, 0, NULL);
5117
imprint = HiddenGroup (cit_fields, 7, 0, NULL);
5268
5118
SetGroupSpacing (imprint, 5, 3);
5270
cufp->Year = CheckBox (imprint, "Year", NULL);
5120
cufp->Year = CheckBox (imprint, "Year", SetRequestType);
5121
SetObjectExtra (cufp->Year, cufp, NULL);
5271
5122
cufp->year_text = DialogText (imprint, "", 6, NULL);
5272
cufp->Volume = CheckBox (imprint, "Volume", NULL);
5123
cufp->expand_year = CheckBox (imprint, "+/- 1 Year", NULL);
5124
SetStatus (cufp->expand_year, TRUE);
5125
cufp->Volume = CheckBox (imprint, "Volume", SetRequestType);
5126
SetObjectExtra (cufp->Volume, cufp, NULL);
5273
5127
cufp->volume_text = DialogText (imprint, "", 6, NULL);
5274
cufp->Page = CheckBox (imprint, "Page", NULL);
5128
cufp->Page = CheckBox (imprint, "Page", SetRequestType);
5129
SetObjectExtra (cufp->Page, cufp, NULL);
5275
5130
cufp->page_text = DialogText (imprint, "", 6, NULL);
5420
5284
for (pub=pubdesc->pub, cap=NULL; pub; pub=pub->next) {
5421
5285
if (pub->choice == PUB_Article) {
5423
5286
is_article = TRUE;
5424
5287
cap = (CitArtPtr) pub->data.ptrvalue;
5425
5288
if (cap == NULL) return;
5427
5290
/* look for cit-art from journals only*/
5428
if (cap->from ==1) {
5430
cjp = (CitJourPtr) cap->fromptr;
5431
if (cjp == NULL) return;
5433
ImpPtr =(ImprintPtr) cjp->imp;
5434
if(ImpPtr == NULL) return;
5291
if (cap->from ==1) {
5292
cjp = (CitJourPtr) cap->fromptr;
5293
if (cjp == NULL) return;
5295
ImpPtr =(ImprintPtr) cjp->imp;
5296
if(ImpPtr == NULL) return;
5437
/* get article title */
5438
if( !cap->title ) { art_title = StringSave("No title was available"); }
5439
for (art_title_vnp=cap->title; art_title_vnp; art_title_vnp=art_title_vnp->next) {
5440
/*could combine the four*/
5441
if((art_title_vnp->choice == Cit_title_name) || (art_title_vnp->choice == Cit_title_tsub)|| (art_title_vnp->choice == Cit_title_trans)) {
5442
art_title = art_title_vnp->data.ptrvalue;
5446
/* get journal title */
5447
if( !cjp->title ) { jour_title = StringSave("null"); }
5448
for (title_vnp=cjp->title; title_vnp; title_vnp=title_vnp->next) {
5449
/*could combine the four*/
5450
if (title_vnp->choice == Cit_title_iso_jta) {
5451
jour_title = title_vnp->data.ptrvalue;
5453
else if (title_vnp->choice == Cit_title_ml_jta) {
5454
jour_title = title_vnp->data.ptrvalue;
5456
else if (title_vnp->choice == Cit_title_jta) {
5457
jour_title = title_vnp->data.ptrvalue;
5459
else if (title_vnp->choice == Cit_title_name) {
5460
jour_title = title_vnp->data.ptrvalue;
5461
/* break; don't need break ??? */
5464
jour_title = StringSave("this journal got a WEIRD title");
5470
if (ImpPtr->volume) {
5471
jour_volume = ImpPtr->volume;
5474
else { jour_volume = StringSave("null"); }
5476
if (ImpPtr->pages) {
5477
jour_page = ImpPtr->pages;
5480
else { jour_page = StringSave("null"); }
5483
/* not ideal behavior, although date is required in imp*/
5484
if ((DatePtr)ImpPtr->date == NULL) { return; }
5487
DateRead (ImpPtr->date, &year, NULL, NULL, NULL);
5488
if (year != -1) { has_year = TRUE; }
5490
alp = (AuthListPtr) cap->authors;
5493
if (caipp->logfile) {
5495
fprintf(caipp->logfile,"|this in-press cit-art has no author| %s | %s| %s | %d\n", jour_title, jour_volume, jour_page, year);
5500
/*get ptr to both 1st and last author*/
5501
auth_vnp = (ValNodePtr) alp->names; /*get the first node */
5503
f_author_p = (AuthorPtr)auth_vnp->data.ptrvalue;
5505
/* get the node for the last author*/
5506
while (auth_vnp->next) {
5507
auth_vnp = auth_vnp->next;
5509
l_author_p =(AuthorPtr)auth_vnp->data.ptrvalue;
5511
/* should be analyzing the value of alp->choice, not alp->names->choice*/
5512
if (alp->choice == 1) {
5513
/*could make this (getting name from author_p) a function */
5514
pid_p = (PersonIdPtr) f_author_p->name;
5516
if (pid_p->choice ==2) {
5518
nsp = (NameStdPtr) pid_p -> data;
5520
/* why didnot this work?? *
5521
if (!( nsp->names[0])) */
5523
if (nsp->names[0] != NULL ) {
5525
f_last_name = nsp->names[0];
5528
if (nsp->names[1]!= NULL) {
5529
f_first_name = nsp->names[1];
5531
else { f_first_name = StringSave("null"); }
5535
else { f_last_name = StringSave("null");
5536
f_first_name = StringSave("null");
5541
/*now do the last author */
5543
if (l_author_p->name == f_author_p->name) { /*single author*/
5544
l_first_name = f_first_name;
5545
l_last_name =f_last_name;
5549
pid_p = (PersonIdPtr) l_author_p->name;
5550
if (pid_p->choice ==2) {
5551
nsp = (NameStdPtr) pid_p -> data;
5553
if (nsp->names[0] != NULL ) {
5555
l_last_name = nsp->names[0];
5556
if (nsp->names[1]!= NULL) {
5557
l_first_name = nsp->names[1];
5559
else { l_first_name = StringSave("null"); }
5561
else { l_last_name = StringSave("null");
5562
l_first_name = StringSave("null");
5565
} /*end of last author */
5566
} /* end alp-> choice is std */
5569
/* here, if author list is not std names */
5570
else if (alp->choice == 2) {
5572
/* full name as last name*/
5573
f_last_name = (CharPtr)f_author_p;
5574
f_first_name = StringSave ("null");
5577
l_last_name = (CharPtr)l_author_p;
5578
l_first_name = StringSave ("null");
5581
/* full name as last name*/
5582
f_last_name = (CharPtr)f_author_p;
5583
f_first_name = StringSave ("null");
5586
l_last_name = (CharPtr)l_author_p;
5587
l_first_name = StringSave ("null");
5595
if (has_page && has_volume && has_title) {
5598
else if (has_author) {
5600
if(has_year && has_volume) { rank = 9; }
5601
else if (has_year || has_volume) { rank = 8; }
5602
else { rank = 7; } /* auth + journal_title only*/
5604
else if (has_year) { rank = 6; } /* auth + year only*/
5605
else { rank = 5; } /* author but no journal_title case */
5607
else { rank = 0; } /*ignore all other combo*/
5612
/* better set flags as key individual fields are collected!!
5613
* avoid many calls to StringCmp */
5614
/* must have first author, or (journal_title, volume and page)*/
5616
if (has_page && has_volume && has_title) {
5619
else if (has_author) {
5621
if(has_year && has_volume) { rank = 9; }
5622
else if (has_year || has_volume) { rank = 8; }
5623
else { rank = 7; } /* auth + journal_title only*/
5625
else if (has_year) { rank = 6; } /* auth + year only*/
5626
else { rank = 5; } /* author but no journal_title case */
5628
else { rank = 0; } /*ignore all other combo*/
5631
/* safe practice to save a new copy if the struct my go away. */
5632
caipp->jour_title = StringSave(jour_title);
5633
caipp->f_last_name = StringSave(f_last_name);
5634
caipp->f_first_name =StringSave(f_first_name);
5635
caipp->l_last_name = StringSave(l_last_name);
5636
caipp->l_first_name = StringSave(l_first_name);
5637
caipp->jour_volume = StringSave(jour_volume);
5638
caipp->jour_page = StringSave(jour_page);
5640
caipp->art_title = StringSave(art_title);
5298
/* get article title */
5299
for (art_title_vnp=cap->title; art_title_vnp; art_title_vnp=art_title_vnp->next) {
5300
/*could combine the four*/
5301
if((art_title_vnp->choice == Cit_title_name) || (art_title_vnp->choice == Cit_title_tsub)|| (art_title_vnp->choice == Cit_title_trans)) {
5302
art_title = art_title_vnp->data.ptrvalue;
5306
/* get journal title */
5307
for (title_vnp=cjp->title; title_vnp; title_vnp=title_vnp->next) {
5308
/*could combine the four*/
5309
if (title_vnp->choice == Cit_title_iso_jta) {
5310
jour_title = title_vnp->data.ptrvalue;
5312
else if (title_vnp->choice == Cit_title_ml_jta) {
5313
jour_title = title_vnp->data.ptrvalue;
5315
else if (title_vnp->choice == Cit_title_jta) {
5316
jour_title = title_vnp->data.ptrvalue;
5318
else if (title_vnp->choice == Cit_title_name) {
5319
jour_title = title_vnp->data.ptrvalue;
5320
/* break; don't need break ??? */
5323
jour_title = "this journal got a WEIRD title";
5328
if (ImpPtr->volume) {
5329
jour_volume = ImpPtr->volume;
5332
if (ImpPtr->pages) {
5333
jour_page = ImpPtr->pages;
5337
/* not ideal behavior, although date is required in imp*/
5338
if ((DatePtr)ImpPtr->date != NULL) {
5339
DateRead (ImpPtr->date, &year, NULL, NULL, NULL);
5342
alp = (AuthListPtr) cap->authors;
5344
/*get ptr to both 1st and last author*/
5345
auth_vnp = (ValNodePtr) alp->names; /*get the first node */
5347
f_author_p = (AuthorPtr)auth_vnp->data.ptrvalue;
5348
l_author_p =(AuthorPtr)auth_vnp->data.ptrvalue;
5350
/* get the node for the last author, but ignore consortium */
5351
while (auth_vnp->next) {
5352
auth_vnp = auth_vnp->next;
5353
ap = (AuthorPtr) auth_vnp->data.ptrvalue;
5355
pid = (PersonIdPtr) ap->name;
5357
if (pid->choice == 2) {
5358
l_author_p =(AuthorPtr)auth_vnp->data.ptrvalue;
5364
/* should be analyzing the value of alp->choice, not alp->names->choice*/
5365
if (alp->choice == 1) {
5367
f_last_name = GetLastNameFromPersonId (f_author_p->name);
5368
l_last_name = GetLastNameFromPersonId (l_author_p->name);
5369
} else if (alp->choice == 2) {
5370
/* full name as last name*/
5371
f_last_name = (CharPtr)f_author_p;
5372
l_last_name = (CharPtr)l_author_p;
5374
/* full name as last name*/
5375
f_last_name = (CharPtr)f_author_p;
5376
l_last_name = (CharPtr)l_author_p;
5644
5379
} /*end if cit-art*/
5645
5380
} /*end if Pub_article*/
5646
5381
} /* end for, looped through all valnodes of pub*/