mirror of https://github.com/Rekoe/rk_svnadmin
add
parent
d8c7cda742
commit
e74f71a78c
|
@ -2,10 +2,11 @@ package com.rekoe.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.nutz.dao.entity.annotation.Comment;
|
import org.nutz.dao.entity.annotation.Column;
|
||||||
import org.nutz.dao.entity.annotation.Index;
|
import org.nutz.dao.entity.annotation.Index;
|
||||||
import org.nutz.dao.entity.annotation.Name;
|
import org.nutz.dao.entity.annotation.Name;
|
||||||
import org.nutz.dao.entity.annotation.PK;
|
import org.nutz.dao.entity.annotation.PK;
|
||||||
|
import org.nutz.dao.entity.annotation.Readonly;
|
||||||
import org.nutz.dao.entity.annotation.Table;
|
import org.nutz.dao.entity.annotation.Table;
|
||||||
import org.nutz.dao.entity.annotation.TableIndexes;
|
import org.nutz.dao.entity.annotation.TableIndexes;
|
||||||
|
|
||||||
|
@ -28,17 +29,17 @@ public class PjGrUsr implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 用户
|
* 用户
|
||||||
*/
|
*/
|
||||||
@Comment
|
@Column
|
||||||
private String usr;
|
private String usr;
|
||||||
/**
|
/**
|
||||||
* 用户姓名
|
* 用户姓名
|
||||||
*/
|
*/
|
||||||
@Comment
|
@Readonly
|
||||||
private String usrName;
|
private String usrName;
|
||||||
/**
|
/**
|
||||||
* 组
|
* 组
|
||||||
*/
|
*/
|
||||||
@Comment
|
@Column
|
||||||
private String gr;
|
private String gr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,7 +28,8 @@ public class AdminProjectGroupAct extends BaseAction {
|
||||||
@Ok("fm:template.admin.project_group.list")
|
@Ok("fm:template.admin.project_group.list")
|
||||||
@RequiresPermissions({ "project.group:view" })
|
@RequiresPermissions({ "project.group:view" })
|
||||||
@PermissionTag(name = "SVN浏览账号", tag = "SVN账号管理")
|
@PermissionTag(name = "SVN浏览账号", tag = "SVN账号管理")
|
||||||
public Pagination list(@Param(value = "pageNumber", df = "1") Integer page, @Param("pj") String pj) {
|
public Pagination list(@Param(value = "pageNumber", df = "1") Integer page, @Param("pj") String pj,HttpServletRequest req) {
|
||||||
|
req.setAttribute("pj", pj);
|
||||||
return projectGroupService.getObjListByPager(page, 20, Cnd.where("pj", "=", pj));
|
return projectGroupService.getObjListByPager(page, 20, Cnd.where("pj", "=", pj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.rekoe.module.admin;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.nutz.dao.Cnd;
|
||||||
|
import org.nutz.ioc.loader.annotation.Inject;
|
||||||
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
|
import org.nutz.mvc.annotation.At;
|
||||||
|
import org.nutz.mvc.annotation.Ok;
|
||||||
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
|
||||||
|
import com.rekoe.annotation.PermissionTag;
|
||||||
|
import com.rekoe.common.Message;
|
||||||
|
import com.rekoe.common.page.Pagination;
|
||||||
|
import com.rekoe.domain.PjGrUsr;
|
||||||
|
import com.rekoe.module.BaseAction;
|
||||||
|
import com.rekoe.service.ProjectGroupUsrService;
|
||||||
|
import com.rekoe.service.SvnUserService;
|
||||||
|
|
||||||
|
@IocBean
|
||||||
|
@At("/admin/project/group/usr")
|
||||||
|
public class AdminProjectGroupUsrAct extends BaseAction {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ProjectGroupUsrService projectGroupUsrService;
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Ok("fm:template.admin.project_group_usr.list")
|
||||||
|
@RequiresPermissions({ "project.group:view" })
|
||||||
|
@PermissionTag(name = "SVN浏览账号", tag = "SVN账号管理")
|
||||||
|
public Pagination list(@Param(value = "pageNumber", df = "1") int page, @Param("pj") String pj, @Param("gr") String gr, HttpServletRequest req) {
|
||||||
|
req.setAttribute("pj", pj);
|
||||||
|
req.setAttribute("gr", gr);
|
||||||
|
return projectGroupUsrService.getObjListByPager(page, 20, Cnd.where("pj", "=", pj).and("gr", "=", gr));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private SvnUserService svnUserService;
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Ok("fm:template.admin.project_group_usr.add")
|
||||||
|
@RequiresPermissions({ "project.group:add" })
|
||||||
|
@PermissionTag(name = "添加项目组用户", tag = "SVN账号管理", enable = true)
|
||||||
|
public String add(@Param("pj") String pj, @Param("gr") String gr, HttpServletRequest req) {
|
||||||
|
req.setAttribute("pj", pj);
|
||||||
|
req.setAttribute("gr", gr);
|
||||||
|
req.setAttribute("usrList", svnUserService.listUnSelected(pj, gr));
|
||||||
|
return pj;
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Ok("json")
|
||||||
|
@RequiresPermissions("project.group:add")
|
||||||
|
@PermissionTag(name = "添加项目组用户", tag = "SVN账号管理", enable = false)
|
||||||
|
public Message o_save(@Param("::pgu.") PjGrUsr group, HttpServletRequest req) {
|
||||||
|
return Message.error("ok", req);
|
||||||
|
}
|
||||||
|
|
||||||
|
@At
|
||||||
|
@Ok("json")
|
||||||
|
@RequiresPermissions("project.group:delete")
|
||||||
|
@PermissionTag(name = "删除项目组用户", tag = "SVN账号管理", enable = true)
|
||||||
|
public Message delete(@Param("pj") String pj, @Param("gr") String gr, @Param("usr") String usr, HttpServletRequest req) {
|
||||||
|
projectGroupUsrService.delete(pj, gr, usr);
|
||||||
|
return Message.success("ok", req);
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,18 +17,18 @@ import com.rekoe.module.BaseAction;
|
||||||
import com.rekoe.service.SvnUserService;
|
import com.rekoe.service.SvnUserService;
|
||||||
|
|
||||||
@IocBean
|
@IocBean
|
||||||
@At("/admin/project/group")
|
@At("/admin/svn/user")
|
||||||
public class AdminSvnUserAct extends BaseAction {
|
public class AdminSvnUserAct extends BaseAction {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private SvnUserService projectUserService;
|
private SvnUserService svnUserService;
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@Ok("fm:template.admin.project_group.list")
|
@Ok("fm:template.admin.project_group.list")
|
||||||
@RequiresPermissions({ "project.group:view" })
|
@RequiresPermissions({ "project.group:view" })
|
||||||
@PermissionTag(name = "SVN浏览账号", tag = "SVN账号管理")
|
@PermissionTag(name = "SVN浏览账号", tag = "SVN账号管理")
|
||||||
public Pagination list(@Param(value = "pageNumber", df = "1") int page) {
|
public Pagination list(@Param(value = "pageNumber", df = "1") int page) {
|
||||||
return projectUserService.getObjListByPager(page, 20, null);
|
return svnUserService.getObjListByPager(page, 20, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At
|
||||||
|
@ -43,9 +43,9 @@ public class AdminSvnUserAct extends BaseAction {
|
||||||
@RequiresPermissions("project.group:add")
|
@RequiresPermissions("project.group:add")
|
||||||
@PermissionTag(name = "SVN添加账号", tag = "SVN账号管理", enable = false)
|
@PermissionTag(name = "SVN添加账号", tag = "SVN账号管理", enable = false)
|
||||||
public Message o_save(@Param("::user.") Usr user, HttpServletRequest req) {
|
public Message o_save(@Param("::user.") Usr user, HttpServletRequest req) {
|
||||||
boolean isOk = projectUserService.nameOk(user.getUsr());
|
boolean isOk = svnUserService.nameOk(user.getUsr());
|
||||||
if (isOk) {
|
if (isOk) {
|
||||||
isOk = projectUserService.insert(user);
|
isOk = svnUserService.insert(user);
|
||||||
}
|
}
|
||||||
if (isOk) {
|
if (isOk) {
|
||||||
return Message.success("ok", req);
|
return Message.success("ok", req);
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
package com.rekoe.service;
|
package com.rekoe.service;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nutz.dao.Cnd;
|
import org.nutz.dao.Cnd;
|
||||||
import org.nutz.dao.Dao;
|
import org.nutz.dao.Dao;
|
||||||
|
import org.nutz.dao.Sqls;
|
||||||
|
import org.nutz.dao.sql.Sql;
|
||||||
|
import org.nutz.dao.sql.SqlCallback;
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
import org.nutz.ioc.loader.annotation.IocBean;
|
||||||
import org.nutz.lang.Lang;
|
import org.nutz.lang.Lang;
|
||||||
|
|
||||||
|
@ -23,7 +31,7 @@ public class SvnUserService extends BaseService<Usr> {
|
||||||
|
|
||||||
public SvnUserService() {
|
public SvnUserService() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public SvnUserService(Dao dao) {
|
public SvnUserService(Dao dao) {
|
||||||
super(dao);
|
super(dao);
|
||||||
}
|
}
|
||||||
|
@ -47,4 +55,40 @@ public class SvnUserService extends BaseService<Usr> {
|
||||||
public boolean isUsername(String username) {
|
public boolean isUsername(String username) {
|
||||||
return Pattern.matches(REGEX_USERNAME, username);
|
return Pattern.matches(REGEX_USERNAME, username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取这个项目组未选的用户(不包括*)
|
||||||
|
*
|
||||||
|
* @param pj
|
||||||
|
* 项目
|
||||||
|
* @param gr
|
||||||
|
* 组
|
||||||
|
* @return 项目组未选的用户(不包括*)
|
||||||
|
*/
|
||||||
|
public List<Usr> listUnSelected(String pj, String gr) {
|
||||||
|
Sql sql = Sqls.create("select usr,name,psw,role from usr a where a.usr <> '*' " + " and not exists (select usr from pj_gr_usr b where a.usr = b.usr and b.pj=@pj and b.gr=@gr) order by a.usr");
|
||||||
|
sql.setParam("pj", pj).setParam("gr", gr);
|
||||||
|
final List<Usr> list = new ArrayList<Usr>();
|
||||||
|
sql.setCallback(new SqlCallback() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object invoke(Connection conn, ResultSet rs, Sql sql) throws SQLException {
|
||||||
|
while (rs.next()) {
|
||||||
|
list.add(readUsr(rs));
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dao().execute(sql);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
Usr readUsr(ResultSet rs) throws SQLException {
|
||||||
|
Usr result = new Usr();
|
||||||
|
result.setUsr(rs.getString("usr"));
|
||||||
|
result.setName(rs.getString("name"));
|
||||||
|
result.setPsw(rs.getString("psw"));
|
||||||
|
result.setRole(rs.getString("role"));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,21 +12,18 @@ $(function() {
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="box-positon">
|
<div class="box-positon">
|
||||||
<div class="rpos"><@s.m "global.position"/>: SVN账号 - <@s.m "global.add"/></div>
|
<div class="rpos"><@s.m "global.position"/>: SVN项目组账号 - <@s.m "global.add"/></div>
|
||||||
<form class="ropt">
|
<form class="ropt">
|
||||||
<input type="submit" value="<@s.m "global.backToList"/>" onclick="this.form.action='list.rk';" class="return-button"/>
|
<input type="submit" value="<@s.m "global.backToList"/>" onclick="this.form.action='list.rk';" class="return-button"/>
|
||||||
</form>
|
</form>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="body-box">
|
<div class="body-box">
|
||||||
<@p.form id="jvForm" action="o_update" labelWidth="12" onsubmit="return false;">
|
<@p.form id="jvForm" action="o_save" labelWidth="12" onsubmit="return false;">
|
||||||
<@p.text width="30" label="姓名" id="user.name" name="user.name" value="" maxlength="100" class="required" required="true"/><@p.tr/>
|
<@p.hidden name="pgu.pj" value='${obj}' />
|
||||||
<@p.text width="30" label="用户名" id="user.usr" name="user.usr" value="" maxlength="100" class="required" required="true"/><@p.tr/>
|
<@p.text width="30" label="项目" id="pgu.pj" name="pgu.pj" value="${obj}" maxlength="100" class="required" required="true" readonly="true"/><@p.tr/>
|
||||||
<@p.text width="30" label="密码" id="user.psw" name="user.psw" value="" maxlength="100" class="required" required="true"/><@p.tr/>
|
<@p.text width="30" label="用户组" id="pgu.gr" name="pgu.gr" value="" maxlength="100" class="required" required="true"/><@p.tr/>
|
||||||
<@p.text width="30" label="邮箱地址" id="user.email" name="user.email" value="" maxlength="100" class="required" required="true"/><@p.tr/>
|
<@p.text width="30" label="描述" id="pgu.des" name="pgu.des" value="" maxlength="100" class="required" required="true"/><@p.tr/>
|
||||||
<@p.td width="50" label="角色" required="true">
|
|
||||||
<@p.select id="user.role" name="user.role" value='0' list={"guest":"选择角色","admin":"admin"} required="true"/>
|
|
||||||
</@p.td><@p.tr/>
|
|
||||||
<@p.td colspan="2">
|
<@p.td colspan="2">
|
||||||
<@p.submit code="global.submit" onclick="Cms.add();"/>
|
<@p.submit code="global.submit" onclick="Cms.add();"/>
|
||||||
</@p.td><@p.tr/>
|
</@p.td><@p.tr/>
|
||||||
|
|
|
@ -39,6 +39,7 @@ function deleted(pj,gr){
|
||||||
<div class="box-positon">
|
<div class="box-positon">
|
||||||
<div class="rpos"><@s.m "global.position"/>: OauthUser - <@s.m "global.list"/></div>
|
<div class="rpos"><@s.m "global.position"/>: OauthUser - <@s.m "global.list"/></div>
|
||||||
<form class="ropt">
|
<form class="ropt">
|
||||||
|
<input type="hidden" name="pj" id="pj" value="${pj}"/>
|
||||||
<input type="submit" class="add" value="<@s.m "global.add"/>" onclick="this.form.action='add';"/>
|
<input type="submit" class="add" value="<@s.m "global.add"/>" onclick="this.form.action='add';"/>
|
||||||
</form>
|
</form>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
@ -51,7 +52,7 @@ function deleted(pj,gr){
|
||||||
<@p.column title="项目" align="center">${group.pj}</@p.column><#t/>
|
<@p.column title="项目" align="center">${group.pj}</@p.column><#t/>
|
||||||
<@p.column title="用户组" align="center">${group.gr}</@p.column><#t/>
|
<@p.column title="用户组" align="center">${group.gr}</@p.column><#t/>
|
||||||
<@p.column title="描述" align="center">${group.des!}</@p.column><#t/>
|
<@p.column title="描述" align="center">${group.des!}</@p.column><#t/>
|
||||||
<@p.column title="设置用户" align="center">设置用户</@p.column><#t/>
|
<@p.column title="设置用户" align="center"><a href="${base}/admin/project/group/usr/list?pageNumber=1&pj=${group.pj}&gr=${group.gr}">设置用户</a></@p.column><#t/>
|
||||||
<@shiro.hasPermission name="project.group:delete">
|
<@shiro.hasPermission name="project.group:delete">
|
||||||
<@p.column title="删除" align="center">
|
<@p.column title="删除" align="center">
|
||||||
<#if group.gr != "manager"><a href="javascript:void(0);" onclick="deleted('${group.pj}','${group.gr}')" class="pn-opt">删除</a></#if><#rt/>
|
<#if group.gr != "manager"><a href="javascript:void(0);" onclick="deleted('${group.pj}','${group.gr}')" class="pn-opt">删除</a></#if><#rt/>
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
|
<title></title>
|
||||||
|
<#include "/template/admin/head.ftl"/>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
$("#jvForm").validate();
|
||||||
|
//移到右边
|
||||||
|
$('#add').click(function() {
|
||||||
|
//获取选中的选项,删除并追加给对方
|
||||||
|
$('#select1 option:selected').appendTo('#select2');
|
||||||
|
});
|
||||||
|
//移到左边
|
||||||
|
$('#remove').click(function() {
|
||||||
|
$('#select2 option:selected').appendTo('#select1');
|
||||||
|
});
|
||||||
|
//全部移到右边
|
||||||
|
$('#add_all').click(function() {
|
||||||
|
//获取全部的选项,删除并追加给对方
|
||||||
|
$('#select1 option').appendTo('#select2');
|
||||||
|
});
|
||||||
|
//全部移到左边
|
||||||
|
$('#remove_all').click(function() {
|
||||||
|
$('#select2 option').appendTo('#select1');
|
||||||
|
});
|
||||||
|
//双击选项
|
||||||
|
$('#select1').dblclick(function(){ //绑定双击事件
|
||||||
|
//获取全部的选项,删除并追加给对方
|
||||||
|
$("option:selected",this).appendTo('#select2'); //追加给对方
|
||||||
|
});
|
||||||
|
//双击选项
|
||||||
|
$('#select2').dblclick(function(){
|
||||||
|
$("option:selected",this).appendTo('#select1');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
function checkForm(f){
|
||||||
|
var x = f.elements["usrs"];
|
||||||
|
if(x.value==""){
|
||||||
|
alert("用户不可以为空");
|
||||||
|
f.elements["usrs"].focus();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var s="";
|
||||||
|
for (var i=0;i<x.length;i++)
|
||||||
|
{
|
||||||
|
s += x[i].value;
|
||||||
|
s += ",";
|
||||||
|
}
|
||||||
|
$.dialog({
|
||||||
|
type: "warn",
|
||||||
|
content: '确定要添加此记录?',
|
||||||
|
ok: 'Ok',
|
||||||
|
cancel: 'Cancel',
|
||||||
|
onOk: function() {
|
||||||
|
$.ajax({
|
||||||
|
url: "o_save.rk",
|
||||||
|
type: "POST",
|
||||||
|
data: {"pj":'${pj}',"gr":'${gr}',"usrs":s},
|
||||||
|
dataType: "json",
|
||||||
|
cache: false,
|
||||||
|
success: function(message) {
|
||||||
|
$.message(message);
|
||||||
|
if (message.type == "success")
|
||||||
|
{
|
||||||
|
window.location.href = "list.rk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="box-positon">
|
||||||
|
<div class="rpos"><@s.m "global.position"/>: SVN项目组账号 - <@s.m "global.add"/></div>
|
||||||
|
<form class="ropt">
|
||||||
|
<input type="hidden" name="pj" id="pj" value="${pj}" />
|
||||||
|
<input type="submit" value="<@s.m "global.backToList"/>" onclick="this.form.action='${base}/admin/project/group/list.rk';" class="return-button"/>
|
||||||
|
</form>
|
||||||
|
<div class="clear"></div>
|
||||||
|
</div>
|
||||||
|
<div class="body-box">
|
||||||
|
<@p.form action="o_save" method="post" labelWidth="12" onsubmit="return checkForm(this);">
|
||||||
|
<@p.hidden name="pgu.pj" id="pgu.pj" value="${pj}" />
|
||||||
|
<@p.hidden name="pgu.gr" id="gr" value="${gr}" />
|
||||||
|
<@p.td width="50"required="true">
|
||||||
|
<select multiple="multiple" id="select1" style="height: 150px;width: 480px;">
|
||||||
|
<#list usrList as usr>
|
||||||
|
<option value="${usr.usr}">${usr.name!usr.usr}(${usr.usr})</option>
|
||||||
|
</#list>
|
||||||
|
</select>
|
||||||
|
</@p.td>
|
||||||
|
<@p.td width="50" required="true">
|
||||||
|
<input id="add" type="button" value=">" style="width:30px;"><br>
|
||||||
|
<input id="add_all" type="button" value=">>" style="width:30px;"><br><br>
|
||||||
|
<input id="remove" type="button" value="<" style="width:30px;"><br>
|
||||||
|
<input id="remove_all" type="button" value="<<" style="width:30px;"><br><br>
|
||||||
|
</@p.td>
|
||||||
|
<@p.td width="50" required="true">
|
||||||
|
<select id="select2" name="usrs" multiple="multiple" style="height: 150px;width: 480px;"></select>
|
||||||
|
</@p.td><@p.tr/>
|
||||||
|
<@p.td colspan="3">
|
||||||
|
<@p.submit code="global.submit"/>
|
||||||
|
</@p.td><@p.tr/>
|
||||||
|
</@p.form>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,31 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
|
<title></title>
|
||||||
|
<#include "/template/admin/head.ftl"/>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
$("#jvForm").validate();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="box-positon">
|
||||||
|
<div class="rpos"><@s.m "global.position"/>: OauthUser - <@s.m "global.edit"/></div>
|
||||||
|
<form class="ropt">
|
||||||
|
<input type="submit" value="<@s.m "global.backToList"/>" onclick="this.form.action='list.rk';" class="return-button"/>
|
||||||
|
</form>
|
||||||
|
<div class="clear"></div>
|
||||||
|
</div>
|
||||||
|
<div class="body-box">
|
||||||
|
<@p.form id="jvForm" action="o_update" labelWidth="12" onsubmit="return false;">
|
||||||
|
<@p.hidden name="user.id" value='${obj.id}' />
|
||||||
|
<@p.text width="30" label="名称" id="user.userName" name="user.userName" value="${obj.userName!}" maxlength="100" class="required" required="true" readonly="true"/><@p.tr/>
|
||||||
|
<@p.td colspan="2">
|
||||||
|
<@p.submit code="global.submit" onclick="Cms.update();"/>
|
||||||
|
</@p.td><@p.tr/>
|
||||||
|
</@p.form>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,66 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
|
<title></title>
|
||||||
|
<#include "/template/admin/head.ftl"/>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function getTableForm() {
|
||||||
|
return document.getElementById('tableForm');
|
||||||
|
}
|
||||||
|
function deleted(pj,gr,usr){
|
||||||
|
$.dialog({
|
||||||
|
type: "warn",
|
||||||
|
content: '确定要删除此记录?',
|
||||||
|
ok: 'Ok',
|
||||||
|
cancel: 'Cancel',
|
||||||
|
onOk: function() {
|
||||||
|
$.ajax({
|
||||||
|
url: "delete.rk",
|
||||||
|
type: "POST",
|
||||||
|
data: {"pj":pj,"gr":gr,"usr":usr},
|
||||||
|
dataType: "json",
|
||||||
|
cache: false,
|
||||||
|
success: function(message) {
|
||||||
|
$.message(message);
|
||||||
|
if (message.type == "success")
|
||||||
|
{
|
||||||
|
window.location.href = back;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="box-positon">
|
||||||
|
<div class="rpos"><@s.m "global.position"/>: OauthUser - <@s.m "global.list"/></div>
|
||||||
|
<form class="ropt">
|
||||||
|
<input type="hidden" name="pj" id="pj" value="${pj}"/>
|
||||||
|
<input type="hidden" name="gr" id="pj" value="${gr}"/>
|
||||||
|
<input type="submit" class="add" value="<@s.m "global.add"/>" onclick="this.form.action='add';"/>
|
||||||
|
</form>
|
||||||
|
<div class="clear"></div>
|
||||||
|
</div>
|
||||||
|
<div class="body-box">
|
||||||
|
<@p.form id="tableForm" method="post">
|
||||||
|
<@p.hidden name="pageNumber" value="${pageNo!}" />
|
||||||
|
<@p.table value=obj;group,i,has_next><#rt/>
|
||||||
|
<@p.column title="ID" align="center">${i+1}</@p.column><#t/>
|
||||||
|
<@p.column title="项目" align="center">${group.pj}</@p.column><#t/>
|
||||||
|
<@p.column title="用户组" align="center">${group.gr}</@p.column><#t/>
|
||||||
|
<@p.column title="用户名" align="center">${group.usr!}</@p.column><#t/>
|
||||||
|
<@p.column title="姓名" align="center">${group.usrName}</@p.column><#t/>
|
||||||
|
<@shiro.hasPermission name="project.group:delete">
|
||||||
|
<@p.column title="删除" align="center">
|
||||||
|
<#if group.gr != "manager"><a href="javascript:void(0);" onclick="deleted('${group.pj}','${group.gr}')" class="pn-opt">删除</a></#if><#rt/>
|
||||||
|
</@p.column><#t/>
|
||||||
|
</@shiro.hasPermission>
|
||||||
|
</@p.table>
|
||||||
|
</@p.form>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -40,7 +40,7 @@ Cms.lmenu = function(id) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Cms.add = function(id){
|
Cms.add = function(){
|
||||||
$.dialog({
|
$.dialog({
|
||||||
type: "warn",
|
type: "warn",
|
||||||
content: '确定要添加此记录?',
|
content: '确定要添加此记录?',
|
||||||
|
|
Loading…
Reference in New Issue