#NEWLINE# def programme( ) : #NEWLINE# #INDENT# ' Volunteer Programmes controller ' #NEWLINE# mode = session . s3 . hrm . mode #NEWLINE# if ( not auth . s3_has_role ( ADMIN ) ) : #NEWLINE# #INDENT# s3 . filter = auth . filter_by_root_org ( s3db . hrm_programme ) #NEWLINE# #UNINDENT# def prep( r ) : #NEWLINE# #INDENT# if ( mode is not None ) : #NEWLINE# #INDENT# auth . permission . fail ( ) #NEWLINE# #UNINDENT# if ( r . component_name == 'person' ) : #NEWLINE# #INDENT# s3db . configure ( 'hrm_programme_hours' , list_fields = [ 'person_id' , 'training' , 'programme_id' , 'date' , 'hours' ] ) #NEWLINE# #UNINDENT# return True #NEWLINE# #UNINDENT# s3 . prep = mode #NEWLINE# return s3_rest_controller ( 'hrm' , resourcename , rheader = s3db . hrm_rheader , csv_stylesheet = ( 'hrm' , 'programme.xsl' ) , csv_template = ( 'hrm' , 'programme' ) )