Пример #1
0
 def fillresponse(self):
     img_title = XferCompImage('img')
     img_title.set_location(0, 0, 1, 6)
     img_title.set_value(self.icon_path())
     self.add_component(img_title)
     lab = XferCompLabelForm('title')
     lab.set_location(1, 0, 2)
     lab.set_value_as_title(_("Print models"))
     self.add_component(lab)
     self.fill_from_model(2, 1, False, ['name'])
     self.fill_from_model(2, 2, True, ['kind'])
     self.item.mode = int(self.item.mode)
     if self.item.kind == 1:
         self.fill_from_model(2, 3, False, ['mode'])
         self.get_components('mode').set_action(self.request, self.get_action('', ''), modal=FORMTYPE_REFRESH, close=CLOSE_NO)
         if (self.item.mode == 1) and (self.item.value[:6] != '<model'):
             self.item.value = "<model>\n<body>\n<text>%s</text></body>\n</model>" % self.item.value
     if self.item.kind == 0:
         self._fill_listing_editor()
     elif (self.item.kind == 1) and (self.item.mode == 0):
         self._fill_label_editor()
     elif (self.item.kind == 2) or ((self.item.kind == 1) and (self.item.mode == 1)):
         self._fill_report_editor()
     for act, opt in ActionsManage.get_actions(ActionsManage.ACTION_IDENT_EDIT, self, key=action_list_sorted):
         self.add_action(act, **opt)
     self.add_action(WrapAction(TITLE_CLOSE, 'images/close.png'))
Пример #2
0
 def add_action_notified(self, xfer_custom, model=None):
     from lucterios.framework.xferadvance import action_list_sorted
     if model is None:
         model = xfer_custom.model.get_long_name()
     elif hasattr(model, "get_long_name"):
         model = model.get_long_name()
     for act, opt in ActionsManage.get_actions(ActionsManage.ACTION_IDENT_GRID, xfer_custom, model, key=action_list_sorted, gridname=self.name):
         self.add_action(xfer_custom.request, act, **opt)
Пример #3
0
 def add_action_notified(self, xfer_custom, model=None):
     from lucterios.framework.xferadvance import action_list_sorted
     if model is None:
         model = xfer_custom.model.get_long_name()
     elif hasattr(model, "get_long_name"):
         model = model.get_long_name()
     for act, opt in ActionsManage.get_actions(ActionsManage.ACTION_IDENT_GRID, xfer_custom, model, key=action_list_sorted, gridname=self.name):
         self.add_action(xfer_custom.request, act, **opt)
Пример #4
0
 def fillresponse(self):
     if self.item.id is None:
         raise LucteriosException(IMPORTANT, _("This record not exist!\nRefresh your application."))
     max_row = self.get_max_row() + 1
     img = XferCompImage('img')
     img.set_value(self.icon_path())
     img.set_location(0, 0, 1, 6)
     self.add_component(img)
     self.fill_from_model(1, max_row, True)
     for act, opt in ActionsManage.get_actions(ActionsManage.ACTION_IDENT_SHOW, self, key=action_list_sorted):
         self.add_action(act, **opt)
     self.add_action(WrapAction(_('Close'), 'images/close.png'))
Пример #5
0
 def fillresponse(self):
     if self.item.id is None:
         raise LucteriosException(IMPORTANT, _("This record not exist!\nRefresh your application."))
     max_row = self.get_max_row() + 1
     img = XferCompImage('img')
     img.set_value(self.icon_path())
     img.set_location(0, 0, 1, 6)
     self.add_component(img)
     self.fill_from_model(1, max_row, True)
     for act, opt in ActionsManage.get_actions(ActionsManage.ACTION_IDENT_SHOW, self, key=action_list_sorted):
         self.add_action(act, **opt)
     self.add_action(WrapAction(_('Close'), 'images/close.png'))
     add_auditlog_button(self, self.item, 0, max(6, self.get_max_row()) + 20)
Пример #6
0
 def fillresponse(self):
     if self.is_new:
         self.caption = self.caption_add
     else:
         self.caption = self.caption_modify
     img = XferCompImage('img')
     img.set_value(self.icon_path())
     img.set_location(0, 0, 1, 6)
     self.add_component(img)
     self.fill_from_model(1, 0, False)
     if len(self.actions) == 0:
         self.add_action(self.get_action(TITLE_OK, 'images/ok.png'), params={"SAVE": "YES"})
     for act, opt in ActionsManage.get_actions(ActionsManage.ACTION_IDENT_EDIT, self, key=action_list_sorted):
         self.add_action(act, **opt)
     self.add_action(WrapAction(TITLE_CANCEL, 'images/cancel.png'))
Пример #7
0
 def fillresponse(self):
     img = XferCompImage('img')
     img.set_value(self.icon_path())
     img.set_location(0, 0)
     self.add_component(img)
     lbl = XferCompLabelForm('title')
     lbl.set_value_as_title(self.caption)
     lbl.set_location(1, 0)
     self.add_component(lbl)
     self.fillresponse_header()
     self.fillresponse_body()
     if self.model is not None:
         for act, opt in ActionsManage.get_actions(ActionsManage.ACTION_IDENT_LIST, self, key=action_list_sorted):
             self.add_action(act, **opt)
     self.add_action(WrapAction(TITLE_CLOSE, 'images/close.png'))
Пример #8
0
 def fillresponse(self):
     if self.is_new:
         self.caption = self.caption_add
     else:
         self.caption = self.caption_modify
     img = XferCompImage('img')
     img.set_value(self.icon_path())
     img.set_location(0, 0, 1, 6)
     self.add_component(img)
     self.fill_from_model(1, 0, False)
     if len(self.actions) == 0:
         self.add_action(self.get_action(TITLE_OK, 'images/ok.png'), params={"SAVE": "YES"})
     for act, opt in ActionsManage.get_actions(ActionsManage.ACTION_IDENT_EDIT, self, key=action_list_sorted):
         self.add_action(act, **opt)
     self.add_action(WrapAction(TITLE_CANCEL, 'images/cancel.png'))
     add_auditlog_button(self, self.item, 0, max(6, self.get_max_row()) + 20)
Пример #9
0
 def fillresponse(self):
     img = XferCompImage('img')
     img.set_value(self.icon_path())
     img.set_location(0, 0)
     self.add_component(img)
     lbl = XferCompLabelForm('title')
     lbl.set_value_as_title(self.caption)
     lbl.set_location(1, 0)
     self.add_component(lbl)
     self.fillresponse_header()
     self.fillresponse_body()
     add_auditlogs_button(self, self.model, 0, self.get_max_row() + 20)
     if self.model is not None:
         for act, opt in ActionsManage.get_actions(ActionsManage.ACTION_IDENT_LIST, self, key=action_list_sorted):
             self.add_action(act, **opt)
     self.add_action(WrapAction(TITLE_CLOSE, 'images/close.png'))
Пример #10
0
 def fillresponse(self):
     self.fields_desc.initial(self.item)
     self.read_criteria_from_params()
     self.fillresponse_add_title()
     self.fillresponse_search_select()
     self.fillresponse_search_values()
     self.fillresponse_show_criteria()
     row = self.get_max_row()
     self.filter_items()
     grid = XferCompGrid(self.field_id)
     grid.set_model(self.items, self.fieldnames, self)
     grid.add_action_notified(self)
     grid.set_location(0, row + 4, 6)
     grid.set_size(200, 500)
     self.add_component(grid)
     for act, opt in ActionsManage.get_actions(
             ActionsManage.ACTION_IDENT_LIST, self, key=action_list_sorted):
         self.add_action(act, **opt)
     self.add_action(WrapAction(_('Close'), 'images/close.png'))