Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-timesheet2-tasks
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-timesheet2-tasks
Commits
d3af69c5
Commit
d3af69c5
authored
Nov 03, 2020
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Implemented CSP (Content Security Policy)
parent
beb7fade
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
12 deletions
+44
-12
intranet-timesheet2-tasks-create.sql
sql/postgresql/intranet-timesheet2-tasks-create.sql
+4
-4
intranet-timesheet2-tasks-procs.tcl
tcl/intranet-timesheet2-tasks-procs.tcl
+22
-5
index.adp
www/index.adp
+7
-0
new.adp
www/new.adp
+9
-1
new.tcl
www/new.tcl
+2
-2
No files found.
sql/postgresql/intranet-timesheet2-tasks-create.sql
View file @
d3af69c5
...
...
@@ -647,7 +647,7 @@ insert into im_views (view_id, view_name, visible_for) values (910, 'im_timeshee
insert
into
im_view_columns
(
column_id
,
view_id
,
group_id
,
column_name
,
column_render_tcl
,
extra_select
,
extra_where
,
sort_order
,
visible_for
)
values
(
91022
,
910
,
NULL
,
'"<input
type=checkbox name=_dummy onclick=acs_ListCheckAll(
''
tasks
''
,this.checked)
>"'
,
'"<input
id=list_check_all type=checkbox name=_dummy
>"'
,
'"<input type=checkbox name=task_id.$task_id id=tasks,$task_id>"'
,
''
,
''
,
-
1
,
''
);
insert
into
im_view_columns
(
column_id
,
view_id
,
group_id
,
column_name
,
column_render_tcl
,
...
...
@@ -762,11 +762,11 @@ insert into im_views (view_id, view_name, visible_for) values (911,
delete
from
im_view_columns
where
column_id
=
91112
;
insert
into
im_view_columns
(
column_id
,
view_id
,
group_id
,
column_name
,
column_render_tcl
,
extra_select
,
extra_where
,
sort_order
,
visible_for
)
values
(
91112
,
911
,
NULL
,
'"<input
type=checkbox name=_dummy onclick=acs_ListCheckAll(
''
tasks
''
,this.checked)>
"'
,
'"<input
id=list_check_all type=checkbox name=_dummy
"'
,
'"<input type=checkbox name=task_id.$task_id id=tasks,$task_id>"'
,
''
,
''
,
-
1
,
''
);
'"[im_gif del "Delete"]"'
,
'"<input type=checkbox name=task_id.$task_id>"'
,
''
,
''
,
-
1
,
''
);
--
'"[im_gif del "Delete"]"',
--
'"<input type=checkbox name=task_id.$task_id>"', '', '', -1, '');
-- insert into im_view_columns (column_id, view_id, group_id, column_name, column_render_tcl,
-- extra_select, extra_where, sort_order, visible_for) values (91100,911,NULL,'"Project Nr"',
...
...
tcl/intranet-timesheet2-tasks-procs.tcl
View file @
d3af69c5
...
...
@@ -744,11 +744,21 @@ ad_proc -public im_timesheet_task_list_component {
set task_id
$project
_id
if
{
$write
}
{
set cal_picker_start_date
"<input type=
\"
button
\"
style=
\"
height:20px; width:20px; background: url('/resources/acs-templating/calendar.gif');
\"
onclick =
\"
return showCalendar('start_date.
$task
_id', 'y-m-d');
\"
>"
set start_date_input
"<input name='start_date.
$task
_id' id='start_date.
$task
_id' size='10' type='text' value='
[
string
range
$start
_date 0 9
]
'>
$cal
_picker_start_date"
set cal_picker_end_date
"<input type=
\"
button
\"
style=
\"
height:20px; width:20px; background: url('/resources/acs-templating/calendar.gif');
\"
onclick =
\"
return showCalendar('end_date.
$task
_id', 'y-m-d');
\"
>"
set end_date_input
"<input name='end_date.
$task
_id' id='end_date.
$task
_id' size='10' type='text' value='
[
string
range
$end
_date 0 9
]
'>
$cal
_picker_end_date"
set cal_picker_start_date
"<input id=start_date_calendar.
$task
_id type=
\"
button
\"
style=
\"
height:20px; width:20px; background: url('/resources/acs-templating/calendar.gif');
\"
>"
set cal_script_start_date
"<script type=
\"
text/javascript
\"
nonce=
\"
[
im_csp_nonce
]
\"
>
window.addEventListener('load', function() {
document.getElementById('start_date_calendar.
$task
_id').addEventListener('click', function() { showCalendar('start_date.
$task
_id', 'y-m-d'); });
});
</script>
\n
"
set start_date_input
"<input name='start_date.
$task
_id' id='start_date.
$task
_id' size='10' type='text' value='
[
string
range
$start
_date 0 9
]
'>
$cal
_picker_start_date
$cal
_script_start_date"
set cal_picker_end_date
"<input id=end_date_calendar.
$task
_id type=
\"
button
\"
style=
\"
height:20px; width:20px; background: url('/resources/acs-templating/calendar.gif');
\"
>"
set cal_script_end_date
"<script type=
\"
text/javascript
\"
nonce=
\"
[
im_csp_nonce
]
\"
>
window.addEventListener('load', function() {
document.getElementById('end_date_calendar.
$task
_id').addEventListener('click', function() { showCalendar('end_date.
$task
_id', 'y-m-d'); });
});
</script>
\n
"
set end_date_input
"<input name='end_date.
$task
_id' id='end_date.
$task
_id' size='10' type='text' value='
[
string
range
$end
_date 0 9
]
'>
$cal
_picker_end_date
$cal
_script_end_date"
}
else
{
set start_date_input
[
string
range
$start
_date 0 9
]
set end_date_input
[
string
range
$end
_date 0 9
]
...
...
@@ -882,6 +892,13 @@ ad_proc -public im_timesheet_task_list_component {
set project_id
$restrict
_to_project_id
set component_html
"
<script type='text/javascript' nonce='
$::
__csp_nonce'>
window.addEventListener('load', function() {
document.getElementById('list_check_all').addEventListener('click', function() { acs_ListCheckAll('tasks', this.checked) });
});
</script>
<form action=/intranet-timesheet2-tasks/task-action method=POST>
[
export_vars -form
{
project_id return_url
}]
<table bgcolor=white border=0 cellpadding=0 cellspacing=0 class=
\"
table_list_page
\"
>
...
...
www/index.adp
View file @
d3af69c5
...
...
@@ -10,5 +10,12 @@
<property name="left_navbar">@left_navbar;literal@</property>
<property name="show_context_help_p">@show_context_help_p;literal@</property>
<script type="text/javascript" <if @::__csp_nonce@ not nil>nonce="@::__csp_nonce;literal@"</if>>
window.addEventListener('load', function() {
document.getElementById('list_check_all').addEventListener('click', function() { acs_ListCheckAll('tasks', this.checked) });
});
</script>
@task_content;noquote@
www/new.adp
View file @
d3af69c5
...
...
@@ -5,6 +5,14 @@
<property name="focus">@focus;literal@</property>
<property name="sub_navbar">@sub_navbar;literal@</property>
<!-- Show calendar on start- and end-date -->
<script type="text/javascript" <if @::__csp_nonce@ not nil>nonce="@::__csp_nonce;literal@"</if>>
window.addEventListener('load', function() {
document.getElementById('start_date_calendar').addEventListener('click', function() { showCalendarWithDateWidget('start_date', 'y-m-d'); });
document.getElementById('end_date_calendar').addEventListener('click', function() { showCalendarWithDateWidget('end_date', 'y-m-d'); });
});
</script>
<if @message@ not nil>
<div class="general-message">@message@</div>
...
...
@@ -39,7 +47,7 @@
</tr>
</table>
<script type="text/javascript">
<script type="text/javascript"
<if @::__csp_nonce@ not nil>nonce="@::__csp_nonce;literal@"</if>
>
var html_tag = document.getElementsByName('task_name')[0];
html_tag.setAttribute('onBlur','set_project_nr();');
function set_project_nr() {
...
...
www/new.tcl
View file @
d3af69c5
...
...
@@ -292,8 +292,8 @@ if {1} {
ad_form -extend -name task -form
{
{
percent_completed:float
(
text
)
,optional
{
label
"
[
_ intranet-timesheet2-tasks.Percentage_completed
]
"
}
{
html
{
size 10
}}
{
help_text
$percentage
_completed_help
}}
{
note:text
(
textarea
)
,optional
{
label
"
[
_ intranet-timesheet2-tasks.Note
]
"
}
{
html
{
cols 40
}}}
{
start_date:date
(
date
)
,optional
{
label
"
[
_ intranet-timesheet2.Start_Date
]
"
}
{
after_html
{
<input
type=
"button"
style=
"height:23px; width:23px; background: url('/resources/acs-templating/calendar.gif');"
onclick =
"return showCalendarWithDateWidget('start_date', 'y-m-d');"
>
}}
}
{
end_date:date
(
date
)
,optional
{
label
"
[
_ intranet-timesheet2.End_Date
]
"
}
{
after_html
{
<input
type=
"button"
style=
"height:23px; width:23px; background: url('/resources/acs-templating/calendar.gif');"
onclick =
"return showCalendarWithDateWidget('end_date', 'y-m-d');"
>
}}
}
{
start_date:date
(
date
)
,optional
{
label
"
[
_ intranet-timesheet2.Start_Date
]
"
}
{
after_html
{
<input
id=start_date_calendar type=
"button"
style=
"height:23px; width:23px; background: url('/resources/acs-templating/calendar.gif');"
>
}}
}
{
end_date:date
(
date
)
,optional
{
label
"
[
_ intranet-timesheet2.End_Date
]
"
}
{
after_html
{
<input
id=end_date_calendar type=
"button"
style=
"height:23px; width:23px; background: url('/resources/acs-templating/calendar.gif');"
>
}}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment