Skip to content
Browse files

added filter by employee to PM dashboard

  • Loading branch information...
1 parent 6f3183a commit 7382284e7d9b3a66e0f0206f512c9463f16e689d @gborelli gborelli committed Apr 7, 2013
View
2 docs/HISTORY.txt
@@ -4,6 +4,8 @@ Changelog
1.0 (unreleased)
----------------
+- Added IUserStoriesListing adapter to listing stories by user [giorgio]
+- Removed IMyStoriesListing adapter [giorgio]
- added "Simplemanagement: Manage project" permission to
Manager, PM and Site Administrator [giorgio]
- fix Dexterity2.0 relations issue [giorgio]
View
12 src/collective/simplemanagement/browser/dashboard.py
@@ -21,7 +21,7 @@
from .. import messageFactory as _
from ..configure import Settings
-from ..interfaces import IMyStoriesListing
+from ..interfaces import IUserStoriesListing
from ..interfaces import IProject
from ..interfaces import IQuickForm
from ..interfaces import IBooking
@@ -216,9 +216,13 @@ def add_booking_form(self):
return addform.render()
def projects(self):
- listing = IMyStoriesListing(self.context)
+ listing = IUserStoriesListing(self.context)
projects = {}
- for st in listing.stories(project_info=True):
+ stories = listing.stories(
+ user_id=self._get_employee_filter(),
+ project_info=True
+ )
+ for st in stories:
prj = st.pop('project')
if prj['UID'] not in projects:
projects[prj['UID']] = prj
@@ -260,7 +264,7 @@ def _bookings(self, userid, from_date, to_date):
return bookings
def bookings(self):
- user_id = self.user.getId()
+ user_id = self._get_employee_filter()
project = None
is_project_context = IProject.providedBy(self.context)
if is_project_context:
View
15 src/collective/simplemanagement/browser/templates/dashboard.pt
@@ -50,9 +50,10 @@
<div id="stories-wrapper"
class="pane"
tal:define="booking_holes view/booking_holes;">
- <div id="missed-bookings" class="pat-expose alert alert-top alert-booking"
+ <div id="missed-bookings"
+ class="pat-expose alert alert-top alert-booking"
data-expose-triggers="hover"
- tal:condition="booking_holes">
+ tal:condition="python: booking_holes and not employee_details">
<h2 i18n:translate="">Please complete your booking</h2>
<p class="claim"
i18n:translate="">You seem to have missing bookings
@@ -117,7 +118,8 @@
colspan="2">Story</th>
<th i18n:translate="">Estimate</th>
<th i18n:translate="">Done</th>
- <th i18n:translate="">Actions</th>
+ <th i18n:translate=""
+ tal:condition="not: employee_details">Actions</th>
</tr>
</thead>
<tbody>
@@ -131,7 +133,8 @@
fill-slot="extra-info" />
<metal:after-columns fill-slot="after-columns">
- <td class="quick-booking">
+ <td class="quick-booking"
+ tal:condition="not: employee_details">
<a i18n:translate=""
class="bookform btn"
title="Add Booking"
@@ -168,10 +171,6 @@
<!-- Booking History pane -->
<div id="booking-wrapper" class="pane">
- <h2 i18n:translate="">
- Your booking
- </h2>
-
<table class="listing">
<thead>
<tr>
View
4 src/collective/simplemanagement/browser/templates/macros.pt
@@ -433,7 +433,7 @@
<metal:employee-form define-macro="employee-form">
<div class="employees-form-wrapper"
tal:define="selected python:request.get('employee')">
- <form tal:attributes="action form_action|string:dashboard#tickets">
+ <form tal:attributes="action form_action|string:dashboard">
<div class="field">
<label class="formQuestion" for="employee"
i18n:translate="">Filter results by employee</label>
@@ -455,7 +455,7 @@
</select>
<a class="reset btn"
tal:condition="selected"
- tal:attributes="href string:dashboard#tickets">
+ tal:attributes="href string:dashboard">
<span i18n:translate="">Reset filter</span>
</a>
</div>
View
8 src/collective/simplemanagement/configure.zcml
@@ -35,14 +35,14 @@
<adapter
for="plone.app.layout.navigation.interfaces.INavigationRoot"
- provides=".interfaces.IMyStoriesListing"
- factory=".stories_listing.MyStoriesListing"
+ provides=".interfaces.IUserStoriesListing"
+ factory=".stories_listing.UserStoriesListing"
/>
<adapter
for=".interfaces.IProject"
- provides=".interfaces.IMyStoriesListing"
- factory=".stories_listing.MyStoriesListing"
+ provides=".interfaces.IUserStoriesListing"
+ factory=".stories_listing.UserStoriesListing"
/>
<include file="vocabularies.zcml" />
View
13 src/collective/simplemanagement/interfaces.py
@@ -242,8 +242,17 @@ def totals():
"""
-class IMyStoriesListing(IStoriesListing):
- """This adapter return all stories assigned to myself"""
+class IUserStoriesListing(IStoriesListing):
+ """This adapter return all stories assigned to a specific user
+ """
+
+ def stories(user_id=None, project_info=False):
+ """return stories details if project_info is True
+ each story contains also information about project and iteration
+
+ This method returns all stories assigned to the current
+ logged in user or filters stories by user_id parameter
+ """
class IBacklogView(Interface):
View
74 src/collective/simplemanagement/locales/collective.simplemanagement.pot
@@ -4,7 +4,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2013-04-07 15:28+0000\n"
+"POT-Creation-Date: 2013-04-07 18:23+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -37,23 +37,23 @@ msgstr ""
msgid "${username} dashboard"
msgstr ""
-#: ../browser/templates/dashboard.pt:72
+#: ../browser/templates/dashboard.pt:73
msgid "(${time} hours booked)"
msgstr ""
#: ../browser/templates/macros.pt:26
msgid "(None)"
msgstr ""
-#: ../browser/templates/dashboard.pt:84
+#: ../browser/templates/dashboard.pt:85
msgid "- select reason -"
msgstr ""
#: ../events.py:25
msgid "<p>Here are collected all the issues relative to the project <em>${project_name}</em>.</p><p>If you found any problems, please report it here by clicking <em>New issue</em>.</p>"
msgstr ""
-#: ../browser/templates/dashboard.pt:120
+#: ../browser/templates/dashboard.pt:121
#: ../browser/templates/macros.pt:142
msgid "Actions"
msgstr ""
@@ -66,7 +66,7 @@ msgstr ""
msgid "Actual hours"
msgstr ""
-#: ../browser/templates/dashboard.pt:135
+#: ../browser/templates/dashboard.pt:138
#: ../story_templates/view.pt:31
msgid "Add Booking"
msgstr ""
@@ -103,7 +103,7 @@ msgid "Backlog"
msgstr ""
#: ../browser/dashboard.py:66
-#: ../browser/templates/dashboard.pt:135
+#: ../browser/templates/dashboard.pt:138
msgid "Book time"
msgstr ""
@@ -112,11 +112,11 @@ msgstr ""
msgid "Booking"
msgstr ""
-#: ../interfaces.py:325
+#: ../interfaces.py:334
msgid "Booking check days delta end"
msgstr ""
-#: ../interfaces.py:322
+#: ../interfaces.py:331
msgid "Booking check days delta start"
msgstr ""
@@ -156,7 +156,7 @@ msgid "Data successfully updated."
msgstr ""
#: ../booking_templates/view.pt:14
-#: ../browser/templates/dashboard.pt:178
+#: ../browser/templates/dashboard.pt:177
#: ../browser/templates/macros.pt:300
msgid "Date"
msgstr ""
@@ -191,7 +191,7 @@ msgstr ""
msgid "Documents folder"
msgstr ""
-#: ../browser/templates/dashboard.pt:119
+#: ../browser/templates/dashboard.pt:120
#: ../browser/templates/macros.pt:147
msgid "Done"
msgstr ""
@@ -214,7 +214,7 @@ msgstr ""
msgid "Employees"
msgstr ""
-#: ../interfaces.py:344
+#: ../interfaces.py:353
msgid "Employess group"
msgstr ""
@@ -234,7 +234,7 @@ msgstr ""
msgid "Environment"
msgstr ""
-#: ../interfaces.py:332
+#: ../interfaces.py:341
msgid "Environment types"
msgstr ""
@@ -248,7 +248,7 @@ msgstr ""
msgid "Epic"
msgstr ""
-#: ../browser/templates/dashboard.pt:118
+#: ../browser/templates/dashboard.pt:119
#: ../browser/templates/macros.pt:146
#: ../epic_templates/view.pt:89
msgid "Estimate"
@@ -274,15 +274,15 @@ msgstr ""
msgid "February"
msgstr ""
-#: ../browser/templates/dashboard.pt:90
+#: ../browser/templates/dashboard.pt:91
msgid "Fill it!"
msgstr ""
#: ../browser/templates/macros.pt:438
msgid "Filter results by employee"
msgstr ""
-#: ../browser/templates/dashboard.pt:159
+#: ../browser/templates/dashboard.pt:162
msgid "Found ${n_ticket} ticket/s"
msgstr ""
@@ -302,21 +302,21 @@ msgstr ""
msgid "Here you can plan your iterations: choose a destination iteration on the right panel and drag stories from the backlog to it, or the other way around, or select two iterations to move stories between them. If you wish to create a copy of the story, instead of moving it, keep Ctrl pressed while dragging."
msgstr ""
-#: ../browser/templates/dashboard.pt:179
+#: ../browser/templates/dashboard.pt:178
#: ../browser/templates/worklog.pt:64
#: ../interfaces.py:225
msgid "Hours"
msgstr ""
-#: ../interfaces.py:345
+#: ../interfaces.py:354
msgid "Identifier of the group containing all employees"
msgstr ""
#: ../epic_templates/view.pt:37
msgid "Initial estimate"
msgstr ""
-#: ../browser/templates/dashboard.pt:80
+#: ../browser/templates/dashboard.pt:81
msgid "It's okay, I"
msgstr ""
@@ -353,7 +353,7 @@ msgstr ""
msgid "Last documents"
msgstr ""
-#: ../interfaces.py:318
+#: ../interfaces.py:327
msgid "Man day hours"
msgstr ""
@@ -419,11 +419,11 @@ msgstr ""
msgid "November"
msgstr ""
-#: ../interfaces.py:353
+#: ../interfaces.py:362
msgid "Number of weeks after month"
msgstr ""
-#: ../interfaces.py:348
+#: ../interfaces.py:357
msgid "Number of weeks before month"
msgstr ""
@@ -450,11 +450,11 @@ msgstr ""
msgid "Planning"
msgstr ""
-#: ../browser/templates/dashboard.pt:56
+#: ../browser/templates/dashboard.pt:57
msgid "Please complete your booking"
msgstr ""
-#: ../interfaces.py:340
+#: ../interfaces.py:349
msgid "Possible reasons to be off duty"
msgstr ""
@@ -481,19 +481,19 @@ msgstr ""
msgid "Project portlet"
msgstr ""
-#: ../interfaces.py:328
+#: ../interfaces.py:337
msgid "Project statuses"
msgstr ""
#: ../browser/templates/macros.pt:352
msgid "Project:"
msgstr ""
-#: ../browser/templates/dashboard.pt:181
+#: ../browser/templates/dashboard.pt:180
msgid "Projects"
msgstr ""
-#: ../interfaces.py:373
+#: ../interfaces.py:382
msgid "Reason"
msgstr ""
@@ -519,7 +519,7 @@ msgstr ""
msgid "Resource"
msgstr ""
-#: ../interfaces.py:336
+#: ../interfaces.py:345
msgid "Resource roles"
msgstr ""
@@ -577,7 +577,7 @@ msgstr ""
msgid "Stories"
msgstr ""
-#: ../browser/templates/dashboard.pt:116
+#: ../browser/templates/dashboard.pt:117
#: ../browser/templates/macros.pt:144
#: ../browser/templates/worklog.pt:61
msgid "Story"
@@ -623,19 +623,19 @@ msgstr ""
msgid "The man days that this project is paid for"
msgstr ""
-#: ../interfaces.py:319
+#: ../interfaces.py:328
msgid "The number of hours a person works in a day"
msgstr ""
-#: ../interfaces.py:354
+#: ../interfaces.py:363
msgid "The number of weeks to show in monthly views that actually fall in the next month"
msgstr ""
-#: ../interfaces.py:349
+#: ../interfaces.py:358
msgid "The number of weeks to show in monthly views that actually fall in the previous month"
msgstr ""
-#: ../interfaces.py:312
+#: ../interfaces.py:321
msgid "The percentage (between 0 and 1) after which a deviation needs to be highlighted"
msgstr ""
@@ -681,7 +681,7 @@ msgstr ""
msgid "Time spent"
msgstr ""
-#: ../browser/templates/dashboard.pt:180
+#: ../browser/templates/dashboard.pt:179
#: ../browser/templates/macros.pt:301
#: ../browser/templates/ticketsmacros.pt:17
msgid "Title"
@@ -730,7 +730,7 @@ msgstr ""
msgid "View details"
msgstr ""
-#: ../interfaces.py:311
+#: ../interfaces.py:320
msgid "Warning delta"
msgstr ""
@@ -760,14 +760,10 @@ msgstr ""
msgid "You have no tickets assigned"
msgstr ""
-#: ../browser/templates/dashboard.pt:57
+#: ../browser/templates/dashboard.pt:58
msgid "You seem to have missing bookings for the following days:"
msgstr ""
-#: ../browser/templates/dashboard.pt:171
-msgid "Your booking"
-msgstr ""
-
#: ../browser/templates/dashboard.pt:21
msgid "Your dashboard"
msgstr ""
View
74 src/collective/simplemanagement/locales/it/LC_MESSAGES/collective.simplemanagement.po
@@ -3,7 +3,7 @@
msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
-"POT-Creation-Date: 2013-04-07 15:28+0000\n"
+"POT-Creation-Date: 2013-04-07 18:23+0000\n"
"PO-Revision-Date: 2012-08-23 22:03+0000\n"
"Last-Translator: Giorgio Borelli <giorgio@abstract.it>\n"
"Language-Team: Giorgio Borelli <giorgio@abstract.it>\n"
@@ -37,23 +37,23 @@ msgstr "${project_name} - Tracker"
msgid "${username} dashboard"
msgstr "Dashboard di ${username}"
-#: ../browser/templates/dashboard.pt:72
+#: ../browser/templates/dashboard.pt:73
msgid "(${time} hours booked)"
msgstr "(${time} ore segnate)"
#: ../browser/templates/macros.pt:26
msgid "(None)"
msgstr "(nessuno/a)"
-#: ../browser/templates/dashboard.pt:84
+#: ../browser/templates/dashboard.pt:85
msgid "- select reason -"
msgstr "- seleziona una motivazione -"
#: ../events.py:25
msgid "<p>Here are collected all the issues relative to the project <em>${project_name}</em>.</p><p>If you found any problems, please report it here by clicking <em>New issue</em>.</p>"
msgstr "<p>Qui sono conservate tutte le richieste e le segnalazioni dei problemi di funzionamento relativi al progetto <em>${project_name}</em> </p><p>Se trovi un qualcisasi problema, segnalalo qui cliccando sul pulsante <em>Genera una nuova richiesta</em>.</p>"
-#: ../browser/templates/dashboard.pt:120
+#: ../browser/templates/dashboard.pt:121
#: ../browser/templates/macros.pt:142
msgid "Actions"
msgstr "Azioni"
@@ -66,7 +66,7 @@ msgstr "Attivo"
msgid "Actual hours"
msgstr "Effettuate"
-#: ../browser/templates/dashboard.pt:135
+#: ../browser/templates/dashboard.pt:138
#: ../story_templates/view.pt:31
msgid "Add Booking"
msgstr "Aggiungi Booking"
@@ -103,7 +103,7 @@ msgid "Backlog"
msgstr "Backlog"
#: ../browser/dashboard.py:66
-#: ../browser/templates/dashboard.pt:135
+#: ../browser/templates/dashboard.pt:138
msgid "Book time"
msgstr "Scarica ore"
@@ -112,11 +112,11 @@ msgstr "Scarica ore"
msgid "Booking"
msgstr "Booking"
-#: ../interfaces.py:325
+#: ../interfaces.py:334
msgid "Booking check days delta end"
msgstr "Fine del periodo di grazia dal booking"
-#: ../interfaces.py:322
+#: ../interfaces.py:331
msgid "Booking check days delta start"
msgstr "Inizio del periodo di grazia dal booking"
@@ -156,7 +156,7 @@ msgid "Data successfully updated."
msgstr "Dati modificati"
#: ../booking_templates/view.pt:14
-#: ../browser/templates/dashboard.pt:178
+#: ../browser/templates/dashboard.pt:177
#: ../browser/templates/macros.pt:300
msgid "Date"
msgstr "Data"
@@ -191,7 +191,7 @@ msgstr "Documentazione"
msgid "Documents folder"
msgstr "Cartella documentazione"
-#: ../browser/templates/dashboard.pt:119
+#: ../browser/templates/dashboard.pt:120
#: ../browser/templates/macros.pt:147
msgid "Done"
msgstr "Fatto"
@@ -214,7 +214,7 @@ msgstr "Impiegato"
msgid "Employees"
msgstr "Impiegati"
-#: ../interfaces.py:344
+#: ../interfaces.py:353
msgid "Employess group"
msgstr "Gruppo impiegati"
@@ -234,7 +234,7 @@ msgstr "Data di fine"
msgid "Environment"
msgstr "Ambiente"
-#: ../interfaces.py:332
+#: ../interfaces.py:341
msgid "Environment types"
msgstr "Ambienti, tipologia"
@@ -248,7 +248,7 @@ msgstr "Ambienti"
msgid "Epic"
msgstr "Epic"
-#: ../browser/templates/dashboard.pt:118
+#: ../browser/templates/dashboard.pt:119
#: ../browser/templates/macros.pt:146
#: ../epic_templates/view.pt:89
msgid "Estimate"
@@ -274,15 +274,15 @@ msgstr "Data di fine prevista:"
msgid "February"
msgstr "Febbraio"
-#: ../browser/templates/dashboard.pt:90
+#: ../browser/templates/dashboard.pt:91
msgid "Fill it!"
msgstr "Completa il booking!"
#: ../browser/templates/macros.pt:438
msgid "Filter results by employee"
msgstr "Filtra i risultati per impiegato"
-#: ../browser/templates/dashboard.pt:159
+#: ../browser/templates/dashboard.pt:162
msgid "Found ${n_ticket} ticket/s"
msgstr "Trovato/i ${n_ticket} ticket"
@@ -302,21 +302,21 @@ msgstr "Vai alla cartella documenti"
msgid "Here you can plan your iterations: choose a destination iteration on the right panel and drag stories from the backlog to it, or the other way around, or select two iterations to move stories between them. If you wish to create a copy of the story, instead of moving it, keep Ctrl pressed while dragging."
msgstr "Qui puoi pianificare le iterazioni: scegli una iterazione di destinazione nella colonna di destra e trascina le storie dal backlog (a destra) sino alla colonna di sinistra. Puoi inoltre selezionare due differenti iterazioni e spostare le storie tra di esse. Se vuoi invece creare una copia della storia, al posto di spostarla, tieni premuto il tasto CTRL mentre la sposti."
-#: ../browser/templates/dashboard.pt:179
+#: ../browser/templates/dashboard.pt:178
#: ../browser/templates/worklog.pt:64
#: ../interfaces.py:225
msgid "Hours"
msgstr "Ore"
-#: ../interfaces.py:345
+#: ../interfaces.py:354
msgid "Identifier of the group containing all employees"
msgstr "Identificativo del gruppo che contiene tutti gli impiegati"
#: ../epic_templates/view.pt:37
msgid "Initial estimate"
msgstr "Stima iniziale"
-#: ../browser/templates/dashboard.pt:80
+#: ../browser/templates/dashboard.pt:81
msgid "It's okay, I"
msgstr "Tutto ok…"
@@ -353,7 +353,7 @@ msgstr "Giugno"
msgid "Last documents"
msgstr "Ultimi documenti"
-#: ../interfaces.py:318
+#: ../interfaces.py:327
msgid "Man day hours"
msgstr "Ore lavorative giornaliere"
@@ -419,11 +419,11 @@ msgstr "Note"
msgid "November"
msgstr "Novembre"
-#: ../interfaces.py:353
+#: ../interfaces.py:362
msgid "Number of weeks after month"
msgstr "Numero di settimane dopo la fine del mese corrente"
-#: ../interfaces.py:348
+#: ../interfaces.py:357
msgid "Number of weeks before month"
msgstr "Numero di settimane prima dell'inizio del mese corrente"
@@ -450,11 +450,11 @@ msgstr "Iterazioni passate (${n_iterations})"
msgid "Planning"
msgstr "Pianificazione"
-#: ../browser/templates/dashboard.pt:56
+#: ../browser/templates/dashboard.pt:57
msgid "Please complete your booking"
msgstr "Completa il tuo booking"
-#: ../interfaces.py:340
+#: ../interfaces.py:349
msgid "Possible reasons to be off duty"
msgstr "Possibili ragioni d'assenza"
@@ -481,19 +481,19 @@ msgstr "Project manager"
msgid "Project portlet"
msgstr "Portlet progetto"
-#: ../interfaces.py:328
+#: ../interfaces.py:337
msgid "Project statuses"
msgstr "Stati del progetto"
#: ../browser/templates/macros.pt:352
msgid "Project:"
msgstr "Progetto:"
-#: ../browser/templates/dashboard.pt:181
+#: ../browser/templates/dashboard.pt:180
msgid "Projects"
msgstr "Progetti"
-#: ../interfaces.py:373
+#: ../interfaces.py:382
msgid "Reason"
msgstr "Motivazione"
@@ -519,7 +519,7 @@ msgstr "Azzera i filtri"
msgid "Resource"
msgstr "Risorsa"
-#: ../interfaces.py:336
+#: ../interfaces.py:345
msgid "Resource roles"
msgstr "Ruoli risorsa"
@@ -577,7 +577,7 @@ msgstr "Stato"
msgid "Stories"
msgstr "Storie"
-#: ../browser/templates/dashboard.pt:116
+#: ../browser/templates/dashboard.pt:117
#: ../browser/templates/macros.pt:144
#: ../browser/templates/worklog.pt:61
msgid "Story"
@@ -623,19 +623,19 @@ msgstr "I giorni uomo richiesti per il completamento dell'attività stimati dal
msgid "The man days that this project is paid for"
msgstr "I giorni uomo disponibili per questo progetto"
-#: ../interfaces.py:319
+#: ../interfaces.py:328
msgid "The number of hours a person works in a day"
msgstr "Il numero di ore che una persona è tenuta a lavorare in un giorno"
-#: ../interfaces.py:354
+#: ../interfaces.py:363
msgid "The number of weeks to show in monthly views that actually fall in the next month"
msgstr "Numero di settimane da visualizzare nelle viste mensili che cadrebbero nel mese successivo"
-#: ../interfaces.py:349
+#: ../interfaces.py:358
msgid "The number of weeks to show in monthly views that actually fall in the previous month"
msgstr "Numero di settimane da visualizzare nelle viste mensili che cadrebbero nel mese precedente"
-#: ../interfaces.py:312
+#: ../interfaces.py:321
msgid "The percentage (between 0 and 1) after which a deviation needs to be highlighted"
msgstr "La precentualie (tra 0 e 1) dopo la quale la deviazione dal pianificato dev'essere evidenziata"
@@ -681,7 +681,7 @@ msgstr "Ora"
msgid "Time spent"
msgstr "Ore spese"
-#: ../browser/templates/dashboard.pt:180
+#: ../browser/templates/dashboard.pt:179
#: ../browser/templates/macros.pt:301
#: ../browser/templates/ticketsmacros.pt:17
msgid "Title"
@@ -730,7 +730,7 @@ msgstr "Visualizza"
msgid "View details"
msgstr "Visualizza i dettagli"
-#: ../interfaces.py:311
+#: ../interfaces.py:320
msgid "Warning delta"
msgstr "Warning delta"
@@ -760,14 +760,10 @@ msgstr "Non hai storie assegnate"
msgid "You have no tickets assigned"
msgstr "Non hai ticket assegnati"
-#: ../browser/templates/dashboard.pt:57
+#: ../browser/templates/dashboard.pt:58
msgid "You seem to have missing bookings for the following days:"
msgstr "Sembra che tu non abbia inserito dei booking nei seguenti giorni:"
-#: ../browser/templates/dashboard.pt:171
-msgid "Your booking"
-msgstr "I tuoi booking"
-
#: ../browser/templates/dashboard.pt:21
msgid "Your dashboard"
msgstr "La tua dashboard"
View
34 src/collective/simplemanagement/stories_listing.py
@@ -7,7 +7,7 @@
from Products.CMFCore.utils import getToolByName
from .interfaces import IStoriesListing
-from .interfaces import IMyStoriesListing
+from .interfaces import IUserStoriesListing
from .utils import get_timings
from .utils import get_assignees_details
from .utils import get_epic_by_story
@@ -18,7 +18,7 @@
class StoriesListing(object):
implements(IStoriesListing)
-
+ _user_id = None
totals = {
'hours': 0,
'difference': 0,
@@ -37,12 +37,12 @@ def portal_state(self):
return self.context.restrictedTraverse('plone_portal_state')
@property
- def user(self):
- user = None
+ def user_id(self):
+ user_id = self._user_id
portal_state = self.portal_state()
- if not portal_state.anonymous():
- user = portal_state.member()
- return user
+ if not (user_id or portal_state.anonymous()):
+ user_id = portal_state.member().getId()
+ return user_id
@property
def _query(self):
@@ -131,8 +131,8 @@ def stories(self, project_info=False):
return stories
-class MyStoriesListing(StoriesListing):
- implements(IMyStoriesListing)
+class UserStoriesListing(StoriesListing):
+ implements(IUserStoriesListing)
@property
def _query(self):
@@ -141,18 +141,10 @@ def _query(self):
'query': '/'.join(self.context.getPhysicalPath()),
},
'portal_type': 'Story',
- 'assigned_to': self.user.getId(),
+ 'assigned_to': self.user_id,
'review_state': ('todo', 'suspended', 'in_progress')
}
-
-# class ProjectMyStoriesListing(StoriesListing):
-# implements(IMyStoriesListing)
-
-# @property
-# def _query(self):
-# return {
-# 'portal_type': 'Story',
-# 'assigned_to': self.user.getId(),
-# 'review_state': ('todo', 'suspended', 'in_progress')
-# }
+ def stories(self, user_id=None, project_info=False):
+ self._user_id = user_id
+ return super(UserStoriesListing, self).stories(project_info)

0 comments on commit 7382284

Please sign in to comment.
Something went wrong with that request. Please try again.