Пример #1
0
 def _updatePersonSummary(self,index):
     '''
     Slot for updating the person information into the tree widget based on the user-selected value
     '''
     #Get the id from the model then the value of the ID model index
     row = index.row()
     idIndex = self.personStandardModel.index(row, 0)
     personId,ok = idIndex.data().toInt()  
     
     #Get person info
     person = Person()
     p = person.queryObject().filter(Person.id == personId).first()
     if p:   
         self.selPerson = p
                  
         personInfoMapping = self._mapPersonAttributes(p)
         personTreeLoader = TreeSummaryLoader(self.tvPersonInfo)
         personTreeLoader.addCollection(personInfoMapping, QApplication.translate("newSTRWiz","Occupant Information"), 
                                        ":/plugins/stdm/images/icons/user.png")
         personTreeLoader.display()
Пример #2
0
 def _updatePersonSummary(self,index):
     '''
     Slot for updating the person information into the tree widget based on the user-selected value
     '''
     Person=self.mapping.tableMapping('party')
     person=Person()
     #Get the id from the model then the value of the ID model index
     index =self.cboFilterPattern.currentIndex()
     personId = self.cboFilterPattern.itemData(index)
     #QMessageBox.information(None,'index',str(data))
     # personId = pData
     if personId is not None:
     #Get person info
         p = person.queryObject().filter(Person.id == str(personId)).first()
         if p:
             self.selPerson = p
             personInfoMapping = self._mapPersonAttributes(p)
             personTreeLoader = TreeSummaryLoader(self.tvPersonInfo)
             personTreeLoader.addCollection(personInfoMapping, QApplication.translate("newSTRWiz","Occupant Information"),
                                            ":/plugins/stdm/images/icons/user.png")
             personTreeLoader.display()
Пример #3
0
 def _updatePropertySummary(self,propid):
     '''
     Update the summary information for the selected property
     '''       
     propty = Property()
     prop = propty.queryObject().filter(Property.PropertyID == str(propid)).first()
     
     if prop:
         propMapping = self._mapPropertyAttributes(prop)
         
         #Load information in the tree view
         propertyTreeLoader = TreeSummaryLoader(self.tvPropInfo)
         propertyTreeLoader.addCollection(propMapping, QApplication.translate("newSTRWiz","Property Information"), 
                                          ":/plugins/stdm/images/icons/property.png")       
         propertyTreeLoader.display()  
         
         self.selProperty = prop
         
         #Show property in OpenLayers
         if self.gpOpenLayers.isChecked():
             if self.olLoaded:
                 self.overlayProperty()                      
Пример #4
0
 def _updatePropertySummary(self,propid):
     '''
     Update the summary information for the selected property
     '''       
     propty=Table('spatial_unit',Base.metadata,autoload=True,autoload_with=STDMDb.instance().engine)
     session=STDMDb.instance().session
     prop =session.query(propty).filter(propty.c.spatial_unit_id == str(propid)).first()
     if prop:
         propMapping = self._mapPropertyAttributes(prop)
         
         #Load information in the tree view
         propertyTreeLoader = TreeSummaryLoader(self.tvPropInfo)
         propertyTreeLoader.addCollection(propMapping, QApplication.translate("newSTRWiz","Property Information"), 
                                          ":/plugins/stdm/images/icons/property.png")       
         propertyTreeLoader.display()  
         
         self.selProperty = prop
         
         #Show property in OpenLayers
         if self.gpOpenLayers.isChecked():
             if self.olLoaded:
                 self.overlayProperty()                      
Пример #5
0
 def buildSummary(self):
     '''
     Display summary information.
     '''
     personMapping = self._mapPersonAttributes(self.selPerson)
     propertyMapping = self._mapPropertyAttributes(self.selProperty)
     STRMapping = self._mapSTRTypeSelection()
     
     #Load summary information in the tree view
     summaryTreeLoader = TreeSummaryLoader(self.twSTRSummary)
     summaryTreeLoader.addCollection(personMapping, QApplication.translate("newSTRWiz","Occupant Information"), 
                                          ":/plugins/stdm/images/icons/user.png")    
     summaryTreeLoader.addCollection(propertyMapping, QApplication.translate("newSTRWiz","Property Information"), 
                                          ":/plugins/stdm/images/icons/property.png")
     summaryTreeLoader.addCollection(STRMapping, QApplication.translate("newSTRWiz","Social Tenure Relationship Information"), 
                                          ":/plugins/stdm/images/icons/social_tenure.png")    
     
     #Check if enjoyment right is specified
     heir = QApplication.translate("Lookup","Heir")
     selIndex= self.cboSTRType.currentIndex()        
     #Get index of heir item
     heirIndex = self.cboSTRType.findText(heir)   
     if selIndex == heirIndex:
         if self.enjoymentRight != None:
             enjoyRightMapping = self._mapEnjoyRightSelection(self.enjoymentRight)
             summaryTreeLoader.addCollection(enjoyRightMapping, QApplication.translate("newSTRWiz","Right of Enjoyment Information"), 
                                          ":/plugins/stdm/images/icons/inherit.png") 
             
     #Check the source documents based on the type of property
     if self.rbPrivateProperty.isChecked():
         srcDocMapping = self.sourceDocManager.attributeMapping()
         summaryTreeLoader.addCollection(srcDocMapping, QApplication.translate("newSTRWiz","Source Documents"), 
                                          ":/plugins/stdm/images/icons/attachment.png") 
         #Tax information
         if self.gpPrivateTaxInfo.isChecked():
             privatePropTaxMapping = self._mapPrivatePropertyTax()
             taxDocMapping = self.privateTaxDocManager.attributeMapping()
             privatePropTaxMapping.update(taxDocMapping)
             summaryTreeLoader.addCollection(privatePropTaxMapping, QApplication.translate("newSTRWiz","Tax Information"), 
                                          ":/plugins/stdm/images/icons/receipt.png")
     elif self.rbStateland.isChecked():
         #Tax information only
         statePropTaxMapping = self._mapStatePropertyTax()
         taxDocMapping = self.stateTaxDocManager.attributeMapping()
         statePropTaxMapping.update(taxDocMapping)
         summaryTreeLoader.addCollection(statePropTaxMapping, QApplication.translate("newSTRWiz","Tax Information"), 
                                          ":/plugins/stdm/images/icons/receipt.png")
         
     #Map conflict
     if self.cboConflictOccurrence.currentIndex() != 0:
         conflictMapping = self._mapConflict(self.conflict)
         summaryTreeLoader.addCollection(conflictMapping, QApplication.translate("newSTRWiz","Conflict Information"), 
                                          ":/plugins/stdm/images/icons/conflict.png")
     
     summaryTreeLoader.display()  
Пример #6
0
    def buildSummary(self):
        '''
        Display summary information.
        '''
        personMapping = self._mapPersonAttributes(self.selPerson)
        propertyMapping = self._mapPropertyAttributes(self.selProperty)
        STRMapping = self._mapSTRTypeSelection()
        
        #Load summary information in the tree view
        summaryTreeLoader = TreeSummaryLoader(self.twSTRSummary)
        summaryTreeLoader.addCollection(personMapping, QApplication.translate("newSTRWiz","Party Information"),
                                             ":/plugins/stdm/images/icons/user.png")    
        
        summaryTreeLoader.addCollection(propertyMapping, QApplication.translate("newSTRWiz","Spatial Unit Information"),
                                             ":/plugins/stdm/images/icons/property.png")
                                             
        summaryTreeLoader.addCollection(STRMapping, QApplication.translate("newSTRWiz","Social Tenure Relationship Information"), 
                                             ":/plugins/stdm/images/icons/social_tenure.png")    

        #Check the source documents based on the type of property
        srcDocMapping = self.sourceDocManager.attributeMapping()

        summaryTreeLoader.addCollection(srcDocMapping, QApplication.translate("newSTRWiz","Source Documents"), 
                                             ":/plugins/stdm/images/icons/attachment.png") 
      
        summaryTreeLoader.display()