def _get_from_custom(self, request, *args, **kwargs): dlg = XferContainerCustom() dlg.request = self.request dlg.is_view_right = self.is_view_right dlg.caption = self.caption dlg.extension = self.extension dlg.action = self.action img_title = XferCompImage('img_title') img_title.set_location(0, 0, 1, 2) img_title.set_value(self.traitment_data[0]) dlg.add_component(img_title) lbl = XferCompLabelForm("info") lbl.set_location(1, 0) dlg.add_component(lbl) if self.getparam("RELOAD") is not None: lbl.set_value(six.text_type(self.traitment_data[2])) dlg.add_action(WrapAction(_("Close"), "images/close.png")) else: lbl.set_value_center("{[br/]}" + six.text_type(self.traitment_data[1])) btn = XferCompButton("Next") btn.set_location(1, 1) btn.set_size(50, 300) btn.set_action(self.request, self.return_action(_('Traitment...'), ""), params={"RELOAD": "YES"}) btn.java_script = "parent.refresh()" dlg.params["RELOAD"] = "YES" dlg.add_component(btn) dlg.add_action(WrapAction(_("Cancel"), "images/cancel.png")) return dlg.get_post(request, *args, **kwargs)
def _get_from_custom(self, request, *args, **kwargs): dlg = XferContainerCustom() dlg.request = self.request dlg.is_view_right = self.is_view_right dlg.caption = self.caption dlg.extension = self.extension dlg.action = self.action img_title = XferCompImage('img_title') img_title.set_location(0, 0, 1, 2) img_title.set_value(self.traitment_data[0]) dlg.add_component(img_title) lbl = XferCompLabelForm("info") lbl.set_location(1, 0) dlg.add_component(lbl) if self.getparam("RELOAD") is not None: lbl.set_value( "{[br/]}{[center]}" + six.text_type(self.traitment_data[2]) + "{[/center]}") dlg.add_action(WrapAction(_("Close"), "images/close.png"), {}) else: lbl.set_value( "{[br/]}{[center]}" + six.text_type(self.traitment_data[1]) + "{[/center]}") btn = XferCompButton("Next") btn.set_location(1, 1) btn.set_size(50, 300) btn.set_action(self.request, self.get_action( _('Traitment...'), ""), {'params': {"RELOAD": "YES"}}) btn.java_script = "parent.refresh()" dlg.params["RELOAD"] = "YES" dlg.add_component(btn) dlg.add_action(WrapAction(_("Cancel"), "images/cancel.png"), {}) return dlg.get(request, *args, **kwargs)
def fillresponse_search_values(self): comp = XferCompButton("searchButtonAdd") comp.is_default = True comp.set_is_mini(True) comp.set_location(4, 10, 1, 7) comp.set_action(self.request, self.get_action("", "images/add.png"), modal=FORMTYPE_REFRESH, close=CLOSE_NO, params={'ACT': 'ADD'}) self.add_component(comp) comp = XferCompDate("searchValueDate") comp.set_needed(True) comp.set_location(3, 11) comp.set_size(20, 200) self.add_component(comp) comp = XferCompFloat("searchValueFloat") comp.set_needed(True) comp.set_location(3, 12) comp.set_size(20, 200) self.add_component(comp) comp = XferCompEdit("searchValueStr") comp.set_location(3, 13) comp.set_size(20, 200) self.add_component(comp) comp = XferCompCheckList("searchValueList") comp.set_location(3, 14) comp.set_size(80, 200) self.add_component(comp) comp = XferCompCheck("searchValueBool") comp.set_location(3, 15) comp.set_size(20, 200) self.add_component(comp) comp = XferCompTime("searchValueTime") comp.set_needed(True) comp.set_location(3, 16) comp.set_size(20, 200) self.add_component(comp) label = XferCompLabelForm('labelsearchSep') label.set_value("") label.set_size(1, 200) label.set_location(3, 17) self.add_component(label)
def fillresponse_search_values(self): comp = XferCompButton("searchButtonAdd") comp.set_is_mini(True) comp.set_location(4, 10, 1, 7) comp.set_action(self.request, self.get_action("", "images/add.png"), {'modal': FORMTYPE_REFRESH, 'close': CLOSE_NO, 'params': {'ACT': 'ADD'}}) self.add_component(comp) comp = XferCompDate("searchValueDate") comp.set_needed(True) comp.set_location(3, 11) comp.set_size(20, 200) self.add_component(comp) comp = XferCompFloat("searchValueFloat") comp.set_needed(True) comp.set_location(3, 12) comp.set_size(20, 200) self.add_component(comp) comp = XferCompEdit("searchValueStr") comp.set_location(3, 13) comp.set_size(20, 200) self.add_component(comp) comp = XferCompCheckList("searchValueList") comp.set_location(3, 14) comp.set_size(80, 200) self.add_component(comp) comp = XferCompCheck("searchValueBool") comp.set_location(3, 15) comp.set_size(20, 200) self.add_component(comp) comp = XferCompTime("searchValueTime") comp.set_needed(True) comp.set_location(3, 16) comp.set_size(20, 200) self.add_component(comp) label = XferCompLabelForm('labelsearchSep') label.set_value("") label.set_size(1, 200) label.set_location(3, 17) self.add_component(label)