From 047ab7ede7c1b72d590c459fe53aad6052b8be56 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sat, 27 Dec 2008 10:42:48 +0000 Subject: [PATCH] work in progress: task management with work items git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3088 fd906abe-77d9-0310-91a1-e0d9ade77398 --- organize/work/__init__.py | 3 ++ organize/work/base.py | 41 +++++++++++++++++++++++ organize/work/browser.py | 64 ++++++++++++++++++++++++++++++++++++ organize/work/configure.zcml | 34 +++++++++++++++++++ organize/work/setup.py | 35 ++++++++++++++++++++ organize/work/work_macros.pt | 31 +++++++++++++++++ 6 files changed, 208 insertions(+) create mode 100644 organize/work/__init__.py create mode 100644 organize/work/base.py create mode 100644 organize/work/browser.py create mode 100644 organize/work/configure.zcml create mode 100644 organize/work/setup.py create mode 100644 organize/work/work_macros.pt diff --git a/organize/work/__init__.py b/organize/work/__init__.py new file mode 100644 index 0000000..38314f3 --- /dev/null +++ b/organize/work/__init__.py @@ -0,0 +1,3 @@ +""" +$Id$ +""" diff --git a/organize/work/base.py b/organize/work/base.py new file mode 100644 index 0000000..6d6b1e9 --- /dev/null +++ b/organize/work/base.py @@ -0,0 +1,41 @@ +# +# Copyright (c) 2008 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Recording changes to loops objects. + +$Id$ +""" + +from zope.cachedescriptors.property import Lazy +from zope.component import adapter + +from cybertools.organize.work import WorkItem as BaseWorkItem +from cybertools.organize.work import WorkItems as BaseWorkItems +from loops.organize.tracking.base import BaseRecordManager + + +class WorkItem(BaseWorkItem): + + pass + + +class WorkItems(BaseRecordManager, BaseWorkItems): + + pass + diff --git a/organize/work/browser.py b/organize/work/browser.py new file mode 100644 index 0000000..aa22319 --- /dev/null +++ b/organize/work/browser.py @@ -0,0 +1,64 @@ +# +# Copyright (c) 2008 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +View class(es) for change tracks. + +$Id$ +""" + +from zope import component +from zope.app.security.interfaces import IAuthentication, PrincipalLookupError +from zope.cachedescriptors.property import Lazy +from zope.app.pagetemplate import ViewPageTemplateFile +from zope.traversing.browser import absoluteURL +from zope.traversing.api import getName + +from cybertools.browser.action import actions +from cybertools.tracking.browser import TrackView +from loops.browser.action import DialogAction +from loops.browser.form import ObjectForm, EditObject +from loops.organize.tracking.browser import BaseTrackView +from loops import util + + +work_macros = ViewPageTemplateFile('work_macros.pt') + + +class WorkItemView(BaseTrackView): + + pass + + +class CreateWorkItemForm(ObjectForm): + + template = work_macros + + @Lazy + def macro(self): + return self.template.macros['create_workitem'] + + +# actions + +actions.register('createWorkitem', 'portlet', DialogAction, + title=_(u'Create Work Item...'), + description=_(u'Create a work item for this object.'), + viewName='create_workitem.html', + dialogName='createWorkitem', +) diff --git a/organize/work/configure.zcml b/organize/work/configure.zcml new file mode 100644 index 0000000..e3c47ef --- /dev/null +++ b/organize/work/configure.zcml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/organize/work/setup.py b/organize/work/setup.py new file mode 100644 index 0000000..b017841 --- /dev/null +++ b/organize/work/setup.py @@ -0,0 +1,35 @@ +# +# Copyright (c) 2008 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Automatic setup of a loops site for the organize.work package. + +$Id$ +""" + +from cybertools.tracking.btree import TrackingStorage +from loops.organize.work.base import WorkItem +from loops.setup import SetupManager as BaseSetupManager + + +class SetupManager(BaseSetupManager): + + def setup(self): + records = self.context.getRecordManager() + work = self.addObject(records, TrackingStorage, 'work', + trackFactory=WorkItem) diff --git a/organize/work/work_macros.pt b/organize/work/work_macros.pt new file mode 100644 index 0000000..91c647e --- /dev/null +++ b/organize/work/work_macros.pt @@ -0,0 +1,31 @@ + + + + + +
+ +
Add Work Item
+
+ +
+
+
+
+ + +
+ + + + +