Ejemplo n.º 1
0
    def handle_save(self):
        data, errors = self.extractData()
        if errors:
            self.flash(_(u"An error occured"))
            return FAILURE

        apply_data_event(self.fields, self.getContentData(), data)
        self.flash(_(u"Content updated"))
        self.redirect(self.application_url())
        return SUCCESS
Ejemplo n.º 2
0
    def __call__(self, form):
        data, errors = form.extractData()
        if errors:
            form.submissionError = errors
            return FAILURE

        apply_data_event(form.fields, form.getContentData(), data)
        message(self.successMessage)
        url = str(IURL(form.context, form.request))
        return SuccessMarker('Updated', True, url=url)
Ejemplo n.º 3
0
    def save(self):
        data, errors = self.extractData()
        if errors:
            self.submissionError = errors
            return FAILURE

        apply_data_event(self.fields, self.getContentData(), data)
        message(_(u"Ihre Auswertungsgruppe wurde aktualisiert."))
        url = self.application_url()
        return SuccessMarker('Updated', True, url=url)
Ejemplo n.º 4
0
    def __call__(self, form):
        data, errors = form.extractData()
        if errors:
            form.submissionError = errors
            return FAILURE

        apply_data_event(form.fields, form.getContentData(), data)
        message(_(u"Content updated"))
        url = get_absolute_url(form.context, form.request)
        return SuccessMarker('Updated', True, url=url)
Ejemplo n.º 5
0
    def apply_changes(self):
        data, errors = self.extractData()
        if errors:
            self.errors = errors
            return FAILURE

        website_message(u"Edition successful.")
        apply_data_event(self.fields, self.getContentData(), data)
        raise HTTPFound(get_absolute_url(self.context, self.request))
        return SUCCESS
Ejemplo n.º 6
0
 def handle_edit(self):
     data, errors = self.extractData()
     if errors:
         self.submissionError = errors
         return FAILURE
     for x in ['adresszusatz', 'ort', 'plz', 'nr', 'email', 'strasse', 'telefon']:
         if data[x] == NO_VALUE:
             data[x] = ""
     apply_data_event(self.fields, self.getContentData(), data)
     self.flash(_(u"Content updated"))
     self.redirect(self.url(self.context))
Ejemplo n.º 7
0
    def __call__(self, form):
        self.form=form
        data, errors = form.extractData()
        if errors:
            form.submissionError = errors
            return FAILURE

        apply_data_event(form.fields, form.getContentData(), data)
        message(_(u"Content updated"))
        form.postProcess()
        baseURL = str(IURL(form.context, form.request))
        url=self.newURL(baseURL)
        return SuccessMarker('Updated', True, url=url)
Ejemplo n.º 8
0
 def handle_edit(self):
     data, errors = self.extractData()
     if errors:
         self.submissionError = errors
         return FAILURE
     def getUnternehmen(mnr):
         session = Session()
         return session.query(Unternehmen).get(mnr)
     data['unternehmen'] = [getUnternehmen(x) for x in list(data['unternehmen'])]
     teilnehmer = self.getContentData()
     apply_data_event(self.fields, teilnehmer, data)
     teilnehmer = teilnehmer.getContent()
     self.flash(_(u"Content updated"))
     self.redirect(self.application_url() + '?form.field.id=%s&form.action.suchen=Suchen' %teilnehmer.id)
Ejemplo n.º 9
0
    def handle_save(self):
        data, errors = self.extractData()
        print data
        journal_note = data.pop('note')

        if errors:
            self.flash(_(u'Es ist ein Fehler aufgetreten!'))
            return FAILURE

        if isinstance(self.context, Invoice):
            data.pop('oid')
        print self.getContentData()
        print data
        apply_data_event(self.fields, self.getContentData(), data)

        # journalize
        session = get_session('ukhvoucher')
        if str(self.context.__label__) == "Kontingent":
            aktion = u"Kontingente bearbeitet"
        elif str(self.context.__label__) == "Address":
            aktion = u"Adresse bearbeitet"
        elif str(self.context.__label__) == "Account":
            aktion = u"Benutzer bearbeitet"
        else:
            aktion = str(self.context.__label__)
        entry = JournalEntry(
            date=datetime.now().strftime('%Y-%m-%d'),
            userid=self.request.principal.id,
            action=aktion,
            oid=str(self.context.oid),
            note=journal_note)
        session.add(entry)
        self.flash(_(u'Eintrag in der Historie hinzugefügt.'))

        self.redirect(self.application_url())
        return SUCCESS
Ejemplo n.º 10
0
 def handle_edit(self):
     data, errors = self.extractData()
     apply_data_event(self.fields, self.getContentData(), data)
     self.flash(_(u"Content updated"))
     self.redirect(self.url(self.context))