search_results.smarty
6.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/MochiKitPacked.js')}
{$context->oPage->requireJSResource('resources/js/toggleselect.js')}
<div class="collapsible">
<h4 onclick="toggleElementClass('expanded', this.parentNode)">{i18n}Search Criteria{/i18n}</h4>
<div class="collapsiblebody">
<fieldset>
<legend>{i18n}Search Criteria{/i18n}</legend>
{$txtQuery}
<br>
{if empty($iSavedID)}
{capture assign=options}
<a href="{addQS}action=queryBuilder{/addQS}">{i18n}Search Critieria Editor{/i18n}</a>
{/capture}
{i18n arg_options=$options}Use the #options# to extend your search criteria.{/i18n}
{/if}
{if !empty($iSavedID)}
{capture assign=options}
<a href="{addQS}action=queryBuilder&fSavedSearchId={$iSavedID}{/addQS}">Query Editor</a>
{/capture}
{i18n arg_options=$options}To edit the search criteria, use the #options#.{/i18n}
{/if}
<font color=brown><div id="savedSearch" style="display: none">{i18n}The search criteria has been saved.{/i18n}</div></font>
</fieldset>
<br>
{if !empty($iSavedID)}
<fieldset>
<legend>{i18n}Saved Search{/i18n}</legend>
{i18n}This is the saved search criteria:{/i18n} {$txtSavedName}. <br/>
{capture assign=options}
<a href="{addQS}action=manage{/addQS}">{i18n}Manage Saved Search Criteria{/i18n}</a>
{/capture}
{i18n arg_options=$options}To delete this saved search criteria or to edit other saved search criteria, #options#.{/i18n}
</fieldset>
{/if}
{literal}
<script language="javascript">
var savesearch_gotStatus = function callBack(o)
{
if (o.responseText != '{}')
{
var resp = eval('(' + o.responseText + ')');
if (resp.status == 0)
{
parseSuccess = true;
$('saveSearch').style.display='none';
$('savedSearch').style.display='block';
//alert('{/literal}{i18n}The search expression has been saved.{/i18n}{literal}');
}
else
{
alert('{/literal}{i18n}There is a problem saving the expression expression.{/i18n}{literal}\n\n' + resp.message );
}
}
}
var savesearch_gotNoStatus = function callBack(o)
{
alert('{/literal}{i18n}There is a problem communicating with the server.{/i18n}{literal}' + o.responseText);
}
var saveSearchCallback =
{
success:savesearch_gotStatus,
failure:savesearch_gotNoStatus
}
function saveSearch()
{
var txtName = $('txtSaveName');
if (txtName.value == '')
{
alert('{/literal}{i18n}Please enter a name for the search expression.{/i18n}{literal}');
txtName.focus();
return;
}
url='{/literal}{$rootUrl}{literal}/search2/ajax/saveExpr.php?txtName='+ txtName.value +'&txtQuery={/literal}{$txtQuery|escape:'quotes'}{literal}';
YAHOO.util.Connect.asyncRequest('GET',url, saveSearchCallback);
}
function onSelectAll()
{
var cbSelectAll = $('cbSelectAll');
for(var i={/literal}{$firstRec}{literal};i<{/literal}{$lastRec}{literal};i++)
{
var cb = $('cb' + i);
cb.checked = cbSelectAll.checked;
}
}
function onShowAll(showall)
{
url = "{/literal}{addQS}{literal}action=searchResults&pageOffset={/literal}{$pageOffset}{literal}&showAll=" + showall + "{/literal}{/addQS}{literal}";
document.location = url;
}
</script>
{/literal}
</div>
</div>
{if empty($iSavedID)}
<div id="saveSearch">
<fieldset>
<legend>{i18n}You can save this search:{/i18n}</legend>
<input id=txtSaveName>
<input type=button value="{i18n}Save{/i18n}" onclick="saveSearch()">
</fieldset>
</div>
{/if}
<fieldset>
<legend>{i18n}Search Results{/i18n}</legend>
{if $numResults == 0}
{i18n}There are no search results matching your search criteria.{/i18n}
<p>
{capture assign=options}
<a href="{addQS}action=queryBuilder{/addQS}">{i18n}Search Criteria Editor{/i18n}</a>
{/capture}
{i18n arg_options=$options}Use the #options# to extend this query.{/i18n}
{else}
<form method=post action="/action.php">
<table border=0 cellpadding="1" cellspacing="1" width="800px" align=center>
{assign var=cbid value=0}
{foreach item=document from=$results}
<tr><td>
<input type="checkbox" name="selection_d[]" id="cb{$cbid}" value="{$document->DocumentID}"><nobr><a href="view.php?fDocumentId={$document->DocumentID}"><B>{$document->Title}</b></a>
{if $document->Title != $document->Filename}
<font style=" color: green "> - Filename: {$document->Filename}</font>
{/if}
{if !$document->IsAvailable}
<font style=" color: red "><B> * {i18n}NOT AVAILABLE{/i18n} * </B></font>
{/if}
</td><td align=right>
<font style="color: green ">{i18n}Document ID:{/i18n} {$document->DocumentID}</font>
<font style=" color: orange ">{i18n}Version:{/i18n} {$document->Version}</font></td>
</tr>
<tr><td colspan=2>{$document->Text}</td></tr>
<tr><td><font style=" color: green "><a href="{$rootUrl}/browse.php?fFolderId={$document->FolderId}">{$document->FullPath}</a>/{$document->Title} - {$document->Filesize}</font></td>
<td align=right><nobr>
<font style="color: orange ">
{i18n}Created By:{/i18n} {$document->CreatedBy}
{i18n}on{/i18n} {$document->DateCreated}
</font>
</td>
<tr><td>
{if $workflow != ''}
<font style="color: orange ">{i18n}Workflow:{/i18n} $document->Workflow}</font>
{/if}
</td>
<td align=right><nobr>
<font style="color: brown ">
{if $document->CheckedOutUser != ''}
<b>{i18n}Checked out by:{/i18n} {$document->CheckedOutUser}
{i18n}on{/i18n} {$document->DateCheckedOut}</b>
{else}
{i18n}Modified by:{/i18n} {$document->ModifiedBy}
{i18n}on{/i18n} {$document->DateModified}
{/if}
</font>
</td>
<tr><td colspan=2><br></br></td></tr></tr>
{assign var=cbid value=$cbid+1}
{/foreach}
<tr><td>
<input type="checkbox" id="cbSelectAll" onclick="onSelectAll()">{i18n}Select All{/i18n}
{if $showAll}
<input type="checkbox" onclick="onShowAll('false')" checked>{i18n}Show All{/i18n}
{/if}
{if !$showAll}
<input type="checkbox" onclick="onShowAll('true')">{i18n}Show All{/i18n}
{/if}
<br>
<input type="hidden" name="fFolderId" value="1" />
<input type="hidden" name="sListCode" value="" />
<input type="hidden" name="action" value="bulkaction" />
<input type="hidden" name="fReturnAction" value="search2" />
<input type="hidden" name="fReturnData" value="1" />
<nobr>
{foreach from=$bulkactions item=bulkaction}
<input type="submit" name="submit[{$bulkaction->getName()}]" value="{$bulkaction->getDisplayName()}" />
{/foreach}
</nobr>
</table>
</form>
{/if}
</fieldset>
{if $endMovement - $startMovement > 0}
<br>
<br>
<table align="center">
<tr>
{foreach item=move from=$pageMovement}
{if $move == $startMovement}
<td></td>
{/if}
<td><a href="search2.php?action=searchResults&pageOffset={$move}">{$move}</a></td>
{if $move == $endMovement}
<td></td>
{/if}
{/foreach}
</tr>
</table>
{/if}