def execute(self): self.out = response.writer if self.loginUser == None: self.out.write(u"请先<a href='../../login.jsp'>登录</a>,然后才能管理活动") return site_config = SiteConfig() site_config.get_config() show_type = self.params.getStringParam("type") self.pager = self.params.createPager() self.pager.itemName = u"活动" self.pager.itemUnit = u"个" qry = ActionQuery(""" act.title, act.createDate, act.actionId, act.ownerId, act.ownerType, act.createUserId, act.actionType, act.description, act.userLimit, act.startDateTime,act.finishDateTime, act.attendLimitDateTime, act.place, act.status, act.visibility, act.attendCount """) if show_type == "owner": qry.createUserId = self.loginUser.userId self.pager.totalRows = qry.count() action_list = qry.query_map(self.pager) request.setAttribute("action_list", action_list) request.setAttribute("pager", self.pager) response.setContentType("text/html; charset=UTF-8") if show_type == "owner": return "/WEB-INF/ftl/action/action_manage_list.ftl" else: return "/WEB-INF/ftl/action/action_list.ftl"
def get_action_list(self): ownerType = self.params.getStringParam("ownerType") showtype = self.params.getStringParam("type") request.setAttribute("type", showtype) request.setAttribute("ownerType", ownerType) self.pager = self.params.createPager() self.pager.itemName = u"活动" self.pager.itemUnit = u"个" self.pager.pageSize = 20 qry = ActionQuery( """ act.title, act.createDate, act.actionId, act.ownerId, act.ownerType, act.createUserId, act.actionType, act.description, act.userLimit, act.startDateTime,act.finishDateTime, act.attendLimitDateTime, act.place, act.status, act.visibility, act.attendCount,u.loginName,u.trueName """) if not (ownerType == None or len(ownerType) < 1): qry.ownerType = ownerType if showtype == "running": qry.qryDate = 1 #正在进行 elif showtype == "finish": qry.qryDate = 2 #已经完成的活动 elif showtype == "new": qry.qryDate = 0 #正在报名的活动 self.pager.totalRows = qry.count() action_list = qry.query_map(self.pager) request.setAttribute("action_list", action_list) request.setAttribute("pager", self.pager)
def execute(self): response.setContentType("text/html; charset=UTF-8") groupName = request.getAttribute("groupName") if groupName == None or groupName == "": return "" group = group_svc.getGroupByName(groupName) if group == None: return self.notFound() page = self.getGroupIndexPage(group) page = { "pageId": 0, "layoutId": 2, # 固定是布局2 "isSystemPage": "true", "owner": "user", "title": "", "skin": page.skin } # 构造widgets . widgets = [{ "id": "1", "pageId": 0, "columnIndex": 1, "title": u"协作组信息", "module": "group_info", "ico": "", "data": "" }] self.getGroupInfo(group.groupName) request.setAttribute("widget_list", widgets) request.setAttribute("widgets", widgets) request.setAttribute("page", page) pager = self.params.createPager() pager.itemName = u"活动" pager.itemUnit = u"个" pager.pageSize = 20 qry = ActionQuery( """ act.title, act.createDate, act.actionId, act.ownerId, act.ownerType, act.createUserId, act.actionType, act.description, act.userLimit, act.startDateTime,act.finishDateTime, act.attendLimitDateTime, act.place, act.status, act.visibility, act.attendCount, u.trueName, u.loginName """) qry.ownerType = "group" qry.status = 0 qry.ownerId = group.groupId #print "qry = ", str(qry.ownerId) pager.totalRows = qry.count() action_list = qry.query_map(pager) request.setAttribute("pager", pager) request.setAttribute("action_list", action_list) request.setAttribute("group", group) return "/WEB-INF/group/default/group_action_list.ftl"
def action_list(self): qry = ActionQuery( """ act.actionId, act.title, act.ownerType, act.ownerId, act.createDate, act.startDateTime, act.finishDateTime, act.createUserId, act.actionType, act.status """ ) qry.ownerId = self.subject.subjectId qry.ownerType = "subject" qry.status = None pager = self.params.createPager() pager.itemName = u"活动" pager.itemUnit = u"个" pager.pageSize = 25 pager.totalRows = qry.count() action_list = qry.query_map(pager) request.setAttribute("subject", self.subject) request.setAttribute("action_list", action_list) return "/WEB-INF/subjectmanage/action.ftl"
def execute(self): self.getBaseData() self.prepareCourseId = self.params.getIntParam("prepareCourseId") if self.prepareCourseId == 0: self.printer.write(u"无效的备课标识。") return prepareCourse = self.getBasePrepareCourse() if prepareCourse == None: self.printer.write(u"没有加载到所请求的备课。") return if self.canManage(prepareCourse) == False: self.printer.write(u"您无权管理本备课。") return if request.getMethod() == "POST": cmd = self.params.safeGetIntParam("cmdtype") guid = self.params.safeGetIntValues("guid") for actionId in guid: self.act_svc.updateActionStatus(cmd, int(actionId)) pager = self.params.createPager() pager.itemName = u"活动" pager.itemUnit = u"个" qry = ActionQuery( """ act.title, act.createDate, act.actionId, act.ownerId, act.ownerType, act.createUserId, act.actionType, act.description, act.userLimit, act.startDateTime,act.finishDateTime, act.attendLimitDateTime, act.place, act.status, act.visibility, act.attendCount,u.trueName,u.loginName """) qry.k = None #防止右边查询冲突 qry.ownerType = "preparecourse" qry.ownerId = prepareCourse.prepareCourseId pager.totalRows = qry.count() action_list = qry.query_map(pager) request.setAttribute("pager", pager) request.setAttribute("action_list", action_list) request.setAttribute("prepareCourse", prepareCourse) response.setContentType("text/html; charset=UTF-8") return "/WEB-INF/ftl/course/manage_createPrepareCourse_action.ftl"
def execute(self): self.getBaseData() response.setContentType("text/html; charset=UTF-8") if self.prepareCourseId == 0: self.printer.write(u"无效的课程标识。") return prepareCourse = self.getBasePrepareCourse() if prepareCourse == None: self.printer.write(u"没有加载到所请求的备课。") return if self.canView(prepareCourse) == False: self.printer.write(u"您无权查看本内容。") return page = self.getPrepareCoursePageWithCustomSkin(prepareCourse) widgets = [ {"id": "1", "pageId":0, "columnIndex":1,"title":u"备课基本信息","module":"show_preparecourse_info", "ico":"", "data":""}, {"id": "placerholder1", "pageId":0, "columnIndex":2,"title":"","module":"placeholder", "ico":"", "data":""} ] pager = self.params.createPager() pager.itemName = u"活动" pager.itemUnit = u"个" qry = ActionQuery(""" act.title, act.createDate, act.actionId, act.ownerId, act.ownerType, act.createUserId, act.actionType, act.description, act.userLimit, act.startDateTime,act.finishDateTime, act.attendLimitDateTime, act.place, act.status, act.visibility, act.attendCount """) qry.ownerType = "preparecourse" #qry.status = 0 qry.ownerId = self.prepareCourseId action_list = qry.query_map(pager) pager.totalRows = qry.count() request.setAttribute("widgets",widgets) request.setAttribute("widget_list",widgets) request.setAttribute("page", page) request.setAttribute("pager", pager) request.setAttribute("prepareCourse",prepareCourse) request.setAttribute("action_list", action_list) return "/WEB-INF/ftl/course/show_preparecourse_action_list.ftl"
def execute(self): if self.loginUser == None: self.out.println(u"请先<a href='../../login.jsp'>登录</a>,然后才能管理活动") return accessControlService = __spring__.getBean("accessControlService") if False == accessControlService.isSystemContentAdmin(self.loginUser): ActionError(u"没有管理权限.") return ActionResult.ERROR self.pager = self.params.createPager() self.pager.itemName = u"活动" self.pager.itemUnit = u"个" qry = ActionQuery( """ act.title, act.createDate, act.actionId, act.ownerId, act.ownerType, act.createUserId, act.actionType, act.description, act.userLimit, act.startDateTime,act.finishDateTime, act.attendLimitDateTime, act.place, act.status, act.visibility, act.attendCount,u.loginName,u.trueName """) self.pager.totalRows = qry.count() action_list = qry.query_map(self.pager) request.setAttribute("action_list", action_list) request.setAttribute("pager", self.pager) response.setContentType("text/html; charset=UTF-8") return "/WEB-INF/ftl/action/admin_action_list.ftl"