Exemple #1
0
    def get_display(self):

        task_div = DivWdg(self.label)
        task_div.add_style("text-align: left")
        task_div.add_style('margin-left', '10px')
        setting = ProdSetting.get_by_key(self.shot_status_setting)
        if not setting:
            BaseAppServer.add_onload_script(IframeWdg.get_popup_script(\
                "The Project Setting [%s] is required to be set."%self.shot_status_setting))
            return

        # add a check-all toggle control
        checkbox_control = CheckboxWdg("sobj_status_control")
        checkbox_control.add_event(
            "onclick", "get_elements('sobj_status').toggle_all(this);")
        task_div.add(checkbox_control)

        checked_all_status = True
        for status in self.statuses:
            span = SpanWdg(css="med")
            checkbox = CheckboxWdg("sobj_status")
            checkbox.set_persistence()

            checkbox.set_option("value", status)

            if checked_all_status and not checkbox.is_checked():
                checked_all_status = False

            span.add(checkbox)
            span.add(status)
            task_div.add(span)

        if checked_all_status:
            checkbox_control.set_checked()
        return task_div
Exemple #2
0
    def __init__(my, **kwargs):
        my.frames = kwargs.get("frames")
        my.fps = kwargs.get("fps")
        if not my.fps:
            from pyasm.prod.biz import ProdSetting
            my.fps = ProdSetting.get_by_key("fps")
        if not my.fps:
            my.fps = 24

        if not my.frames:
            timecode = kwargs.get("timecode")
            my.frames = my.calculate_frames(timecode, my.fps)
Exemple #3
0
    def get_display(self):
        
        task_div = DivWdg(self.label)
        task_div.add_style("text-align: left")
        task_div.add_style('margin-left','10px')
        setting = ProdSetting.get_by_key(self.shot_status_setting)
        if not setting:
            BaseAppServer.add_onload_script(IframeWdg.get_popup_script(\
                "The Project Setting [%s] is required to be set."%self.shot_status_setting))
            return

        # add a check-all toggle control
        checkbox_control = CheckboxWdg("sobj_status_control")
        checkbox_control.add_event("onclick", "get_elements('sobj_status').toggle_all(this);")
        task_div.add(checkbox_control)
        
        

        checked_all_status = True
        for status in self.statuses:
            span = SpanWdg(css="med")
            checkbox = CheckboxWdg("sobj_status")
            checkbox.set_persistence()
            
            checkbox.set_option("value", status)

            if checked_all_status and not checkbox.is_checked():
                checked_all_status = False
            
            span.add(checkbox)
            span.add(status)
            task_div.add(span)
        
        if checked_all_status:
            checkbox_control.set_checked()
        return task_div
Exemple #4
0
    def get_notes_wdg(self):
        widget = Widget()
        help = HelpItemWdg('Notes tab', 'The Notes tab focuses on the display of notes. It includes both shot notes and submission notes for each shot.')
        widget.add(help)
        div = DivWdg(css="filter_box")
        text = TextWdg("shot_search")
        text.set_persist_on_submit()
        div.add("Shot Search: ")
        div.add(text)

        sequence_filter = SequenceFilterWdg()
        
        div.add(sequence_filter)

        # add Note Context dropdown
        # scope with config base, also used in DiscussionWdg and SObjectTaskTableElement
        config_base = 'prod_notes' 
        context_select = ProcessFilterSelectWdg(name="%s_discussion_context" %config_base,\
                has_empty=False, search_type='prod/shot', label='Note Context: ' )

        context_select.add_empty_option("-- Any Context --")
        context_select._add_options()
        setting = "notes_prod_context"
        values_option = ProdSetting.get_seq_by_key(setting) 
        if not values_option:
            data_dict = {'key': setting}
            prod_setting = ProdSetting.get_by_key(setting)
            ps_id = -1
            if prod_setting:
                ps_id = prod_setting.get_id()
            context_select._set_append_widget(ps_id, data_dict)
        labels, values = context_select.get_select_values()
        if values_option:
            context_select.append_option('','')
            context_select.append_option('<< %s >>' %setting, ','.join(values_option))
        for value in values_option:
            if value not in values:
                context_select.append_option(value, value)

        context_select.set_dom_options()

        div.add(context_select)
        hint = HintWdg('Submission notes for each shot are also included here')
        div.add(hint)

        div.add(IconRefreshWdg(long=False))
        search_limit = SearchLimitWdg()
        div.add(search_limit)

        widget.add(div)


        # create a search
        search = Search("prod/shot")
        text_value = text.get_value()
        sequence_filter.alter_search(search)  

        if text_value:
            filter = Search.get_compound_filter(text_value, ['code', 'description'])
            search.add_where(filter)
        search_limit.alter_search(search)
        sobjects = search.get_sobjects()


        table = TableWdg("prod/shot", config_base)
        table.set_class("table")
        table.set_sobjects(sobjects)
        widget.add(table)
        return widget
Exemple #5
0
    def get_notes_wdg(self):
        widget = Widget()
        help = HelpItemWdg(
            'Notes tab',
            'The Notes tab focuses on the display of notes. It includes both shot notes and submission notes for each shot.'
        )
        widget.add(help)
        div = DivWdg(css="filter_box")
        text = TextWdg("shot_search")
        text.set_persist_on_submit()
        div.add("Shot Search: ")
        div.add(text)

        sequence_filter = SequenceFilterWdg()

        div.add(sequence_filter)

        # add Note Context dropdown
        # scope with config base, also used in DiscussionWdg and SObjectTaskTableElement
        config_base = 'prod_notes'
        context_select = ProcessFilterSelectWdg(name="%s_discussion_context" %config_base,\
                has_empty=False, search_type='prod/shot', label='Note Context: ' )

        context_select.add_empty_option("-- Any Context --")
        context_select._add_options()
        setting = "notes_prod_context"
        values_option = ProdSetting.get_seq_by_key(setting)
        if not values_option:
            data_dict = {'key': setting}
            prod_setting = ProdSetting.get_by_key(setting)
            ps_id = -1
            if prod_setting:
                ps_id = prod_setting.get_id()
            context_select._set_append_widget(ps_id, data_dict)
        labels, values = context_select.get_select_values()
        if values_option:
            context_select.append_option('', '')
            context_select.append_option('<< %s >>' % setting,
                                         ','.join(values_option))
        for value in values_option:
            if value not in values:
                context_select.append_option(value, value)

        context_select.set_dom_options()

        div.add(context_select)
        hint = HintWdg('Submission notes for each shot are also included here')
        div.add(hint)

        div.add(IconRefreshWdg(long=False))
        search_limit = SearchLimitWdg()
        div.add(search_limit)

        widget.add(div)

        # create a search
        search = Search("prod/shot")
        text_value = text.get_value()
        sequence_filter.alter_search(search)

        if text_value:
            filter = Search.get_compound_filter(text_value,
                                                ['code', 'description'])
            search.add_where(filter)
        search_limit.alter_search(search)
        sobjects = search.get_sobjects()

        table = TableWdg("prod/shot", config_base)
        table.set_class("table")
        table.set_sobjects(sobjects)
        widget.add(table)
        return widget