def payment_fixed_rate_class_add(): """ Add customers to attendance for a class """ from openstudio.os_customer import Customer from openstudio.os_customers import Customers from general_helpers import datestr_to_python response.view = 'general/only_content.html' teID = request.vars['teID'] customer = Customer(teID) response.title = customer.get_name() response.subtitle = T("Add class payment rate") if 'date' in request.vars: date = datestr_to_python(DATE_FORMAT, request.vars['date']) else: date = TODAY_LOCAL customers = Customers() result = customers.classes_add_get_form_date(teID, date) form = result['form'] form_date = result['form_styled'] db.classes.id.readable = False # list of classes grid = customers.classes_add_get_list(date, 'tp_fixed_rate', teID=teID) back = os_gui.get_button('back', URL('payment_fixed_rate', vars={'teID': teID}), _class='left') return dict(content=DIV(form_date, grid), back=back)
def index(): response.title = T("School") response.subtitle = T("Teachers") # response.view = 'general/tabs_menu.html' response.search_available = True if 'q' in request.vars: session.teachers_index_q = request.vars['q'] response.q = session.teachers_index_q or "" session.customers_back = 'teachers' session.customers_add_back = 'teachers' session.settings_groups_back = 'teachers' # show back, add and export buttons above teachers list back = os_gui.get_button('back', URL('school_properties', 'index')) # add employee customers = Customers() add = customers.get_add(redirect_vars={'teacher': True}) contact_list = A(SPAN(os_gui.get_fa_icon('fa-volume-control-phone'), ' ', T("Contact list")), _href=URL('index_export_excel')) links = [contact_list] export = os_gui.get_dropdown_menu(links=links, btn_text='', btn_size='btn-sm', btn_icon='download', menu_class='pull-right') tools = index_get_tools() header_tools = '' content = index_get_content(response.q) menu = index_get_menu(request.function) back = DIV(add, export, tools) return dict(back=back, header_tools=header_tools, menu=menu, content=content)
def index(): response.title = T("School") response.subtitle = T("Teachers") response.view = 'general/tabs_menu.html' # response.view = 'general/only_content.html' session.customers_back = 'teachers' session.customers_add_back = 'teachers' session.settings_groups_back = 'teachers' # show back, add and export buttons above teachers list back = os_gui.get_button('back', URL('school_properties', 'index')) #add = os_gui.get_button('add', URL('teacher_add')) customers = Customers() result = customers.get_add_modal(redirect_vars={'teacher': True}, button_class='btn-sm pull-right') add = SPAN(result['button'], result['modal']) contact_list = A(SPAN(os_gui.get_fa_icon('fa-volume-control-phone'), ' ', T("Contact list")), _href=URL('index_export_excel')) links = [contact_list] export = os_gui.get_dropdown_menu(links=links, btn_text='', btn_size='btn-sm', btn_icon='download', menu_class='pull-right') tools = index_get_tools() header_tools = '' content = index_get_content() menu = index_get_menu(request.function) back = DIV(add, export, tools) return dict(back=back, header_tools=header_tools, menu=menu, content=content)