provide generic 'create concept' actions based on qualifier setting or assigned subtypes
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@4161 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
629de87686
commit
ba2ea67244
5 changed files with 62 additions and 7 deletions
|
@ -19,7 +19,7 @@
|
|||
"""
|
||||
Base classes (sort of views) for action portlet items.
|
||||
|
||||
$Id: action.py 2313 2008-01-15 13:00:34Z helmutm $
|
||||
$Id$
|
||||
"""
|
||||
|
||||
from urllib import urlencode
|
||||
|
@ -145,3 +145,23 @@ actions.register('edit_concept', 'portlet', DialogAction,
|
|||
dialogName='edit',
|
||||
prerequisites=['registerDojoEditor'],
|
||||
)
|
||||
|
||||
actions.register('create_concept', 'portlet', DialogAction,
|
||||
title=_(u'Create Concept...'),
|
||||
description=_(u'Create a new concept.'),
|
||||
viewName='create_concept.html',
|
||||
dialogName='createConcept',
|
||||
qualifier='create_concept',
|
||||
#typeToken='.loops/concepts/topic',
|
||||
#fixedType=True,
|
||||
innerForm='inner_concept_form.html',
|
||||
)
|
||||
|
||||
actions.register('create_subtype', 'portlet', DialogAction,
|
||||
title=_(u'Create Concept...'),
|
||||
description=_(u'Create a new concept.'),
|
||||
viewName='create_concept.html',
|
||||
dialogName='createConcept',
|
||||
qualifier='subtype',
|
||||
innerForm='inner_concept_form.html',
|
||||
)
|
||||
|
|
|
@ -62,7 +62,7 @@ from loops.query import ConceptQuery, IQueryConcept
|
|||
from loops.resource import Resource
|
||||
from loops.schema.field import relation_macros
|
||||
from loops.security.common import canAccessObject, canListObject, canWriteObject
|
||||
from loops.type import ITypeConcept
|
||||
from loops.type import ITypeConcept, ConceptTypeInfo
|
||||
from loops import util
|
||||
from loops.util import _
|
||||
from loops.versioning.interfaces import IVersionable
|
||||
|
@ -375,6 +375,23 @@ class CreateConceptForm(CreateObjectForm):
|
|||
defaultTitle = u'Create Concept, Type = '
|
||||
form_action = 'create_concept'
|
||||
|
||||
@Lazy
|
||||
def defaultTypeToken(self):
|
||||
return None
|
||||
|
||||
def getTypesVocabulary(self, include=None):
|
||||
types = []
|
||||
if 'subtype' in include:
|
||||
include = list(include)
|
||||
include.remove('subtype')
|
||||
parentType = self.target.conceptType
|
||||
subtypePred = self.conceptManager['issubtype']
|
||||
types = [dict(token=ConceptTypeInfo(t).token, title=t.title)
|
||||
for t in parentType.getChildren([subtypePred])]
|
||||
if include:
|
||||
return util.KeywordVocabulary(types + self.listTypes(include, ('hidden',)))
|
||||
return util.KeywordVocabulary(types)
|
||||
|
||||
@Lazy
|
||||
def dialog_name(self):
|
||||
return self.request.get('dialog', 'createConcept')
|
||||
|
|
Binary file not shown.
|
@ -3,7 +3,7 @@ msgstr ""
|
|||
|
||||
"Project-Id-Version: $Id$\n"
|
||||
"POT-Creation-Date: 2007-05-22 12:00 CET\n"
|
||||
"PO-Revision-Date: 2010-08-22 12:00 CET\n"
|
||||
"PO-Revision-Date: 2011-02-09 12:00 CET\n"
|
||||
"Last-Translator: Helmut Merz <helmutm@cy55.de>\n"
|
||||
"Language-Team: loops developers <helmutm@cy55.de>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -29,6 +29,12 @@ msgstr "Anlegen"
|
|||
msgid "Edit Concept Map"
|
||||
msgstr "Concept Map bearbeiten"
|
||||
|
||||
msgid "Create Concept..."
|
||||
msgstr "Begriff anlegen..."
|
||||
|
||||
msgid "Create a new concept."
|
||||
msgstr "Einen neuen Begriff erzeugen."
|
||||
|
||||
msgid "Create Resource..."
|
||||
msgstr "Ressource anlegen..."
|
||||
|
||||
|
@ -44,6 +50,12 @@ msgstr "Ordner anlegen..."
|
|||
msgid "Create a new folder."
|
||||
msgstr "Einen neuen Ordner anlegen"
|
||||
|
||||
msgid "Edit Concept..."
|
||||
msgstr "Begriff bearbeiten..."
|
||||
|
||||
msgid "Modify concept."
|
||||
msgstr "Begriff ändern."
|
||||
|
||||
msgid "Edit Folder..."
|
||||
msgstr "Ordner bearbeiten..."
|
||||
|
||||
|
@ -134,6 +146,9 @@ msgstr "Adresse bearbeiten..."
|
|||
msgid "Modify address."
|
||||
msgstr "Adresse bearbeiten"
|
||||
|
||||
msgid "Create Concept, Type = "
|
||||
msgstr "Begriff anlegen, Typ = "
|
||||
|
||||
msgid "Create Resource, Type = "
|
||||
msgstr "Ressource anlegen, Typ = "
|
||||
|
||||
|
@ -149,9 +164,6 @@ msgstr "Diese Ressource bearbeiten."
|
|||
msgid "Edit Concept"
|
||||
msgstr "Begriff bearbeiten"
|
||||
|
||||
msgid "Edit Concept..."
|
||||
msgstr "Begriff bearbeiten..."
|
||||
|
||||
msgid "Create Event..."
|
||||
msgstr "Termin anlegen..."
|
||||
|
||||
|
@ -479,6 +491,12 @@ msgstr "Beginn"
|
|||
msgid "End date"
|
||||
msgstr "Ende"
|
||||
|
||||
msgid "Knowledge"
|
||||
msgstr "Wissen"
|
||||
|
||||
msgid "The knowledge elements for this person."
|
||||
msgstr "Die Wissenselemente für diese Person."
|
||||
|
||||
msgid "Create loops Note"
|
||||
msgstr "loops-Notiz anlegen"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<!-- process/workflow management stuff -->
|
||||
|
||||
<zope:adapter factory="loops.organize.process.definition.Process"
|
||||
provides="cybertools.process.interfaces.IProcess"
|
||||
provides="loops.organize.process.interfaces.IProcess"
|
||||
trusted="True" />
|
||||
<zope:class class="loops.organize.process.definition.Process">
|
||||
<require permission="zope.View"
|
||||
|
|
Loading…
Add table
Reference in a new issue