Ejemplo n.º 1
0
    def get_display(self):
        web = WebContainer.get_web()

        widget = Widget()

        search_type = web.get_form_value("parent_search_type")
        search_id = web.get_form_value("parent_search_id")

        if not search_type:
            widget.add("RenderSubmitInfo: parent type not found")
            return widget

        hidden = HiddenWdg("parent_search_type", search_type)
        widget.add(hidden)
        hidden = HiddenWdg("parent_search_id", search_id)
        widget.add(hidden)

        sobject = Search.get_by_id(search_type, search_id)
        table = TableWdg(search_type, css="embed")
        table.set_show_property(False)
        table.set_sobject(sobject)
        table.remove_widget("render")
        table.remove_widget("description")
        widget.add(table)

        return widget
Ejemplo n.º 2
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type, search_id))

        search = Search("prod/sequence_instance")
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        all_instances = search.get_sobjects()
        widget = DivWdg()
        widget.add_style("width: 95%")
        widget.add_style("margin-left: 20px")
        table = TableWdg("prod/sequence_instance", "layout", css="minimal")
        table.set_show_property(False)
        table.set_show_header(False)
        table.set_sobjects(all_instances)
        table.set_search(search)
        widget.add(table)

        aux_data = SequenceInstance.get_aux_data(all_instances)
        table.set_aux_data(aux_data)
        return widget
Ejemplo n.º 3
0
    def get_display(self):
        web = WebContainer.get_web()

        widget = Widget()

        search_type = web.get_form_value("parent_search_type")
        search_id = web.get_form_value("parent_search_id")

        if not search_type:
            widget.add("RenderSubmitInfo: parent type not found")
            return widget

        hidden = HiddenWdg("parent_search_type", search_type)
        widget.add(hidden)
        hidden = HiddenWdg("parent_search_id", search_id)
        widget.add(hidden)

        sobject = Search.get_by_id(search_type, search_id)
        table = TableWdg(search_type, css="embed")
        table.set_show_property(False)
        table.set_sobject(sobject)
        table.remove_widget("render")
        table.remove_widget("description")
        widget.add(table)

        return widget
Ejemplo n.º 4
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        search = Search("prod/sequence_instance")
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        all_instances = search.get_sobjects()
        widget = DivWdg()
        widget.add_style("width: 95%")
        widget.add_style("margin-left: 20px")
        table = TableWdg("prod/sequence_instance", "layout", css="minimal")
        table.set_show_property(False)
        table.set_show_header(False)
        table.set_sobjects(all_instances)
        table.set_search(search)
        widget.add(table)

        aux_data = SequenceInstance.get_aux_data(all_instances)
        table.set_aux_data(aux_data)
        return widget
Ejemplo n.º 5
0
    def _get_sobject_history_wdg(self):
        ''' this method is called thru ajax '''
        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']
        #sobject = Search.get_by_id(search_type, search_id)

        div = Widget()

        search = Search("sthpw/sobject_log")
        search.add_filter("search_type", search_type)
        search.add_filter("search_id", search_id)
        sobjects = search.get_sobjects()

        search = Search("sthpw/transaction_log")
        search.add_filters(
            "id", [x.get_value("transaction_log_id") for x in sobjects])
        sobjects = search.get_sobjects()

        table = TableWdg("sthpw/transaction_log", "table", css='table')
        table.set_show_property(False)
        table.set_sobjects(sobjects)
        div.add(table)
        div.add(HtmlElement.br(2))

        return div

        div.add(assigned_shot_wdg)
        div.add(HtmlElement.br(2))
        return div
Ejemplo n.º 6
0
    def _get_sobject_history_wdg(my):
        ''' this method is called thru ajax '''
        args = WebContainer.get_web().get_form_args()
        
        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']
        #sobject = Search.get_by_id(search_type, search_id)

        div = Widget()

        search = Search("sthpw/sobject_log")
        search.add_filter("search_type", search_type)
        search.add_filter("search_id", search_id)
        sobjects = search.get_sobjects()

        search = Search("sthpw/transaction_log")
        search.add_filters("id", [x.get_value("transaction_log_id") for x in sobjects] )
        sobjects = search.get_sobjects()


        table = TableWdg("sthpw/transaction_log", "table", css='table')
        table.set_show_property(False)
        table.set_sobjects(sobjects)
        div.add(table)
        div.add(HtmlElement.br(2))

        return div

     
        div.add(assigned_shot_wdg)
        div.add(HtmlElement.br(2))
        return div
Ejemplo n.º 7
0
    def get_display(self):

        web = WebContainer.get_web()
        args = web.get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        planner_search_type = self.get_search_type()


        # get parent instances first
        '''
        all_instances = []
        parent_code = ""
        if sobject.has_value("parent_code"):
            parent_code = sobject.get_value("parent_code")
        if parent_code != "":
            parent = sobject.get_by_code(parent_code)

            search = Search(planner_search_type)
            search.add_filter(sobject.get_foreign_key(), parent.get_code())
            instances = search.get_sobjects()

            all_instances.extend(instances)
        '''


        search = Search(planner_search_type)
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        instances = search.get_sobjects()
        #all_instances.extend(instances)

        widget = DivWdg()
        widget.add( HiddenWdg("planner_search_type", planner_search_type) )
        widget.add_style("width: 95%")
        widget.add_style("float: right")
        table = TableWdg(search_type, "layout", css='minimal')
        table.table.set_max_width(use_css=True)
        #table.set_sobjects(all_instances)
        table.set_search(search)
        table.do_search()
        table.set_show_property(False)

        #aux_data = ShotInstance.get_aux_data(all_instances)
        #table.set_aux_data(aux_data)
        widget.add(table)
        return widget
Ejemplo n.º 8
0
    def get_display(my):

        web = WebContainer.get_web()
        args = web.get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        planner_search_type = my.get_search_type()


        # get parent instances first
        '''
        all_instances = []
        parent_code = ""
        if sobject.has_value("parent_code"):
            parent_code = sobject.get_value("parent_code")
        if parent_code != "":
            parent = sobject.get_by_code(parent_code)

            search = Search(planner_search_type)
            search.add_filter(sobject.get_foreign_key(), parent.get_code())
            instances = search.get_sobjects()

            all_instances.extend(instances)
        '''


        search = Search(planner_search_type)
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        instances = search.get_sobjects()
        #all_instances.extend(instances)

        widget = DivWdg()
        widget.add( HiddenWdg("planner_search_type", planner_search_type) )
        widget.add_style("width: 95%")
        widget.add_style("float: right")
        table = TableWdg(search_type, "layout", css='minimal')
        table.table.set_max_width(use_css=True)
        #table.set_sobjects(all_instances)
        table.set_search(search)
        table.do_search()
        table.set_show_property(False)

        #aux_data = ShotInstance.get_aux_data(all_instances)
        #table.set_aux_data(aux_data)
        widget.add(table)
        return widget
Ejemplo n.º 9
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        #instances = sobject.get_all_children("prod/instance")

        all_instances = []

        # get parent instances first
        parent_code = ""
        if sobject.has_value("parent_code"):
            parent_code = sobject.get_value("parent_code")
        if parent_code != "":
            parent = sobject.get_by_code(parent_code)

            search = Search(my.get_search_type())
            search.add_filter(sobject.get_foreign_key(), parent.get_code())
            search.add_filter("type", "asset")
            instances = search.get_sobjects()

            all_instances.extend(instances)


        search = Search(my.get_search_type())
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        search.add_filter("type", "asset")
        instances = search.get_sobjects()
        all_instances.extend(instances)

        widget = DivWdg()
        
        widget.add_style("width: 95%")
        
        widget.add_style("float: right")
        table = TableWdg(my.get_search_type(),"layout", css='simple')
        table.set_sobjects(all_instances)
        table.set_show_property(False)

        aux_data = ShotInstance.get_aux_data(all_instances)
        table.set_aux_data(aux_data)
        widget.add(table)
        return widget
Ejemplo n.º 10
0
    def get_display(self):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        #instances = sobject.get_all_children("prod/instance")

        all_instances = []

        # get parent instances first
        parent_code = ""
        if sobject.has_value("parent_code"):
            parent_code = sobject.get_value("parent_code")
        if parent_code != "":
            parent = sobject.get_by_code(parent_code)

            search = Search(self.get_search_type())
            search.add_filter(sobject.get_foreign_key(), parent.get_code())
            search.add_filter("type", "asset")
            instances = search.get_sobjects()

            all_instances.extend(instances)


        search = Search(self.get_search_type())
        search.add_filter(sobject.get_foreign_key(), sobject.get_code())
        search.add_filter("type", "asset")
        instances = search.get_sobjects()
        all_instances.extend(instances)

        widget = DivWdg()
        
        widget.add_style("width: 95%")
        
        widget.add_style("float: right")
        table = TableWdg(self.get_search_type(),"layout", css='simple')
        table.set_sobjects(all_instances)
        table.set_show_property(False)

        aux_data = ShotInstance.get_aux_data(all_instances)
        table.set_aux_data(aux_data)
        widget.add(table)
        return widget
Ejemplo n.º 11
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type, search_id))

        widget = DivWdg()
        widget.add_style("width: 95%")
        widget.add_style("margin-left: 20px")
        table = TableWdg("sthpw/task", "layout_right")
        from pyasm.biz import Task
        tasks = Task.get_by_sobject(sobject)
        table.set_sobjects(tasks)
        table.set_show_property(False)
        widget.add(table)

        return widget
Ejemplo n.º 12
0
    def get_display(my):

        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        search_id = args['search_id']

        sobject = Search.get_by_search_key("%s|%s" % (search_type,search_id) )

        widget = DivWdg()
        widget.add_style("width: 95%")
        widget.add_style("margin-left: 20px")
        table = TableWdg("sthpw/task", "layout_right")
        from pyasm.biz import Task
        tasks = Task.get_by_sobject(sobject)
        table.set_sobjects(tasks)
        table.set_show_property(False)
        widget.add(table)

        return widget
Ejemplo n.º 13
0
    def _get_sobject_wdg(self):
        ''' this method is called thru ajax '''
        args = WebContainer.get_web().get_form_args()

        # get the args in the URL
        search_type = args['search_type']
        sobj_search_type = args['sobj_search_type']
        search_id = args['search_id']
        view = args['view']
        sobject = Search.get_by_id(sobj_search_type, search_id)

        content = Widget()
        table = TableWdg(search_type, view, css='table')
        table.set_show_property(False)
        content.add(table)
        content.add(HtmlElement.br(2))

        search = self._get_sobject_search(sobject, search_type)

        sobjects = search.get_sobjects()
        if search_type.startswith("sthpw/note"):
            # this assumes that a project has submission!
            from pyasm.prod.biz import Submission
            from pyasm.search import SqlException
            try:
                notes = Submission.get_all_notes(sobject)
                sobjects.extend(notes)
            except SqlException:
                pass

            def compare(x, y):
                return cmp(y.get_value("timestamp"), x.get_value("timestamp"))

            sobjects.sort(cmp=compare)

        table.set_search(search)
        table.set_sobjects(sobjects)
        return content
Ejemplo n.º 14
0
    def _get_sobject_wdg(my):
        ''' this method is called thru ajax '''
        args = WebContainer.get_web().get_form_args()
        
        # get the args in the URL
        search_type = args['search_type']
        sobj_search_type = args['sobj_search_type']
        search_id = args['search_id']
        view = args['view']
        sobject = Search.get_by_id(sobj_search_type, search_id)

        content = Widget()
        table = TableWdg(search_type, view, css='table')
        table.set_show_property(False)
        content.add(table)
        content.add(HtmlElement.br(2))

        search = my._get_sobject_search(sobject, search_type)
           
        sobjects = search.get_sobjects()
        if search_type.startswith("sthpw/note"):
            # this assumes that a project has submission!
            from pyasm.prod.biz import Submission
            from pyasm.search import SqlException
            try:
                notes = Submission.get_all_notes(sobject)
                sobjects.extend( notes )
            except SqlException:
                pass

            def compare(x,y):
                return cmp( y.get_value("timestamp"), x.get_value("timestamp") )

            sobjects.sort(cmp=compare)

        table.set_search(search)
        table.set_sobjects(sobjects)
        return content