From 58d13f5fbbad5fb8c257920611afca609aa72526 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 18 Dec 2001 04:21:07 +0000 Subject: [PATCH] LDS ordinance places support svn: r632 --- gramps/src/EditPerson.py | 28 +++++++++++++++++++++++++--- gramps/src/GrampsParser.py | 5 ++++- gramps/src/WriteXML.py | 1 + 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index cca9eede8..ad26a87af 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -765,6 +765,8 @@ class EditPerson: date = self.ldsbap_date.get_text() temple = self.ldsbap_temple.entry.get_text() + place = utils.get_place_from_list(self.ldsbapplace) + if const.lds_temple_codes.has_key(temple): temple = const.lds_temple_codes[temple] else: @@ -778,6 +780,8 @@ class EditPerson: d.set(date) if compare_dates(d,ord.getDateObj()) != 0: changed = 1 + elif ord.getPlace() != place: + changed = 1 elif ord.getStatus() != self.bap_stat: changed = 1 elif ord.getTemple() != temple: @@ -785,6 +789,8 @@ class EditPerson: date = self.ldsend_date.get_text() temple = self.ldsend_temple.entry.get_text() + place = utils.get_place_from_list(self.ldsendowplace) + if const.lds_temple_codes.has_key(temple): temple = const.lds_temple_codes[temple] else: @@ -798,6 +804,8 @@ class EditPerson: d.set(date) if compare_dates(d,ord.getDateObj()) != 0: changed = 1 + elif ord.getPlace() != place: + changed = 1 elif ord.getStatus() != self.end_stat: changed = 1 elif ord.getTemple() != temple: @@ -805,6 +813,7 @@ class EditPerson: date = self.ldsseal_date.get_text() temple = self.ldsseal_temple.entry.get_text() + place = utils.get_place_from_list(self.ldssealplace) if const.lds_temple_codes.has_key(temple): temple = const.lds_temple_codes[temple] else: @@ -819,6 +828,8 @@ class EditPerson: d.set(date) if compare_dates(d,ord.getDateObj()) != 0: changed = 1 + elif ord.getPlace() != place: + changed = 1 elif ord.getTemple() != temple: changed = 1 elif ord.getStatus() != self.seal_stat: @@ -1148,7 +1159,8 @@ class EditPerson: else: temple = "" ord = self.person.getLdsBaptism() - update_ord(self.person.setLdsBaptism,ord,date,temple,self.bap_stat) + place = utils.get_place_from_list(self.ldsbapplace) + update_ord(self.person.setLdsBaptism,ord,date,temple,self.bap_stat,place) date = self.ldsend_date.get_text() temple = self.ldsend_temple.entry.get_text() @@ -1157,7 +1169,8 @@ class EditPerson: else: temple = "" ord = self.person.getLdsEndowment() - update_ord(self.person.setLdsEndowment,ord,date,temple,self.end_stat) + place = utils.get_place_from_list(self.ldsendowplace) + update_ord(self.person.setLdsEndowment,ord,date,temple,self.end_stat,place) date = self.ldsseal_date.get_text() temple = self.ldsseal_temple.entry.get_text() @@ -1166,12 +1179,14 @@ class EditPerson: else: temple = "" ord = self.person.getLdsSeal() + place = utils.get_place_from_list(self.ldssealplace) if not ord: if self.ldsfam or date or temple: ord = LdsOrd() ord.setDate(date) ord.setTemple(temple) ord.setFamily(self.ldsfam) + ord.setPlace(place) self.person.setLdsSeal(ord) utils.modified() else: @@ -1180,6 +1195,9 @@ class EditPerson: if compare_dates(d,ord.getDateObj()) != 0: ord.setDateObj(d) utils.modified() + if ord.getPlace() != place: + ord.setPlace(place) + utils.modified() if ord.getTemple() != temple: ord.setTemple(temple) utils.modified() @@ -1292,12 +1310,13 @@ class EditPerson: place = None utils.attach_places(plist,self.ldsendowplace,place) -def update_ord(func,ord,date,temple,stat): +def update_ord(func,ord,date,temple,stat,place): if not ord: if (date or temple): ord = LdsOrd() ord.setDate(date) ord.setTemple(temple) + ord.setPlace(place) func(ord) utils.modified() else: @@ -1309,6 +1328,9 @@ def update_ord(func,ord,date,temple,stat): elif ord.getTemple() != temple: ord.setTemple(temple) utils.modified() + elif ord.getPlace() != place: + ord.setPlace(place) + utils.modified() elif ord.getStatus() != stat: ord.setStatus(stat) utils.modified() diff --git a/gramps/src/GrampsParser.py b/gramps/src/GrampsParser.py index 5c59ded0f..a4feba3ac 100644 --- a/gramps/src/GrampsParser.py +++ b/gramps/src/GrampsParser.py @@ -511,7 +511,10 @@ class GrampsParser: self.placeobj.set_title(u2l(tag)) self.db.addPlace(self.placeobj) self.place_map[u2l(tag)] = self.placeobj - self.event.place = self.placeobj + if self.ord: + self.ord.setPlace(self.placeobj) + else: + self.event.place = self.placeobj def stop_uid(self,tag): self.person.setPafUid(u2l(tag)) diff --git a/gramps/src/WriteXML.py b/gramps/src/WriteXML.py index 36664d057..6fe697ea5 100644 --- a/gramps/src/WriteXML.py +++ b/gramps/src/WriteXML.py @@ -145,6 +145,7 @@ def dump_ordinance(g,name,ord,index=1): write_date(g,dateobj,index+1) if ord.getTemple(): g.write('%s\n' % (sp2,fix(ord.getTemple()))) + write_ref(g,"place",ord.getPlace(),index+1) if ord.getStatus() != 0: g.write('%s\n' % (sp2,ord.getStatus())) if ord.getFamily():