コード例 #1
0
ファイル: views_contacts.py プロジェクト: badenweb/contacts
 def fillresponse(self):
     XferSearchEditor.fillresponse(self)
     self.item.editor.add_email_selector(self, 0, self.get_max_row() + 1, 5)
     if WrapAction.is_permission(self.request, 'contacts.add_abstractcontact'):
         self.get_components(self.field_id).add_action(self.request, ObjectMerge.get_action(_("Merge"), "images/clone.png"),
                                                       close=CLOSE_NO, unique=SELECT_MULTI, params={'modelname': self.model.get_long_name(), 'field_id': self.field_id})
     self.add_action(AbstractContactFindDouble.get_action(_("duplicate"), "images/clone.png"),
                     params={'modelname': self.model.get_long_name(), 'field_id': self.field_id}, pos_act=0)
コード例 #2
0
ファイル: views_contacts.py プロジェクト: badenweb/contacts
 def fillresponse(self, modelname, field_id):
     if modelname is not None:
         self.model = apps.get_model(modelname)
     self.field_id = field_id
     XferListEditor.fillresponse(self)
     if WrapAction.is_permission(self.request, 'contacts.add_abstractcontact'):
         self.get_components(self.field_id).add_action(self.request, ObjectMerge.get_action(_("Merge"), "images/clone.png"),
                                                       close=CLOSE_NO, unique=SELECT_MULTI)
コード例 #3
0
ファイル: views_contacts.py プロジェクト: Lucterios2/contacts
 def fillresponse(self, modelname, field_id):
     if modelname is not None:
         self.model = apps.get_model(modelname)
     self.field_id = field_id
     XferListEditor.fillresponse(self)
     if WrapAction.is_permission(self.request, 'contacts.add_abstractcontact'):
         self.get_components(self.field_id).add_action(self.request, ObjectMerge.get_action(_("Merge"), "images/clone.png"),
                                                       close=CLOSE_NO, unique=SELECT_MULTI)
コード例 #4
0
ファイル: views_contacts.py プロジェクト: Lucterios2/contacts
 def fillresponse(self):
     XferSearchEditor.fillresponse(self)
     self.item.editor.add_email_selector(self, 0, self.get_max_row() + 1, 5)
     if WrapAction.is_permission(self.request, 'contacts.add_abstractcontact'):
         self.get_components(self.field_id).add_action(self.request, ObjectMerge.get_action(_("Merge"), "images/clone.png"),
                                                       close=CLOSE_NO, unique=SELECT_MULTI, params={'modelname': self.model.get_long_name(), 'field_id': self.field_id})
     self.add_action(AbstractContactFindDouble.get_action(_("duplicate"), "images/clone.png"),
                     params={'modelname': self.model.get_long_name(), 'field_id': self.field_id}, pos_act=0)
コード例 #5
0
 def fillresponse_body(self):
     if Params.getvalue("member-age-enable") == 1:
         self.new_tab(_('Age'))
         self.fill_grid(0, Age, "age", Age.objects.all())
     if Params.getvalue("member-team-enable") == 1:
         show_only_enabled_team = self.getparam('show_only_enabled_team',
                                                True)
         self.new_tab(Params.getvalue("member-team-text"))
         if show_only_enabled_team:
             team_list = Team.objects.filter(unactive=False)
         else:
             team_list = Team.objects.all()
         self.fill_grid(0, Team, "team", team_list)
         if show_only_enabled_team:
             grid = self.get_components('team')
             grid.delete_header('unactive')
         check = XferCompCheck('show_only_enabled_team')
         check.set_location(0, 2)
         check.set_value(show_only_enabled_team)
         check.description = _('show only enabled team')
         check.set_action(self.request,
                          self.get_action(),
                          modal=FORMTYPE_REFRESH,
                          close=CLOSE_NO)
         self.add_component(check)
     if Params.getvalue("member-activite-enable") == 1:
         self.new_tab(Params.getvalue("member-activite-text"))
         self.fill_grid(0, Activity, "activity", Activity.objects.all())
         grid = self.get_components("activity")
         if WrapAction.is_permission(self.request, 'CORE.add_parameter'):
             grid.add_action(self.request,
                             ObjectMerge.get_action(_("Merge"),
                                                    "images/clone.png"),
                             close=CLOSE_NO,
                             unique=SELECT_MULTI,
                             params={
                                 'modelname': 'member.Activity',
                                 'field_id': 'activity'
                             })
         if hasattr(settings, "DIACAMMA_MAXACTIVITY") and (getattr(
                 settings, "DIACAMMA_MAXACTIVITY") <= grid.nb_lines):
             lbl = XferCompLabelForm("limit_activity")
             lbl.set_color('red')
             lbl.set_value_as_headername(
                 _('You have the maximum of activities!'))
             lbl.set_location(grid.col, self.get_max_row() + 1)
             self.add_component(lbl)
             grid.delete_action("diacamma.member/activityAddModify", True)
コード例 #6
0
ファイル: views_accounts.py プロジェクト: Diacamma2/financial
 def fillresponse(self):
     ObjectMerge.fillresponse(self, 'chartsaccount')
コード例 #7
0
ファイル: views_accounts.py プロジェクト: Diacamma2/financial
 def __init__(self, **kwargs):
     ObjectMerge.__init__(self, **kwargs)
     self.params['modelname'] = ChartsAccount.get_long_name()