More work in progress on custom fields extension.
authorNik Okuntseff <support@anuko.com>
Thu, 27 Jun 2019 20:10:14 +0000 (20:10 +0000)
committerNik Okuntseff <support@anuko.com>
Thu, 27 Jun 2019 20:10:14 +0000 (20:10 +0000)
34 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/cf_custom_field_add.tpl
WEB-INF/templates/footer.tpl
cf_custom_field_add.php
plugins/CustomFields.class.php

index 960ed0b..0f0b4c7 100644 (file)
@@ -415,6 +415,7 @@ $i18n_key_words = array(
 // 'dropdown.selected_year' => 'year',
 // 'dropdown.all_time' => 'all time',
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projectes',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index 1d1da52..9000b3b 100644 (file)
@@ -425,6 +425,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'od počátku',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projekty',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index b1afacb..c176763 100644 (file)
@@ -398,6 +398,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'Alt',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'Projekter',
 'dropdown.tasks' => 'Opgaver',
 'dropdown.clients' => 'Klienter',
index 9524dad..9fe12df 100644 (file)
@@ -380,6 +380,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'Gesamtzeitraum',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'Projekte',
 'dropdown.tasks' => 'Aufgaben',
 'dropdown.clients' => 'Kunden',
index ef89c36..7d25fd6 100644 (file)
@@ -364,6 +364,7 @@ $i18n_key_words = array(
 'dropdown.selected_year' => 'year',
 'dropdown.all_time' => 'all time',
 'dropdown.time' => 'time',
+'dropdown.user' => 'user',
 'dropdown.projects' => 'projects',
 'dropdown.tasks' => 'tasks',
 'dropdown.clients' => 'clients',
index 5fd0ac4..44ed256 100644 (file)
@@ -415,6 +415,7 @@ $i18n_key_words = array(
 // TODO: translate the following.
 // 'dropdown.all_time' => 'all time',
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'proyectos',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index 3eea2d0..34a7239 100644 (file)
@@ -403,6 +403,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'kõik ajavahemikud',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projektid',
 'dropdown.tasks' => 'tööülesanded',
 'dropdown.clients' => 'kliendid',
index 3b6e9d8..3095a87 100644 (file)
@@ -409,6 +409,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'همه زمان ها',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'پروژه ها',
 'dropdown.tasks' => 'وظایف',
 'dropdown.clients' => 'مشتریان',
index 1aa06d5..752c6ff 100644 (file)
@@ -398,6 +398,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'kaikki tunnit',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projektit',
 'dropdown.tasks' => 'tehtävät',
 'dropdown.clients' => 'asiakkaat',
index cb48837..ff7e4e6 100644 (file)
@@ -390,6 +390,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'depuis toujours',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'Projets',
 'dropdown.tasks' => 'Tâches',
 'dropdown.clients' => 'Clients',
index c8a8ab0..1e3c8be 100644 (file)
@@ -388,6 +388,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'όλη την περίοδο',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'έργα',
 'dropdown.tasks' => 'εργασίες',
 'dropdown.clients' => 'πελάτες',
index 10a40ed..2905e27 100644 (file)
@@ -415,6 +415,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'הכל',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'פרוייקטים',
 'dropdown.tasks' => 'משימות',
 'dropdown.clients' => 'לקוחות',
index 95d9904..d44c8d8 100644 (file)
@@ -417,6 +417,7 @@ $i18n_key_words = array(
 // 'dropdown.selected_year' => 'year',
 // 'dropdown.all_time' => 'all time',
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projektek',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index 845b1d1..a1efcd5 100644 (file)
@@ -398,6 +398,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'tutto il tempo',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'progetti',
 'dropdown.tasks' => 'compiti',
 'dropdown.clients' => 'clienti',
index 3b9c091..1fadd68 100644 (file)
@@ -421,6 +421,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'すべての時間',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'プロジェクト',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index 43d3f8a..115a96a 100644 (file)
@@ -424,6 +424,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => '전시간',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => '프로젝트',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index 49125a6..58d3aaa 100644 (file)
@@ -365,6 +365,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'alles',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projecten',
 'dropdown.tasks' => 'taken',
 'dropdown.clients' => 'klanten',
index 04ccf3c..27d6a91 100644 (file)
@@ -419,6 +419,7 @@ $i18n_key_words = array(
 // 'dropdown.all_time' => 'all time',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'prosjekter',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index 3f0d93b..aa6a2ce 100644 (file)
@@ -401,6 +401,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'od początku',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projekty',
 'dropdown.tasks' => 'zadania',
 'dropdown.clients' => 'klienci',
index ef6eace..3d1d0ab 100644 (file)
@@ -396,6 +396,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'todas as datas',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projetos',
 'dropdown.tasks' => 'tarefas',
 'dropdown.clients' => 'clientes',
index 79bbae1..2720464 100644 (file)
@@ -404,6 +404,7 @@ $i18n_key_words = array(
 // 'dropdown.all_time' => 'all time',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projetos',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index fc9f67e..64b4551 100644 (file)
@@ -421,6 +421,7 @@ $i18n_key_words = array(
 // 'dropdown.selected_year' => 'year',
 // 'dropdown.all_time' => 'all time',
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'proiecte',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index 22c666f..980aa46 100644 (file)
@@ -361,6 +361,7 @@ $i18n_key_words = array(
 'dropdown.selected_year' => 'год',
 'dropdown.all_time' => 'всё время',
 'dropdown.time' => 'время',
+'dropdown.user' => 'пользователь',
 'dropdown.projects' => 'проекты',
 'dropdown.tasks' => 'задачи',
 'dropdown.clients' => 'клиенты',
index 133f80f..56d14f6 100644 (file)
@@ -405,6 +405,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'celý čas',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projekty',
 'dropdown.tasks' => 'úlohy',
 // TODO: translate the following.
index f022099..db54f19 100644 (file)
@@ -395,6 +395,7 @@ $i18n_key_words = array(
 // 'dropdown.selected_year' => 'year',
 // 'dropdown.all_time' => 'all time',
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projekti',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index d8f8986..eb8f3eb 100644 (file)
@@ -399,6 +399,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'svi datumi',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projekti',
 'dropdown.tasks' => 'zadaci',
 'dropdown.clients' => 'klijenti',
index 97392f9..c17662b 100644 (file)
@@ -398,6 +398,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'Livstid',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'Projekt',
 'dropdown.tasks' => 'Arbetsuppgifter',
 'dropdown.clients' => 'Kunder',
index 39c39e8..5701f56 100644 (file)
@@ -430,6 +430,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => 'tüm zamanlar',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => 'projeler',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index 7493be7..dce6df8 100644 (file)
@@ -411,6 +411,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => '全部时间',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => '项目',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index b8d923b..a18cb21 100644 (file)
@@ -416,6 +416,7 @@ $i18n_key_words = array(
 'dropdown.all_time' => '全部時間',
 // TODO: translate the following.
 // 'dropdown.time' => 'time',
+// 'dropdown.user' => 'user',
 'dropdown.projects' => '項目',
 // TODO: translate the following.
 // 'dropdown.tasks' => 'tasks',
index 442f41b..4c343ee 100644 (file)
@@ -8,6 +8,12 @@
           <td align="right">{$i18n.label.thing_name} (*):</td>
           <td>{$forms.fieldForm.name.control}</td>
         </tr>
+{if isTrue('CF_DEBUG')}
+        <tr>
+          <td align="right">{$i18n.label.entity}:</td>
+          <td>{$forms.fieldForm.entity.control} <a href="https://www.anuko.com/lp/tt_39.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+        </tr>
+{/if}
         <tr>
           <td align="right">{$i18n.label.type}:</td>
           <td>{$forms.fieldForm.type.control}</td>
index 59b49cf..265b35f 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.5.5017 | 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.5.5018 | 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>
index c22c10e..e4a919e 100644 (file)
@@ -49,7 +49,7 @@ if (count($fields) >= 1) {
 
 if ($request->isPost()) {
   $cl_field_name = trim($request->getParameter('name'));
-  $cl_field_entity = $request->getParameter('entity');
+  $cl_entity_type = $request->getParameter('entity');
   $cl_field_type = $request->getParameter('type');
   $cl_required = $request->getParameter('required');
   if (!$cl_required)
@@ -59,8 +59,8 @@ if ($request->isPost()) {
 $form = new Form('fieldForm');
 $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>''));
 $form->addInput(array('type'=>'combobox','name'=>'entity',
-  'data'=>array(CustomFields::ENTITY_TIME=>$i18n->get('label.type_text'),
-                CustomFields::ENTITY_USER=>$i18n->get('label.user'))
+  'data'=>array(CustomFields::ENTITY_TIME=>$i18n->get('dropdown.time'),
+                CustomFields::ENTITY_USER=>$i18n->get('dropdown.user'))
 ));
 $form->addInput(array('type'=>'combobox','name'=>'type',
   'data'=>array(CustomFields::TYPE_TEXT=>$i18n->get('label.type_text'),
@@ -74,7 +74,7 @@ if ($request->isPost()) {
   if (!ttValidString($cl_field_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
 
   if ($err->no()) {
-    $res = CustomFields::insertField($cl_field_name, $cl_field_type, $cl_required);
+    $res = CustomFields::insertField($cl_field_name, $cl_entity_type, $cl_field_type, $cl_required);
     if ($res) {
       header('Location: cf_custom_fields.php');
       exit();
index ce870a9..a0c49ec 100644 (file)
@@ -32,7 +32,7 @@ class CustomFields {
   const ENTITY_TIME = 1;    // Field is associated with time entries.
   const ENTITY_USER = 2;    // Field is associated with users.
   const ENTITY_PROJECT = 3; // Field is associated with projects.
-    
+
   const TYPE_TEXT = 1;     // A text field.
   const TYPE_DROPDOWN = 2; // A dropdown field with pre-defined values.
 
@@ -301,7 +301,7 @@ class CustomFields {
   }
 
   // The insertField inserts a custom field for group.
-  static function insertField($field_name, $field_type, $required) {
+  static function insertField($field_name, $entity_type, $field_type, $required) {
     global $user;
     $mdb2 = getConnection();