Ejemplo n.º 1
0
    def get_display(my):
        web = WebContainer.get_web()
        if not my.view:
            view = web.get_form_value("filter|view")

        # create popup
        create_popup = PopupWdg("create_action")
        create_popup.set_auto_hide(False)
        create_popup.add("Enter name of view: ")
        create_popup.add(TextWdg("create_view_name"))
        # create_popup.add( HtmlElement.br(2) )
        # create_popup.add( "Copy from template: " )
        # template_select = SelectWdg("copy_from_template")
        # template_select.add_empty_option("-- None --")
        # template_select.set_option("values", "list|summary|task")
        # create_popup.add( template_select )

        create_popup.add(HtmlElement.br(2, clear="all"))

        from pyasm.prod.web import ProdIconButtonWdg, ProdIconSubmitWdg

        create_icon = ProdIconButtonWdg("Create")

        ajax = AjaxCmd()
        ajax.register_cmd("pyasm.widget.CustomCreateViewCbk")
        ajax.add_element_name("create_view_name")
        ajax.add_element_name("auto_create_edit")
        ajax.set_option("search_type", my.search_type)
        ajax.set_option("project", Project.get_project_code())
        if my.view:
            ajax.set_option("template_view", my.view)
        create_icon.add_event(
            "onclick",
            "%s;%s"
            % (ajax.get_on_script(), "toggle_display('create_action');setTimeout('document.form.submit()',1000)"),
        )

        cancel_icon = ProdIconButtonWdg("Cancel")
        cancel_icon.add_event("onclick", "toggle_display('create_action')")

        span = SpanWdg()
        span.add(create_icon)
        span.add(cancel_icon)
        create_popup.add(span)
        create_popup.add(HtmlElement.br())

        # add the create button
        create = IconButtonWdg("Create View", IconWdg.SAVE, True)
        create.add_event("onclick", "%s" % create_popup.get_on_script())

        # lay it all out
        widget = Widget()
        widget.add(create_popup)
        # Browser does not have create
        # widget.add(create)
        return widget
Ejemplo n.º 2
0
    def get_display(my):
        web = WebContainer.get_web()
        if not my.view:
            view = web.get_form_value("filter|view")

        # create popup
        create_popup = PopupWdg("create_action")
        create_popup.set_auto_hide(False)
        create_popup.add("Enter name of view: ")
        create_popup.add(TextWdg("create_view_name"))
        #create_popup.add( HtmlElement.br(2) )
        #create_popup.add( "Copy from template: " )
        #template_select = SelectWdg("copy_from_template")
        #template_select.add_empty_option("-- None --")
        #template_select.set_option("values", "list|summary|task")
        #create_popup.add( template_select )

        create_popup.add(HtmlElement.br(2, clear="all"))

        from pyasm.prod.web import ProdIconButtonWdg, ProdIconSubmitWdg
        create_icon = ProdIconButtonWdg('Create')

        ajax = AjaxCmd()
        ajax.register_cmd("pyasm.widget.CustomCreateViewCbk")
        ajax.add_element_name("create_view_name")
        ajax.add_element_name("auto_create_edit")
        ajax.set_option("search_type", my.search_type)
        ajax.set_option("project", Project.get_project_code())
        if my.view:
            ajax.set_option("template_view", my.view)
        create_icon.add_event(
            "onclick", "%s;%s" %
            (ajax.get_on_script(),
             "toggle_display('create_action');setTimeout('document.form.submit()',1000)"
             ))

        cancel_icon = ProdIconButtonWdg('Cancel')
        cancel_icon.add_event("onclick", "toggle_display('create_action')")

        span = SpanWdg()
        span.add(create_icon)
        span.add(cancel_icon)
        create_popup.add(span)
        create_popup.add(HtmlElement.br())

        # add the create button
        create = IconButtonWdg("Create View", IconWdg.SAVE, True)
        create.add_event("onclick", "%s" % create_popup.get_on_script())

        # lay it all out
        widget = Widget()
        widget.add(create_popup)
        # Browser does not have create
        #widget.add(create)
        return widget
Ejemplo n.º 3
0
    def get_create_view_wdg(my, search_type):

        # create popup
        create_popup = PopupWdg("create_action")
        create_popup.set_auto_hide(False)
        create_popup.add("Enter name of view: ")
        create_popup.add(TextWdg("create_view_name"))
        #create_popup.add( HtmlElement.br(2) )
        #create_popup.add( "Copy from template: " )
        #template_select = SelectWdg("copy_from_template")
        #template_select.add_empty_option("-- None --")
        #template_select.set_option("values", "list|summary|task")
        #create_popup.add( template_select )
        create_popup.add(HtmlElement.br(2))
        create_popup.add(
            CheckboxWdg('auto_create_edit', label='Auto Create Edit View'))
        create_popup.add(HtmlElement.br(2, clear="all"))

        from pyasm.prod.web import ProdIconButtonWdg, ProdIconSubmitWdg
        create_icon = ProdIconButtonWdg('Create')

        ajax = AjaxCmd()
        ajax.register_cmd("pyasm.widget.CustomCreateViewCbk")
        ajax.add_element_name("create_view_name")
        ajax.add_element_name("auto_create_edit")
        ajax.set_option("search_type", search_type)
        ajax.set_option("project", Project.get_project_code())
        div = ajax.generate_div()
        div.set_post_ajax_script('document.form.submit()')
        create_icon.add_event(
            "onclick", "%s;%s" %
            (ajax.get_on_script(), "toggle_display('create_action')"))

        cancel_icon = ProdIconButtonWdg('Cancel')
        cancel_icon.add_event("onclick", "toggle_display('create_action')")

        span = SpanWdg()
        span.add(create_icon)
        span.add(cancel_icon)
        create_popup.add(span)
        create_popup.add(HtmlElement.br())

        # add the create button
        create = IconButtonWdg("Create View", IconWdg.SAVE, True)
        create.add_event("onclick", "%s" % create_popup.get_on_script())

        # lay it all out
        widget = Widget()
        widget.add(create_popup)
        widget.add(create)
        widget.add(div)
        return widget
Ejemplo n.º 4
0
    def get_create_view_wdg(my, search_type):

        # create popup
        create_popup = PopupWdg("create_action")
        create_popup.set_auto_hide(False)
        create_popup.add("Enter name of view: ")
        create_popup.add(TextWdg("create_view_name"))
        # create_popup.add( HtmlElement.br(2) )
        # create_popup.add( "Copy from template: " )
        # template_select = SelectWdg("copy_from_template")
        # template_select.add_empty_option("-- None --")
        # template_select.set_option("values", "list|summary|task")
        # create_popup.add( template_select )
        create_popup.add(HtmlElement.br(2))
        create_popup.add(CheckboxWdg("auto_create_edit", label="Auto Create Edit View"))
        create_popup.add(HtmlElement.br(2, clear="all"))

        from pyasm.prod.web import ProdIconButtonWdg, ProdIconSubmitWdg

        create_icon = ProdIconButtonWdg("Create")

        ajax = AjaxCmd()
        ajax.register_cmd("pyasm.widget.CustomCreateViewCbk")
        ajax.add_element_name("create_view_name")
        ajax.add_element_name("auto_create_edit")
        ajax.set_option("search_type", search_type)
        ajax.set_option("project", Project.get_project_code())
        div = ajax.generate_div()
        div.set_post_ajax_script("document.form.submit()")
        create_icon.add_event("onclick", "%s;%s" % (ajax.get_on_script(), "toggle_display('create_action')"))

        cancel_icon = ProdIconButtonWdg("Cancel")
        cancel_icon.add_event("onclick", "toggle_display('create_action')")

        span = SpanWdg()
        span.add(create_icon)
        span.add(cancel_icon)
        create_popup.add(span)
        create_popup.add(HtmlElement.br())

        # add the create button
        create = IconButtonWdg("Create View", IconWdg.SAVE, True)
        create.add_event("onclick", "%s" % create_popup.get_on_script())

        # lay it all out
        widget = Widget()
        widget.add(create_popup)
        widget.add(create)
        widget.add(div)
        return widget