diff --git a/config.inc.php b/config.inc.php index a5db541a..b6179eea 100644 --- a/config.inc.php +++ b/config.inc.php @@ -780,7 +780,7 @@ $CONF['password_expiration'] = 'YES'; // used in (at least) password-recover.php. $CONF['site_url'] = null; -$CONF['version'] = '4.0-beta1'; +$CONF['version'] = '4.0'; // The smtp_active_flag when set to YES enables editing of the smtp_active // field of the mailbox table. The smtp_active field can be used to enable diff --git a/functions.inc.php b/functions.inc.php index 62ddbbce..df6174ef 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -16,7 +16,7 @@ */ -$min_db_version = 1844; # update (at least) before a release with the latest function number in upgrade.php +$min_db_version = 1850; # update (at least) before a release with the latest function number in upgrade.php /** diff --git a/public/list.php b/public/list.php index 2b1c42a6..e4b37fef 100644 --- a/public/list.php +++ b/public/list.php @@ -149,22 +149,24 @@ if (safeget('output') == 'csv') { fputcsv($out, $fields); } fclose($out); -} else { # HTML output - - $smarty->assign('admin_list', $list_admins); - $smarty->assign('admin_selected', $username); - $smarty->assign('smarty_template', 'list'); - $smarty->assign('struct', $handler->getStruct()); - $smarty->assign('msg', $handler->getMsg()); - $smarty->assign('table', $table); - $smarty->assign('items', $items); - $smarty->assign('id_field', $handler->getId_field()); - $smarty->assign('formconf', $formconf); - $smarty->assign('search', $search); - $smarty->assign('searchmode', $searchmode); - $smarty->assign('domain_selected', ''); /* stop list-virtual.tpl triggering a PHP notice */ - - $smarty->display('index.tpl'); + exit(0); } +# HTML output + +$smarty->assign('admin_list', $list_admins); +$smarty->assign('admin_selected', $username); +$smarty->assign('smarty_template', 'list'); +$smarty->assign('struct', $handler->getStruct()); +$smarty->assign('msg', $handler->getMsg()); +$smarty->assign('table', $table); +$smarty->assign('items', $items); +$smarty->assign('id_field', $handler->getId_field()); +$smarty->assign('formconf', $formconf); +$smarty->assign('search', $search); +$smarty->assign('searchmode', $searchmode); +$smarty->assign('domain_selected', ''); /* stop list-virtual.tpl triggering a PHP notice */ + +$smarty->display('index.tpl'); + /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ diff --git a/templates/editform.tpl b/templates/editform.tpl index 181e3810..f52f0625 100644 --- a/templates/editform.tpl +++ b/templates/editform.tpl @@ -10,90 +10,95 @@ {if $table == 'foo' && $key == 'bar'}
Special handling (complete table row) for {$table} / {$key}
- {else} -
- -
- {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'} -
- {elseif $field.type == 'enum'} - - {elseif $field.type == 'enma'} - - {elseif $field.type == 'list'} - - - {elseif $field.type == 'pass' || $field.type == 'b64p'} - - {elseif $field.type == 'txtl'} - - {elseif $field.type == 'txta'} - - {else} - - {/if} - {/if} - - {if $table == 'foo' && $key == 'bar'} - Special handling (td content) for {$table} / {$key} - {else} - {if $fielderror.{$key}} - {$fielderror.{$key}} - {else} - {$field.desc} - {/if} - {/if} -
-
{/if} +
+ +
+ {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'} +
+ {elseif $field.type == 'enum'} + + {elseif $field.type == 'enma'} + + {elseif $field.type == 'list'} + + + {elseif $field.type == 'pass' || $field.type == 'b64p'} + + {elseif $field.type == 'txtl'} + + {elseif $field.type == 'txta'} + + {else} + + {/if} + {/if} + + {if $table == 'foo' && $key == 'bar'} + Special handling (td content) for {$table} / {$key} + {else} + {if $fielderror.{$key}} + {$fielderror.{$key}} + {else} + {$field.desc} + {/if} + {/if} +
+
{/if} {/foreach} @@ -101,42 +106,42 @@ diff --git a/templates/list-virtual.tpl b/templates/list-virtual.tpl index 650ade8b..b23d0046 100644 --- a/templates/list-virtual.tpl +++ b/templates/list-virtual.tpl @@ -19,8 +19,9 @@ {else}

{$PALANG.pOverview_welcome}{$fDomain} :

{/if} @@ -96,7 +97,8 @@ class="btn btn-default"> {$PALANG.add_mailbox} {/if} - {$PALANG.download_csv} diff --git a/templates/list.tpl b/templates/list.tpl index 831a0c9d..20d327d2 100644 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -1,68 +1,69 @@
-{if ($admin_list|count > 1)} -
-
- {html_options name='username' output=$admin_list values=$admin_list selected=$admin_selected onchange="this.form.submit();"} - -
-
-{/if} - -{if $msg.show_simple_search} - {#form_search#} -{/if} - -{if $msg.show_simple_search} - {if ($search|count > 0)} -
-

{$PALANG.searchparams} - {foreach key=key item=field from=$search} - {if $struct.$key.label}{$struct.$key.label}{else}{$key}{/if} - {if isset($searchmode.$key)}{$searchmode.$key}{else}={/if} {$field} - - {/foreach} - [x] + {if ($admin_list|count > 1)} +

+
+ {html_options name='username' output=$admin_list values=$admin_list selected=$admin_selected onchange="this.form.submit();"} + +
{/if} -{/if} - + {if $msg.show_simple_search} + {#form_search#} + {/if} -{if $msg.list_header} - {assign var="colcount" value=2} - {foreach key=key item=field from=$struct} - {if $field.display_in_list == 1 && $field.label}{* don't show fields without a label *} - {assign var="colcount" value=$colcount+1} - {/if} - {/foreach} - - - - - -{/if} - - - - {foreach key=key item=field from=$struct} - {if $field.display_in_list == 1 && $field.label}{* don't show fields without a label *} - + {if $msg.show_simple_search} + {if ($search|count > 0)} +
+

{$PALANG.searchparams} + {foreach key=key item=field from=$search} + {if $struct.$key.label}{$struct.$key.label}{else}{$key}{/if} + {if isset($searchmode.$key)}{$searchmode.$key}{else}={/if} {$field} + + {/foreach} + [x] +

{/if} - {/foreach} - - - - + {/if} -{foreach key=raw_itemkey from=$RAW_items item=RAW_item} - {assign var="itemkey" value=$raw_itemkey|htmlentities_no_double_encode} {* array keys in $items are escaped by PFASmarty::sanitise() *} - {assign var="item" value=$items[$itemkey]} +
{$PALANG.{$msg.list_header}}
{$field.label}  
+ - + {if $msg.list_header} + {assign var="colcount" value=2} + {foreach key=key item=field from=$struct} + {if $field.display_in_list == 1 && $field.label}{* don't show fields without a label *} + {assign var="colcount" value=$colcount+1} + {/if} + {/foreach} + + + + + + {/if} - {foreach key=key item=field from=$struct} - {if $field.display_in_list == 1 && $field.label} + + + {foreach key=key item=field from=$struct} + {if $field.display_in_list == 1 && $field.label}{* don't show fields without a label *} + + {/if} + {/foreach} + + + + + + {foreach key=raw_itemkey from=$RAW_items item=RAW_item} + {assign var="itemkey" value=$raw_itemkey|htmlentities_no_double_encode} {* array keys in $items are escaped by PFASmarty::sanitise() *} + {assign var="item" value=$items[$itemkey]} + + + + {foreach key=key item=field from=$struct} + {if $field.display_in_list == 1 && $field.label} {if $field.linkto != '' && ($item.$id_field != '' || $item.$id_field > 0) } {assign "linkto" "{$field.linkto|replace:'%s':{$item.$id_field|escape:url}}"} {* TODO: use label field instead *} @@ -72,97 +73,106 @@ {/if} {if $table == 'foo' && $key == 'bar'} - + {else} - - {/if} - {/if} - {/foreach} +{elseif $field.type == 'txtl'} +{foreach key=key2 item=field2 from=$item.$key}{$field2}
{/foreach} +{elseif $field.type == 'html'} +{$RAW_item.$key} +{else} +{$linktext} +{/if} + +{/if} +{/if} +{/foreach} - - + - + {/foreach} - +
{$PALANG.{$msg.list_header}}
{$field.label}  
Special handling (complete table row) for {$table} / {$key}Special handling (complete table row) for {$table} / {$key} - {if $table == 'foo' && $key == 'bar'} - Special handling (td content) for {$table} / {$key} - {elseif $table == 'aliasdomain' && $key == 'target_domain' && $struct.target_domain.linkto == 'target'} - {$item.target_domain} {* do we need escape:url or escpae:quotes here? see #705 *} -{* {elseif $table == 'domain' && $key == 'domain'} - {$item.domain} -*} - {elseif $key == 'active'} - {if $item._can_edit} - - {if $item._active == $PALANG['YES']} - - {else} - - {/if} - {$item._active} - + + {if $table == 'foo' && $key == 'bar'} + Special handling (td content) for {$table} / {$key} + {elseif $table == 'aliasdomain' && $key == 'target_domain' && $struct.target_domain.linkto == 'target'} + {$item.target_domain} {* do we need escape:url or escpae:quotes here? see #705 *} + {* {elseif $table == 'domain' && $key == 'domain'} + {$item.domain} + *} + {elseif $key == 'active'} + {if $item._can_edit} + + {if $item._active == $PALANG['YES']} + {else} - {$item._active} + {/if} - {elseif $field.type == 'bool'} - {assign "tmpkey" "_{$key}"}{$item.{$tmpkey}} - {elseif $field.type == 'list'} - {foreach key=key2 item=field2 from=$item.$key}{$field2}
{/foreach} - {elseif $field.type == 'pass'} - (hidden) - {elseif $field.type == 'quot'} - {assign "tmpkey" "_{$key}_percent"} + {$item._active} +
+ {else} + {$item._active} + {/if} + {elseif $field.type == 'bool'} + {assign "tmpkey" "_{$key}"}{$item.{$tmpkey}} + {elseif $field.type == 'list'} + {foreach key=key2 item=field2 from=$item.$key}{$field2}
{/foreach} + {elseif $field.type == 'pass'} + (hidden) + {elseif $field.type == 'quot'} + {assign "tmpkey" "_{$key}_percent"} - {if $item[$tmpkey] > $CONF.quota_level_high_pct} - {assign var="quota_level" value="high"} - {elseif $item[$tmpkey] > $CONF.quota_level_med_pct} - {assign var="quota_level" value="mid"} - {else} - {assign var="quota_level" value="low"} - {/if} - {if $item[$tmpkey] > -1} -
-
-
{$linktext}
- {else} -
-
{$linktext}
- {/if} + {if $item[$tmpkey] > $CONF.quota_level_high_pct} + {assign var="quota_level" value="high"} + {elseif $item[$tmpkey] > $CONF.quota_level_med_pct} + {assign var="quota_level" value="mid"} + {else} + {assign var="quota_level" value="low"} + {/if} + {if $item[$tmpkey] > -1} +
+
+ +
{$linktext}
+{else} +
+
{$linktext}
+{/if} - {elseif $field.type == 'txtl'} - {foreach key=key2 item=field2 from=$item.$key}{$field2}
{/foreach} - {elseif $field.type == 'html'} - {$RAW_item.$key} - {else} - {$linktext} - {/if} -
{if $item._can_edit} - {$PALANG.edit} - {else}  - {/if} - {if $item._can_delete} +{if $item._can_edit} + {$PALANG.edit} + {else}  + {/if} +{if $item._can_delete}
-
{else} {/if}
diff --git a/templates/menu.tpl b/templates/menu.tpl index e5ec4d73..4f310202 100644 --- a/templates/menu.tpl +++ b/templates/menu.tpl @@ -8,8 +8,6 @@ {/strip} {strip} - -