Introduced a separate page for advanced group settings.
authorNik Okuntseff <support@anuko.com>
Sun, 19 May 2019 19:08:47 +0000 (19:08 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 19 May 2019 19:08:47 +0000 (19:08 +0000)
35 files changed:
WEB-INF/resources/ca.lang.php
WEB-INF/resources/cs.lang.php
WEB-INF/resources/da.lang.php
WEB-INF/resources/de.lang.php
WEB-INF/resources/en.lang.php
WEB-INF/resources/es.lang.php
WEB-INF/resources/et.lang.php
WEB-INF/resources/fa.lang.php
WEB-INF/resources/fi.lang.php
WEB-INF/resources/fr.lang.php
WEB-INF/resources/gr.lang.php
WEB-INF/resources/he.lang.php
WEB-INF/resources/hu.lang.php
WEB-INF/resources/it.lang.php
WEB-INF/resources/ja.lang.php
WEB-INF/resources/ko.lang.php
WEB-INF/resources/nl.lang.php
WEB-INF/resources/no.lang.php
WEB-INF/resources/pl.lang.php
WEB-INF/resources/pt-br.lang.php
WEB-INF/resources/pt.lang.php
WEB-INF/resources/ro.lang.php
WEB-INF/resources/ru.lang.php
WEB-INF/resources/sk.lang.php
WEB-INF/resources/sl.lang.php
WEB-INF/resources/sr.lang.php
WEB-INF/resources/sv.lang.php
WEB-INF/resources/tr.lang.php
WEB-INF/resources/zh-cn.lang.php
WEB-INF/resources/zh-tw.lang.php
WEB-INF/templates/footer.tpl
WEB-INF/templates/group_advanced_edit.tpl [new file with mode: 0644]
WEB-INF/templates/group_edit.tpl
group_advanced_edit.php [new file with mode: 0644]
group_edit.php

index 3018387..89172f6 100644 (file)
@@ -598,6 +598,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 07adf4f..4a3b90a 100644 (file)
@@ -611,6 +611,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index f7ae2ff..cd7d54f 100644 (file)
@@ -572,6 +572,7 @@ $i18n_key_words = array(
 // TODO: translate the following.
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 97f497f..5c9a7f0 100644 (file)
@@ -548,6 +548,8 @@ $i18n_key_words = array(
 // TODO: translate the following.
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 'form.group_edit.allow_ip' => 'Erlaube IP',
+// TODO: translate the following.
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 'form.group_delete.hint' => 'Sind Sie sicher, dass Sie die gesamte Gruppe löschen möchten?',
index fb48593..add6c0b 100644 (file)
@@ -532,6 +532,7 @@ $i18n_key_words = array(
 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 'form.group_edit.confirm_save' => 'Confirm saving',
 'form.group_edit.allow_ip' => 'Allow IP',
+'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
index 7198902..60b1adb 100644 (file)
@@ -612,6 +612,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index e371fa9..d18ce58 100644 (file)
@@ -577,6 +577,8 @@ $i18n_key_words = array(
 'form.group_edit.uncompleted_indicators' => 'Lõpetamata kirjete indikaator', // TODO: Fix this. Indicators (plural), not indicator.
 'form.group_edit.confirm_save' => 'Kinnita salvestamine',
 'form.group_edit.allow_ip' => 'Luba IP',
+// TODO: translate the following.
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 'form.group_delete.hint' => 'Oled kindel, et soovid kogu gruppi kustutada?',
index 3daed57..eaae095 100644 (file)
@@ -594,6 +594,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 6f3338e..8d1e441 100644 (file)
@@ -577,6 +577,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index e8cc2f1..4971474 100644 (file)
@@ -568,6 +568,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 52925c5..ad0dcd2 100644 (file)
@@ -558,6 +558,7 @@ $i18n_key_words = array(
 // TODO: translate the following.
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 1446956..aa9fafb 100644 (file)
@@ -598,6 +598,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 3f194d1..9639f8f 100644 (file)
@@ -604,6 +604,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 0582444..d895558 100644 (file)
@@ -573,6 +573,7 @@ $i18n_key_words = array(
 // TODO: translate the following.
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 39cc49c..9a58c2d 100644 (file)
@@ -606,6 +606,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index f0156d0..84e1cdf 100644 (file)
@@ -604,6 +604,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index a288dac..39cfaef 100644 (file)
@@ -525,6 +525,8 @@ $i18n_key_words = array(
 'form.group_edit.uncompleted_indicators' => 'Onvolledige indicatoren',
 'form.group_edit.confirm_save' => 'Bevestigen dat je wilt opslaan',
 'form.group_edit.allow_ip' => 'Toegestane IP adressen',
+// TODO: translate the following.
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 'form.group_delete.hint' => 'Bent u er zeker van dat u de hele groep wilt verwijderen?',
index 5d826ce..bfeabdd 100644 (file)
@@ -603,6 +603,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 7a34834..828af78 100644 (file)
@@ -580,6 +580,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 69e9dd0..cb8d68f 100644 (file)
@@ -575,6 +575,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 5007d58..9b87642 100644 (file)
@@ -585,6 +585,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 950ed77..057714e 100644 (file)
@@ -606,6 +606,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index e502890..bc1963b 100644 (file)
@@ -523,6 +523,7 @@ $i18n_key_words = array(
 'form.group_edit.uncompleted_indicators' => 'Индикаторы незавершения',
 'form.group_edit.confirm_save' => 'Предупреждать при сохранении',
 'form.group_edit.allow_ip' => 'Разрешить доступ с IP',
+'form.group_edit.advanced_settings' => 'Продвинутые настройки',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 'form.group_delete.hint' => 'Вы уверены, что хотите удалить всю группу?',
index 8e381c9..e681070 100644 (file)
@@ -587,6 +587,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 6aab8d2..2157ff5 100644 (file)
@@ -580,6 +580,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index c435705..63ec330 100644 (file)
@@ -578,6 +578,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 89c1c7c..7d756a5 100644 (file)
@@ -577,6 +577,7 @@ $i18n_key_words = array(
 // TODO: translate the following.
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index b7433d5..479c8cd 100644 (file)
@@ -619,6 +619,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index f63b288..a1fc15d 100644 (file)
@@ -590,6 +590,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index 577663b..9c97297 100644 (file)
@@ -596,6 +596,7 @@ $i18n_key_words = array(
 // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators',
 // 'form.group_edit.confirm_save' => 'Confirm saving',
 // 'form.group_edit.allow_ip' => 'Allow IP',
+// 'form.group_edit.advanced_settings' => 'Advanced settings',
 
 // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
 // TODO: translate the following.
index a989f27..a3ce248 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.19.4.5006 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.19.4.5007 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
diff --git a/WEB-INF/templates/group_advanced_edit.tpl b/WEB-INF/templates/group_advanced_edit.tpl
new file mode 100644 (file)
index 0000000..a936978
--- /dev/null
@@ -0,0 +1,37 @@
+{$forms.groupAdvancedForm.open}
+
+<table cellspacing="4" cellpadding="7" border="0">
+    <tr>
+      <td>
+        <table cellspacing="1" cellpadding="2" border="0">
+          <tr>
+            <td align="right" nowrap>{$i18n.label.group_name} (*):</td>
+            <td>{$forms.groupAdvancedForm.group_name.control}</td>
+          </tr>
+          <tr>
+            <td align = "right">{$i18n.label.description}:</td>
+            <td>{$forms.groupAdvancedForm.description.control}</td>
+          </tr>
+          <tr>
+            <td align="right" nowrap>{$i18n.label.bcc}:</td>
+            <td>{$forms.groupAdvancedForm.bcc_email.control} <a href="https://www.anuko.com/lp/tt_10.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+          </tr>
+          <tr>
+            <td align="right" nowrap>{$i18n.form.group_edit.allow_ip}:</td>
+            <td>{$forms.groupAdvancedForm.allow_ip.control} <a href="https://www.anuko.com/lp/tt_21.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+          </tr>
+          <tr>
+            <td></td>
+            <td>{$i18n.label.required_fields}</td>
+          </tr>
+          <tr>
+            <td colspan="2">&nbsp;</td>
+          </tr>
+          <tr>
+            <td colspan="2" height="50" align="center">{$forms.groupAdvancedForm.btn_save.control}</td>
+          </tr>
+        </table>
+      </td>
+    </tr>
+</table>
+{$forms.groupForm.close}
index 0da797f..be8c46c 100644 (file)
@@ -17,10 +17,7 @@ function handleTaskRequiredCheckbox() {
 </script>
 
 {$forms.groupForm.open}
-
-{if $user->can('manage_basic_settings')}
 {include file="datetime_format_preview.tpl"}
-{/if}
 
 <table cellspacing="4" cellpadding="7" border="0">
     <tr>
@@ -32,25 +29,16 @@ function handleTaskRequiredCheckbox() {
             <td>{$forms.groupForm.group.control}</td>
           </tr>
 {/if}
-{if $user->can('manage_basic_settings')}
-          <tr>
-            <td align="right" nowrap>{$i18n.label.group_name} (*):</td>
-            <td>{$forms.groupForm.group_name.control}</td>
-          </tr>
-          <tr>
-            <td align = "right">{$i18n.label.description}:</td>
-            <td>{$forms.groupForm.description.control}</td>
-          </tr>
           <tr>
             <td align="right">{$i18n.label.currency}:</td>
             <td>{$forms.groupForm.currency.control}</td>
           </tr>
-  {if $user->can('manage_roles')}
+{if $user->can('manage_roles')}
           <tr>
             <td align="right" nowrap>{$i18n.label.roles}:</td>
             <td><a href="roles.php">{$i18n.label.configure}</a></td>
           </tr>
-  {/if}
+{/if}
           <tr>
            <td align="right" nowrap>{$i18n.label.language}:</td>
            <td>{$forms.groupForm.lang.control}</td>
@@ -106,20 +94,16 @@ function handleTaskRequiredCheckbox() {
             <td align="right" nowrap>{$i18n.form.group_edit.confirm_save}:</td>
             <td>{$forms.groupForm.confirm_save.control} <a href="https://www.anuko.com/lp/tt_26.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
           </tr>
-  {if $user->can('manage_advanced_settings')}
-          <tr>
-            <td align="right" nowrap>{$i18n.label.bcc}:</td>
-            <td>{$forms.groupForm.bcc_email.control} <a href="https://www.anuko.com/lp/tt_10.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
-          </tr>
+{if $user->can('manage_advanced_settings')}
           <tr>
-            <td align="right" nowrap>{$i18n.form.group_edit.allow_ip}:</td>
-            <td>{$forms.groupForm.allow_ip.control} <a href="https://www.anuko.com/lp/tt_21.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+            <td align="right" nowrap>{$i18n.form.group_edit.advanced_settings}:</td>
+            <td><a href="group_advanced_edit.php">{$i18n.label.configure}</a></td>
           </tr>
+{/if}
           <tr>
             <td></td>
             <td>{$i18n.label.required_fields}</td>
           </tr>
-  {/if}
           {* initialize preview text *}
           <script>
             MakeFormatPreview("date_format_preview", document.getElementById("date_format"));
@@ -133,7 +117,6 @@ function handleTaskRequiredCheckbox() {
             }
             adjustDecimalPreview();
           </script>
-{/if}
 
           <tr>
             <td colspan="2">&nbsp;</td>
diff --git a/group_advanced_edit.php b/group_advanced_edit.php
new file mode 100644 (file)
index 0000000..03c7711
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+// +----------------------------------------------------------------------+
+// | Anuko Time Tracker
+// +----------------------------------------------------------------------+
+// | Copyright (c) Anuko International Ltd. (https://www.anuko.com)
+// +----------------------------------------------------------------------+
+// | LIBERAL FREEWARE LICENSE: This source code document may be used
+// | by anyone for any purpose, and freely redistributed alone or in
+// | combination with other software, provided that the license is obeyed.
+// |
+// | There are only two ways to violate the license:
+// |
+// | 1. To redistribute this code in source form, with the copyright
+// |    notice or license removed or altered. (Distributing in compiled
+// |    forms without embedded copyright notices is permitted).
+// |
+// | 2. To redistribute modified versions of this code in *any* form
+// |    that bears insufficient indications that the modifications are
+// |    not the work of the original author(s).
+// |
+// | This license applies to this document only, not any other software
+// | that it may be combined with.
+// |
+// +----------------------------------------------------------------------+
+// | Contributors:
+// | https://www.anuko.com/time_tracker/credits.htm
+// +----------------------------------------------------------------------+
+
+require_once('initialize.php');
+import('form.Form');
+import('ttUserHelper');
+import('ttRoleHelper');
+import('ttConfigHelper');
+
+// Access checks.
+if (!ttAccessAllowed('manage_advanced_settings')) {
+  header('Location: access_denied.php');
+  exit();
+}
+// End of access checks.
+
+$group = ttGroupHelper::getGroupAttrs($user->getGroup());
+
+if ($request->isPost()) {
+  $cl_group = trim($request->getParameter('group_name'));
+  $cl_description = trim($request->getParameter('description'));
+  $cl_bcc_email = trim($request->getParameter('bcc_email'));
+  $cl_allow_ip = trim($request->getParameter('allow_ip'));
+} else {
+  $cl_group = $group['name'];
+  $cl_description = $group['description'];
+  $cl_bcc_email = $group['bcc_email'];
+  $cl_allow_ip = $group['allow_ip'];
+}
+
+$form = new Form('groupAdvancedForm');
+$form->addInput(array('type'=>'text','maxlength'=>'200','name'=>'group_name','value'=>$cl_group,'enable'=>$advanced_settings));
+$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description));
+$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'bcc_email','value'=>$cl_bcc_email));
+$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'allow_ip','value'=>$cl_allow_ip));
+
+$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
+
+if ($request->isPost()) {
+  if ($request->getParameter('btn_save')) {
+    // Validate user input.
+    if (!ttValidString($cl_group)) $err->add($i18n->get('error.field'), $i18n->get('label.group_name'));
+    if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
+    if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.bcc'));
+    if (!ttValidIP($cl_allow_ip, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.allow_ip'));
+    // Finished validating user input.
+
+    if ($err->no()) {
+      if ($user->updateGroup(array(
+        'name' => $cl_group,
+        'description' => $cl_description,
+        'bcc_email' => $cl_bcc_email,
+        'allow_ip' => $cl_allow_ip))) {
+        header('Location: success.php');
+        exit();
+      } else
+        $err->add($i18n->get('error.db'));
+    }
+  }
+} // isPost
+
+$smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('title', $i18n->get('title.edit_group'));
+$smarty->assign('content_page_name', 'group_advanced_edit.tpl');
+$smarty->display('index.tpl');
index abc06b4..1df99a1 100644 (file)
@@ -45,7 +45,7 @@ if ($request->isGet()) {
 $home_group = $user->group_id == $group_id;
 if ($home_group) {
   // Editing home group.
-  if (!(ttAccessAllowed('manage_basic_settings') || ttAccessAllowed('manage_advanced_settings'))) {
+  if (!ttAccessAllowed('manage_basic_settings')) {
     header('Location: access_denied.php'); // Not allowed to edit home group settings.
     exit();
   }
@@ -72,12 +72,9 @@ $groups = $user->getGroupsForDropdown();
 $group = ttGroupHelper::getGroupAttrs($group_id);
 $config = $user->getConfigHelper();
 
-$advanced_settings = $home_group ? $user->can('manage_advanced_settings') : true;
 if (!defined('CURRENCY_DEFAULT')) define('CURRENCY_DEFAULT', '$');
 
 if ($request->isPost() && !$groupChanged) {
-  $cl_group = trim($request->getParameter('group_name'));
-  $cl_description = trim($request->getParameter('description'));
   $cl_currency = trim($request->getParameter('currency'));
   if (!$cl_currency) $cl_currency = CURRENCY_DEFAULT;
   $cl_lang = $request->getParameter('lang');
@@ -95,11 +92,7 @@ if ($request->isPost() && !$groupChanged) {
   $cl_future_entries = $request->getParameter('future_entries');
   $cl_uncompleted_indicators = $request->getParameter('uncompleted_indicators');
   $cl_confirm_save = $request->getParameter('confirm_save');
-  $cl_bcc_email = trim($request->getParameter('bcc_email'));
-  $cl_allow_ip = trim($request->getParameter('allow_ip'));
 } else {
-  $cl_group = $group['name'];
-  $cl_description = $group['description'];
   $cl_currency = ($group['currency'] == ''? CURRENCY_DEFAULT : $group['currency']);
   $cl_lang = $group['lang'];
   $cl_decimal_mark = $group['decimal_mark'];
@@ -116,8 +109,6 @@ if ($request->isPost() && !$groupChanged) {
   $cl_future_entries = $config->getDefinedValue('future_entries');
   $cl_uncompleted_indicators = $config->getDefinedValue('uncompleted_indicators');
   $cl_confirm_save = $config->getDefinedValue('confirm_save');
-  $cl_bcc_email = $group['bcc_email'];
-  $cl_allow_ip = $group['allow_ip'];
 }
 
 $form = new Form('groupForm');
@@ -133,8 +124,6 @@ if (count($groups) > 1) {
   $form->addInput(array('type'=>'hidden','name'=>'group_changed'));
   $smarty->assign('group_dropdown', 1);
 }
-$form->addInput(array('type'=>'text','maxlength'=>'200','name'=>'group_name','value'=>$cl_group,'enable'=>$advanced_settings));
-$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description));
 $form->addInput(array('type'=>'text','maxlength'=>'7','name'=>'currency','value'=>$cl_currency));
 
 // Prepare an array of available languages.
@@ -213,12 +202,6 @@ $form->addInput(array('type'=>'checkbox','name'=>'uncompleted_indicators','value
 // Confirm save checkbox.
 $form->addInput(array('type'=>'checkbox','name'=>'confirm_save','value'=>$cl_confirm_save));
 
-// Add bcc email control.
-if ($advanced_settings) {
-  $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'bcc_email','value'=>$cl_bcc_email));
-  $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'allow_ip','value'=>$cl_allow_ip));
-}
-
 $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
 if ($user->can('delete_group')) $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('button.delete')));
 
@@ -234,14 +217,8 @@ if ($request->isPost()) {
 
   if ($request->getParameter('btn_save')) {
     // Validate user input.
-    if (!ttValidString($cl_group)) $err->add($i18n->get('error.field'), $i18n->get('label.group_name'));
-    if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
     if (!ttValidString($cl_currency, true)) $err->add($i18n->get('error.field'), $i18n->get('label.currency'));
     if (!ttValidHolidays($cl_holidays)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.holidays'));
-    if ($advanced_settings) {
-      if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.bcc'));
-      if (!ttValidIP($cl_allow_ip, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.allow_ip'));
-    }
     // Finished validating user input.
 
     if ($err->no()) {
@@ -254,8 +231,6 @@ if ($request->isPost()) {
 
       if ($user->updateGroup(array(
         'group_id' => $group_id,
-        'name' => $cl_group,
-        'description' => $cl_description,
         'currency' => $cl_currency,
         'lang' => $cl_lang,
         'decimal_mark' => $cl_decimal_mark,
@@ -268,8 +243,6 @@ if ($request->isPost()) {
         'task_required' => $cl_task_required,
         'record_type' => $cl_record_type,
         'uncompleted_indicators' => $cl_uncompleted_indicators,
-        'bcc_email' => $cl_bcc_email,
-        'allow_ip' => $cl_allow_ip,
         'config' => $config->getConfig()))) {
         header('Location: success.php');
         exit();
@@ -279,8 +252,6 @@ if ($request->isPost()) {
   }
 } // isPost
 
-$smarty->assign('auth_external', $auth->isPasswordExternal());
-$smarty->assign('group_id', $group_id);
 $smarty->assign('group_dropdown', count($groups) > 1);
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('onload', 'onLoad="handleTaskRequiredCheckbox(); handlePluginCheckboxes();"');