# -*- coding: utf-8 # Copyright 2007 by Vahur Rebas from Products.Archetypes.public import BaseSchema, Schema from Products.Archetypes.public import StringField, LinesField, FileField, TextField from Products.Archetypes.public import LinesWidget, TextAreaWidget, RichWidget, StringWidget, FileWidget from Products.Archetypes.public import BaseContent, registerType from Globals import InitializeClass from Products.CMFCore.utils import getToolByName from Common import CommonMix as Common from AccessControl import ClassSecurityInfo, Unauthorized from config import PROJECT_NAME, TASK_TYPES schema = BaseSchema + Schema(( TextField('body', accessor='getBody', default_content_type = 'text/html', default_output_type = 'text/html', allowable_content_types = ('text/html',), widget = RichWidget( label = 'Body', label_msgid='label_qcl_body', description = 'You can describe your QCL here.', description_msgid='desc_qcl_body', i18n_domain="eportfolio", rows = 15, ), ), FileField('file', widget = FileWidget( descriptio = '', label = 'File', i18n_domain = 'plone', ), ), )) class QCL(BaseContent, Common): """ Qualifications, Certificates, Licenses """ meta_type = "QCL" archetype_name = "QCL" global_allow = 1 security = ClassSecurityInfo() schema = schema actions = ( { 'id':'view', 'name':'View', 'action':'string:${object_url}/base_view', 'permissions': ('View',), }, { 'id':'edit', 'name':'Edit', 'action':'string:${object_url}/base_edit', 'permissions': ('Modify portal content',), }, { 'id':'metadata', 'name':'Properties', 'action':'string:${object_url}/base_metadata', 'permissions': ('Manage Portal',), }, { 'id':'delete', 'name':'Delete', 'action':'string:${object_url}/delete_confirmation', 'permissions': ('Modify portal content',), }, { 'id':'competencies', 'name':'Associate with competency', 'action':'string:${object_url}/add_reference_to_competency?uid=${object/UID}', 'permissions': ('Modify portal content',), }, ) def showEditableBorder(self, **args): return 0 registerType(QCL, PROJECT_NAME)