5a56a1696dc3e6e1bb27fcb7cba0a324df73918b
[ldapsaisie.git] / public_html / templates / default / viewSearch.tpl
1 {include file='ls:top.tpl'}
2 <form action='{$searchForm.action}' method='post' class='LSview_search' id='LSsearch_form'>
3
4 <div class='LSview_search'>
5   {foreach from=$searchForm.hiddenFields item=value key=name}
6     <input type='hidden' name='{$name}' value='{$value}' />
7   {/foreach}
8   
9   <input type='text' name='pattern' class='LSview_search' value="{$searchForm.values.pattern}"/>
10   <input type='submit' value='{$searchForm.labels.submit}' name='{$searchForm.names.submit}' class='LSview_search' />
11   <p id='LSview_search_param'>
12     <label class='LSview_search'>{$searchForm.labels.approx} : <input type='checkbox' name='approx' class='LSview_search' {if $searchForm.values.approx!=''}checked="true"{/if} /></label>
13     {if $searchForm.recursive}<label class='LSview_search'>{$searchForm.labels.recursive} : <input type='checkbox' name='recursive' class='LSview_search' {if $searchForm.values.recursive!=''}checked="true"{/if}/></label>{/if}
14   </p>
15 </div>
16
17 <h1>
18   {$pagetitle}
19 </h1>
20
21 {if $LSview_actions != ''}
22 <ul class='LSview-actions'>
23   {foreach from=$LSview_actions item=item}
24     {if is_array($item)}
25       <li class='LSview-actions'><a href='{$item.url}' class='LSview-actions'><img src='{img name=$item.action}' alt='{tr msg=$label}' title='{tr msg=$label}' /> {tr msg=$item.label}</a></li>
26     {/if}
27   {/foreach}
28 </ul>
29 {/if}
30
31 {if count($LSsearch->predefinedFilters) != 0}
32   <select id='LSview_search_predefinedFilter' name='predefinedFilter'>
33     <option value=''>--</option>
34     {html_options options=$LSsearch->predefinedFilters selected=$searchForm.predefinedFilter}
35   </select>
36 {/if}
37
38
39 </form>
40
41 <table class='LSobject-list'>
42     <tr class='LSobject-list'>
43       <th class='LSobject-list'>
44         {if $LSsearch->sort}
45         <a href='view.php?LSobject={$LSsearch->LSobject}&amp;sortBy=displayName&amp;nocache={$smarty.now}'>
46           {if $LSsearch->sortBy == 'displayName'}
47             <strong>{$LSsearch->label_objectName}</strong>
48             <img src='{img name=$LSsearch->sortDirection}' class='LSobject-list-ordersense' alt='{$LSsearch->sortDirection}'/>
49           {else}
50             {$LSsearch->label_objectName}
51           {/if}
52         </a>
53         {else}
54           {$LSsearch->label_objectName}
55         {/if}
56       </th>
57       {if $LSsearch->displaySubDn}
58         <th class='LSobject-list LSobject-list-subdn'>
59         {if $LSsearch->sort}
60           <a href='view.php?LSobject={$LSsearch->LSobject}&amp;sortBy=subDn&amp;nocache={$smarty.now}'>
61           {if $LSsearch->sortBy == 'subDn'}
62             <strong>{$LSsearch->label_level}</strong>
63             <img src='{img name=$LSsearch->sortDirection}' class='LSobject-list-ordersense' alt='{$LSsearch->sortDirection}'/>
64           {else}
65             {$LSsearch->label_level}
66           {/if}
67           </a>
68         {else}
69           {$LSsearch->label_level}
70         {/if}
71         </th>
72       {/if}
73       {if $LSsearch->extraDisplayedColumns}
74         {foreach from=$LSsearch->extraDisplayedColumns item=conf key=cid}
75         <th class='LSobject-list'>
76         {if $LSsearch->sort}
77           <a href='view.php?LSobject={$LSsearch->LSobject}&amp;sortBy={$cid}&amp;nocache={$smarty.now}'>
78           {if $LSsearch->sortBy == $cid}
79             <strong>{tr msg=$conf.label}</strong>
80             <img src='{img name=$LSsearch->sortDirection}' class='LSobject-list-ordersense' alt='{$LSsearch->sortDirection}'/>
81           {else}
82             {tr msg=$conf.label}
83           {/if}
84           </a>
85         {else}
86           {tr msg=$conf.label}
87         {/if}
88         </th>
89         {/foreach}
90       {/if}
91       <th class='LSobject-list'>{$LSsearch->label_actions}</th>
92     </tr>
93     {foreach from=$page.list item=object}
94     <tr class='{cycle values="LSobject-list,LSobject-list LSobject-list-bis"}'>
95         <td class='LSobject-list LSobject-list-names'><a href='view.php?LSobject={$LSsearch->LSobject}&amp;dn={$object->dn|escape:'url'}'  class='LSobject-list'>{$object->displayName}</a> </td>
96         {if $LSsearch->displaySubDn}<td class='LSobject-list'>{$object->subDn}</td>{/if}
97         {if $LSsearch->extraDisplayedColumns}
98           {foreach from=$LSsearch->extraDisplayedColumns item=conf key=cid}
99           <td class='LSobject-list'>{$object->$cid}</th>
100           {/foreach}
101         {/if}
102         <td class='LSobject-list LSobject-list-actions'>
103         {foreach from=$object->actions item=item}
104           <a href='{$item.url}'  class='LSobject-list-actions'><img src='{img name=$item.action}' alt='{$item.label}' title='{$item.label}'/></a>
105         {/foreach}
106         </td>
107     </tr>
108     {foreachelse}
109       <tr class='LSobject-list'>
110         <td colspan='{if $LSsearch->extraDisplayedColumns}{count($LSsearch->extraDisplayedColumns)+3}{else}3{/if}' class='LSobject-list-without-result'>
111           {$LSsearch->label_no_result}
112         </td>
113       </tr>   
114     {/foreach}
115 </table>
116 <span id='LSobject_list_nbresult'>{$LSsearch->label_total}</span>
117 {if $page.nbPages > 1}
118   <p class='LSobject-list-page'>
119     
120   {if $page.nbPages > 10}
121     {if $page.nb > 5}
122       {if $page.nb > $page.nbPages-6}
123         {assign var=start value=$page.nbPages-12}
124        {else}
125         {assign var=start value=$page.nb-6}
126       {/if}
127     {else}
128       {assign var=start value=0}
129     {/if}
130     <a href='view.php?LSobject={$LSsearch->LSobject}&amp;page=0' class='LSobject-list-page'><</a> 
131     {foreach from=0|range:10 item=i}
132       {if $page.nb==$start+$i}
133         <strong class='LSobject-list-page'>{$page.nb+1}</strong> 
134       {else}
135         <a href='view.php?LSobject={$LSsearch->LSobject}&amp;page={$i+$start}'  class='LSobject-list-page'>{$i+$start+1}</a> 
136       {/if}
137     {/foreach}
138     <a href='view.php?LSobject={$LSsearch->LSobject}&amp;page={$page.nbPages-1}' class='LSobject-list-page'>></a> 
139   {else}
140     {section name=listpage loop=$page.nbPages step=1}
141       {if $page.nb == $smarty.section.listpage.index}
142         <strong class='LSobject-list-page'>{$page.nb+1}</strong> 
143       {else}
144         <a href='view.php?LSobject={$LSsearch->LSobject}&amp;page={$smarty.section.listpage.index}'  class='LSobject-list-page'>{$smarty.section.listpage.index+1}</a> 
145       {/if}
146     {/section}
147   {/if}
148   </p>
149 {/if}
150 {include file='ls:bottom.tpl'}