search_results.smarty
7.76 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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
{$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 Criteria Editor{/i18n}</a>
{/capture}
{i18n arg_options=$options}Use the #options# to extend your search criteria.{/i18n}
{/if}
{if !$search2_anonymous && !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 !$search2_anonymous && !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">
function saveSearch()
{
var txtName = $('txtSaveName');
var txtQuery = '{/literal}{$txtQuery|escape:'quotes'}{literal}';
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';
Ext.Ajax.request(
{
url: url,
method: 'GET',
success: 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';
}
else
{
alert("{/literal}{i18n}There is a problem saving the expression expression.{/i18n}{literal}\n\n" + resp.message );
}
}
},
failure: function(o)
{
alert("{/literal}{i18n}There is a problem communicating with the server.{/i18n}{literal}" + o.responseText);
},
params: {
txtName: txtName.value,
txtQuery: txtQuery
}
});
}
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 !$search2_anonymous && 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="{$rootUrl}/action.php">
<table border=0 cellpadding="1" cellspacing="1" width="100%" align=center>
{assign var=cbid value=0}
{i18n arg_count=$numResults}Search results found: #count#{/i18n}
<br/>
<br/>
{foreach item=hit from=$results}
<tr><td>
<input type="checkbox" {if $hit->IsDocument}name="selection_d[]"{else}name="selection_f[]"{/if} id="cb{$cbid}" value="{$hit->Id}"><nobr>
<span class="contenttype {$hit->MimeIconPath}">
{if $hit->IsDocument}
<a href="{$rootUrl}/view.php?fDocumentId={$hit->Id}"><B>{$hit->Title|truncate:80}</b></a>
{if $hit->Title != $hit->Filename}
<font style=" color: green "> - {i18n}Filename:{/i18n} {$hit->Filename|truncate:40}</font>
{/if}
{if $hit->IsAvailable}
<img src="{$rootUrl}/resources/graphics/download.png" title="Download Document" onclick="document.location='{$rootUrl}/action.php?kt_path_info=ktcore.actions.document.view&fDocumentId={$hit->Id}';"></a>
{/if}
{if !$hit->IsAvailable}
<font style=" color: red "><B> * {i18n}NOT AVAILABLE{/i18n} * </B></font>
{/if}
{else}
<a href="{$rootUrl}/browse.php?fFolderId={$hit->RealId}{if $hit->IsProxy}&fShortcutFolder={$hit->Id}{/if}"><B>{$hit->Title|truncate:80}</b></a>
{/if}
</nobr>
</td><td align=right>
{if $hit->IsDocument}
<font style="color: green ">{i18n}Document ID:{/i18n} {$hit->Id}</font>
<font style=" color: orange ">{i18n}Version:{/i18n} {$hit->Version}</font></td>
{else}
<font style="color: green ">{i18n}Folder ID:{/i18n} {$hit->Id}</font>
{/if}
</tr>
<tr><td colspan=2>{$hit->Text}</td></tr>
<tr><td>
{if $hit->IsDocument}
<font style=" color: green "><a href="{$rootUrl}/browse.php?fFolderId={$hit->FolderId}" tag="{$hit->FullPath}">{$hit->FullPath|truncate:40}</a>/{$hit->Title|truncate:40} - {$hit->Filesize}</font>
{else}
<font style=" color: green "><a href="{$rootUrl}/browse.php?fFolderId={$hit->FolderId}" tag="{$hit->FullPath}">{$hit->FullPath|truncate:40}</a></font>
{/if}
</td>
<td align=right><nobr>
<font style="color: orange ">
{i18n}Created By:{/i18n} {$hit->CreatedBy}
{if $hit->IsDocument}
{i18n}on{/i18n} {$hit->DateCreated}
{/if}
</font>
</td>
{if $hit->IsDocument}
<tr><td>
{if $workflow != ''}
<font style="color: orange ">{i18n}Workflow:{/i18n} $hit->Workflow}</font>
{/if}
</td>
<td align=right><nobr>
<font style="color: brown ">
{if $hit->CheckedOutUser != ''}
<b>{i18n}Checked out by:{/i18n} {$hit->CheckedOutUser}
{i18n}on{/i18n} {$hit->DateCheckedOut}</b>
{else}
{i18n}Modified by:{/i18n} {$hit->ModifiedBy}
{i18n}on{/i18n} {$hit->DateModified}
{/if}
</font>
</td>
{/if}
<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="{$rootUrl}/search2.php?action=searchResults&pageOffset={$move}">{$move}</a></td>
{if $move == $endMovement}
<td></td>
{/if}
{/foreach}
</tr>
</table>
{/if}