Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / widgets / edit_event.py @ a2744508

History | View | Annotate | Download (2.24 KB)

1
# -*- coding: utf-8 -*-
2
# vim:set expandtab tabstop=4 shiftwidth=4:
3
################################################################################
4
#
5
# Copyright (C) 2007-2012 CS-SI
6
#
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License version 2 as
9
# published by the Free Software Foundation.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
################################################################################
20

    
21
"""Le formulaire d'édition d'un événement."""
22

    
23
from pylons.i18n import lazy_ugettext as l_
24
from tw.api import WidgetsList
25
from tw.forms import TableForm, SingleSelectField, TextField, \
26
                        HiddenField, Label
27

    
28
__all__ = (
29
    'edit_event_status_options',
30
    'EditEventForm',
31
)
32

    
33
edit_event_status_options = [
34
    ['NoChange', l_('No change')],
35
    ['None', l_('Change to None')],
36
    ['Acknowledged', l_('Change to Acknowledged')],
37
    ['AAClosed', l_('Change to Closed')],
38
    ['Forced', l_('Force to Closed')],
39
]
40

    
41
class EditEventForm(TableForm):
42
    """
43
    Formulaire d'édition d'événement
44

45
    Affiche une zone de texte pour le Trouble Ticket et une
46
    liste déroulante pour le nouveau status
47

48
    Ce widget permet de répondre aux exigences suivantes :
49
        - VIGILO_EXIG_VIGILO_BAC_0060
50
        - VIGILO_EXIG_VIGILO_BAC_0110
51
    """
52

    
53
    class fields(WidgetsList):
54
        """
55
        Champs du formulaire d'édition des événements.
56
        """
57
        id = HiddenField('id')
58
        trouble_ticket = TextField(label_text=l_('Trouble Ticket'))
59
        warning = Label(suppress_label=True, text=l_('Warning: changing '
60
                        'the ticket will affect all selected events.'))
61
        ack = SingleSelectField(label_text=l_('Acknowledgement Status'),
62
                                options=edit_event_status_options)
63
        last_modification = HiddenField()