Skip to content

Commit

Permalink
1. 修复邮件附件接受错误。
Browse files Browse the repository at this point in the history
2. 系统设置管理修改
3. 修复不能添加用户
4. 添加PHPEXCEL
  • Loading branch information
smeoa committed Apr 3, 2015
1 parent 0759e26 commit a457ef4
Show file tree
Hide file tree
Showing 9 changed files with 825 additions and 660 deletions.
11 changes: 8 additions & 3 deletions Application/Home/Controller/MailController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ public function receve($user_id = null, $background = false) {
$connect = $mail -> connect($mail_account['pop3svr'], '995', $mail_account['mail_id'], $mail_account['mail_pwd'], 'INBOX', 'pop3/ssl/novalidate-cert');
}
$mail_count = $mail -> mail_total_count();

if ($connect) {
for ($i = 1; $i <= $mail_count; $i++) {
$mail_id = $mail_count - $i + 1;
Expand All @@ -489,15 +488,18 @@ public function receve($user_id = null, $background = false) {
}
return;
}

$new++;
$model -> user_id = $user_id;
$model -> read = 0;
$model -> folder = 1;
$model -> is_del = 0;
$str = $mail -> get_attach($mail_id);
$model -> add_file = $this -> _receive_file($str, $model);

$model -> add_file = $this -> _receive_file($str, $model);
$this -> _organize($model);
$model -> add();

} else {
if (!$background) {
if ($new == 0) {
Expand Down Expand Up @@ -532,7 +534,10 @@ private function _receive_file($str, &$model) {
$files[$key]['name'] = $file_name;
$files[$key]['tmp_name'] = $tmp_name;
$files[$key]['size'] = filesize($tmp_name);

$files[$key]['is_mail'] = true;

dump($files);

if (!empty($files)) {
$File = D('File');
$file_driver = C('DOWNLOAD_UPLOAD_DRIVER');
Expand Down
80 changes: 63 additions & 17 deletions Application/Home/Controller/SystemConfigController.class.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,79 @@
<?php
/*---------------------------------------------------------------------------
小微OA系统 - 让工作更轻松快乐
小微OA系统 - 让工作更轻松快乐
Copyright (c) 2013 http://www.smeoa.com All rights reserved.
Copyright (c) 2013 http://www.smeoa.com All rights reserved.
Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
Author: jinzhu.yin<[email protected]>
Author: jinzhu.yin<[email protected]>
Support: https://git.oschina.net/smeoa/smeoa
Support: https://git.oschina.net/smeoa/smeoa
-------------------------------------------------------------------------*/


namespace Home\Controller;

class SystemConfigController extends HomeController {
//过滤查询字段
protected $config=array('app_type'=>'master');

function _search_filter(&$map) {
$keyword=I('keyword');
if (!empty($keyword)){
$map['val|name|code'] = array('like', "%" . $keyword . "%");

protected $config = array('app_type' => 'master');

public function index(){

$node = M("SystemConfig");

if (!empty($_POST['eq_pid'])) {
$eq_pid = $_POST['eq_pid'];
} else {
$eq_pid = "#";
}

$this -> assign('eq_pid', $eq_pid);

$list = $node -> where('pid=0') -> order('sort desc') -> getField('id,name');
$this -> assign('groupList', $list);

$node = M("SystemConfig");
$menu = array();
$menu = $node -> where($map) -> field('id,pid,name,is_del') -> order('sort desc') -> select();

if ($eq_pid != "#") {
$tree = list_to_tree($menu,$eq_pid);
} else {
$tree = list_to_tree($menu);
}

$this -> assign('menu', popup_tree_menu($tree));

$model = M("SystemConfig");
$list = $model -> order('sort asc') -> getField('id,name');
$this -> assign('system_config_list', $list);

$model = M("DeptGrade");
$list = $model -> where('is_del=0') -> order('sort asc') -> getField('id,name');
$this -> assign('dept_grade_list', $list);

$this -> display();
}

function del(){
$id=$_POST['id'];
$this->_destory($id);

public function del($id) {
$this -> _destory($id);
}

public function winpop() {
$node = M("SystemConfig");
$menu = array();
$menu = $node -> where('is_del=0') -> field('id,pid,name') -> order('sort asc') -> select();

$tree = list_to_tree($menu);
$this -> assign('menu', popup_tree_menu($tree));

$this -> assign('pid', $pid);
$this -> display();
}

public function winpop2() {
$this -> winpop();
}

}
?>
8 changes: 4 additions & 4 deletions Application/Home/Controller/UserController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public function _insert() {
M("UserConfig") -> add($data);
if (!empty($mobile_tel)) {
$agent_id = get_system_config('WEIXIN_AGENT_ID');
$weixin = new \ThinkWechat($agent_id);
$weixin -> add_user($emp_no,$name,$mobile_tel);
//$weixin = new \ThinkWechat($agent_id);
//$weixin -> add_user($emp_no,$name,$mobile_tel);
}
$this -> assign('jumpUrl', get_return_url());
$this -> success('用户添加成功!');
Expand Down Expand Up @@ -187,8 +187,8 @@ function _update() {
//成功提示
if (!empty($mobile_tel)) {
$agent_id = get_system_config('WEIXIN_AGENT_ID');
$weixin = new \ThinkWechat($agent_id);
$weixin -> add_user($emp_no,$name,$mobile_tel);
//$weixin = new \ThinkWechat($agent_id);
//$weixin -> add_user($emp_no,$name,$mobile_tel);
}
$this -> assign('jumpUrl', get_return_url());
$this -> success('编辑成功!');
Expand Down
123 changes: 70 additions & 53 deletions Application/Home/View/SystemConfig/add.html
Original file line number Diff line number Diff line change
@@ -1,60 +1,77 @@
<extend name="Layout/page_detail" />
<extend name="Layout/page_popup" />
<block name="content">
{:W('PageHeader/simple',array('name'=>'新建系统参数','search'=>'N'))}

<div class="operate panel panel-default">
<div class="panel-body">
<div class="pull-left">
<a onclick="go_return_url();" class="btn btn-sm btn-primary">返回</a>
</div>
<div class="pull-right">
<a onclick="save();" class="btn btn-sm btn-primary">保存</a>
</div>
</div>
</div>
<form method='post' id="form_data" action="" name="form_data" class="well form-horizontal clearfix">
<input type="hidden" name="opmode" id="opmode" value="add">
<div class="form-group col-xs-12">
<label class="col-sm-4 control-label" for="code">代码*:</label>
<div class="col-sm-8">
<input class="form-control" type="text" id="code" name="code" check="require" msg="请输入代码">
</div>
</div>
<div class="form-group col-xs-12">
<label class="col-sm-4 control-label" for="name">名称*:</label>
<div class="col-sm-8">
<input class="form-control" type="text" id="name" name="name" check="require" msg="请输入名称">
</div>
</div>
<div class="form-group col-xs-12">
<label class="col-sm-4 control-label" for="val">数据*:</label>
<div class="col-sm-8">
<input class="form-control" type="text" id="val" name="val" check="require" msg="请输入数据">
</div>
</div>
<div class="form-group col-xs-12">
<label class="col-sm-4 control-label" for="sort">排序:</label>
<div class="col-sm-8">
<input class="form-control" value="{$vo.sort}" type="text" id="sort" name="sort" >
<input type="hidden" name="ajax" id="ajax" value="1">
{:W('PageHeader/popup',array('name'=>'新建系统参数','search'=>'N'))}
<!-- 功能操作区域结束 -->
<!-- 列表显示区域 -->
<div class="row">
<div class="col-xs-12">
<form id="form_data" name="form_data" method="post" class="well form-horizontal clearfix">
<input type="hidden" name="opmode" id="opmode" value="add">
<input type="hidden" name="pid" id="pid" value="">
<div class="form-group col-xs-12">
<label class="col-xs-3 control-label" for="code">编码*:</label>
<div class="col-xs-9">
<input class="form-control" type="text" id="code" name="code" check="require" msg="请输入编码">
</div>
</div>
<div class="form-group col-xs-12">
<label class="col-xs-3 control-label" for="name">名称*:</label>
<div class="col-xs-9">
<input class="form-control" type="text" id="name" name="name" check="require" msg="请输入名称">
</div>
</div>
<div class="form-group col-xs-12">
<label class="col-xs-3 control-label" for="val">数据*:</label>
<div class="col-xs-9">
<input class="form-control" type="text" id="val" name="val" check="require" msg="请输入数据">
</div>
</div>
<div class="form-group col-xs-12">
<label class="col-xs-3 control-label" for="sort">排序:</label>
<div class="col-xs-9">
<input class="form-control" type="text" id="sort" name="sort" >
</div>
</div>
<div class="form-group col-xs-12">
<label class="col-xs-3 control-label" for="is_del">状态*:</label>
<div class="col-xs-9">
<select name="is_del" id="is_del" class="form-control">
<option value="0">启用</option>
<option value="1">禁用</option>
</select>
</div>
</div>
<div class="form-group col-xs-12">
<label class="col-xs-3 control-label" for="remark" >其他:</label>
<div class="col-xs-9" >
<textarea class="form-control" name="remark" id="remark" rows="5" class="col-xs-12" ></textarea>
</div>
</div>
</form>
</div>
</div>
<div class="form-group col-xs-12">
<label class="col-sm-4 control-label" for="is_del">状态*:</label>
<div class="col-sm-8">
<select name="is_del" id="is_del" class="form-control">
<option value="0">启用</option>
<option value="1">禁用</option>
</select>
</div>
</div>
</form>
</block>
<block name="js">
<script type="text/javascript">
function save() {
if (check_form("form_data")) {
sendForm("form_data", "{:U('save')}");
<script type="text/javascript">
function save() {
if (check_form("form_data")) {
var vars = $("#form_data").serialize();
sendAjax("{:U('save')}", vars, function(data) {
if (data.status) {
ui_alert(data.info, function() {
parent.location.reload(true);
myclose();
});
}
});
}
}
}
</script>

$(document).ready(function() {
$pid = $("#id", parent.document).val();
$("#pid").val($pid);
});
</script>

</block>
Loading

0 comments on commit a457ef4

Please sign in to comment.