<?php include_once "inc/auth.inc.php"; include_once "inc/utility_all.php"; require_once "inc/weixinqy/class/weixinqy.department.funcs.php"; $web_action = $_GET['action'] ? addslashes($_GET['action']) : addslashes($_POST['action']); if ($web_action != "") { ob_clean(); switch ($web_action) { case "getList": //( ); $department = new WeiXinQYDepartment(); $xtree = $department->getDepartmentList(intval($_GET['dept_id'])); echo $xtree; exit; case "deleteDept": //( ); $department = new WeiXinQYDepartment(); $rs = $department->deleteDept(intval($_GET['dept_id'])); echo json_encode($rs); exit; case "createDept": //( ); $department = new WeiXinQYDepartment(); $rs = $department->createDept($_GET['dept_id']); echo $rs; exit; case "updateDept": //( ); $department = new WeiXinQYDepartment(); $rs = $department->updateDept(array("id" => intval($_POST['dept_id']), "name" => td_iconv(addslashes($_POST['dept_name']), "UTF-8", MYOA_CHARSET), "parentid" => intval($_POST['dept_parentid'])));
echo "</button>\r\n <button class=\"btn btn-small btn-primary\" type=\"button\" id=\"btn-rename-dept\">"; echo _("编辑选中部门"); echo "</button>\r\n</div>\r\n<div id=\"listTree\" class=\"dept-list-tree\"></div>\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\""; echo MYOA_STATIC_SERVER; echo "/static/images/org/ui.dynatree.css"; echo $GZIP_POSTFIX; echo "\">\r\n<script type=\"text/javascript\" src=\"/inc/js_lang.php\"></script>\r\n<script type=\"text/javascript\" src=\""; echo MYOA_JS_SERVER; echo "/static/js/tree.js"; echo $GZIP_POSTFIX; echo "\"></script>\r\n<script type=\"text/javascript\">\r\n var tree = new Tree(\"listTree\", \"weixin_org.php?action=getList&dept_id=1\", '"; echo MYOA_STATIC_SERVER; echo "/static/images/org/', true, 1, {\"minExpandLevel\":2});\r\n tree.BuildTree();\r\n</script>\r\n"; //( ); $department = new WeiXinQYDepartment(); $xtree = $department->getDepartmentList(1); $dept = $department->list; echo "<div id=\"del-modal\" class=\"modal hide fade\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>\r\n <h3>"; echo _("删除部门"); echo "</h3>\r\n </div>\r\n <div class=\"modal-body\">\r\n <p>"; echo sprintf(_("确定要删除 %s 吗?"), "<span id='del-dept-name'></span>"); echo "</p>\r\n </div>\r\n <div class=\"modal-footer\">\r\n <button type=\"botton\" class=\"btn\" data-dismiss=\"modal\">"; echo _("取消"); echo "</button>\r\n <button id=\"confirm-del\" type=\"botton\" class=\"btn btn-danger\">"; echo _("确认删除"); echo "</button>\r\n </div>\r\n</div>\r\n\r\n<div id=\"rename-modal\" class=\"modal hide fade\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>\r\n <h3>"; echo _("编辑部门"); echo "</h3>\r\n </div>\r\n <div class=\"modal-body\">\r\n <form class=\"form-horizontal\">\r\n <div class=\"control-group\">\r\n <label class=\"control-label\" for=\"inputDeptID\">"; echo _("部门ID"); echo "</label>\r\n <div class=\"controls\">\r\n <input type=\"text\" id=\"inputDeptID\" value=\"\" readonly>\r\n </div>\r\n </div>\r\n <div class=\"control-group\">\r\n <label class=\"control-label\" for=\"inputDeptName\">"; echo _("部门名称");