projects
/
timetracker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
768cd79
)
Fixed mobile user pages for client role.
author
Nik Okuntseff
<support@anuko.com>
Wed, 20 Feb 2019 16:09:57 +0000
(16:09 +0000)
committer
Nik Okuntseff
<support@anuko.com>
Wed, 20 Feb 2019 16:09:57 +0000
(16:09 +0000)
WEB-INF/templates/footer.tpl
patch
|
blob
|
history
WEB-INF/templates/mobile/user_add.tpl
patch
|
blob
|
history
WEB-INF/templates/mobile/user_edit.tpl
patch
|
blob
|
history
mobile/user_add.php
patch
|
blob
|
history
mobile/user_edit.php
patch
|
blob
|
history
diff --git
a/WEB-INF/templates/footer.tpl
b/WEB-INF/templates/footer.tpl
index
5d4037a
..
751fe2e
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.37.474
3
| Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.37.474
4
| 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/mobile/user_add.tpl
b/WEB-INF/templates/mobile/user_add.tpl
index
d23dcf9
..
1bde81b
100644
(file)
--- a/
WEB-INF/templates/mobile/user_add.tpl
+++ b/
WEB-INF/templates/mobile/user_add.tpl
@@
-29,20
+29,31
@@
function setDefaultRate(element) {
}
}
}
}
-// handleClientControl - controls visibility of the client dropdown depending on the selected user role
.
-//
We need to show it only when the
"Client" user role is selected.
+// handleClientControl - controls visibility of the client dropdown depending on the selected user role
,
+//
also hides and unselects projects when
"Client" user role is selected.
function handleClientControl() {
var selectedRoleId = document.getElementById("role").value;
var clientControl = document.getElementById("client");
function handleClientControl() {
var selectedRoleId = document.getElementById("role").value;
var clientControl = document.getElementById("client");
+ var projectsControl = document.getElementById("projects_control");
+
var len = roles.length;
for (var i = 0; i < len; i++) {
if (selectedRoleId == roles[i][0]) {
var isClient = roles[i][1];
var len = roles.length;
for (var i = 0; i < len; i++) {
if (selectedRoleId == roles[i][0]) {
var isClient = roles[i][1];
- if (isClient == 1)
+ if (isClient == 1)
{
clientControl.style.visibility = "visible";
clientControl.style.visibility = "visible";
- else {
- clientControl.value = '';
+ projectsControl.style.display = "none";
+
+ // Uncheck all project checkboxes.
+ var checkboxes = document.getElementsByName("projects[]");
+ var j;
+ for (j = 0; j < checkboxes.length; j++) {
+ checkboxes[j].checked = false;
+ }
+ } else {
+ clientControl.value = "";
clientControl.style.visibility = "hidden";
clientControl.style.visibility = "hidden";
+ projectsControl.style.display = "";
}
break;
}
}
break;
}
@@
-90,6
+101,7
@@
function handleClientControl() {
</tr>
{/if}
{if $show_projects}
</tr>
{/if}
{if $show_projects}
+<tbody id="projects_control">
<tr valign="top">
<td align="right">{$i18n.label.projects}:</td>
<td>{$forms.userForm.projects.control}</td>
<tr valign="top">
<td align="right">{$i18n.label.projects}:</td>
<td>{$forms.userForm.projects.control}</td>
@@
-97,6
+109,7
@@
function handleClientControl() {
<tr>
<td colspan="2" align="center">{$i18n.label.required_fields}</td>
</tr>
<tr>
<td colspan="2" align="center">{$i18n.label.required_fields}</td>
</tr>
+</tbody>
{/if}
<tr>
<td colspan="2" align="center" height="50">{$forms.userForm.btn_submit.control}</td>
{/if}
<tr>
<td colspan="2" align="center" height="50">{$forms.userForm.btn_submit.control}</td>
diff --git
a/WEB-INF/templates/mobile/user_edit.tpl
b/WEB-INF/templates/mobile/user_edit.tpl
index
9929e72
..
6bddbb9
100644
(file)
--- a/
WEB-INF/templates/mobile/user_edit.tpl
+++ b/
WEB-INF/templates/mobile/user_edit.tpl
@@
-51,20
+51,31
@@
function setRate(element) {
}
}
}
}
-// handleClientControl - controls visibility of the client dropdown depending on the selected user role
.
-//
We need to show it only when the
"Client" user role is selected.
+// handleClientControl - controls visibility of the client dropdown depending on the selected user role
,
+//
also hides and unselects projects when
"Client" user role is selected.
function handleClientControl() {
var selectedRoleId = document.getElementById("role").value;
var clientControl = document.getElementById("client");
function handleClientControl() {
var selectedRoleId = document.getElementById("role").value;
var clientControl = document.getElementById("client");
+ var projectsControl = document.getElementById("projects_control");
+
var len = roles.length;
for (var i = 0; i < len; i++) {
if (selectedRoleId == roles[i][0]) {
var isClient = roles[i][1];
var len = roles.length;
for (var i = 0; i < len; i++) {
if (selectedRoleId == roles[i][0]) {
var isClient = roles[i][1];
- if (isClient == 1)
+ if (isClient == 1)
{
clientControl.style.visibility = "visible";
clientControl.style.visibility = "visible";
- else {
- clientControl.value = '';
+ projectsControl.style.display = "none";
+
+ // Uncheck all project checkboxes.
+ var checkboxes = document.getElementsByName("projects[]");
+ var j;
+ for (j = 0; j < checkboxes.length; j++) {
+ checkboxes[j].checked = false;
+ }
+ } else {
+ clientControl.value = "";
clientControl.style.visibility = "hidden";
clientControl.style.visibility = "hidden";
+ projectsControl.style.display = "";
}
break;
}
}
break;
}
@@
-118,10
+129,12
@@
function handleClientControl() {
</tr>
{/if}
{if $show_projects}
</tr>
{/if}
{if $show_projects}
+<tbody id="projects_control">
<tr valign="top">
<td align="right">{$i18n.label.projects}:</td>
<td>{$forms.userForm.projects.control}</td>
</tr>
<tr valign="top">
<td align="right">{$i18n.label.projects}:</td>
<td>{$forms.userForm.projects.control}</td>
</tr>
+</tbody>
{/if}
<tr>
<td colspan="2" align="center">{$i18n.label.required_fields}</td>
{/if}
<tr>
<td colspan="2" align="center">{$i18n.label.required_fields}</td>
diff --git
a/mobile/user_add.php
b/mobile/user_add.php
index
c821c7d
..
ed017de
100644
(file)
--- a/
mobile/user_add.php
+++ b/
mobile/user_add.php
@@
-125,7
+125,7
@@
class RateCellRenderer extends DefaultCellRenderer {
// Create projects table.
$table = new Table('projects');
$table->setIAScript('setDefaultRate');
// Create projects table.
$table = new Table('projects');
$table->setIAScript('setDefaultRate');
-$table->setTableOptions(array('width'=>'
100%
','cellspacing'=>'1','cellpadding'=>'3','border'=>'0'));
+$table->setTableOptions(array('width'=>'
250
','cellspacing'=>'1','cellpadding'=>'3','border'=>'0'));
$table->setRowOptions(array('valign'=>'top','class'=>'tableHeader'));
$table->setData($projects);
$table->setKeyField('id');
$table->setRowOptions(array('valign'=>'top','class'=>'tableHeader'));
$table->setData($projects);
$table->setKeyField('id');
diff --git
a/mobile/user_edit.php
b/mobile/user_edit.php
index
1e0845e
..
411586b
100644
(file)
--- a/
mobile/user_edit.php
+++ b/
mobile/user_edit.php
@@
-145,7
+145,7
@@
class RateCellRenderer extends DefaultCellRenderer {
// Create projects table.
$table = new Table('projects');
$table->setIAScript('setRate');
// Create projects table.
$table = new Table('projects');
$table->setIAScript('setRate');
-$table->setTableOptions(array('width'=>'
100%
','cellspacing'=>'1','cellpadding'=>'3','border'=>'0'));
+$table->setTableOptions(array('width'=>'
250
','cellspacing'=>'1','cellpadding'=>'3','border'=>'0'));
$table->setRowOptions(array('valign'=>'top','class'=>'tableHeader'));
$table->setData($projects);
$table->setKeyField('id');
$table->setRowOptions(array('valign'=>'top','class'=>'tableHeader'));
$table->setData($projects);
$table->setKeyField('id');