From 764eef2d0dd9c6561f88579dbb4e6323d1702d14 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 19 Apr 2019 12:53:59 +0000 Subject: [PATCH] Work in progress on remote work plugin. --- WEB-INF/resources/en.lang.php | 2 + WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/header.tpl | 2 +- WEB-INF/templates/work.tpl | 107 ++++++++++++++++++++++++++++++++++ work.php | 62 ++++++++++++++++++++ 5 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 WEB-INF/templates/work.tpl create mode 100644 work.php diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 0d09af03..780de306 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -337,6 +337,8 @@ $i18n_key_words = array( 'title.delete_file' => 'Deleting File', 'title.download_file' => 'Downloading File', 'title.work' => 'Work', +'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. +'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. // Section for common strings inside combo boxes on forms. Strings shared between forms shall be placed here. // Strings that are used in a single form must go to the specific form section. diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 13e7cdfd..99115a67 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.19.0.4958 | Copyright © Anuko | +  Anuko Time Tracker 1.19.0.4959 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl index 0fa5d70e..9c46a7a8 100644 --- a/WEB-INF/templates/header.tpl +++ b/WEB-INF/templates/header.tpl @@ -138,7 +138,7 @@ {if $user->isPluginEnabled('cl') && ($user->can('view_own_clients') || $user->can('manage_clients'))} · {$i18n.menu.clients} {/if} - {if $user->isPluginEnabled('wk') && ($user->can('do_work') || $user->can('bid_on_work') || $user->can('manage_work')) && $user->exists()} + {if $user->isPluginEnabled('wk') && ($user->can('update_work') || $user->can('bid_on_work') || $user->can('manage_work')) && $user->exists()} · {$i18n.title.work} {/if} {if $user->can('export_data')} diff --git a/WEB-INF/templates/work.tpl b/WEB-INF/templates/work.tpl new file mode 100644 index 00000000..359c385c --- /dev/null +++ b/WEB-INF/templates/work.tpl @@ -0,0 +1,107 @@ + + + + + + +
+{if $user->can('manage_work')} + + + + + + {if $show_files} + + {/if} + + + + {if $active_work} + {foreach $active_work as $work_item} + + + {if $show_files} + {if $project.has_files} + + {else} + + {/if} + {/if} + + + + {/foreach} + {/if} +
{$i18n.title.active_work}
{$i18n.label.thing_name}{$i18n.label.description}
{$work_item.name|escape}{$i18n.label.files}{$i18n.label.files}{$i18n.label.edit}{$i18n.label.delete}
+ + + + + +

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

+
+
+ {/if} +{else} + + + + + {if $show_files} + + {/if} + + {if $active_projects} + {foreach $active_projects as $project} + + + + {if $show_files && $project.has_files} + + {/if} + + {/foreach} + {/if} +
{$i18n.label.thing_name}{$i18n.label.description}
{$project.name|escape}{$project.description|escape}{$i18n.label.files}
+{/if} +
diff --git a/work.php b/work.php new file mode 100644 index 00000000..60a8f7c8 --- /dev/null +++ b/work.php @@ -0,0 +1,62 @@ +isPluginEnabled('wk')) { + header('Location: feature_disabled.php'); + exit(); +} +// End of access checks. + +if($user->can('manage_work')) { + // $active_work = ttWorkHelper::getActiveWork(); // Active work items this group is outsourcing. + // $inactive_work = ttWorkHelper::getInactiveWork(); // Inactive work items this group was outsourcing. +} +if($user->can('bid_on_work')) { + // $available_work = ttWorkHelper::getAvailableWork(); // Currently available work items from other groups. +} +if($user->can('update_work')) { + // $in_progress_work = ttWorkHelper::getInProgressWork(); // Work items in progress for other groups. + // $completed_work = ttWorkHelper::getCompletedWork(); // Completed work items for other groups. +} + +$smarty->assign('active_work', $active_work); +$smarty->assign('inactive_work', $inactive_work); +$smarty->assign('available_work', $available_work); +$smarty->assign('in_progress_work', $in_progress_work); +$smarty->assign('completed_work', $completed_work); +$smarty->assign('title', $i18n->get('title.work')); +$smarty->assign('content_page_name', 'work.tpl'); +$smarty->display('index.tpl'); -- 2.20.1