-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5352259
commit 58806bb
Showing
8 changed files
with
379 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
from iosanita.contenttypes.interfaces.documento import IDocumento | ||
from plone.dexterity.content import Container | ||
from zope.interface import implementer | ||
|
||
|
||
@implementer(IDocumento) | ||
class Documento(Container): | ||
""" """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from collective.volto.blocksfield.field import BlocksField | ||
from iosanita.contenttypes import _ | ||
from iosanita.contenttypes.interfaces import IIosanitaContenttypes | ||
from plone.app.z3cform.widget import RelatedItemsFieldWidget | ||
from plone.autoform import directives as form | ||
from plone.supermodel import model | ||
from z3c.relationfield.schema import RelationChoice | ||
from z3c.relationfield.schema import RelationList | ||
from zope import schema | ||
|
||
|
||
class IDocumento(model.Schema, IIosanitaContenttypes): | ||
"""Marker interface for content type""" | ||
|
||
protocollo = schema.TextLine( | ||
title=_( | ||
"protocollo_documento_label", | ||
default="Numero di protocollo", | ||
), | ||
description=_( | ||
"protocollo_documento_help", | ||
default="Il numero di protocollo del documento.", | ||
), | ||
max_length=255, | ||
required=False, | ||
) | ||
|
||
data_protocollo = schema.Date( | ||
title=_("data_protocollo", default="Data del protocollo"), | ||
required=False, | ||
) | ||
|
||
descrizione_estesa = BlocksField( | ||
title=_("descrizione_estesa_label", default="Cos'è"), | ||
required=True, | ||
description=_( | ||
"descrizione_estesa_documento_help", | ||
default="Descrizione estesa e completa del Documento.", | ||
), | ||
) | ||
|
||
# formati_alternativi = BlocksField( | ||
# title=_("formati_alternativi_label", default="Formati disponibili"), | ||
# description=_( | ||
# "formati_alternativi_help", | ||
# default="Lista dei formati in cui è disponibile il documento", | ||
# ), | ||
# required=True, | ||
# ) | ||
|
||
servizio_procedura_riferimento = RelationList( | ||
title=_( | ||
"servizio_procedura_riferimento_label", | ||
default="Servizio di riferimento / Procedura di riferimento", | ||
), | ||
description=_( | ||
"servizio_procedura_riferimento_help", | ||
default="Indicazione del servizio, la prestazione o la procedura (Come fare per) a cui fa riferimento il documento.", | ||
), | ||
default=[], | ||
value_type=RelationChoice(vocabulary="plone.app.vocabularies.Catalog"), | ||
required=False, | ||
missing_value=(), | ||
) | ||
|
||
uo_correlata = RelationList( | ||
title=_("uo_correlata_documento_label", default="Responsabile del documento"), | ||
default=[], | ||
value_type=RelationChoice(vocabulary="plone.app.vocabularies.Catalog"), | ||
required=True, | ||
missing_value=(), | ||
) | ||
|
||
autori = RelationList( | ||
title=_( | ||
"autori_label", | ||
default="Autore/i", | ||
), | ||
description=_( | ||
"autori_help", | ||
default="Seleziona una lista di autori che hanno pubblicato " | ||
"il documento.", | ||
), | ||
value_type=RelationChoice(vocabulary="plone.app.vocabularies.Catalog"), | ||
required=False, | ||
default=[], | ||
) | ||
|
||
# widgets | ||
form.widget( | ||
"uo_correlata", | ||
RelatedItemsFieldWidget, | ||
vocabulary="plone.app.vocabularies.Catalog", | ||
pattern_options={ | ||
"maximumSelectionSize": 1, | ||
"selectableTypes": ["UnitaOrganizzativa"], | ||
}, | ||
) | ||
form.widget( | ||
"autori", | ||
RelatedItemsFieldWidget, | ||
vocabulary="plone.app.vocabularies.Catalog", | ||
pattern_options={ | ||
"selectableTypes": ["Persona"], | ||
}, | ||
) | ||
form.widget( | ||
"servizio_procedura_riferimento", | ||
RelatedItemsFieldWidget, | ||
vocabulary="plone.app.vocabularies.Catalog", | ||
pattern_options={ | ||
"selectableTypes": ["ComeFarePer", "Servizio"], | ||
}, | ||
) | ||
|
||
model.fieldset( | ||
"cosa_e", | ||
label=_("cosa_e_fieldset", default="Cos'è"), | ||
fields=["descrizione_estesa"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
src/iosanita/contenttypes/profiles/default/types/Documento.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
meta_type="Dexterity FTI" | ||
name="Documento" | ||
i18n:domain="iosanita.contenttypes" | ||
> | ||
|
||
<!-- Basic properties --> | ||
<property name="title" | ||
i18n:translate="" | ||
>Documento</property> | ||
<property name="description" | ||
i18n:translate="" | ||
/> | ||
|
||
<property name="allow_discussion">False</property> | ||
<property name="factory">Documento</property> | ||
<property name="icon_expr" /> | ||
<property name="link_target" /> | ||
|
||
<!-- Hierarchy control --> | ||
<property name="global_allow">True</property> | ||
<property name="filter_content_types">True</property> | ||
<property name="allowed_content_types" | ||
purge="False" | ||
> | ||
<element value="Document" /> | ||
|
||
</property> | ||
<!-- Schema, class and security --> | ||
<property name="add_permission">iosanita.contenttypes.AddDocumento</property> | ||
<property name="klass">iosanita.contenttypes.content.documento.Documento</property> | ||
<property name="model_file" /> | ||
<property name="model_source" /> | ||
<property name="schema">iosanita.contenttypes.interfaces.documento.IDocumento</property> | ||
|
||
<!-- Enabled behaviors --> | ||
<property name="behaviors" | ||
purge="false" | ||
> | ||
<element value="plone.namefromtitle" /> | ||
<element value="plone.allowdiscussion" /> | ||
<element value="plone.excludefromnavigation" /> | ||
<element value="plone.shortname" /> | ||
<element value="plone.ownership" /> | ||
<element value="plone.publication" /> | ||
<element value="plone.categorization" /> | ||
<element value="plone.basic" /> | ||
<element value="plone.locking" /> | ||
<element value="plone.constraintypes" /> | ||
<element value="plone.leadimage" /> | ||
<element value="volto.preview_image" /> | ||
<element value="plone.relateditems" /> | ||
<element value="plone.textindexer" /> | ||
<element value="plone.translatable" /> | ||
<element value="kitconcept.seo" /> | ||
<element value="plone.versioning" /> | ||
<element value="iosanita.contenttypes.behavior.a_chi_si_rivolge" /> | ||
<element value="collective.taxonomy.generated.a_chi_si_rivolge_tassonomia" /> | ||
<element value="collective.taxonomy.generated.parliamo_di" /> | ||
</property> | ||
|
||
<!-- View information --> | ||
<property name="add_view_expr">string:${folder_url}/++add++Documento</property> | ||
<property name="default_view">view</property> | ||
<property name="default_view_fallback">False</property> | ||
<property name="immediate_view">view</property> | ||
<property name="view_methods"> | ||
<element value="view" /> | ||
</property> | ||
|
||
<!-- Method aliases --> | ||
<alias from="(Default)" | ||
to="(dynamic view)" | ||
/> | ||
<alias from="edit" | ||
to="@@edit" | ||
/> | ||
<alias from="sharing" | ||
to="@@sharing" | ||
/> | ||
<alias from="view" | ||
to="(selected layout)" | ||
/> | ||
|
||
<!-- Actions --> | ||
<action action_id="view" | ||
category="object" | ||
condition_expr="" | ||
title="View" | ||
url_expr="string:${object_url}" | ||
visible="True" | ||
i18n:attributes="title" | ||
> | ||
<permission value="View" /> | ||
</action> | ||
<action action_id="edit" | ||
category="object" | ||
condition_expr="not:object/@@plone_lock_info/is_locked_for_current_user|python:True" | ||
title="Edit" | ||
url_expr="string:${object_url}/edit" | ||
visible="True" | ||
i18n:attributes="title" | ||
> | ||
<permission value="Modify portal content" /> | ||
</action> | ||
|
||
</object> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.