source: publico/ILIntranet/trunk/LigacaoInterurbana.py @ 488

Última Alteração nesse arquivo desde 488 foi 488, incluída por jeanferri, 14 anos atrás

Valor default nulo para o ramal

File size: 6.4 KB
Linha 
1# File: LigacaoInterurbana.py
2#
3# Copyright (c) 2005 by Interlegis
4# Generator: ArchGenXML Version 1.4.0-beta1 devel http://sf.net/projects/archetypes/
5#
6# GNU General Public Licence (GPL)
7#
8# This program is free software; you can redistribute it and/or modify it under
9# the terms of the GNU General Public License as published by the Free Software
10# Foundation; either version 2 of the License, or (at your option) any later
11# version.
12# This program is distributed in the hope that it will be useful, but WITHOUT
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
15# details.
16# You should have received a copy of the GNU General Public License along with
17# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18# Place, Suite 330, Boston, MA  02111-1307  USA
19#
20__author__  = '''STC Interlegis <admin-stc@interlegis.gov.br>'''
21__docformat__ = 'plaintext'
22
23from AccessControl import ClassSecurityInfo
24from Products.Archetypes.atapi import *
25
26
27
28
29from Products.Archetypes.SQLStorage import *
30# additional imports from tagged value 'import'
31from DateTime import DateTime
32
33from Products.ILIntranet.config import *
34##code-section module-header #fill in your manual code here
35##/code-section module-header
36
37schema=Schema((
38    StringField('id',
39        widget=IdWidget
40        (
41            visible={'view':'hidden','edit':'hidden'},
42            label='Id',
43            label_msgid='ILIntranet_label_id',
44            description='Enter a value for id.',
45            description_msgid='ILIntranet_help_id',
46            i18n_domain='ILIntranet',
47        )
48    ),
49   
50    StringField('title',
51        widget=StringWidget(
52            visible={'view':'hidden','edit':'hidden'},
53            label='Title',
54            label_msgid='ILIntranet_label_title',
55            description='Enter a value for title.',
56            description_msgid='ILIntranet_help_title',
57            i18n_domain='ILIntranet',
58        ),
59        required=0
60    ),
61   
62    DateTimeField('data_ligacao',
63        index="FieldIndex:schema",
64        widget=CalendarWidget(
65            label="Data",
66            description="Data da ligacao.",
67            label_msgid='ILIntranet_label_data_ligacao',
68            description_msgid='ILIntranet_help_data_ligacao',
69            i18n_domain='ILIntranet',
70        ),
71        required=1,
72        default_method=DateTime
73    ),
74   
75    IntegerField('ramal',
76        default='',
77        index=":schema",
78        widget=IntegerWidget(
79            description="Ramal utilizado para a ligacao.",
80            size=4,
81            maxlength=4,
82            label='Ramal',
83            label_msgid='ILIntranet_label_ramal',
84            description_msgid='ILIntranet_help_ramal',
85            i18n_domain='ILIntranet',
86        ),
87        required=1,
88        validators=('isInt',)
89    ),
90   
91    StringField('telefone',
92        index=":schema",
93        widget=StringWidget(
94            description="Numero do telefone discado.",
95            size=15,
96            maxlength=15,
97            label='Telefone',
98            label_msgid='ILIntranet_label_telefone',
99            description_msgid='ILIntranet_help_telefone',
100            i18n_domain='ILIntranet',
101        ),
102        required=1
103    ),
104   
105    TextField('contato',
106        index=":schema",
107        widget=TextAreaWidget(
108            description="Dados da pessoa e/ou organizacao contactado.",
109            rows=5,
110            label='Contato',
111            label_msgid='ILIntranet_label_contato',
112            description_msgid='ILIntranet_help_contato',
113            i18n_domain='ILIntranet',
114        ),
115        required=1
116    ),
117   
118    TextField('assunto',
119        index="TextIndexNG|TextField:schema",
120        widget=TextAreaWidget(
121            description="Assunto tratado na ligacao.",
122            rows=5,
123            label='Assunto',
124            label_msgid='ILIntranet_label_assunto',
125            description_msgid='ILIntranet_help_assunto',
126            i18n_domain='ILIntranet',
127        ),
128        required=1
129    ),
130   
131    StringField('autorizacao',
132        index=":schema",
133        widget=StringWidget(
134            description="Nome da pessoa que autorizou a ligacao.",
135            label="Autorizado por",
136            maxlength=40,
137            label_msgid='ILIntranet_label_autorizacao',
138            description_msgid='ILIntranet_help_autorizacao',
139            i18n_domain='ILIntranet',
140        ),
141        required=1
142    ),
143   
144    StringField('setor',
145        index=":schema",
146        widget=SelectionWidget(
147            description="Diretoria ou servico onde esta lotado.",
148            rows=6,
149            label='Setor',
150            label_msgid='ILIntranet_label_setor',
151            description_msgid='ILIntranet_help_setor',
152            i18n_domain='ILIntranet',
153        ),
154        required=1,
155        vocabulary=['SINTER','GABINT','SEINPO','SSASTE','GBSAST','SEPLAP','SEACLE','SSADM','GBSSAD','SEADAD','SEFADM','SSFORM','GBFORM','SEATID','SSCAP','GBSCAP','SEPTED']
156    ),
157   
158),
159)
160
161
162##code-section after-schema #fill in your manual code here
163##/code-section after-schema
164
165class LigacaoInterurbana(BaseContent):
166    security = ClassSecurityInfo()
167    __implements__ = (getattr(BaseContent,'__implements__',()),)
168
169
170    # This name appears in the 'add' box
171    archetype_name             = 'Ligacao Interurbana'
172
173    meta_type                  = 'LigacaoInterurbana'
174    portal_type                = 'LigacaoInterurbana'
175    allowed_content_types      = []
176    filter_content_types       = 0
177    global_allow               = 0
178    allow_discussion           = 0
179    content_icon               = 'ligacao_interurbana_icon.gif'
180    immediate_view             = 'base_view'
181    default_view               = 'base_view'
182    typeDescription            = "Ligacao Interurbana"
183    typeDescMsgId              = 'description_edit_ligacaointerurbana'
184
185    schema = BaseSchema + \
186             schema
187
188    ##code-section class-header #fill in your manual code here
189    ##/code-section class-header
190
191
192    #Methods
193
194    security.declarePublic('Title')
195    def Title(self):
196        """
197        Retorna o id do owner e o telefone discado como titulo.
198        """
199       
200        dono = str(self.getOwner())
201        return dono+': '+self.getTelefone()
202
203
204
205registerType(LigacaoInterurbana,PROJECTNAME)
206# end of class LigacaoInterurbana
207
208##code-section module-footer #fill in your manual code here
209##/code-section module-footer
210
211
212
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.