def get_display(self):
        # Set up the outer <div> to hold all the form elements
        outer_div = DivWdg()
        outer_div.add_class('new-order-entry-form')
        outer_div.set_id('new-order-entry-form')

        # Set up the <input> widget for 'name'
        outer_div.add(HtmlElement.label('Name'))
        name_input = TextInputWdg(name='name')
        outer_div.add(name_input)

        # Set up the <input> widget for 'po_number'
        outer_div.add(HtmlElement.label('PO Number'))
        po_number_input = TextInputWdg()
        po_number_input.set_name('po_number')
        outer_div.add(po_number_input)

        # Set up the <select> widget and it's options for 'client'
        outer_div.add(HtmlElement.label('Client'))
        client_select_wdg = get_select_widget_from_search_type(
            'twog/client', 'client', 'name', 'code')
        outer_div.add(client_select_wdg)

        # Set up the Save button
        save_button = SubmitWdg('Save')
        save_button.add_behavior(self.save_button_behavior())
        outer_div.add(save_button)

        # Set up the Save and Add button
        save_and_add_button = SubmitWdg('Save and Add')
        save_and_add_button.add_behavior(self.save_and_add_button_behavior())
        outer_div.add(save_and_add_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('add_deliverable_files_to_package')

        order_code = self.package_sobject.get('order_code')
        order_search = Search('twog/order')
        order_search.add_code_filter(order_code)
        order_sobject = order_search.get_sobject()

        deliverable_files = get_deliverable_files_in_order(order_sobject)
        selected_files = get_files_for_package(self.package_sobject.get_code())

        # Only show the selectable files and the submit button if the parent order has any deliverable files
        if deliverable_files:
            deliverable_file_select_wdg = get_files_checkbox_from_file_list(
                deliverable_files, selected_files)
            outer_div.add(deliverable_file_select_wdg)

            submit_button = SubmitWdg('Submit')
            submit_button.add_behavior(self.get_submit_button_behavior())

            outer_div.add(submit_button)
        else:
            outer_div.add(
                '<div>No deliverable files are available for this Order yet.</div>'
            )

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('add_files_to_order')

        division_sobject = get_sobject_by_code(
            'twog/division', self.order_sobject.get('division_code'))

        if division_sobject:
            division_code = division_sobject.get_code()

            outer_div.add(
                get_files_checkboxes_for_division(
                    division_code, self.order_sobject.get_code()))

            submit_button = SubmitWdg('Submit')
            submit_button.add_behavior(
                self.get_submit_button_behavior(division_code))

            outer_div.add(submit_button)
        else:
            outer_div.add(
                '<div>You cannot add files to an Order until a Client Division has been selected.</div>'
            )

        return outer_div
Exemple #4
0
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('change-package-instructions')

        package_instructions_code = self.package_sobject.get_value(
            'package_instructions_code')

        if package_instructions_code:
            package_instructions_sobject = get_sobject_by_code(
                'twog/package_instructions', package_instructions_code)

            outer_div.add(
                'Instruction Document is currently set to: {0}'.format(
                    package_instructions_sobject.get_value('name')))
        else:
            outer_div.add('No Instructions Document currently selected')

        division_sobject = get_client_division_sobject_for_package_sobject(
            self.package_sobject)
        division_code = division_sobject.get_code()
        platform_code = self.package_sobject.get('platform_code')

        outer_div.add(get_instructions_select_wdg(division_code,
                                                  platform_code))

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior())

        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('move_input_file_to_output')

        outer_div.add(widgets.html_widgets.get_label_widget('Path'))
        outer_div.add(
            widgets.input_widgets.get_text_input_wdg('new_file_for_task_path',
                                                     800))

        outer_div.add(widgets.html_widgets.get_label_widget('Classification'))
        outer_div.add(get_file_classification_select_wdg())

        files = get_potential_origin_files(self.task_data.get_code())

        outer_div.add(widgets.html_widgets.get_label_widget('Original File'))
        outer_div.add(get_files_checkbox_from_file_list(files, []))

        order_sobject = get_order_sobject_from_task_sobject(self.task_sobject)
        order_code = order_sobject.get_code()

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(
            self.get_submit_button_behavior(
                self.task_data.get_code(), self.division.get_code(),
                order_code, self.task_sobject.get_search_key()))
        outer_div.add(submit_button)

        return outer_div
Exemple #6
0
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('insert-component-in-order')

        outer_div.add(widgets.html_widgets.get_label_widget('Name'))
        outer_div.add(
            widgets.input_widgets.get_text_input_wdg('new_component_name',
                                                     400))

        outer_div.add(widgets.html_widgets.get_label_widget('Title'))
        outer_div.add(get_title_select_wdg(400))

        outer_div.add(widgets.html_widgets.get_label_widget('Language'))
        outer_div.add(get_language_select_wdg())

        outer_div.add(widgets.html_widgets.get_label_widget('Pipeline'))
        outer_div.add(get_pipeline_select_wdg('twog/component'))

        outer_div.add(widgets.html_widgets.get_label_widget('Instructions'))
        outer_div.add(get_instructions_select_wdg())

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior())
        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('change-instructions')

        instructions_code = self.component_sobject.get_value(
            'instructions_code')

        if instructions_code:
            instructions_search = Search('twog/instructions')
            instructions_search.add_code_filter(instructions_code)
            instructions_sobject = instructions_search.get_sobject()

            outer_div.add(
                'Instruction Document is currently set to: {0}'.format(
                    instructions_sobject.get_value('name')))
        else:
            outer_div.add('No Instructions Document currently selected')

        outer_div.add(get_instructions_select_wdg())

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior())

        outer_div.add(submit_button)

        return outer_div
Exemple #8
0
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('edit_instructions_{0}'.format(self.instructions_sobject.get_code()))

        # Get a list of the components the instructions are attached to
        attached_components = get_components_attached_to_instructions(self.instructions_sobject)
        component_div = DivWdg()
        title_span = SpanWdg()

        if attached_components:
            title_span.add('The following Components are attached to this Instructions Document:')
            component_div.add(title_span)

            component_list = HtmlElement.ul()

            for component in attached_components:
                li = HtmlElement.li()
                li.add('{0} ({1})'.format(component.get('name'), component.get_code()))
                component_list.add(li)

            component_div.add(component_list)
        else:
            title_span.add('Instructions are not currently attached to any Components')
            component_div.add(title_span)

        outer_div.add(component_div)
        outer_div.add(get_instructions_textarea_wdg(self.instructions_sobject))

        submit_button = SubmitWdg('Submit Changes')
        submit_button.add_behavior(self.submit_button_behavior())
        submit_button.add_style('display', 'block')

        outer_div.add(submit_button)

        return outer_div
Exemple #9
0
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('equipment-in-task')

        outer_div.add(self.get_equipment_checkboxes())

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior())

        outer_div.add(submit_button)

        return outer_div
Exemple #10
0
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('insert-task-in-component')

        outer_div.add(widgets.input_widgets.get_text_input_wdg('process'))

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(
            self.get_submit_button_behavior(self.component_sobject.get_code()))

        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('status_select_{0}'.format(self.task_sobject.get_code()))

        outer_div.add(get_task_status_select_wdg(self.task_sobject))

        submit_button = SubmitWdg('Submit Changes')
        submit_button.add_behavior(self.submit_button_behavior())
        submit_button.add_style('display', 'block')

        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('multiple_status_edit_{0}'.format(self.package_sobject.get_code()))

        outer_div.add(self.get_files_checkboxes())
        outer_div.add(get_file_in_package_status_select())

        submit_button = SubmitWdg('Submit Changes')
        submit_button.add_behavior(self.submit_button_behavior())
        submit_button.add_style('display', 'block')

        outer_div.add(submit_button)

        return outer_div
Exemple #13
0
    def get_display(self):
        calendar_input = self.get_date_calendar_wdg()

        # Set up the Save button
        save_button = SubmitWdg('Save')
        save_button.add_behavior(
            self.save_button_behavior(self.title_order_code))

        main_wdg = DivWdg()
        main_wdg.set_id('change_due_date_wdg')

        main_wdg.add(calendar_input)
        main_wdg.add(save_button)

        return main_wdg
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('link_components_to_packages_div')

        table = Table()
        table.add_attr('id', 'link_components_to_packages_table')
        table.add_style('width', '100%')
        table.add_border(style='solid', color='#F2F2F2', size='1px')

        order_code = self.order_sobject.get_code()

        components = get_component_sobjects_from_order_code(order_code)
        packages = get_package_sobjects_from_order_code(order_code)

        existing_component_package_links = self.get_existing_entries(
            components, packages)

        package_row = table.add_row()
        table.add_cell(row=package_row)

        for package in packages:
            table.add_cell(package.get('name'), row=package_row)

        for component in components:
            component_row = table.add_row()
            component_row.set_id(component.get_code())

            table.add_cell(component.get('name'), row=component_row)

            for package in packages:
                checkbox = CheckboxWdg(name='{0}_{1}'.format(
                    component.get_code(), package.get_code()))

                if self.component_package_link_exists(
                        component, package, existing_component_package_links):
                    checkbox.set_checked()

                checkbox_cell = table.add_cell(checkbox)
                checkbox_cell.add_style('text-align', 'center')

        outer_div.add(table)

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior())

        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('add-instructions-from-template')

        outer_div.add(
            'Choose an Instructions Template from the dropdown list below. The resulting Instructions '
            'Document will be added automatically to this Component.')

        outer_div.add(get_instructions_template_select_wdg())

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior())

        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('add_files_to_task')

        if self.order_files:
            outer_div.add(self.get_files_checkbox_for_task())

            submit_button = SubmitWdg('Submit')
            submit_button.add_behavior(self.get_submit_button_behavior(self.task_data.get_code(),
                                                                       self.task_sobject.get_search_key()))

            outer_div.add(submit_button)
        else:
            outer_div.add('<div>No files exist for this Order yet.</div>')

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('insert-package-in-order')

        outer_div.add(get_label_widget('Name'))
        outer_div.add(get_text_input_wdg('new_package_name', 400))

        outer_div.add(get_platforms_checkboxes())

        outer_div.add(get_label_widget('Due Date'))
        outer_div.add(obu.get_date_calendar_wdg())

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior())

        outer_div.add(submit_button)

        return outer_div
Exemple #18
0
    def get_display(self):
        div_wdg = DivWdg()
        div_wdg.set_id('change-order-expected-completion-date')

        calendar_wdg = CalendarInputWdg(
            name='change-expected-completion-date-calendar', width='120px')
        time_wdg = TimeInputWdg(name='change-expected-completion-date-time')

        div_wdg.add(get_label_widget('Date'))
        div_wdg.add(calendar_wdg)
        div_wdg.add(get_label_widget('Time'))
        div_wdg.add(time_wdg)

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.submit_button_behavior())
        div_wdg.add(submit_button)

        return div_wdg
Exemple #19
0
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('reassign-component-to-package')

        outer_div.add(
            'This component currently belongs to this package:\n{0}\n'.format(
                self.package_sobject.get('name')))

        package_select_wdg = self.get_package_select_wdg()
        outer_div.add(package_select_wdg)

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(
            self.get_submit_button_behavior(self.component_sobject.get_code()))

        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('add_new_files_to_task')

        outer_div.add(get_label_widget('Path'))
        outer_div.add(get_text_input_wdg('new_file_path', 800))

        outer_div.add(get_label_widget('Classification'))
        outer_div.add(get_file_classification_select_wdg())

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior(self.task_data.get_code(),
                                                                   self.division.get_code(),
                                                                   self.order_sobject.get_code(),
                                                                   self.task_sobject.get_search_key()))

        outer_div.add(submit_button)

        return outer_div
Exemple #21
0
    def get_display(self):
        outer_div = DivWdg()
        outer_div.add_class('assign-pipeline-wdg')

        outer_div.add(get_label_widget('Pipeline'))

        pipeline_code = self.sobject.get_value('pipeline_code')

        # 'get_search_type' returns the full search type ('twog/component?project=twog'). Only need the first part.
        search_type = self.sobject.get_search_type().split('?')[0]

        outer_div.add(get_pipeline_select_wdg(pipeline_code, search_type))

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(
            self.get_submit_button_behavior(search_type))

        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('change-estimated-hours')

        current_estimated_hours = self.task_data.get('estimated_hours')

        if current_estimated_hours:
            current_hours_text = 'The estimated hours for this task is currently set to {0} hour(s).'.format(
                current_estimated_hours)
        else:
            current_hours_text = 'Estimated hours is not currently set for this task.'

        outer_div.add(current_hours_text)
        outer_div.add(get_text_input_wdg('new_estimated_hours', 100))

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior())

        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('add_new_files_to_task')

        if self.division_sobject:
            outer_div.add(get_label_widget('Path'))
            outer_div.add(get_text_input_wdg('new_file_path', 800))

            outer_div.add(get_label_widget('Classification'))
            outer_div.add(get_file_classification_select_wdg())

            submit_button = SubmitWdg('Submit')
            submit_button.add_behavior(self.get_submit_button_behavior())

            outer_div.add(submit_button)
        else:
            outer_div.add(
                '<div>You cannot add files to an Order until a Client Division has been selected.</div>'
            )

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('department-request-response')

        if self.department_request_sobject.get('response'):
            current_response_div = DivWdg()
            current_response_div.add(
                get_pre_widget(
                    self.department_request_sobject.get('response')))

            outer_div.add(current_response_div)

        outer_div.add(get_label_widget('Response'))
        outer_div.add(
            get_text_area_input_wdg('response', 800, [('display', 'block')]))

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(
            self.submit_button_behavior(
                self.department_request_sobject.get_search_key(),
                self.department_request_sobject.get_code()))
        outer_div.add(submit_button)

        return outer_div
    def get_display(self):
        outer_div = DivWdg()
        outer_div.set_id('change-title')

        title_code = self.component_sobject.get_value('title_code')

        if title_code:
            title_sobject_search = Search('twog/title')
            title_sobject_search.add_code_filter(title_code)
            title_sobject = title_sobject_search.get_sobject()

            outer_div.add('Title is currently set to: {0}'.format(
                title_sobject.get_value('name')))
        else:
            outer_div.add('No Title currently selected')

        outer_div.add(get_title_select_wdg())

        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.get_submit_button_behavior())

        outer_div.add(submit_button)

        return outer_div
Exemple #26
0
    def get_display(self):
        div_wdg = DivWdg()
        div_wdg.set_id('edit_file_{0}'.format(self.file_sobject.get_code()))

        # Add a text section for File Path
        div_wdg.add(get_label_widget('File Path'))
        div_wdg.add(
            get_text_input_wdg('file_path_input',
                               pretext=self.file_sobject.get('file_path')))

        # Add a Select widget for Classification
        div_wdg.add(get_label_widget('Classification'))
        div_wdg.add(
            get_file_classification_select_wdg(
                selected=self.file_sobject.get('classification')))

        # Add the submit button
        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.submit_button_behavior())
        submit_button.add_style('display', 'block')

        div_wdg.add(submit_button)

        return div_wdg
    def get_display(self):
        div_wdg = DivWdg()
        div_wdg.set_id('task_inspect_{0}'.format(self.task_sobject.get_code()))

        div_wdg.add(get_page_header(self.task_sobject.get('process')))
        div_wdg.add(HtmlElement.h4('Code: {0}'.format(self.task_sobject.get_code())))
        div_wdg.add(HtmlElement.h4('Package: {0} ({1})'.format(self.parent_component.get('name'),
                                                                 self.parent_component.get_code())))

        # Get the order that contains the parent component and display its information
        order_sobject = get_order_sobject_from_component_sobject(self.parent_component)
        div_wdg.add(HtmlElement.h4('Order: {0} ({1})'.format(order_sobject.get('name'), order_sobject.get_code())))

        div_wdg.add(HtmlElement.h4('<u>Status</u>'))
        div_wdg.add(get_task_status_select_wdg(self.task_sobject))

        div_wdg.add(HtmlElement.h4('<u>Estimated Hours: {0}</u>'.format(self.task_data.get('estimated_hours'))))

        change_estimated_hours_button = ButtonNewWdg(title='Change Estimated Hours', icon='TIME')
        change_estimated_hours_button.add_behavior(
            obu.get_load_popup_widget_with_reload_behavior(
                'Change Estimated Hours', 'widgets.ChangeEstimatedHoursForTaskWdg', self.task_sobject.get_search_key(),
                'Task', 'widgets.TaskInspectWdg', self.task_sobject.get_search_key()
            )
        )
        change_estimated_hours_button.add_style('display', 'inline-block')
        div_wdg.add(change_estimated_hours_button)

        add_input_file_button = ButtonNewWdg(title='Add Input Files', icon='INSERT_MULTI')
        add_input_file_button.add_behavior(
            obu.get_load_popup_widget_behavior('Add Input Files from Order',
                                               'widgets.AddInputFilesToTaskWdg',
                                               self.task_sobject.get_search_key())
        )
        add_input_file_button.add_style('display', 'inline-block')
        div_wdg.add(add_input_file_button)

        create_input_file_button = ButtonNewWdg(title='Create a new Input File', icon='ADD')
        create_input_file_button.add_behavior(
            obu.get_load_popup_widget_with_reload_behavior(
                'Create a new Input File', 'widgets.CreateNewInputFileForTaskWdg', self.task_sobject.get_search_key(),
                'Task', 'widgets.TaskInspectWdg', self.task_sobject.get_search_key()
            )
        )
        create_input_file_button.add_style('display', 'inline-block')
        div_wdg.add(create_input_file_button)

        move_input_file_to_output_button = ButtonNewWdg(title='Move Input File to Output', icon='RIGHT')
        move_input_file_to_output_button.add_behavior(
            obu.get_load_popup_widget_with_reload_behavior(
                'Move Input File to Output', 'widgets.MoveInputFileToOutputWdg', self.task_sobject.get_search_key(),
                'Task', 'widgets.TaskInspectWdg', self.task_sobject.get_search_key()
            )
        )
        move_input_file_to_output_button.add_style('display', 'inline-block')
        div_wdg.add(move_input_file_to_output_button)

        add_equipment_button = ButtonNewWdg(title='Add Equipment', icon='INSERT_MULTI')
        add_equipment_button.add_behavior(
            obu.get_load_popup_widget_with_reload_behavior('Add Equipment', 'widgets.EquipmentInTaskWdg',
                                                           self.task_sobject.get_search_key(), 'Task',
                                                           'widgets.TaskInspectWdg', self.task_sobject.get_search_key())
        )
        add_equipment_button.add_style('display', 'inline-block')
        div_wdg.add(add_equipment_button)

        if self.parent_component.get_search_type() == u'twog/component?project=twog':
            div_wdg.add(HtmlElement.h4('<u>Instructions</u>'))

            instructions_code = self.parent_component.get('instructions_code')
            instructions = get_task_instructions_text_from_instructions_code(instructions_code,
                                                                             self.task_sobject.get('process'))

            if not instructions:
                instructions = 'Sorry, instructions have not been added yet.'

            div_wdg.add(self.parse_instruction_text(instructions.encode('utf-8')))
        elif self.parent_component.get_search_type() == u'twog/package?project=twog':
            div_wdg.add(HtmlElement.h4('<u>Instructions</u>'))

            instructions = self.parent_component.get('delivery_instructions')

            if not instructions:
                instructions = 'Sorry, instructions have not been added yet.'

            div_wdg.add(self.parse_instruction_text(instructions.encode('utf-8')))

        div_wdg.add(self.get_buttons_row())

        submit_button = SubmitWdg('Submit Changes')
        submit_button.add_behavior(self.submit_button_behavior())
        submit_button.add_style('display', 'block')

        div_wdg.add(submit_button)

        return div_wdg
    def get_submit_widget(self, outer_div):
        submit_button = SubmitWdg('Submit')
        submit_button.add_behavior(self.submit_button_behavior())

        outer_div.add(submit_button)