Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xueyun Qian
erp5
Commits
4a5fa825
Commit
4a5fa825
authored
May 06, 2014
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_calendar: allow to customize the list of periods (exceptions included)
parent
33f8dc6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
bt5/erp5_calendar/DocumentTemplateItem/portal_components/document.erp5.GroupCalendarAssignment.py
...ortal_components/document.erp5.GroupCalendarAssignment.py
+24
-10
bt5/erp5_calendar/bt/revision
bt5/erp5_calendar/bt/revision
+1
-1
No files found.
bt5/erp5_calendar/DocumentTemplateItem/portal_components/document.erp5.GroupCalendarAssignment.py
View file @
4a5fa825
...
...
@@ -38,18 +38,32 @@ class GroupCalendarAssignment(PresencePeriod):
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getPeriodList'
)
def
getPeriodList
(
self
):
period_list
=
[]
method
=
self
.
_getTypeBasedMethod
(
"getPeriodList"
)
if
method
is
None
:
group_calendar
=
self
.
getSpecialiseValue
()
if
group_calendar
is
not
None
:
period_list
=
group_calendar
.
objectValues
(
portal_type
=
self
.
getPortalCalendarPeriodTypeList
())
else
:
period_list
=
method
()
return
period_list
def
_getDatePeriodDataList
(
self
):
result
=
[]
start_date
=
self
.
getStartDate
()
stop_date
=
self
.
getStopDate
()
group_calendar
=
self
.
getSpecialiseValue
()
if
not
(
None
in
(
self
.
getDestinationUid
(),
group_calendar
,
start_date
,
stop_date
)):
presence_period_list
=
group_calendar
.
objectValues
(
portal_type
=
"Group Presence Period"
)
for
presence_period
in
presence_period_list
:
for
date_period_data
in
presence_period
.
_getDatePeriodDataList
():
if
date_period_data
[
'start_date'
].
greaterThanEqualTo
(
start_date
)
and
\
date_period_data
[
'stop_date'
].
lessThanEqualTo
(
stop_date
):
result
.
append
(
date_period_data
)
if
not
(
None
in
(
self
.
getDestinationUid
(),
start_date
)):
period_list
=
self
.
getPeriodList
()
if
len
(
period_list
):
for
period
in
period_list
:
for
date_period_data
in
period
.
_getDatePeriodDataList
():
if
date_period_data
[
'start_date'
].
greaterThanEqualTo
(
start_date
):
if
stop_date
is
None
or
date_period_data
[
'stop_date'
].
lessThanEqualTo
(
stop_date
):
result
.
append
(
date_period_data
)
return
result
\ No newline at end of file
bt5/erp5_calendar/bt/revision
View file @
4a5fa825
390
\ No newline at end of file
392
\ No newline at end of file
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