summaryrefslogtreecommitdiff
path: root/templates/list_contact.tpl
blob: 5fddd74cd5e2cc507d38acb50269db3876ca42e5 (plain)
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
{* $Header: /cvsroot/bitweaver/_bit_contact/templates/list_contact.tpl,v 1.3 2010/02/09 17:21:21 wjames5 Exp $ *}
<div class="floaticon">
	{if $gBitUser->hasPermission('p_contact_admin')}
		<a title="{tr}configure listing{/tr}" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=contact">{biticon ipackage="icons" iname="edit" iexplain="configure"}</a>
	{/if}
	{bithelp}
</div>

<div class="listing contact">
	<div class="header">
		<h1><a href="{$gBitLoc.CONTACT_PKG_URL}list_contact.php">{tr}Contact Records{/tr}</a></h1>
	</div>

	<div class="body">

		<table class="find">
		<tr><td>{tr}Find{/tr}</td>
		   <td>
		   <form method="get" action="{$gBitLoc.CONTACT_PKG_URL}list_contacts.php">
		     <input type="text" name="find" value="{$listInfo.find|escape}" />
		     <input type="submit" name="search" value="{tr}find{/tr}" />
		     <input type="hidden" name="sort_mode" value="{$listInfo.sort_mode|escape}" />
		   </form>
		   </td>
		</tr>
		</table>

		<form id="checkform" method="post" action="{$smarty.server.PHP_SELF}">
		<input type="hidden" name="offset" value="{$listInfo.offset|escape}" />
		<input type="hidden" name="sort_mode" value="{$listInfo.sort_mode|escape}" />
		<table class="data">
		<tr>
		{*  at the moment, the only working option to use the checkboxes for is deleting pages. so for now the checkboxes are visible iff $bit_p_remove is set. Other applications make sense as well (categorize, convert to pdf, etc). Add necessary corresponding permission here: *}

		{if $gBitUser->hasPermission('p_contact_expunge')}              {* ... "or $bit_p_other_sufficient_condition_for_checkboxes eq 'y'"  *}
		  {assign var='checkboxes_on' value='y'}
		{else}
		  {assign var='checkboxes_on' value='n'}
		{/if}
		{if $checkboxes_on eq 'y'}
			<th>&nbsp;</th>{/if}
		{if $contact_list_content_id eq 'y'}
			<th><a href="{$gBitLoc.CONTACT_PKG_URL}list_contacts.php?offset={$listInfo.offset}&amp;sort_mode={if $listInfo.sort_mode eq 'content_id_desc'}content_id_asc{else}content_id_desc{/if}">{tr}Contact Id{/tr}</a></th>
		{/if}{if $contact_list_title eq 'y'}
			<th><a href="{$gBitLoc.CONTACT_PKG_URL}list_contacts.php?offset={$listInfo.offset}&amp;sort_mode={if $listInfo.sort_mode eq 'title_desc'}title_asc{else}title_desc{/if}">{tr}Title{/tr}</a></th>
			<th><a href="{$gBitLoc.CONTACT_PKG_URL}list_contacts.php?offset={$listInfo.offset}&amp;sort_mode={if $listInfo.sort_mode eq 'town_desc'}town_asc{else}town_desc{/if}">{tr}Town{/tr}</a></th>
			<th><a href="{$gBitLoc.CONTACT_PKG_URL}list_contacts.php?offset={$listInfo.offset}&amp;sort_mode={if $listInfo.sort_mode eq 'county_desc'}county_asc{else}county_desc{/if}">{tr}County{/tr}</a></th>
			<th><a href="{$gBitLoc.CONTACT_PKG_URL}list_contacts.php?offset={$listInfo.offset}&amp;sort_mode={if $listInfo.sort_mode eq 'postcode_desc'}postcode_asc{else}postcode_desc{/if}">{tr}Postcode{/tr}</a></th>
		{/if}{if $contact_list_description eq 'y'}
			<th><a href="{$gBitLoc.CONTACT_PKG_URL}list_contacts.php?offset={$listInfo.offset}&amp;sort_mode={if $listInfo.sort_mode eq 'description_desc'}description_asc{else}description_desc{/if}">{tr}Description{/tr}</a></th>
		{/if}
		</tr>

		{cycle values="even,odd" print=false}
		{section name=changes loop=$list}
		<tr class="{cycle}">
		{if $checkboxes_on eq 'y'}
			<td><input type="checkbox" name="checked[]" value="{$list[changes].content_id|escape}" /></td>
		{/if}
		{if $contact_list_content_id eq 'y'}
			<td><a href="{$gBitLoc.CONTACT_PKG_URL}index.php?content_id={$list[changes].content_id|escape:"url"}" title="{$list[changes].content_id}">{$list[changes].content_id|truncate:20:"...":true}</a>
				{if $gBitUser->hasPermission('p_edit_contact')}
					<br />(<a href="{$gBitLoc.CONTACT_PKG_URL}edit.php?content_id={$list[changes].content_id|escape:"url"}">{tr}edit{/tr}</a>)
				{/if}
			</td>
		{/if}
		{if $contact_list_title eq 'y'}
			<td style="text-align:center;">{$list[changes].title}</td>
			<td style="text-align:center;">{$list[changes].town}</td>
			<td style="text-align:center;">{$list[changes].county}</td>
			<td style="text-align:center;">{$list[changes].postcode}<br />
			{$list[changes].pcdetail}</td>
		{/if}
		{if $contact_list_description eq 'y'}
			<td style="text-align:center;">{$list[changes].data}</td>
		{/if}
		</tr>
		{sectionelse}
			<tr class="norecords"><td colspan="16">
				{tr}No records found{/tr}
			</td></tr>
		{/section}

		{if $checkboxes_on eq 'y'}
		<tr><td colspan="16">
		  <script>
		  <!--
		  // check / uncheck all.
		  // in the future, we could extend this to happen serverside as well for the convenience of people w/o javascript.
		  document.write("<tr><td><input name=\"switcher\" type=\"checkbox\" onclick=\"BitBase.switchCheckboxes(this.form.id,'checked[]','switcher')\" /></td>");
		  document.write("<td colspan=\"15\">{tr}All{/tr}</td></tr>");
		  //-->
		  </script>
		</td></tr>
		{/if}
		</table>

		{if $checkboxes_on eq 'y'} {* what happens to the checked items *}
		  <select name="submit_mult" onchange="this.form.submit();">
		    <option value="" selected="selected">{tr}with checked{/tr}:</option>
		    {* add here e.g. <option value="categorize">{tr}categorize{/tr}</option> *}
		  </select>
		  <script>
		  <!--
		  // Fake js to allow the use of the <noscript> tag (so non-js-users kenn still submit)
		  //-->
		  </script>
		  <noscript>
		    <input type="submit" value="{tr}ok{/tr}" />
		  </noscript>
		{/if}
		</form>

	</div><!-- end .body -->

	{pagination}

</div> {* end contact *}