1
- <cfinclude template = " includes/_header.cfm" >
2
- <cfset title = " Publication Search Results" >
3
-
4
- <cfset uName = " getPubs#cfid ##cftoken #" >
5
- <cfif not isdefined (" newQuery" ) >
6
- <cfset newQuery = 1 >
7
- </cfif >
8
- <cfif not isdefined (" toproject_id" ) >
9
- <cfset toproject_id = - 1 >
10
- </cfif >
11
- <cfif #newQuery # is 1 >
12
- <cfset basSQL = " SELECT DISTINCT
13
- publication.publication_id,
14
- publication.publication_type,
15
- formatted_publication,
16
- description,
17
- link " >
18
- <cfset basFrom = "
19
- FROM
20
- publication,
21
- publication_author_name,
22
- project_publication,
23
- agent_name,
24
- formatted_publication,
25
- publication_url" >
26
- <cfset basWhere = "
27
- WHERE
28
- publication.publication_id = project_publication.publication_id (+)
29
- AND publication.publication_id = publication_author_name.publication_id (+)
30
- AND publication_author_name.agent_name_id = agent_name.agent_name_id (+)
31
- AND formatted_publication.publication_id (+) = publication.publication_id
32
- AND formatted_publication.format_style = 'long'
33
- AND publication.publication_id = publication_url.publication_id (+)" >
34
-
35
- <cfif isdefined (" pubTitle" ) AND len (#pubTitle #) gt 0 >
36
- <cfset basWhere = " #basWhere # AND UPPER(publication_title) LIKE '%#ucase (pubTitle ) #%'" >
37
- </cfif >
38
- <cfif isdefined (" onlyCitePubs" ) AND #onlyCitePubs # gt 0 >
39
- <cfif #basFrom # does not contain " citation" >
40
- <cfset basFrom = " #basFrom #,citation" >
41
- </cfif >
42
- <cfset basWhere = " #basWhere # AND publication.publication_id = citation.publication_id" >
43
- </cfif >
44
- <cfif isdefined (" pubAuthor" ) AND len (#pubAuthor #) gt 0 >
45
- <cfset pubAuthor = #replace (pubAuthor ," '" ," ''" ," all" )# >
46
- <cfset basWhere = " #basWhere # AND UPPER(agent_name) LIKE '%#ucase (pubAuthor ) #%'" >
47
- </cfif >
48
- <cfif isdefined (" publication_author_id" ) AND len (#publication_author_id #) gt 0 >
49
- <cfset basWhere = " #basWhere # AND publication_author_name.agent_name_id IN (#publication_author_id #)" >
50
- </cfif >
51
- <cfif isdefined (" pubYear" ) AND len (#pubYear #) gt 0 >
52
- <cfset basWhere = " #basWhere # AND UPPER(PUBLISHED_YEAR) LIKE '%#ucase (pubYear ) #%'" >
53
- </cfif >
54
- <cfif isdefined (" publication_id" ) AND len (#publication_id #) gt 0 >
55
- <cfset basWhere = " #basWhere # AND publication.publication_id = #publication_id #" >
56
- </cfif >
57
- <cfif isdefined (" current_Sci_Name" ) AND len (#current_Sci_Name #) gt 0 >
58
- <cfset basFrom = " #basFrom # ,
59
- citation CURRENT_NAME_CITATION,
60
- cataloged_item,
61
- identification catItemTaxa" >
62
- <cfset basWhere = " #basWhere # AND publication.publication_id = CURRENT_NAME_CITATION.publication_id (+)
63
- AND CURRENT_NAME_CITATION.collection_object_id = cataloged_item.collection_object_id (+)
64
- AND cataloged_item.collection_object_id = catItemTaxa.collection_object_id
65
- AND catItemTaxa.accepted_id_fg = 1
66
- AND upper(catItemTaxa.scientific_name) LIKE '%#ucase (current_Sci_Name ) #%'" >
67
- </cfif >
68
- <cfif isdefined (" cited_Sci_Name" ) AND len (#cited_Sci_Name #) gt 0 >
69
- <cfset basFrom = " #basFrom # ,
70
- citation CITED_NAME_CITATION, taxonomy CitTaxa" >
71
- <cfset basWhere = " #basWhere # AND publication.publication_id = CITED_NAME_CITATION.publication_id (+)
72
- AND CITED_NAME_CITATION.cited_taxon_name_id = CitTaxa.taxon_name_id (+)
73
- AND upper(CitTaxa.scientific_name) LIKE '%#ucase (cited_Sci_Name ) #%'" >
74
- </cfif >
75
- <cfif isdefined (" journal_name" ) AND len (#journal_name #) gt 0 >
76
- <cfif #jnOper # is " LIKE" >
77
- <cfset jname = " '%#ucase (journal_name ) #%'" >
78
- <cfelse >
79
- <cfset jname = " '#ucase (journal_name ) #'" >
80
- </cfif >
81
- <cfset basFrom = " #basFrom # ,
82
- journal, journal_article" >
83
- <cfset basWhere = " #basWhere # AND publication.publication_id = journal_article.publication_id
84
- AND journal_article.journal_id = journal.journal_id AND
85
- upper(journal_name) #jnOper # #jname #" >
86
- </cfif >
87
- <cfif isdefined (" collection_id" ) AND len (#collection_id #) gt 0 >
88
- <cfset basFrom = " #basFrom #,cataloged_item" >
89
- <cfif #basFrom # does not contain " citation" >
90
- <cfset basFrom = " #basFrom #,citation" >
91
- </cfif >
92
- <cfset basWhere = " #basWhere # AND publication.publication_id = citation.publication_id
93
- AND citation.collection_object_id = cataloged_item.collection_object_id AND
94
- cataloged_item.collection_id = #collection_id #" >
95
- </cfif >
96
-
97
-
98
- <cfset basSql = " #basSQL # #basFrom # #basWhere # ORDER BY publication.publication_id" >
99
-
100
- <cfquery name =" getPubs#cfid##cftoken#" datasource =" user_login" username =" #session .dbuser #" password =" #decrypt (session .epw ,cfid ) #" cachedwithin =" #createtimespan (0 ,0 ,0 ,0 ) #" >
101
- # preservesinglequotes(basSQL)#
102
- </cfquery >
103
-
104
- <cfquery name =" getPubs#cfid##cftoken#" datasource =" user_login" username =" #session .dbuser #" password =" #decrypt (session .epw ,cfid ) #" cachedwithin =" #createtimespan (0 ,0 ,60 ,0 ) #" >
105
- # preservesinglequotes(basSQL)#
106
- </cfquery >
107
- <cfset newQuery = 0 >
108
- <cfset newSearch = 1 ><!--- - assign a variable that says we've destroyed the cached query
109
- and should destroy the cache of it used to navigate pages ---->
110
- <!---- kill the cached query since we're in the newquery loop ---->
111
- </cfif >
112
- <cfif isdefined (" newSearch" ) and #newSearch # is 1 >
113
- <cfquery name =" #uName#" dbtype =" query" cachedwithin =" #createtimespan (0 ,0 ,0 ,0 ) #" >
114
- select * from getPubs#cfid ##cftoken #
115
- </cfquery >
116
- </cfif >
117
- <cfquery name =" #uName#" dbtype =" query" cachedwithin =" #createtimespan (0 ,0 ,60 ,0 ) #" >
118
- select * from getPubs#cfid ##cftoken #
119
- </cfquery >
120
-
121
- <cfquery name =" getPubs" dbtype =" query" >
122
- select * from getPubs#cfid ##cftoken #
123
- </cfquery >
124
-
125
- <cfquery name =" count" dbtype =" query" >
126
- select distinct (publication_id) from getPubs
127
- </cfquery >
128
- <cfparam name =" StartRow" default =" 1" >
129
- <CFSET ToRow = StartRow + (session .DisplayRows - 1 ) >
130
- <CFIF ToRow GT count .RecordCount >
131
- <CFSET ToRow = count .RecordCount >
132
- </CFIF ><CFOUTPUT >
133
- <P >
134
- <H4 >
135
- Displaying records #StartRow # - #ToRow # from the #count .RecordCount #
136
- total records that matched your criteria.
137
- </H4 >
138
- </CFOUTPUT >
139
- <form name =" form2" >
140
- <!--- update the values for the next and previous rows to be returned --->
141
- <CFSET Next = StartRow + session .DisplayRows >
142
- <CFSET Previous = StartRow - session .DisplayRows >
143
- <table >
144
-
145
- <CFOUTPUT >
146
- <tr >
147
-
148
- <td ><CFIF Previous GTE 1 >
149
-
150
- <form name =" form3" action =" PublicationResults.cfm" >
151
-
152
- <input name =" toproject_id" type =" hidden" value =" #toproject_id #" >
153
- <input type =" submit"
154
- value =" Previous #session .DisplayRows # Records"
155
- class =" lnkBtn"
156
- onmouseover =" this.className='lnkBtn btnhov'"
157
- onmouseout =" this.className='lnkBtn'" >
158
-
159
- <input name =" StartRow" type =" hidden" value =" #Previous #" >
160
- <input name =" NewQuery" type =" hidden" value =" 0" >
161
- <input name =" displayRows" type =" hidden" value =" #session .DisplayRows #" >
162
- </form >
163
- </CFIF ></td >
164
- <td ><!--- Create a next records link if there are more records in the record set
165
- that haven't yet been displayed. --->
166
- <CFIF Next LTE getPubs .RecordCount >
167
- <form name =" form4" action =" PublicationResults.cfm" >
168
- <input type =" submit"
169
- value =" Next #session .DisplayRows # Records"
170
- class =" lnkBtn"
171
- onmouseover =" this.className='lnkBtn btnhov'"
172
- onmouseout =" this.className='lnkBtn'" >
173
- <input name =" StartRow" type =" hidden" value =" #Next #" >
174
- <input name =" toproject_id" type =" hidden" value =" #toproject_id #" >
175
- <input name =" NewQuery" type =" hidden" value =" 0" >
176
- <input name =" session.displayRows" type =" hidden" value =" #session .DisplayRows #" >
177
- </form >
178
- </CFIF >
179
- </td >
180
- </tr >
181
- </CFOUTPUT >
182
- </table >
183
- </form >
184
- <table border =" 1" >
185
- <cfoutput query =" getPubs" StartRow =" #StartRow #" MaxRows =" #session .DisplayRows #" group =" publication_id" >
186
- <tr #iif (currentrow MOD 2 ,DE (" class='evenRow'" ),DE (" class='oddRow'" )) #>
187
- <td valign =" top" >
188
- <table >
189
- <form action =" ProjectList.cfm?src=pubs" method =" post" >
190
- <input name =" toproject_id" type =" hidden" value =" #toproject_id #" >
191
- <input name =" Action" type =" hidden" >
192
- <input type =" hidden" name =" publication_id" value =" #publication_id #" >
193
- <tr valign =" top" >
194
- <td valign =" top" >
195
- <input type =" submit"
196
- value =" Projects"
197
- class =" lnkBtn"
198
- onmouseover =" this.className='lnkBtn btnhov'"
199
- onmouseout =" this.className='lnkBtn'" >
200
- </td >
201
- </tr >
202
- </form >
203
- <form action =" SpecimenResults.cfm" method =" post" >
204
- <input name =" Action" type =" hidden" >
205
- <input name =" toproject_id" type =" hidden" value =" #toproject_id #" >
206
- <input type =" hidden" name =" publication_id" value =" #publication_id #" >
207
- <tr >
208
- <td valign =" top" >
209
-
210
- <input type =" submit"
211
- value =" Cited Specimens"
212
- class =" lnkBtn"
213
- onmouseover =" this.className='lnkBtn btnhov'"
214
- onmouseout =" this.className='lnkBtn'" >
215
- </td >
216
- </tr >
217
- </form >
218
- <cfif #toproject_id # gt 0 >
219
- <form action =" Project.cfm" method =" post" >
220
- <input name =" project_id" type =" hidden" value =" #toproject_id #" >
221
- <input type =" hidden" name =" Action" value =" addPub" >
222
- <input type =" hidden" name =" publication_id" value =" #publication_id #" >
223
- <tr >
224
- <td valign =" top" >
225
- <input type =" submit"
226
- value =" Add to Project"
227
- class =" lnkBtn"
228
- onmouseover =" this.className='lnkBtn btnhov'"
229
- onmouseout =" this.className='lnkBtn'" >
230
- </td >
231
- </tr >
232
- </form >
233
- </cfif >
234
- <cfif isdefined (" session.roles" ) and listfindnocase (session .roles ," MANAGE_PUBLICATIONS" ) >
235
- <tr >
236
- <td valign =" top" >
237
- <a href =" Publication.cfm?publication_id=#publication_id #" >Edit Publication</a >
238
- </td >
239
- </tr >
240
- <form action =" Citation.cfm" method =" post" >
241
- <input type =" hidden" name =" publication_id" value =" #publication_id #" >
242
- <tr >
243
- <td valign =" top" >
244
-
245
- <input type =" submit"
246
- value =" Manage Citations"
247
- class =" lnkBtn"
248
- onmouseover =" this.className='lnkBtn btnhov'"
249
- onmouseout =" this.className='lnkBtn'" >
250
-
251
- </td >
252
- </tr >
253
- </form >
254
- </cfif >
255
- </table >
256
- </td >
257
- <td >
258
- #formatted_publication #
259
- <cfquery name =" links" dbtype =" query" >
260
- select link, description from getPubs where publication_id = #publication_id #
261
- group by link, description
262
- </cfquery >
263
- <cfif len (#links .description #) gt 0 >
264
- <blockquote >
265
- Links:
266
- <ul >
267
- <cfloop query =" links" >
268
- <li ><a href =" #link #" target =" _blank" >#description #</a ></li >
269
- </cfloop >
270
- </ul >
271
- </blockquote >
272
- </cfif >
273
-
274
- </td >
275
- </tr >
276
- </cfoutput >
277
- </table >
278
-
279
- <form name =" form2" >
280
- <!--- update the values for the next and previous rows to be returned --->
281
- <CFSET Next = StartRow + session .DisplayRows >
282
- <CFSET Previous = StartRow - session .DisplayRows >
283
- <!--- Create a previous records link if the records being displayed aren't the
284
- first set --->
285
- <table >
286
- <CFOUTPUT >
287
- <tr >
288
- <td ><CFIF Previous GTE 1 >
289
- <form name =" form3" action =" PublicationResults.cfm" >
290
-
291
- <input type =" submit"
292
- value =" Previous #session .DisplayRows # Records"
293
- class =" lnkBtn"
294
- onmouseover =" this.className='lnkBtn btnhov'"
295
- onmouseout =" this.className='lnkBtn'" >
296
- <input name =" StartRow" type =" hidden" value =" #Previous #" >
297
- <input name =" NewQuery" type =" hidden" value =" 0" >
298
- <input name =" displayRows" type =" hidden" value =" #session .DisplayRows #" >
299
- </form >
300
- </CFIF ></td >
301
- <td ><!--- Create a next records link if there are more records in the record set
302
- that haven't yet been displayed. --->
303
- <CFIF Next LTE getPubs .RecordCount >
304
- <form name =" form4" action =" PublicationResults.cfm" >
305
-
306
- <input type =" submit"
307
- value =" Next #session .DisplayRows # Records"
308
- class =" lnkBtn"
309
- onmouseover =" this.className='lnkBtn btnhov'"
310
- onmouseout =" this.className='lnkBtn'" >
311
- <input name =" StartRow" type =" hidden" value =" #Next #" >
312
- <input name =" NewQuery" type =" hidden" value =" 0" >
313
- <input name =" session.displayRows" type =" hidden" value =" #session .DisplayRows #" >
314
- </form >
315
- </CFIF >
316
- </td >
317
- </tr >
318
- </CFOUTPUT >
319
- </table >
320
- </form >
321
- <cfinclude template = " includes/_footer.cfm" >
1
+ <cfoutput >
2
+ <cfset rurl = ' /SpecimenUsage.cfm' >
3
+ <cfif isdefined (" publication_id" >
4
+ < cfset rurl = rurl & ' ?action=search&publication_id=' & publication_id >
5
+ < / cfif >
6
+ < cfheader statuscode = " 301" statustext = " Moved permanently" >
7
+ < cfheader name = " Location" value = " #rurl #" >
8
+ < / cfoutput >
0 commit comments