Ignore:
Timestamp:
17 May 2023, 18:21:10 (18 months ago)
Author:
Henrik Bettermann
Message:

Add ReleaseExpiredAllocationsPage2 which allows to release unpaid beds in single hostels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py

    r17313 r17412  
    135135    @property
    136136    def target_url(self):
    137         if self.target and self.context.allocation_expiration:
     137        if self.target and grok.getSite()['hostels'].allocation_expiration:
    138138            return self.view.url(self.view.context, self.target)
    139139        return
     
    146146              "booking if maintenance fee is not " + \
    147147              "paid.'")
    148         msg = _(msg, mapping={'a': self.context.allocation_expiration,})
     148        msg = _(msg, mapping={'a': grok.getSite()['hostels'].allocation_expiration,})
    149149        portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
    150150        return "return window.confirm(%s);" % translate(
     
    218218
    219219    def update(self):
    220         n = self.context.allocation_expiration
     220        n = grok.getSite()['hostels'].allocation_expiration
    221221        if not n:
    222222            self.flash(
     
    250250        return
    251251
     252class ReleaseExpiredAllocationsPage2(ReleaseExpiredAllocationsPage):
     253    """Release all expired allocated beds in a single hostel.
     254    """
     255    grok.context(IHostel)
     256    grok.name('releaseexpired2')
     257
    252258class HostelsStatisticsPage(KofaDisplayFormPage):
    253259    """Some statistics about beds in hostels.
     
    300306    def label(self):
    301307        return self.context.hostel_name
     308
     309class ReleaseExpiredAllocationsActionButton2(ReleaseExpiredAllocationsActionButton):
     310    grok.order(2)
     311    grok.context(IHostel)
     312    grok.view(HostelDisplayFormPage)
     313    target = 'releaseexpired2'
     314    text = _('Release expired bed space allocations in this hostel')
    302315
    303316class HostelManageActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.