From 26dd5629ee5f2c3de36ff44e65529e4ca491cab1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 15 Mar 2019 21:56:01 +0000 Subject: [PATCH] A bit more work in progress on project attachments. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 1 + WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 1 + WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/project_files.tpl | 102 ++++++++++++++++++++++++++++ project_files.php | 22 +++--- projects.php | 1 - 33 files changed, 143 insertions(+), 12 deletions(-) create mode 100644 WEB-INF/templates/project_files.tpl diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index e524613a..59ea97ef 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -274,6 +274,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 2d7b36ff..96f17769 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -284,6 +284,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 662b21bd..7a6ef813 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -262,6 +262,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Fejl', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 7d0dda04..bc7ba0c3 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -250,6 +250,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Fehler', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 3e855d05..8dc20118 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -240,6 +240,7 @@ $i18n_key_words = array( 'label.template' => 'Template', 'label.attachments' => 'Attachments', 'label.files' => 'Files', +'label.image' => 'Image', // Form titles. 'title.error' => 'Error', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index b314181e..7978ff55 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -277,6 +277,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Translate the following. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 7ffb1656..94fb496e 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -265,6 +265,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index e404d79c..17a76172 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -272,6 +272,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'خطا', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index ac6e438f..661edd86 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -266,6 +266,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Virhe', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 5a38ee3f..b797b6ff 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -260,6 +260,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Erreur', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 608b3878..a69e6aa8 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -253,6 +253,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Σφάλμα', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index f0a31aa2..8cc4d022 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -283,6 +283,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'שגיאה', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 0bc245f6..8c2e730c 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -279,6 +279,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Translate the following. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 54cf7e73..c1a87b73 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -257,6 +257,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 0a443f95..3b48408c 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -284,6 +284,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Translate the following. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index c4988fa3..1a77cde7 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -284,6 +284,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Translate the following. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index c5a3b509..426a1428 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -242,6 +242,7 @@ $i18n_key_words = array( // TODO: translate the following. // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Fout', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 55cb9d86..a37e8881 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -281,6 +281,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Translate the following. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 5a6ea8a9..9258b851 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -267,6 +267,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Błąd', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 843258fb..99d4d1c7 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -264,6 +264,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Erro', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 538ec988..8969cdcd 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -269,6 +269,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Translate the following. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 10803e21..74b843e9 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -281,6 +281,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Improve titles for consistency, so that each title explains correctly what each diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 751d3a75..c8dee6fc 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -239,6 +239,7 @@ $i18n_key_words = array( 'label.template' => 'Шаблон', 'label.attachments' => 'Приложения', 'label.files' => 'Файлы', +'label.image' => 'Изображение', // Form titles. 'title.error' => 'Ошибка', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 81409771..34d92dd5 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -272,6 +272,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Chyba', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 712b3ee5..a4cc8fef 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -264,6 +264,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Translate the following. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index a4541454..7178d548 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -265,6 +265,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. 'title.error' => 'Greška', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 105b25f0..818a7db5 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -261,6 +261,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Rubriker för formulär 'title.error' => 'Fel', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index a02ed68a..7608d155 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -288,6 +288,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // Form titles. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 33cd0898..ef133c96 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -272,6 +272,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Translate the following. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 12a328e2..9aa12451 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -279,6 +279,7 @@ $i18n_key_words = array( // 'label.template' => 'Template', // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', +// 'label.image' => 'Image', // Form titles. // TODO: Translate the following. diff --git a/WEB-INF/templates/project_files.tpl b/WEB-INF/templates/project_files.tpl new file mode 100644 index 00000000..0313e030 --- /dev/null +++ b/WEB-INF/templates/project_files.tpl @@ -0,0 +1,102 @@ + + + + + + +
+{if $user->can('manage_projects')} + + {if $inactive_projects} + + {/if} + + + + {if $show_files} + + {/if} + + + + {if $active_projects} + {foreach $active_projects as $project} + + + + {if $show_files} + + {/if} + + + + {/foreach} + {/if} +
{$i18n.form.projects.active_projects}
{$i18n.label.image}{$i18n.label.description}{$i18n.label.files}{$i18n.label.edit}{$i18n.label.delete}
{$project.name|escape}{$project.description|escape}{$i18n.label.view}{$i18n.label.edit}{$i18n.label.delete}
+ + + + + +

+
+
+ + {if $inactive_projects} + + + + + + {if $show_files} + + {/if} + + + + {foreach $inactive_projects as $project} + + + + {if $show_files} + + {/if} + + + + {/foreach} +
{$i18n.form.projects.inactive_projects}
{$i18n.label.thing_name}{$i18n.label.description}{$i18n.label.files}{$i18n.label.edit}{$i18n.label.delete}
{$project.name|escape}{$project.description|escape}{$i18n.label.view}{$i18n.label.edit}{$i18n.label.delete}
+ + + + + +

+
+
+ {/if} +{else} + + + + + {if $show_files} + + {/if} + + {if $active_projects} + {foreach $active_projects as $project} + + + + {if $show_files} + + {/if} + + {/foreach} + {/if} +
{$i18n.label.thing_name}{$i18n.label.description}{$i18n.label.files}
{$project.name|escape}{$project.description|escape}{$i18n.label.view}
+{/if} +
diff --git a/project_files.php b/project_files.php index baec9aa2..b069acb7 100644 --- a/project_files.php +++ b/project_files.php @@ -27,8 +27,7 @@ // +----------------------------------------------------------------------+ require_once('initialize.php'); -import('form.Form'); -import('ttGroupHelper'); +import('ttProjectHelper'); // Access checks. if (!(ttAccessAllowed('view_own_projects') || ttAccessAllowed('manage_projects'))) { @@ -39,17 +38,18 @@ if (MODE_PROJECTS != $user->getTrackingMode() && MODE_PROJECTS_AND_TASKS != $use header('Location: feature_disabled.php'); exit(); } +$cl_project_id = (int)$request->getParameter('id'); +$project = ttProjectHelper::get($cl_project_id); +if (!$project) { + header('Location: access_denied.php'); + exit(); +} // End of access checks. -if($user->can('manage_projects')) { - $active_projects = ttGroupHelper::getActiveProjects(); - $inactive_projects = ttGroupHelper::getInactiveProjects(); -} else - $active_projects = $user->getAssignedProjects(); +$files = null; +// $files = ttAttachmentHelper::getProjectFiles(); -$smarty->assign('active_projects', $active_projects); -$smarty->assign('inactive_projects', $inactive_projects); -$smarty->assign('show_files', $user->isPluginEnabled('at')); +$smarty->assign('files', $files); $smarty->assign('title', $i18n->get('title.project_files')); -$smarty->assign('content_page_name', 'projects.tpl'); +$smarty->assign('content_page_name', 'project_files.tpl'); $smarty->display('index.tpl'); diff --git a/projects.php b/projects.php index 97a86ba6..236291cd 100644 --- a/projects.php +++ b/projects.php @@ -27,7 +27,6 @@ // +----------------------------------------------------------------------+ require_once('initialize.php'); -import('form.Form'); import('ttGroupHelper'); // Access checks. -- 2.20.1