Esempio n. 1
0
 def get_task_type_label(self, language=None):
     # XXX: vocabulary is a contextsourcebinder, we cannot move it to
     # globalindex.Task for now.
     if not self.task_type:
         return ''
     if language:
         return util.get_task_type_title(self.task_type, language)
     else:
         vocabulary = util.getTaskTypeVocabulary(self)
         term = vocabulary.getTerm(self.task_type)
         return term.title
Esempio n. 2
0
 def get_task_type_label(self, language=None):
     # XXX: vocabulary is a contextsourcebinder, we cannot move it to
     # globalindex.Task for now.
     if not self.task_type:
         return ''
     if language:
         return util.get_task_type_title(self.task_type, language)
     else:
         vocabulary = util.getTaskTypeVocabulary(self)
         term = vocabulary.getTerm(self.task_type)
         return term.title
Esempio n. 3
0
def task_type_helper(value):
    """XLS Reporter helper method which returns the translated
    value stored in the vdex files"""

    if value == 'forwarding_task_type':
        return _(u'forwarding_task_type', default=u'Forwarding')

    voc = getTaskTypeVocabulary(getSite())
    try:
        term = voc.getTerm(value)
    except LookupError:
        return value
    else:
        return term.title
Esempio n. 4
0
def task_type_helper(value):
    """XLS Reporter helper method which returns the translated
    value stored in the vdex files"""

    if value == 'forwarding_task_type':
        return _(u'forwarding_task_type', default=u'Forwarding')

    voc = getTaskTypeVocabulary(getSite())
    try:
        term = voc.getTerm(value)
    except LookupError:
        return value
    else:
        return term.title
Esempio n. 5
0
def task_type_helper(item, value):
    """Translate the task type with the vdex vocabulary, which provides
    its own translations stored in the vdex files.
    """
    portal = getSite()
    if value == "forwarding_task_type":
        return portal.translate(_(u"forwarding_task_type", default=u"Forwarding"))

    voc = getTaskTypeVocabulary(portal)
    try:
        term = voc.getTerm(value)
    except LookupError:
        return value
    else:
        return term.title
Esempio n. 6
0
def task_type_helper(item, value):
    """Translate the task type with the vdex vocabulary, which provides
    its own translations stored in the vdex files.
    """
    portal = getSite()
    if value == 'forwarding_task_type':
        return portal.translate(
            _(u'forwarding_task_type', default=u'Forwarding'))

    voc = getTaskTypeVocabulary(portal)
    try:
        term = voc.getTerm(value)
    except LookupError:
        return value
    else:
        return term.title
Esempio n. 7
0
def get_translated_types(context, request):
    values = {}
    for key, terms in getTaskTypeVocabulary(context).by_value.items():
        values[key] = terms.title.lower()

    return values
Esempio n. 8
0
def get_translated_types(context, request):
    values = {}
    for key, terms in getTaskTypeVocabulary(context).by_value.items():
        values[key] = terms.title.lower()

    return values