projects
/
timetracker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3cd4cdb
)
Adjusted task_add.php and task_edit.php to operate with subgroups.
author
Nik Okuntseff
<support@anuko.com>
Mon, 26 Nov 2018 15:54:11 +0000
(15:54 +0000)
committer
Nik Okuntseff
<support@anuko.com>
Mon, 26 Nov 2018 15:54:11 +0000
(15:54 +0000)
WEB-INF/lib/ttOrgImportHelper.class.php
patch
|
blob
|
history
WEB-INF/lib/ttTaskHelper.class.php
patch
|
blob
|
history
WEB-INF/templates/footer.tpl
patch
|
blob
|
history
WEB-INF/templates/task_edit.tpl
patch
|
blob
|
history
task_add.php
patch
|
blob
|
history
task_edit.php
patch
|
blob
|
history
diff --git
a/WEB-INF/lib/ttOrgImportHelper.class.php
b/WEB-INF/lib/ttOrgImportHelper.class.php
index
ec5593c
..
b5a28c8
100644
(file)
--- a/
WEB-INF/lib/ttOrgImportHelper.class.php
+++ b/
WEB-INF/lib/ttOrgImportHelper.class.php
@@
-181,7
+181,9
@@
class ttOrgImportHelper {
if ($task_id) {
// Add a mapping.
$this->currentGroupTaskMap[$attrs['ID']] = $task_id;
if ($task_id) {
// Add a mapping.
$this->currentGroupTaskMap[$attrs['ID']] = $task_id;
- } else $this->errors->add($i18n->get('error.db'));
+ } else {
+ $this->errors->add($i18n->get('error.db'));
+ }
return;
}
return;
}
@@
-205,7
+207,9
@@
class ttOrgImportHelper {
if ($project_id) {
// Add a mapping.
$this->currentGroupProjectMap[$attrs['ID']] = $project_id;
if ($project_id) {
// Add a mapping.
$this->currentGroupProjectMap[$attrs['ID']] = $project_id;
- } else $this->errors->add($i18n->get('error.db'));
+ } else {
+ $this->errors->add($i18n->get('error.db'));
+ }
return;
}
return;
}
diff --git
a/WEB-INF/lib/ttTaskHelper.class.php
b/WEB-INF/lib/ttTaskHelper.class.php
index
c7f25d1
..
0d4d5ef
100644
(file)
--- a/
WEB-INF/lib/ttTaskHelper.class.php
+++ b/
WEB-INF/lib/ttTaskHelper.class.php
@@
-35,9
+35,11
@@
class ttTaskHelper {
global $user;
$mdb2 = getConnection();
global $user;
$mdb2 = getConnection();
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
$sql = "select id, name, description, status from tt_tasks
$sql = "select id, name, description, status from tt_tasks
- where id = $id and group_id = $
user->group
_id and (status = 0 or status = 1)";
+ where id = $id and group_id = $
group_id and org_id = $org
_id and (status = 0 or status = 1)";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
@@
-53,15
+55,17
@@
class ttTaskHelper {
// getAssignedProjects - returns an array of projects associatied with a task.
static function getAssignedProjects($task_id)
{
// getAssignedProjects - returns an array of projects associatied with a task.
static function getAssignedProjects($task_id)
{
-
global $user;
+ global $user;
$result = array();
$mdb2 = getConnection();
$result = array();
$mdb2 = getConnection();
+ $group_id = $user->getGroup();
+ $org_id = $user->org_id;
// Do a query with inner join to get assigned projects.
$sql = "select p.id, p.name from tt_projects p
inner join tt_project_task_binds ptb on (ptb.project_id = p.id and ptb.task_id = $task_id)
// Do a query with inner join to get assigned projects.
$sql = "select p.id, p.name from tt_projects p
inner join tt_project_task_binds ptb on (ptb.project_id = p.id and ptb.task_id = $task_id)
- where p.group_id = $
user->group
_id and p.status = 1 order by p.name";
+ where p.group_id = $
group_id and p.org_id = $org
_id and p.status = 1 order by p.name";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
while ($val = $res->fetchRow()) {
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
while ($val = $res->fetchRow()) {
diff --git
a/WEB-INF/templates/footer.tpl
b/WEB-INF/templates/footer.tpl
index
20cb8ff
..
443e586
100644
(file)
--- a/
WEB-INF/templates/footer.tpl
+++ b/
WEB-INF/templates/footer.tpl
@@
-12,7
+12,7
@@
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.28.452
2
| Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.28.452
3
| Copyright © <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>
<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/task_edit.tpl
b/WEB-INF/templates/task_edit.tpl
index
5af8d93
..
f8b45a3
100644
(file)
--- a/
WEB-INF/templates/task_edit.tpl
+++ b/
WEB-INF/templates/task_edit.tpl
@@
-15,10
+15,12
@@
<td align = "right">{$i18n.label.status}:</td>
<td>{$forms.taskForm.status.control}</td>
</tr>
<td align = "right">{$i18n.label.status}:</td>
<td>{$forms.taskForm.status.control}</td>
</tr>
+{if $show_projects}
<tr valign="top">
<td align="right">{$i18n.label.projects}:</td>
<td>{$forms.taskForm.projects.control}</td>
</tr>
<tr valign="top">
<td align="right">{$i18n.label.projects}:</td>
<td>{$forms.taskForm.projects.control}</td>
</tr>
+{/if}
<tr>
<td></td>
<td>{$i18n.label.required_fields}</td>
<tr>
<td></td>
<td>{$i18n.label.required_fields}</td>
diff --git
a/task_add.php
b/task_add.php
index
28a554b
..
b1ad08a
100644
(file)
--- a/
task_add.php
+++ b/
task_add.php
@@
-37,13
+37,13
@@
if (!ttAccessAllowed('manage_tasks')) {
header('Location: access_denied.php');
exit();
}
header('Location: access_denied.php');
exit();
}
-if (MODE_PROJECTS_AND_TASKS != $user->
tracking_mode
) {
+if (MODE_PROJECTS_AND_TASKS != $user->
getTrackingMode()
) {
header('Location: feature_disabled.php');
exit();
}
// End of access checks.
header('Location: feature_disabled.php');
exit();
}
// End of access checks.
-$projects = ttTeamHelper::getActiveProjects($user->g
roup_id
);
+$projects = ttTeamHelper::getActiveProjects($user->g
etGroup()
);
if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
diff --git
a/task_edit.php
b/task_edit.php
index
2b91f05
..
c9f95ec
100644
(file)
--- a/
task_edit.php
+++ b/
task_edit.php
@@
-36,7
+36,7
@@
if (!ttAccessAllowed('manage_tasks')) {
header('Location: access_denied.php');
exit();
}
header('Location: access_denied.php');
exit();
}
-if (MODE_PROJECTS_AND_TASKS != $user->
tracking_mode
) {
+if (MODE_PROJECTS_AND_TASKS != $user->
getTrackingMode()
) {
header('Location: feature_disabled.php');
exit();
}
header('Location: feature_disabled.php');
exit();
}
@@
-48,7
+48,7
@@
if (!$task) {
}
// End of access checks.
}
// End of access checks.
-$projects = ttTeamHelper::getActiveProjects($user->g
roup_id
);
+$projects = ttTeamHelper::getActiveProjects($user->g
etGroup()
);
if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
@@
-118,6
+118,7
@@
if ($request->isPost()) {
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('show_projects', count($projects) > 0);
$smarty->assign('title', $i18n->get('title.edit_task'));
$smarty->assign('content_page_name', 'task_edit.tpl');
$smarty->display('index.tpl');
$smarty->assign('title', $i18n->get('title.edit_task'));
$smarty->assign('content_page_name', 'task_edit.tpl');
$smarty->display('index.tpl');