|
@@ -4,7 +4,6 @@
|
|
|
* @author darkredz
|
|
|
*/
|
|
|
class HumanResourceController extends DooController {
|
|
|
-
|
|
|
public function beforeRun($resource, $action) {
|
|
|
}
|
|
|
function __construct() {
|
|
@@ -116,6 +115,12 @@ class HumanResourceController extends DooController {
|
|
|
$staff->pendingApprovals = 0;
|
|
|
$staff->InductionDate = date ( "Y-m-d H:i:s" );
|
|
|
|
|
|
+ if($staffDetail['nature']==2)
|
|
|
+ $staffDetail->practiceDate= date ( "Y-m-d H:i:s" );
|
|
|
+ if($staffDetail['nature']==3)
|
|
|
+ $staffDetail->probationaryDate= date ( "Y-m-d H:i:s" );
|
|
|
+
|
|
|
+
|
|
|
$staff->passwork = 'e10adc3949ba59abbe56e057f20f883e';
|
|
|
}
|
|
|
|
|
@@ -127,15 +132,25 @@ class HumanResourceController extends DooController {
|
|
|
// 操作日志
|
|
|
Doo::loadModel ( 'staffOperationLog' );
|
|
|
$staffOperationLog = new staffOperationLog ();
|
|
|
+ $nature='';
|
|
|
+ if($staffDetail['nature']==2){
|
|
|
+ $nature='实习';
|
|
|
+ }elseif($staffDetail['nature']==3){
|
|
|
+ $nature='试用';
|
|
|
+ }
|
|
|
+
|
|
|
$item = array (
|
|
|
'date' => date ( "Y-m-d H:i:s" ),
|
|
|
- 'operation' => $this->staff ['username'] . "入职 审批通过" . $staffDetail ['username'],
|
|
|
- 'status' => 1,
|
|
|
+ 'operation' => $this->staff ['username'] . " 审批通过" . $staffDetail ['username'].$nature."入职",
|
|
|
+ 'status' => 3,
|
|
|
'img' => $staffDetail ['avatar'],
|
|
|
'username' => $staffDetail ['username'],
|
|
|
'uid' => $staffDetail ['sid'],
|
|
|
'category' => $staffDetail ['category']
|
|
|
);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
$staffOperationLog->setInvoiceOperationLog ( $item );
|
|
|
|
|
|
return '/hr';
|
|
@@ -430,6 +445,20 @@ class HumanResourceController extends DooController {
|
|
|
$tag->colorid = $i;
|
|
|
$tag->insert ();
|
|
|
}
|
|
|
+
|
|
|
+ // 操作日志
|
|
|
+ Doo::loadModel ( 'staffOperationLog' );
|
|
|
+ $staffOperationLog = new staffOperationLog ();
|
|
|
+ $item = array (
|
|
|
+ 'date' => date ( "Y-m-d H:i:s" ),
|
|
|
+ 'status' => 1,
|
|
|
+ 'img' => $staffmsg ['avatar'],
|
|
|
+ 'username' => $staffmsg ['username'],
|
|
|
+ 'uid' => $staffmsg ['sid'],
|
|
|
+ 'operation' => "添加新员工",
|
|
|
+ 'category' => $staffmsg ['category']
|
|
|
+ );
|
|
|
+ $staffOperationLog->setInvoiceOperationLog ( $item );
|
|
|
}
|
|
|
return '/hrEmployee';
|
|
|
}
|
|
@@ -668,7 +697,7 @@ class HumanResourceController extends DooController {
|
|
|
$emergencyContacts = $this->get_args ( 'emergencyContacts' ) ? $this->get_args ( 'emergencyContacts' ) : '';
|
|
|
$living = $this->get_args ( 'living' ) ? $this->get_args ( 'living' ) : '';
|
|
|
|
|
|
- if (! empty ( $sidKey ) && ! empty ( $telephone ) && ! empty ( $qq ) && ! empty ( $wecat ) && ! empty ( $phone ) && ! empty ( $email ) && ! empty ( $gender ) && ! empty ( $birthday ) && ! empty ( $qualifications ) && ! empty ( $nativePlace ) && ! empty ( $emergencyContacts ) && ! empty ( $living )) {
|
|
|
+ if (! empty ( $sidKey ) && ! empty ( $telephone ) && ! empty ( $qq ) && ! empty ( $wecat ) && ! empty ( $phone ) && ! empty ( $email ) && ! empty ( $gender ) && ! empty ( $birthday ) && ! empty ( $qualifications ) && ! empty ( $nativePlace ) && ! empty ( $emergencyContacts ) && ! empty ( $living )) {
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 5 );
|
|
|
Doo::loadModel ( 'staff' );
|
|
@@ -696,16 +725,17 @@ class HumanResourceController extends DooController {
|
|
|
);
|
|
|
$staff->setStaffByCondition ( $item );
|
|
|
// 操作日志
|
|
|
+ $staffDetail = $staff->getStaffBySid ( $sid );
|
|
|
Doo::loadModel ( 'staffOperationLog' );
|
|
|
$staffOperationLog = new staffOperationLog ();
|
|
|
$item = array (
|
|
|
'date' => date ( "Y-m-d H:i:s" ),
|
|
|
- 'status' => 3,
|
|
|
- 'img' => $this->staf ['avatar'],
|
|
|
- 'username' => $this->staf ['username'],
|
|
|
+ 'status' => 2,
|
|
|
+ 'img' => $staffDetail ['avatar'],
|
|
|
+ 'username' => $staffDetail ['username'],
|
|
|
'operation' => "申请入职",
|
|
|
- 'uid' => $this->staf ['sid'],
|
|
|
- 'category' => $this->staf ['category']
|
|
|
+ 'uid' => $staffDetail ['sid'],
|
|
|
+ 'category' => $staffDetail ['category']
|
|
|
);
|
|
|
$staffOperationLog->setInvoiceOperationLog ( $item );
|
|
|
|
|
@@ -790,11 +820,11 @@ class HumanResourceController extends DooController {
|
|
|
die ( 'illegal request' );
|
|
|
|
|
|
// 工龄记录
|
|
|
- $seniorityFormula = json_decode ( $detail ['seniorityFormula'] );
|
|
|
+ $seniorityFormula = json_decode ( $detail ['seniorityFormula'],true );
|
|
|
$arr = array_keys ( $seniorityFormula );
|
|
|
$key = end ( $arr );
|
|
|
|
|
|
- if (empty ( $seniorityFormula [$key] ['dimissionDate'] ))
|
|
|
+ if (isset($seniorityFormula [$key] ['dimissionDate'])||empty ( $seniorityFormula [$key] ['dimissionDate'] ))
|
|
|
$seniorityFormula [$key] ['dimissionDate'] = date ( "Y-m-d H:i:s" );
|
|
|
else
|
|
|
die ( 'illegal request' );
|
|
@@ -845,7 +875,7 @@ class HumanResourceController extends DooController {
|
|
|
'nature' => 1,
|
|
|
'pendStatus' => 0,
|
|
|
'seniorityFormula' => json_encode ( $seniorityFormula ),
|
|
|
- 'hiredate' => date ( "Y-m-d H:i:s" )
|
|
|
+ 'hiredate' => date ( "Y-m-d" )
|
|
|
);
|
|
|
$staff->setStaffByCondition ( $item );
|
|
|
// 更新假期相关信息
|
|
@@ -1271,12 +1301,12 @@ class HumanResourceController extends DooController {
|
|
|
$staff = new staff ();
|
|
|
Doo::loadModel ( 'L_category' );
|
|
|
$L_category = new L_category ();
|
|
|
- Doo::loadModel('district');
|
|
|
- $district=new district();
|
|
|
+ Doo::loadModel ( 'district' );
|
|
|
+ $district = new district ();
|
|
|
|
|
|
$stafflist = $staff->getStaffByCondition ( $con );
|
|
|
|
|
|
- //print_r($stafflist);
|
|
|
+ // print_r($stafflist);
|
|
|
|
|
|
$monthstart = date ( 'Y-m-d 00:00:00', mktime ( 0, 0, 0, date ( 'm' ), 1, date ( 'Y' ) ) );
|
|
|
$monthend = date ( 'Y-m-d 23:59:59', mktime ( 0, 0, 0, date ( 'm' ) + 1, 0, date ( 'Y' ) ) );
|
|
@@ -1300,8 +1330,8 @@ class HumanResourceController extends DooController {
|
|
|
$monthstart = date ( 'm.d', mktime ( 0, 0, 0, date ( 'm' ), 1, date ( 'Y' ) ) );
|
|
|
$monthend = date ( 'm.d', mktime ( 0, 0, 0, date ( 'm' ) + 1, 0, date ( 'Y' ) ) );
|
|
|
|
|
|
- //员工可选的
|
|
|
- $this->data ['districtList']=$district->get_lv(1);
|
|
|
+ // 员工可选的
|
|
|
+ $this->data ['districtList'] = $district->get_lv ( 1 );
|
|
|
|
|
|
$this->data ['onJobCount'] = $onJobCount;
|
|
|
$this->data ['inJobCount'] = $inJobCount;
|
|
@@ -1357,22 +1387,22 @@ class HumanResourceController extends DooController {
|
|
|
/**
|
|
|
* 添加浏览省份的权限
|
|
|
*/
|
|
|
- function addUserDistrictAuthor(){
|
|
|
- $didKey = $this->get_args ( 'didKey' ) ? $this->get_args ( 'didKey' ) : array();
|
|
|
- $sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : array();
|
|
|
-
|
|
|
- if (! empty ( $didKey )&&! empty ( $sidKey ) ) {
|
|
|
+ function addUserDistrictAuthor() {
|
|
|
+ $didKey = $this->get_args ( 'didKey' ) ? $this->get_args ( 'didKey' ) : array ();
|
|
|
+ $sidKey = $this->get_args ( 'sidKey' ) ? $this->get_args ( 'sidKey' ) : array ();
|
|
|
+
|
|
|
+ if (! empty ( $didKey ) && ! empty ( $sidKey )) {
|
|
|
Doo::loadModel ( 'staff' );
|
|
|
$staff = new staff ();
|
|
|
Doo::loadClass ( 'XDeode' );
|
|
|
$XDeode = new XDeode ( 5 );
|
|
|
-
|
|
|
- $sid=$XDeode->decode($sidKey);
|
|
|
- $sDetail=$staff->getStaffBySid($sid);
|
|
|
-
|
|
|
- $sDidList=explode(',', $sDetail['did']);
|
|
|
-
|
|
|
- $staff->did=implode(',', $didKey);
|
|
|
+
|
|
|
+ $sid = $XDeode->decode ( $sidKey );
|
|
|
+ $sDetail = $staff->getStaffBySid ( $sid );
|
|
|
+
|
|
|
+ $sDidList = explode ( ',', $sDetail ['did'] );
|
|
|
+
|
|
|
+ $staff->did = implode ( ',', $didKey );
|
|
|
$staff->sid = $sid;
|
|
|
$staff->update ();
|
|
|
return '/hrEmployeeApprovalsSetting';
|
|
@@ -1430,17 +1460,18 @@ class HumanResourceController extends DooController {
|
|
|
if ($type == 'STAFF') {
|
|
|
Doo::loadModel ( 'staff' );
|
|
|
$staff = new staff ();
|
|
|
+ Doo::loadModel ( 'staffOperationLog' );
|
|
|
+ $staffOperationLog = new staffOperationLog ();
|
|
|
|
|
|
$sid = $XDeode->decode ( $serial );
|
|
|
$detail = $staff->getStaffBySid ( $sid );
|
|
|
- // $invoiceOperationLogList = $invoiceOperationLog->getInvoiceOperationLogByIid ( $detail ['iid'] );
|
|
|
|
|
|
+ // 获得操作日志
|
|
|
+ $SOPL = $staffOperationLog->getInvoiceOperationLogByUid ( $sid, 'desc' );
|
|
|
if (empty ( $detail ))
|
|
|
$html = '';
|
|
|
else {
|
|
|
$html = '
|
|
|
-
|
|
|
-
|
|
|
<div class="modal-body saeaList">
|
|
|
<div class="fL staff-detail-con">
|
|
|
<table class="table table-bordered table-condensed">
|
|
@@ -1474,7 +1505,18 @@ class HumanResourceController extends DooController {
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<th class="taC" width="150">最高学历</th><td>' . $detail ['qualifications'] . '</td>
|
|
|
- <th class="taC" width="150">婚姻状况</th><td>' . $detail ['marriage'] . '</td>
|
|
|
+ <th class="taC" width="150">婚姻状况</th><td>
|
|
|
+
|
|
|
+ ';
|
|
|
+
|
|
|
+ if ($detail ['marriage']==0)
|
|
|
+ $html.='未婚';
|
|
|
+ elseif($detail ['marriage']==1)
|
|
|
+ $html.='已婚';
|
|
|
+
|
|
|
+
|
|
|
+ $html.='
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<th class="taC" width="150">籍贯</th><td colspan="3">' . $detail ['nativePlace'] . '</td>
|
|
@@ -1500,37 +1542,27 @@ class HumanResourceController extends DooController {
|
|
|
|
|
|
|
|
|
<div class="fL staff-detail-side">
|
|
|
- <div class="infoFlowList">
|
|
|
- <div class="dateTitle">
|
|
|
- <em class="month"><span class="num">12</span><span class="text">-03</span></em>
|
|
|
- <span class="year">2013</span>
|
|
|
- </div>
|
|
|
- <ul class="flowList">
|
|
|
- <li class="item colGray">总部-何银龄</li>
|
|
|
- <li class="item">审批通过</li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <div class="infoFlowList">
|
|
|
- <div class="dateTitle">
|
|
|
- <em class="month"><span class="num">12</span><span class="text">-03</span></em>
|
|
|
- <span class="year">2013</span>
|
|
|
- </div>
|
|
|
- <ul class="flowList">
|
|
|
- <li class="item colGray">总部-张三</li>
|
|
|
- <li class="item">申请入职</li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <div class="infoFlowList">
|
|
|
+ <!--入职试用 & 离职后再入职试用-->
|
|
|
+ ';
|
|
|
+
|
|
|
+ foreach ( $SOPL as $key => $value ) {
|
|
|
+ $html .= '<div class="infoFlowList">
|
|
|
<div class="dateTitle">
|
|
|
- <em class="month"><span class="num">12</span><span class="text">-02</span></em>
|
|
|
- <span class="year">2013</span>
|
|
|
+ <em class="month"><span class="num">' . date ( 'm', strtotime ( $value ['date'] ) ) . '</span><span class="text">-' . date ( 'd', strtotime ( $value ['date'] ) ) . '</span></em>
|
|
|
+ <span class="year">' . date ( 'Y', strtotime ( $value ['date'] ) ) . '</span>
|
|
|
</div>
|
|
|
<ul class="flowList">
|
|
|
- <li class="item colGray">总部-温秀娟</li>
|
|
|
- <li class="item">添加员工</li>
|
|
|
+ <li class="item colGray">' . $value ['category'] . '-' . $value ['username'] . '</li>
|
|
|
+ <li class="item">' . $value ['operation'] . '</li>
|
|
|
</ul>
|
|
|
- </div>
|
|
|
+ </div>';
|
|
|
+ }
|
|
|
+
|
|
|
+ $html .= '
|
|
|
+
|
|
|
</div>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
';
|
|
@@ -1900,7 +1932,7 @@ class HumanResourceController extends DooController {
|
|
|
$staff = new staff ();
|
|
|
|
|
|
$regularStaff = $staff->getStaffJobNumberByNature ( 1 );
|
|
|
- $internStaff = $staff->getStaffJobNumberByInformal ( );
|
|
|
+ $internStaff = $staff->getStaffJobNumberByInformal ();
|
|
|
|
|
|
if (empty ( $regularStaff ['jobNumber'] ))
|
|
|
$regularStaffJobNumber = 'Z0001';
|
|
@@ -1965,14 +1997,13 @@ class HumanResourceController extends DooController {
|
|
|
/**
|
|
|
* 员工主访问权限
|
|
|
*/
|
|
|
- function isEmployeeVisit($employee=array()){
|
|
|
+ function isEmployeeVisit($employee = array()) {
|
|
|
Doo::loadModel ( 'staff' );
|
|
|
$staff = new staff ();
|
|
|
|
|
|
- $staff->getStaffBySid($this->staff['sid']);
|
|
|
-
|
|
|
- $access=explode(',', $employee['access']);
|
|
|
+ $staff->getStaffBySid ( $this->staff ['sid'] );
|
|
|
|
|
|
+ $access = explode ( ',', $employee ['access'] );
|
|
|
}
|
|
|
}
|
|
|
|