0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00
postfixadmin/templates/editform.tpl
Jan Kruis e279c77ca5 languages/nl.lang translation from english for new function such as dkim and password
public/editactive.php			edit wrong description text it said this module is used for deleting admin domains mailbos etc
					modify templates that it is used

public/list-virtual.php			modify templates that it is used
					modify the remarks behind arguments and internal , the texteditor thought the text after this was still remark text untl is see */

public/vacation.php and
model/VacantionHandel.php		adjust date string actionFrom and activeUntil these are written in the database as e.g. 2020-10-01 15:14:00 and 2020-10-30-15:14:00
					this should be 2020-10-01 00:00:00 and 2020-10-30 23:59:59 so that it contains all day, this happens if no holiday has been set for the account yet
					when adjusting the dates, the seconds of until are set to 00 instead of 59. When the holiday is canceled and then action is taken again, the from time
					to the time when the setting is made.

templates/editform.tpl			remove blank space

templates/list-virtual_mailbox.tpl	remove indent tabs
2022-10-12 17:46:15 +02:00

123 lines
7.3 KiB
Smarty

<form name="edit_{$table}" method="post" action="" class="form-horizontal">
<div id="edit_form" class="panel panel-default">
<div class="panel-heading"><h4>{$formtitle}</h4></div>
<div class="panel-body enable-asterisk">
<input class="flat" type="hidden" name="table" value="{$table}"/>
<input class="flat" type="hidden" name="token" value="{$smarty.session.PFA_token|escape:"url"}"/>
{foreach key=key item=field from=$struct}
{if $field.display_in_form == 1}
{if $table == 'foo' && $key == 'bar'}
<div class="form-group">Special handling (complete table row) for {$table} / {$key}</div>
{else}
<div class="form-group {if $fielderror.{$key}}has-error{/if}">
<label class="col-md-4 col-sm-4 control-label" for="{$key}">{$field.label}</label>
<div class="col-md-6 col-sm-8">
{if $field.editable == 0}
{if $field.type == 'enma'}
{$struct.{$key}.options.{$value_{$key}}}
{else}
{$value_{$key}}
{/if}
{else}
{if $table == 'foo' && $key == 'bar'}
Special handling (td content) for {$table} / {$key}
{elseif $field.type == 'bool'}
<div class="checkbox"><label>
<input type="checkbox" value='1'
name="value[{$key}]"{if {$value_{$key}} == 1} checked="checked"{/if}/>
</label></div>
{elseif $field.type == 'enum'}
<select class="form-control" name="value[{$key}]" id="{$key}">
{html_options output=$struct.{$key}.options values=$struct.{$key}.options selected=$value_{$key}}
</select>
{elseif $field.type == 'enma'}
<select class="form-control" name="value[{$key}]" id="{$key}">
{html_options options=$struct.{$key}.options selected=$value_{$key}}
</select>
{elseif $field.type == 'list'}
<input type="text" class="form-control" style="margin-bottom : 25px;" id="id_searchDomains" onkeyup="searchDomains()" placeholder="Search for domains..." title="search domains">
<ul id="domainsList" name="value[{$key}][]" style="max-height : 250px; overflow: auto;">
{foreach from=$struct.{$key}.options item=domain}
<li>
{assign var=flag value=0}
{foreach from=$value_{$key} item=selectedDomain}
{if $domain == $selectedDomain }
<input type="checkbox" checked name="value[{$key}][]" value="{$domain}" id="{$domain}_id" />
<label for="{$domain}_id">{$domain}</label>
{assign var=flag value=$flag+1}
{/if}
{/foreach}
{if $flag == 0 }
<input type="checkbox" name="value[{$key}][]" value="{$domain}" id="{$domain}_id" />
<label for="{$domain}_id">{$domain}</label>
{/if}
</li>
{/foreach}
</ul>
{elseif $field.type == 'pass' || $field.type == 'b64p'}
<input class="form-control" type="password" name="value[{$key}]" {if $key == 'password' || $key == 'password2'}autocomplete="new-password"{/if}/>
{elseif $field.type == 'txtl'}
<textarea class="form-control" rows="10" cols="35" name="value[{$key}]">{foreach key=key2 item=field2 from=$value_{$key}}{$field2}&#10;{/foreach}</textarea>
{elseif $field.type == 'txta'}
<textarea class="form-control" rows="10" cols="35" name="value[{$key}]">{$value_{$key}}</textarea>
{else}
<input class="form-control" type="text" name="value[{$key}]"
value="{$value_{$key}}"/>
{/if}
{/if}
{if $table == 'foo' && $key == 'bar'}
<span class="help-block">Special handling (td content) for {$table} / {$key}</span>
{else}
{if $fielderror.{$key}}
<span class="help-block">{$fielderror.{$key}}</span>
{else}
<span class="help-block">{$field.desc}</span>
{/if}
{/if}
</div>
</div>
{/if}
{/if}
{/foreach}
</div>
<div class="panel-footer">
<div class="btn-toolbar" role="toolbar">
<div class="btn-group pull-right">
<button class="btn btn-primary" type="submit" name="submit">
<span class="glyphicon glyphicon-edit" aria-hidden="true"></span> {$submitbutton}
</button>
</div>
</div>
</div>
</div>
</form>
<script type="text/javascript">
function searchDomains(){
input = document.getElementById("id_searchDomains").value.toLowerCase();
ul = document.getElementById("domainsList");
li = ul.getElementsByTagName("li");
for (i=0; i< li. length; i++){
//get domain
domain = li[i].innerHTML.split('<label')[1].split('>')[1].split('</label')[0];
//if domain = input
if (domain.indexOf(input) > -1) {
li[i].style.display = "";
}else{
li[i].style.display = "none";
}
}
}
</script>