예제 #1
0
    def processForm(self, REQUEST, RESPONSE):
        # Pro Fall kann es nur 1 Jugendhilfestatistik geben.
##         jghiddel = self.form.get('jghiddel')
        fallid = self.form.get('fallid')
        id = self.form.get('jghid')
##         typ = self.form.get('typ')
##         if jghiddel and typ == 'jhg07' and fallid:
##             # neue Statistik auf alte 'upgraden'
##             upgrade_jgh(jghiddel, old2new=False)
##             fall = Fall(fallid)
##             # diese Fall ist noch unzureichend initialisiert
##             jghstat = fall['jgh']
        if fallid:
            fall = Fall(fallid)
            jghstat = fall['jgh']
            if jghstat:
                # Von menu aus kann ein update der Bundesstatistik angefordert
                # werden, ohne zu spezifizieren ob alte oder neue.
                # Das wird hier abgefangen.
                if isinstance(jghstat, Jugendhilfestatistik2007):
                    return self.ebkus.dispatch('updjgh07', REQUEST, RESPONSE)
            else:
                raise EE('Noch keine Bundesstatistik für den Fall vorhanden.')
        elif id:
            jghstat = Jugendhilfestatistik(id)
            fallid = jghstat.get('fall_id')
            if fallid:
                fall = Fall(int(fallid))
                akte = fall['akte']
        else:
            self.last_error_message = "Keine Bundesstatistik-ID erhalten"
            return self.EBKuSError(REQUEST, RESPONSE)
            
        geschwisterfaelle = get_codes('gfall')
        stellenzeichen = get_codes('stzei')
        bezirke = get_codes('rbz')
        kreise = get_codes('kr')
        gemeinde = get_codes('gm')
        gemeindeteile = get_codes('gmt')
        traeger = get_codes('traeg')
        beendigungsgruende = get_codes('bgr')
        geschlechter = get_codes('gs')
        altersgruppen = get_codes('ag')
        lebtbeipersonen = get_codes('fs')
        staatsangehoerigkeiten = get_codes('hke')
        erstekontaktaufnahmel = get_codes('zm')
        berschwerpunkte = get_codes('schw')
        ansaetzekind = get_codes('fbe0')
        ansaetzeeltern = get_codes('fbe1')
        ansaetzefamilie = get_codes('fbe2')
        ansaetzeumfeld = get_codes('fbe3')
        geschwister = get_codes('gsa')
        hidden ={'file': 'updjgh'}
        hiddenid ={'name': 'jghid', 'value': '%(id)d' %jghstat }
        hiddenid2 ={'name': 'stz', 'value': self.stelle['id']}
        
        res = []
        res.append(head_normal_t % 'Alte Bundesstatistik bearbeiten (bis 2006)')
        res.append(jghstatedit_t % ({'id':fallid}))
        res.append(jghstateditfn_t  %({'fall_fn' : jghstat['fall_fn']}))
        res.append(jghstateditgemeinde_t %(Code(cc('gm','000'))['id']))
        res.append(jghstateditgemeindeteil_t %(Code(cc('gmt','000'))['id']))
        res.append(formhiddenvalues_t % hidden)
        res.append(formhiddennamevalues_t % hiddenid)
        res.append(formhiddennamevalues_t % hiddenid2)
        res.append(jghstateditmit_t %{'mit_id': jghstat['mit_id'],'mit_name' : jghstat['mit_id__ben']})
        res.append(jghstateditbeginn_t  % jghstat)
        mksel(res, codeliste_t, bezirke, 'id', jghstat['rbz'])
        res.append(jghstateditende_t % jghstat )
        res.append(jghstateditkreis_t)
        mksel(res, codeliste_t, kreise, 'id', jghstat['kr'])
        if config.BERLINER_VERSION:
            res.append(jghstateditwbz_berlin_t)
            res.append(jghstateditgfall_berlin_t)
        else:
            res.append(jghstateditwbz_t)
            res.append(jghstateditgfall_t)
        mksel(res,codeliste_t, geschwisterfaelle, 'id', jghstat['gfall'])
        res.append(jghstatedittraeger_t)
        mksel(res, codeliste_t, traeger, 'id', jghstat['traeg'])
        res.append(jghstateditkontakt_t)
        mksel(res, codeliste_t, erstekontaktaufnahmel, 'id', jghstat['zm'])
        res.append(jghstateditendegrund_t)
        mksel(res, codeliste_t, beendigungsgruende, 'id', jghstat['bgr'])
        res.append(jghstateditanlass_t)
        d = Code(cc('ba0', '1') )
        if jghstat['ba0'] == cc('ba0', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        d = Code(cc('ba1', '1') )
        if jghstat['ba1'] == cc('ba1', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        d = Code(cc('ba2', '1') )
        if jghstat['ba2'] == cc('ba2', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        d = Code(cc('ba3', '1') )
        if jghstat['ba3'] == cc('ba3', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        d = Code(cc('ba4', '1') )
        if jghstat['ba4'] == cc('ba4', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        d = Code(cc('ba5', '1') )
        if jghstat['ba5'] == cc('ba5', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        d = Code(cc('ba6', '1') )
        if jghstat['ba6'] == cc('ba6', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        d = Code(cc('ba7', '1') )
        if jghstat['ba7'] == cc('ba7', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        d = Code(cc('ba8', '1') )
        if jghstat['ba8'] == cc('ba8', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        d = Code(cc('ba9', '1') )
        if jghstat['ba9'] == cc('ba9', '1'):
            d['sel'] = 'selected'
        else:
            d['sel'] = ''
        res.append(codeliste_t % d)
        res.append(jgstateditschwerpunkt_t)
        mksel(res, codeliste_t, berschwerpunkte, 'id', jghstat['schw'])
        res.append(jghstateditlebtbei_t)
        mksel(res, codeliste_t, lebtbeipersonen, 'id', jghstat['fs'])
        res.append(jghstateditgeschlecht_t)
        mksel(res, codeliste_t, geschlechter, 'id', jghstat['gs'])
        res.append(jghstateditalter_t)
        mksel(res, codeliste_t, altersgruppen, 'id', jghstat['ag'] )
        if jghstat['gsu'] == cc('gsu', '1'):
            check = 'checked'
        else:
            check = ''
        if jghstat['gsa'] == None:
            gsa = ''
        else:
            gsa = jghstat['gsa']
            # msgsystems 02.07.2002
        res.append(jghstatedit_t2a %gsa)
        #mksel(res, codeliste_t, geschwister, 'id', gsa)
        res.append(jghstatedit_t2b % ({'gsa': gsa ,'gsu': cc('gsu', '1'), 'check': check }))
        mksel(res, codeliste_t, staatsangehoerigkeiten, 'id', jghstat['hke'])
        res.append(jghstatedit_t3 % ({'gsa': gsa ,'gsu': cc('gsu', '1'), 'check': check }))
        #####
        if jghstat['fbe0'] == cc('fbe0', '1'):
            res.append(radiocheck_t % Code(cc('fbe0', '1')) )
        else:
            res.append(radio_t % Code(cc('fbe0', '1')) )
        res.append(jghstatedit_t4)
        if jghstat['fbe0'] == cc('fbe0', '2'):
            res.append(radiocheck_t % Code(cc('fbe0', '2')) )
        else:
            res.append(radio_t % Code(cc('fbe0', '2')) )
        res.append(jghstatedit_t5)
        if jghstat['fbe1'] == cc('fbe1', '1'):
            res.append(radiocheck_t % Code(cc('fbe1', '1')) )
        else:
            res.append(radio_t % Code(cc('fbe1', '1')) )
        res.append(jghstatedit_t6)
        if jghstat['fbe1'] == cc('fbe1', '2'):
            res.append(radiocheck_t % Code(cc('fbe1', '2')) )
        else:
            res.append(radio_t % Code(cc('fbe1', '2')) )
        res.append(jghstatedit_t7)
        if jghstat['fbe2'] == cc('fbe2', '1'):
            res.append(jghansaetzefamiliecheck_t % Code(cc('fbe2', '1')) )
        else:
            res.append(jghansaetzefamilie_t % Code(cc('fbe2', '1')) )
        res.append(jghstatedit_t8)
        if jghstat['fbe3'] == cc('fbe3', '1'):
            res.append(jghansaetzeumfeldcheck_t % Code(cc('fbe3', '1')) )
        else:
            res.append(jghansaetzeumfeld_t % Code(cc('fbe3', '1')) )
        res.append(jghstatedit_t9)
        return string.join(res, '')
예제 #2
0
 def processForm(self, REQUEST, RESPONSE):
     mitarbeiterliste = self.getMitarbeiterliste()
     user = self.user
     fallid = self.form.get('fallid')
     id = self.form.get('jghid')
     
     # Pro Fall kann es nur 1 Jugendhilfestatistik geben.
     if fallid:
         fall = Fall(int(fallid))
         akte = fall['akte']
         jghstatl = fall['jgh_statistiken']
         letzter_fall = akte['letzter_fall']
         if not jghstatl:
             meldung = {'titel':'Hinweis',
                        'legende':'Hinweis',
                        'zeile1':'Es ist noch keine Bundesstatistik für den Fall vorhanden!',
                        'zeile2':''}
             return meldung_t % meldung
         jghstat = jghstatl[0]
     elif id:
         jghstat = Jugendhilfestatistik(int(id))
         fallid = jghstat.get('fall_id')
         if fallid:
             fall = Fall(int(fallid))
             akte = fall['akte']
     else:
         self.last_error_message = "Keine Bundesstatistik-ID erhalten"
         return self.EBKuSError(REQUEST, RESPONSE)
         
     geschwisterfaelle = get_codes('gfall')
     stellenzeichen = get_codes('stzei')
     bezirke = get_codes('rbz')
     kreise = get_codes('kr')
     gemeinde = get_codes('gm')
     gemeindeteile = get_codes('gmt')
     if config.BERLINER_VERSION:
         wohnbezirk = get_codes('wohnbez')
     traeger = get_codes('traeg')
     beendigungsgruende = get_codes('bgr')
     geschlechter = get_codes('gs')
     altersgruppen = get_codes('ag')
     lebtbeipersonen = get_codes('fs')
     staatsangehoerigkeiten = get_codes('hke')
     erstekontaktaufnahmel = get_codes('zm')
     berschwerpunkte = get_codes('schw')
     ansaetzekind = get_codes('fbe0')
     ansaetzeeltern = get_codes('fbe1')
     ansaetzefamilie = get_codes('fbe2')
     ansaetzeumfeld = get_codes('fbe3')
     geschwister = get_codes('gsa')
     hidden ={'file': 'updjgh'}
     hiddenid ={'name': 'jghid', 'value': '%(id)d' %jghstat }
     hiddenid2 ={'name': 'stz', 'value': self.stelle['id']}
     
     res = []
     res.append(head_normal_t % 'Bundesstatistik bearbeiten')
     res.append(jghstatedit_t % ({'id':fallid}))
     res.append(jghstateditfn_t  %({'fall_fn' : jghstat['fall_fn']}))
     res.append(jghstateditgemeinde_t %(Code(cc('gm','000'))['id']))
     res.append(jghstateditgemeindeteil_t %(Code(cc('gmt','000'))['id']))
     res.append(formhiddenvalues_t % hidden)
     res.append(formhiddennamevalues_t % hiddenid)
     res.append(formhiddennamevalues_t % hiddenid2)
     res.append(jghstateditmit_t %{'mit_id': jghstat['mit_id'],'mit_name' : jghstat['mit_id__ben']})
     res.append(jghstateditbeginn_t  % jghstat)
     mksel(res, codeliste_t, bezirke, 'id', jghstat['rbz'])
     res.append(jghstateditende_t % jghstat )
     res.append(jghstateditkreis_t)
     mksel(res, codeliste_t, kreise, 'id', jghstat['kr'])
     if config.BERLINER_VERSION:
         res.append(jghstateditwbz_berlin_t)
         mksel(res,codeliste_t,wohnbezirk,'id',jghstat['bezirksnr'])
         res.append(jghstateditgfall_berlin_t)
     else:
         res.append(jghstateditwbz_t)
         res.append(jghstateditgfall_t)
     mksel(res,codeliste_t, geschwisterfaelle, 'id', jghstat['gfall'])
     res.append(jghstatedittraeger_t)
     mksel(res, codeliste_t, traeger, 'id', jghstat['traeg'])
     res.append(jghstateditkontakt_t)
     mksel(res, codeliste_t, erstekontaktaufnahmel, 'id', jghstat['zm'])
     res.append(jghstateditendegrund_t)
     mksel(res, codeliste_t, beendigungsgruende, 'id', jghstat['bgr'])
     res.append(jghstateditanlass_t)
     d = Code(cc('ba0', '1') )
     if jghstat['ba0'] == cc('ba0', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     d = Code(cc('ba1', '1') )
     if jghstat['ba1'] == cc('ba1', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     d = Code(cc('ba2', '1') )
     if jghstat['ba2'] == cc('ba2', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     d = Code(cc('ba3', '1') )
     if jghstat['ba3'] == cc('ba3', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     d = Code(cc('ba4', '1') )
     if jghstat['ba4'] == cc('ba4', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     d = Code(cc('ba5', '1') )
     if jghstat['ba5'] == cc('ba5', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     d = Code(cc('ba6', '1') )
     if jghstat['ba6'] == cc('ba6', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     d = Code(cc('ba7', '1') )
     if jghstat['ba7'] == cc('ba7', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     d = Code(cc('ba8', '1') )
     if jghstat['ba8'] == cc('ba8', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     d = Code(cc('ba9', '1') )
     if jghstat['ba9'] == cc('ba9', '1'):
         d['sel'] = 'selected'
     else:
         d['sel'] = ''
     res.append(codeliste_t % d)
     res.append(jgstateditschwerpunkt_t)
     mksel(res, codeliste_t, berschwerpunkte, 'id', jghstat['schw'])
     res.append(jghstateditlebtbei_t)
     mksel(res, codeliste_t, lebtbeipersonen, 'id', jghstat['fs'])
     res.append(jghstateditgeschlecht_t)
     mksel(res, codeliste_t, geschlechter, 'id', jghstat['gs'])
     res.append(jghstateditalter_t)
     mksel(res, codeliste_t, altersgruppen, 'id', jghstat['ag'] )
     if jghstat['gsu'] == cc('gsu', '1'):
         check = 'checked'
     else:
         check = ''
     if jghstat['gsa'] == None:
         gsa = ''
     else:
         gsa = jghstat['gsa']
         # msgsystems 02.07.2002
     res.append(jghstatedit_t2a %gsa)
     #mksel(res, codeliste_t, geschwister, 'id', gsa)
     res.append(jghstatedit_t2b % ({'gsa': gsa ,'gsu': cc('gsu', '1'), 'check': check }))
     mksel(res, codeliste_t, staatsangehoerigkeiten, 'id', jghstat['hke'])
     res.append(jghstatedit_t3 % ({'gsa': gsa ,'gsu': cc('gsu', '1'), 'check': check }))
     #####
     if jghstat['fbe0'] == cc('fbe0', '1'):
         res.append(radiocheck_t % Code(cc('fbe0', '1')) )
     else:
         res.append(radio_t % Code(cc('fbe0', '1')) )
     res.append(jghstatedit_t4)
     if jghstat['fbe0'] == cc('fbe0', '2'):
         res.append(radiocheck_t % Code(cc('fbe0', '2')) )
     else:
         res.append(radio_t % Code(cc('fbe0', '2')) )
     res.append(jghstatedit_t5)
     if jghstat['fbe1'] == cc('fbe1', '1'):
         res.append(radiocheck_t % Code(cc('fbe1', '1')) )
     else:
         res.append(radio_t % Code(cc('fbe1', '1')) )
     res.append(jghstatedit_t6)
     if jghstat['fbe1'] == cc('fbe1', '2'):
         res.append(radiocheck_t % Code(cc('fbe1', '2')) )
     else:
         res.append(radio_t % Code(cc('fbe1', '2')) )
     res.append(jghstatedit_t7)
     if jghstat['fbe2'] == cc('fbe2', '1'):
         res.append(jghansaetzefamiliecheck_t % Code(cc('fbe2', '1')) )
     else:
         res.append(jghansaetzefamilie_t % Code(cc('fbe2', '1')) )
     res.append(jghstatedit_t8)
     if jghstat['fbe3'] == cc('fbe3', '1'):
         res.append(jghansaetzeumfeldcheck_t % Code(cc('fbe3', '1')) )
     else:
         res.append(jghansaetzeumfeld_t % Code(cc('fbe3', '1')) )
     res.append(jghstatedit_t9)
     return string.join(res, '')