Conjunto de mudanças 6569 no repositório publico


Ignorar:
Timestamp:
28/06/2012 15:47:03 (9 anos atrás)
Autor:
jeanferri
Mensagem:

Criado o mecanismo para calcular o número de protocolo de cada solicitação

Localização:
Ombudsman/trunk/content
Arquivos:
2 editados

Legenda:

Não Modificado
Adicionado
Removido
  • Ombudsman/trunk/content/Ombudsman.py

    r6527 r6569  
    6363    copied_fields['availableAreas'],
    6464    copied_fields['managers'],
     65
     66    IntegerField(
     67        name='protocolSequence',
     68        widget=IntegerWidget(
     69        visible={'view': 'invisible', 'edit': 'invisible'}
     70        ),
     71    ),
     72
     73    IntegerField(
     74        name='protocolYear',
     75        widget=IntegerWidget(
     76        visible={'view': 'invisible', 'edit': 'invisible'}
     77        ),
     78    ),
     79
    6580),
    6681)
     
    145160    security.declarePrivate('sendNotificationEmail')
    146161    def sendNotificationEmail(self, addresses, subject, rstText):
    147         """
    148         Send a notification email
     162        """Send a notification email
    149163        """
    150164
     
    178192    security.declarePublic('getFilteredIssues')
    179193    def getFilteredIssues(self, criteria=None, **kwargs):
    180         """
    181         Get key state.
     194        """Get key state
    182195        """
    183196
     
    226239        return vocab.sortedByValue()
    227240
     241    security.declarePrivate('getNextProtocolBuffer')
     242    def getNextProtocolBuffer(self):
     243        """Calculates the next protocol buffer serialized by year + sequence
     244        (with 6 digits) + vd
     245        """
     246        year = self.getProtocolYear()
     247        this_year = int(self.DateTime().year())
     248        if year != this_year:
     249            self.setProtocolYear(this_year)
     250            self.setProtocolSequence(0)
     251        sequence = self.getProtocolSequence() + 1
     252        self.setProtocolSequence(sequence)
     253        return '%s%06d' % (this_year, sequence)
    228254
    229255
  • Ombudsman/trunk/content/OmbudsmanClaim.py

    r6527 r6569  
    240240    security.declarePublic('getAddresses')
    241241    def getAddresses(self):
    242         """
    243         Return member address.
     242        """Return member address.
    244243        """
    245244        portal_membership = getToolByName(self, 'portal_membership')
     
    250249    security.declarePublic('getSexs')
    251250    def getSexs(self):
    252         """
    253         Return sex list.
     251        """Return sex list.
    254252        """
    255253
     
    265263    security.declarePublic('getZips')
    266264    def getZips(self):
    267         """
    268         Return member zip code.
     265        """Return member zip code.
    269266        """
    270267        portal_membership = getToolByName(self, 'portal_membership')
     
    275272    security.declarePublic('getCities')
    276273    def getCities(self):
    277         """
    278         Return cities list.
     274        """Return cities list.
    279275        """
    280276        portal_membership = getToolByName(self, 'portal_membership')
     
    285281    security.declarePublic('getRegions')
    286282    def getRegions(self):
    287         """
    288         Return states/regions list.
     283        """Return states/regions list.
    289284        """
    290285        portal_ombudsman = getToolByName(self, 'portal_ombudsman')
     
    299294    security.declarePublic('getAges')
    300295    def getAges(self):
    301         """
    302         Return ages list.
     296        """Return ages list.
    303297        """
    304298
     
    315309
    316310    def sendRevisionMail(self):
    317         """
    318         When this issue is created, send a notification email to all
     311        """When this issue is created, send a notification email to all
    319312        managers/reviewers.
    320313        """
     
    351344
    352345    def getDefaultContactEmail(self):
    353         """Get the default email address, that of the creating user"""
     346        """Get the default email address, that of the creating user
     347        """
    354348        portal_membership = getToolByName(self, 'portal_membership')
    355349        member = portal_membership.getAuthenticatedMember()
     
    359353    security.declarePublic('getDefaultAge')
    360354    def getDefaultAge(self):
    361         """
    362         Return member age.
    363         """
    364 
     355        """Return member age.
     356        """
    365357        portal_membership = getToolByName(self, 'portal_membership')
    366358        member = portal_membership.getAuthenticatedMember()
     
    368360
    369361    def sendResolvedMail(self):
    370         """
    371         When this claim is resolved, send a notification email to user
     362        """When this claim is resolved, send a notification email to user
    372363        that made the claim.
    373364        """
     
    406397
    407398    def getIssueTypesVocab(self):
    408         """
    409         Get the issue types available as a DisplayList.
     399        """Get the issue types available as a DisplayList.
    410400        """
    411401        field = self.aq_parent.getField('availableIssueTypes')
     
    413403
    414404    def getManagersVocab(self):
    415         """
    416         Get the managers available as a DisplayList. The first item is 'None',
     405        """Get the managers available as a DisplayList. The first item is 'None',
    417406        with a key of '(UNASSIGNED)'.
    418407        """
     
    426415    security.declarePublic('getDefaultRegion')
    427416    def getDefaultRegion(self):
    428         """
    429         Return member state/region.
     417        """Return member state/region.
    430418        """
    431419
     
    435423
    436424    def getAreasVocab(self):
    437         """
    438         Get the available areas as a DispayList.
     425        """Get the available areas as a DispayList.
    439426        """
    440427        field = self.aq_parent.getField('availableAreas')
     
    443430    security.declarePublic('getDefaultSex')
    444431    def getDefaultSex(self):
    445         """
    446         Return member sex.
     432        """Return member sex.
    447433        """
    448434
     
    452438
    453439    def getAvailableIssueTransitions(self):
    454         """
    455         Get the available transitions for the issue.
     440        """Get the available transitions for the issue.
    456441        """
    457442        wftool = getToolByName(self, 'portal_workflow')
     
    463448
    464449    def sendNotificationMail(self):
    465         """
    466         When this claim is created, send a notification email to user
     450        """When this claim is created, send a notification email to user
    467451        that made the claim.
    468452        """
     
    501485        ombudsman.sendNotificationEmail([claimEmail], subject, mailText)
    502486
     487    def _renameAfterCreation(self, check_auto_id=False):
     488        parent = self.aq_inner.aq_parent
     489        newId = parent.getNextProtocolBuffer()
     490        # Can't rename without a subtransaction commit when using
     491        # portal_factory!
     492        transaction.savepoint(optimistic=True)
     493        self.setId(newId)
     494
    503495
    504496def modify_fti(fti):
Note: Veja TracChangeset para ajuda no uso do visualizador de conjunto de mudanças.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.