def getMembers(self): project = self.context.getProject() adapter = IOrganizedEmployess(project.teams) cp = adapter.get_all_companies_and_people() members = [] for k in cp.keys(): count = 0 for i in cp[k]: if count == 0: count += 1 continue else: members.append(i) count += 1 return members
def getTeamsOrUsers(self): teams = self.context.aq_inner.contentValues({'portal_type':['Team']}) teamsids = [team.getId() for team in teams] ksscore = self.getCommandSet('core') selector = ksscore.getSelector('samenode','') content = "<select class=\"selectarea\" style=\"display: inline;\">" content += "<option value=\"please select a option\">分配权限给...</option>" content += "<optgroup label='项目组'>" for team in teams: if team.getId() != 'projectmanagers': content += "<option value=\"" + IGroup(team).getGroupId() + \ "\">" + team.pretty_title_or_id() + \ "</option>" content += "</optgroup>" project = self.context.getProject() adapter = IOrganizedEmployess(project.teams) cp = adapter.get_all_companies_and_people() for k in cp.keys(): count = 0 for i in cp[k]: if count == 0: content += "<optgroup label='" + i.pretty_title_or_id() \ +"'>" count += 1 else: content += "<option value=\"" + i.getId() + \ "\">" + i.pretty_title_or_id() + \ "</option>" count += 1 content += "</optgroup>" content += "</select>" content = force_unicode(content, 'utf-8') ksscore.insertHTMLAfter(selector, content) selectarea = ksscore.getSelector('css', '.selectarea') ksscore.focus(selectarea)
def getTeamsOrUsers(self): teams = self.context.aq_inner.contentValues({'portal_type': ['Team']}) teamsids = [team.getId() for team in teams] ksscore = self.getCommandSet('core') selector = ksscore.getSelector('samenode', '') content = "<select class=\"selectarea\" style=\"display: inline;\">" content += "<option value=\"please select a option\">分配权限给...</option>" content += "<optgroup label='项目组'>" for team in teams: if team.getId() != 'projectmanagers': content += "<option value=\"" + IGroup(team).getGroupId() + \ "\">" + team.pretty_title_or_id() + \ "</option>" content += "</optgroup>" project = self.context.getProject() adapter = IOrganizedEmployess(project.teams) cp = adapter.get_all_companies_and_people() for k in cp.keys(): count = 0 for i in cp[k]: if count == 0: content += "<optgroup label='" + i.pretty_title_or_id() \ +"'>" count += 1 else: content += "<option value=\"" + i.getId() + \ "\">" + i.pretty_title_or_id() + \ "</option>" count += 1 content += "</optgroup>" content += "</select>" content = force_unicode(content, 'utf-8') ksscore.insertHTMLAfter(selector, content) selectarea = ksscore.getSelector('css', '.selectarea') ksscore.focus(selectarea)
def getMembers(self): project = self.context.getProject() adapter = IOrganizedEmployess(project.teams) return adapter.get_all_companies_and_people()