tiki-assignuser.tpl 6.95 KB
Newer Older
1 2
{* $Id$ *}

3
{assign var=escuser value=$assign_user|escape:url}
4
{title}{tr _0=$assign_user}Assign User %0 to Groups{/tr}{/title}
5

6
<div class="t_navbar btn-group form-group">
7
	{if $tiki_p_admin eq 'y'} {* only full admins can manage groups, not tiki_p_admin_users *}
8
		{button href="tiki-admingroups.php" class="btn btn-default" _text="{tr}Admin groups{/tr}"}
9 10
	{/if}
	{if $tiki_p_admin eq 'y' or $tiki_p_admin_users eq 'y'}
11
		{button href="tiki-adminusers.php" class="btn btn-default" _text="{tr}Admin users{/tr}"}
12
	{/if}
13

14 15
	{button href="tiki-user_preferences.php?view_user=$assign_user" class="btn btn-default" _text="{tr}User Preferences{/tr}"}
	{button href="tiki-user_information.php?view_user=$assign_user" class="btn btn-default" _text="{tr}User Information{/tr}"}
16

17 18
</div>

19 20
{if $prefs.feature_intertiki eq 'y' and $prefs.feature_intertiki_import_groups eq 'y'}
	{remarksbox type="warning" title="{tr}Warning{/tr}"}
21
		{tr}Since this Tiki site is in slave mode and imports groups, the master groups will be automatically reimported at each login{/tr}
22
	{/remarksbox}
23
{/if}
24

25
<h2>{tr}User Information{/tr}</h2>
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
	<form class="form-horizontal">
		<div class="form-group">
			<label class="col-sm-3 control-label">{tr}Login{/tr}</label>
			<div class="col-sm-7">
				{$user_info.login|escape}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">{tr}Email{/tr}</label>
			<div class="col-sm-7">
				{$user_info.email}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">{tr}Groups{/tr}</label>
			<div class="col-sm-7">
				{foreach from=$user_info.groups item=what key=grp name=groups}
					{if $what eq 'included'}<i>{/if}{$grp|escape}{if $what eq 'included'}</i>{/if}
					{if $grp != "Anonymous" && $grp != "Registered" and $what neq 'included'}
						<a class="tips" href="tiki-assignuser.php?{if $offset}offset={$offset}&amp;{/if}maxRecords={$prefs.maxRecords}&amp;sort_mode={$sort_mode}{if $assign_user}&amp;assign_user={$assign_user|escape:url}{/if}&amp;action=removegroup&amp;group={$grp|escape:url}" title=":{tr}Remove{/tr}">
							{icon name='remove' style="vertical-align:middle"}
						</a>
					{/if}{if !$smarty.foreach.groups.last},{/if}&nbsp;&nbsp;
				{/foreach}
			</div>
		</div>
	</form>
	<form method="post" action="tiki-assignuser.php{if $assign_user}?assign_user={$assign_user|escape:'url'}{/if}" class="form-horizontal">
		<div class="form-group">
			<label class="col-sm-3 control-label">{tr}Default Group{/tr}</label>
			<div class="col-sm-6">
				<select name="defaultgroup" class="form-control">
					<option value=""></option>
					{foreach from=$user_info.groups key=name item=included}
						<option value="{$name|escape}" {if $name eq $user_info.default_group}selected="selected"{/if}>{$name|escape}</option>
					{/foreach}
				</select>
				<input type="hidden" value="{$user_info.login|escape}" name="login">
				<input type="hidden" value="{$prefs.maxRecords}" name="maxRecords">
				<input type="hidden" value="{$offset}" name="offset">
				<input type="hidden" value="{$sort_mode}" name="sort_mode">
			</div>
			<div class="col-sm-1">
				<input type="submit" class="btn btn-default btn-sm" value="{tr}Set{/tr}" name="set_default">
			</div>
		</div>
	</form>
73
<br>
74
<div align="left"><h2>{tr _0=$assign_user|escape}Assign User %0 to Groups{/tr}</h2></div>
75 76

{include file='find.tpl' find_show_num_rows='y'}
77 78 79 80 81 82 83 84 85 86
{* Use css menus as fallback for item dropdown action menu if javascript is not being used *}
{if $prefs.javascript_enabled !== 'y'}
	{$js = 'n'}
	{$libeg = '<li>'}
	{$liend = '</li>'}
{else}
	{$js = 'y'}
	{$libeg = ''}
	{$liend = ''}
{/if}
87

88
<form method="post" action="tiki-assignuser.php{if $assign_user}?assign_user={$assign_user|escape:'url'}{/if}">
89
	<div class="{if $js === 'y'}table-responsive{/if}"> {*the table-responsive class cuts off dropdown menus *}
90
<table class="table table-striped table-hover">
changi67's avatar
changi67 committed
91 92 93
	<tr>
		<th><a href="tiki-assignuser.php?{if $assign_user}assign_user={$assign_user|escape:url}&amp;{/if}offset={$offset}&amp;maxRecords={$prefs.maxRecords}&amp;sort_mode={if $sort_mode eq 'groupName_desc'}groupName_asc{else}groupName_desc{/if}">{tr}Name{/tr}</a></th>
		<th><a href="tiki-assignuser.php?{if $assign_user}assign_user={$assign_user|escape:url}&amp;{/if}offset={$offset}&amp;maxRecords={$prefs.maxRecords}&amp;sort_mode={if $sort_mode eq 'groupDesc_desc'}groupDesc_asc{else}groupDesc_desc{/if}">{tr}Description{/tr}</a></th>
94
		<th>{tr}Expiration{/tr}</th>
lindonb's avatar
lindonb committed
95
		<th></th>
changi67's avatar
changi67 committed
96
	</tr>
97

changi67's avatar
changi67 committed
98 99
	{section name=user loop=$users}
		{if $users[user].groupName != 'Anonymous'}
100
			<tr>
101
				<td class="text">
changi67's avatar
changi67 committed
102 103 104 105 106 107 108 109
					{if $tiki_p_admin eq 'y'} {* only full admins can manage groups, not tiki_p_admin_users *}
						<a class="link" href="tiki-admingroups.php?group={$users[user].groupName|escape:"url"}{if $prefs.feature_tabs ne 'y'}#2{/if}" title="{tr}Edit{/tr}">
					{/if}
					{$users[user].groupName|escape}
					{if $tiki_p_admin eq 'y'}
						</a>
					{/if}
				</td>
110
				<td class="text">{tr}{$users[user].groupDesc|escape}{/tr}</td>
111
				<td>{if isset($dates[$users[user].groupName]) && !empty($dates[$users[user].groupName]['expire'])}
112 113
					<input type="text" name="new_{$users[user].id}" value="{$dates[$users[user].groupName]['expire']|tiki_short_datetime:'':'n'|escape}" />
					<input type="hidden" name="old_{$users[user].id}" value="{$dates[$users[user].groupName]['expire']|tiki_short_datetime:'':'n'|escape}" />
114 115

				{/if}</td>
116
				<td class="action">
lindonb's avatar
lindonb committed
117 118 119
					{capture name=assign_user_actions}
						{strip}
							{if $users[user].what ne 'real'}
120
								{$libeg}<a href="tiki-assignuser.php?{if $offset}offset={$offset}&amp;{/if}maxRecords={$prefs.maxRecords}&amp;sort_mode={$sort_mode}&amp;action=assign&amp;group={$users[user].groupName|escape:url}{if $assign_user}&amp;assign_user={$assign_user|escape:url}{/if}">
lindonb's avatar
lindonb committed
121
									{icon name='add' _menu_text='y' _menu_icon='y' alt="{tr}Assign{/tr}"}
122
								</a>{$liend}
lindonb's avatar
lindonb committed
123
							{elseif $users[user].groupName ne "Registered"}
124
								{$libeg}<a href="tiki-assignuser.php?{if $offset}offset={$offset}&amp;{/if}maxRecords={$prefs.maxRecords}&amp;sort_mode={$sort_mode}{if $assign_user}&amp;assign_user={$assign_user|escape:url}{/if}&amp;action=removegroup&amp;group={$users[user].groupName|escape:url}">
lindonb's avatar
lindonb committed
125
									{icon name='remove' _menu_text='y' _menu_icon='y' alt="{tr}Unassign{/tr}"}
126
								</a>{$liend}
lindonb's avatar
lindonb committed
127 128 129
							{/if}
						{/strip}
					{/capture}
130 131 132 133 134
					{if $js === 'n'}<ul class="cssmenu_horiz"><li>{/if}
					<a
						class="tips"
						title="{tr}Actions{/tr}"
						href="#"
135
						{if $js === 'y'}{popup fullhtml="1" center=true text=$smarty.capture.assign_user_actions}{/if}
136 137
						style="padding:0; margin:0; border:0"
					>
lindonb's avatar
lindonb committed
138 139
						{icon name='wrench'}
					</a>
140 141 142
					{if $js === 'n'}
						<ul class="dropdown-menu" role="menu">{$smarty.capture.assign_user_actions}</ul></li></ul>
					{/if}
changi67's avatar
changi67 committed
143 144 145 146
				</td>
			</tr>
		{/if}
	{/section}
147
</table>
148
</div>
149
<input type="submit" class="btn btn-default btn-sm" name="save" value="{tr}Save{/tr}" />
150
</form>
151
{pagination_links cant=$cant_pages step=$prefs.maxRecords offset=$offset}{/pagination_links}