def __call__(self): appraisal = IAppraisal(self.context) should_be_archived = json.loads(self.request['should_be_archived']) if self.request.get('dossier-ids'): for intid in json.loads(self.request['dossier-ids']): appraisal.update(intid=intid, archive=should_be_archived) else: appraisal.update( intid=json.loads(self.request['dossier-id']), archive=should_be_archived)
def __call__(self): if not IAppraisal(self.context).is_complete(): msg = _(u'msg_appraisal_incomplete', default=u'The appraisal is incomplete, appraisal could ' 'not be finalized.') api.portal.show_message( message=msg, request=self.request, type='error') return self.request.RESPONSE.redirect(self.context.absolute_url()) return self.request.RESPONSE.redirect( '{}/content_status_modify?workflow_action={}'.format( self.context.absolute_url(), self.transition))
def __init__(self, dossier, disposition): self.title = dossier.title self.intid = getUtility(IIntIds).getId(dossier) self.url = dossier.absolute_url() self.reference_number = dossier.get_reference_number() self.parent = aq_parent(aq_inner(dossier)) self.start = IDossier(dossier).start self.end = IDossier(dossier).end self.public_trial = IClassification(dossier).public_trial self.archival_value = ILifeCycle(dossier).archival_value self.archival_value_annotation = ILifeCycle(dossier).archival_value_annotation self.appraisal = IAppraisal(disposition).get(dossier) self.former_state = dossier.get_former_state()
def __call__(self): appraisal = IAppraisal(self.context) should_be_archived = json.loads(self.request['should_be_archived']) if self.request.get('dossier-ids'): for intid in json.loads(self.request['dossier-ids']): appraisal.update(intid=intid, archive=should_be_archived) else: appraisal.update(intid=json.loads(self.request['dossier-id']), archive=should_be_archived)
def finalize_appraisal(self): """Write back the appraisal value to the dossiers. """ appraisal = IAppraisal(self) for relation in self.dossiers: appraisal.write_to_dossier(relation.to_object)
def update_dropped_dossiers(self, dossiers): for dossier in dossiers: dossier.retract() IAppraisal(self).drop(dossier)
def update_added_dossiers(self, dossiers): for dossier in dossiers: dossier.offer() IAppraisal(self).initialize(dossier)
def has_dossiers_to_archive(self): return any(IAppraisal(self).storage.values())
def finalize_appraisal(self): """Write back the appraisal value to the dossiers. """ appraisal = IAppraisal(self) for relation in self.dossiers: appraisal.write_to_dossier(relation.to_object)