|
@@ -13,127 +13,6 @@ class fee_controller extends DooController {
|
|
|
private $feeService;
|
|
|
private $regionService;
|
|
|
private $officeService;
|
|
|
- public function beforeRun($resource, $action) {
|
|
|
- $this->accessAuth ( $resource, $action );
|
|
|
- }
|
|
|
- function __construct() {
|
|
|
- $this->session ();
|
|
|
- $this->feeService = new fee_service ();
|
|
|
- $this->regionService = new region_service ();
|
|
|
- $this->officeService = new office_service ();
|
|
|
- }
|
|
|
-
|
|
|
- // 访问权限-费用管理
|
|
|
- private function accessAuth($resource, $action) {
|
|
|
- Doo::loadClass ( 'XDeode' );
|
|
|
- $XDeode = new XDeode ( 5 );
|
|
|
- $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
- // 1.单独判断公司汇总的访问权限
|
|
|
- if ($action == 'companyCategoryCollect') {
|
|
|
- Doo::loadModel ( "receiptAuthorityManage" );
|
|
|
- $invoiceCompanyManage = new receiptAuthorityManage ();
|
|
|
-
|
|
|
- $icm = $invoiceCompanyManage->getInvoiceCMByStaff ( $sid );
|
|
|
- if (empty ( $icm ))
|
|
|
- die ( 'illegal request-无权访问该页面' );
|
|
|
- }
|
|
|
-
|
|
|
- // 2.获得登陆用户信息
|
|
|
- Doo::loadModel ( 'cld/staff_cld' );
|
|
|
- $staff = new staff_cld ();
|
|
|
- $this->staff = $staff->Get ( $sid );
|
|
|
-
|
|
|
- // 3.是否有权限访问
|
|
|
- $accessModular = 'RECEIPTS';
|
|
|
- if (empty ( $this->staff ['cldAccessArray'] )) {
|
|
|
- die ( 'illegal request-无权访问费用页面,向总部申请权限' );
|
|
|
- } else {
|
|
|
- if (in_array ( $accessModular, $this->staff ['cldAccessArray'] )) {
|
|
|
- if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
|
|
|
- $flag = true;
|
|
|
- } else {
|
|
|
- $flag = false;
|
|
|
- }
|
|
|
- } else {
|
|
|
- die ( 'illegal request-无权访问费用页面' );
|
|
|
- }
|
|
|
- }
|
|
|
- if (! $flag)
|
|
|
- die ( 'illegal request-无权访问费用页面' );
|
|
|
- }
|
|
|
-
|
|
|
- // 登陆判定
|
|
|
- private function session() {
|
|
|
- if (isset ( $_COOKIE ["staff"] )) {
|
|
|
-
|
|
|
- if (! empty ( $_COOKIE ["staff"] )) {
|
|
|
-
|
|
|
- Doo::loadModel ( 'staff' );
|
|
|
- Doo::loadModel ( 'verify' );
|
|
|
- $verify = new verify ();
|
|
|
- $staff = new staff ();
|
|
|
- Doo::loadModel ( "execute" );
|
|
|
- $execute = new execute ();
|
|
|
-
|
|
|
- $verifyList = $verify->find ( array (
|
|
|
- 'select' => 'staff',
|
|
|
- 'asArray' => true
|
|
|
- ) );
|
|
|
- $list = array ();
|
|
|
-
|
|
|
- // 判断角色的审批权限
|
|
|
- foreach ( $verifyList as $key => $value ) {
|
|
|
- $ver = json_decode ( $value ['staff'] );
|
|
|
-
|
|
|
- foreach ( $ver as $k => $v ) {
|
|
|
- if ($v [1] == 'ROLE') {
|
|
|
- $roleList = json_decode ( $v [3] );
|
|
|
- foreach ( $roleList as $t => $g ) {
|
|
|
- $gList = explode ( "_", $g );
|
|
|
- array_push ( $list, $gList [0] );
|
|
|
- // print_r($list);
|
|
|
- }
|
|
|
- } else
|
|
|
- array_push ( $list, $v [0] );
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 判断执行人的审批权限
|
|
|
- $executeList = $execute->find ( array (
|
|
|
- 'where' => 'mold !="日常收支"',
|
|
|
- 'select' => 'staff',
|
|
|
- 'asArray' => true
|
|
|
- ) );
|
|
|
- $list2 = array ();
|
|
|
- foreach ( $executeList as $key => $value ) {
|
|
|
- $ver = json_decode ( $value ['staff'] );
|
|
|
-
|
|
|
- foreach ( $ver as $k => $v ) {
|
|
|
- array_push ( $list2, $v [0] );
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $eidList = file_get_contents ( "protected/config/execute/execute.ini" );
|
|
|
- $eidList = array_filter ( explode ( ",", $eidList ) );
|
|
|
-
|
|
|
- $this->executeId = array_merge ( $list2, $eidList );
|
|
|
- // print_r($this->executeId);
|
|
|
- $this->verifyId = $list;
|
|
|
- // $this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
|
|
|
-
|
|
|
- return "/";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- Doo::loadCore ( 'uri/DooUriRouter' );
|
|
|
- $router = new DooUriRouter ();
|
|
|
- $routeRs = $router->execute ( Doo::app ()->route, Doo::conf ()->SUBFOLDER );
|
|
|
-
|
|
|
- if ($routeRs ['1'] != "login") {
|
|
|
- header ( 'Content-Type:text/html;charset=utf-8' );
|
|
|
- @header ( "Location: /login" );
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
// 构建申请报销单页面
|
|
|
public function GetViewReceiptCreate() {
|
|
@@ -161,24 +40,6 @@ class fee_controller extends DooController {
|
|
|
$data['defaultTraveProvince']=$traveDefault['defaultTraveProvince'];
|
|
|
$data['defaultTraveProvinceIndex']=$traveDefault['defaultTraveProvinceIndex'];
|
|
|
|
|
|
-// $defaultTraveProvince="";
|
|
|
-// if($this->staff['category']=="总部"){
|
|
|
-// $defaultTraveProvince="广东省";
|
|
|
-// }else{
|
|
|
-// $defaultTraveProvince=str_replace("办","省",$this->staff['category']);
|
|
|
-// }
|
|
|
-// $data['defaultTraveProvince']=$defaultTraveProvince;
|
|
|
-
|
|
|
-// // 获得二级地区的index
|
|
|
-// $defaultTraveProvinceIndex=0;
|
|
|
-// foreach ($region as $key=>$value){
|
|
|
-// if($value['name']==$defaultTraveProvince){
|
|
|
-// $defaultTraveProvinceIndex=$key;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// $data['defaultTraveProvinceIndex']=$defaultTraveProvinceIndex;
|
|
|
-
|
|
|
-
|
|
|
// 附件
|
|
|
$data ['enclosurList'] = array ();
|
|
|
|
|
@@ -431,6 +292,130 @@ class fee_controller extends DooController {
|
|
|
echo json_encode($traveData);
|
|
|
}
|
|
|
|
|
|
+ public function beforeRun($resource, $action) {
|
|
|
+ $this->accessAuth ( $resource, $action );
|
|
|
+ }
|
|
|
+ function __construct() {
|
|
|
+ $this->session ();
|
|
|
+ $this->feeService = new fee_service ();
|
|
|
+ $this->regionService = new region_service ();
|
|
|
+ $this->officeService = new office_service ();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 访问权限-费用管理
|
|
|
+ private function accessAuth($resource, $action) {
|
|
|
+ Doo::loadClass ( 'XDeode' );
|
|
|
+ $XDeode = new XDeode ( 5 );
|
|
|
+ $sid = $XDeode->decode ( $_COOKIE ["staff"] );
|
|
|
+ // 1.单独判断公司汇总的访问权限
|
|
|
+ if ($action == 'companyCategoryCollect') {
|
|
|
+ Doo::loadModel ( "receiptAuthorityManage" );
|
|
|
+ $invoiceCompanyManage = new receiptAuthorityManage ();
|
|
|
+
|
|
|
+ $icm = $invoiceCompanyManage->getInvoiceCMByStaff ( $sid );
|
|
|
+ if (empty ( $icm ))
|
|
|
+ die ( 'illegal request-无权访问该页面' );
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2.获得登陆用户信息
|
|
|
+ Doo::loadModel ( 'cld/staff_cld' );
|
|
|
+ $staff = new staff_cld ();
|
|
|
+ $this->staff = $staff->Get ( $sid );
|
|
|
+
|
|
|
+ // 3.是否有权限访问
|
|
|
+ $accessModular = 'RECEIPTS';
|
|
|
+ if (empty ( $this->staff ['cldAccessArray'] )) {
|
|
|
+ die ( 'illegal request-无权访问费用页面,向总部申请权限' );
|
|
|
+ } else {
|
|
|
+ if (in_array ( $accessModular, $this->staff ['cldAccessArray'] )) {
|
|
|
+ if (Doo::acl ()->isAllowed ( $accessModular, $resource, $action )) {
|
|
|
+ $flag = true;
|
|
|
+ } else {
|
|
|
+ $flag = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ die ( 'illegal request-无权访问费用页面' );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (! $flag)
|
|
|
+ die ( 'illegal request-无权访问费用页面' );
|
|
|
+ }
|
|
|
+
|
|
|
+ // 登陆判定
|
|
|
+ private function session() {
|
|
|
+ if (isset ( $_COOKIE ["staff"] )) {
|
|
|
+
|
|
|
+ if (! empty ( $_COOKIE ["staff"] )) {
|
|
|
+
|
|
|
+ Doo::loadModel ( 'staff' );
|
|
|
+ Doo::loadModel ( 'verify' );
|
|
|
+ $verify = new verify ();
|
|
|
+ $staff = new staff ();
|
|
|
+ Doo::loadModel ( "execute" );
|
|
|
+ $execute = new execute ();
|
|
|
+
|
|
|
+ $verifyList = $verify->find ( array (
|
|
|
+ 'select' => 'staff',
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+ $list = array ();
|
|
|
+
|
|
|
+ // 判断角色的审批权限
|
|
|
+ foreach ( $verifyList as $key => $value ) {
|
|
|
+ $ver = json_decode ( $value ['staff'] );
|
|
|
+
|
|
|
+ foreach ( $ver as $k => $v ) {
|
|
|
+ if ($v [1] == 'ROLE') {
|
|
|
+ $roleList = json_decode ( $v [3] );
|
|
|
+ foreach ( $roleList as $t => $g ) {
|
|
|
+ $gList = explode ( "_", $g );
|
|
|
+ array_push ( $list, $gList [0] );
|
|
|
+ // print_r($list);
|
|
|
+ }
|
|
|
+ } else
|
|
|
+ array_push ( $list, $v [0] );
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断执行人的审批权限
|
|
|
+ $executeList = $execute->find ( array (
|
|
|
+ 'where' => 'mold !="日常收支"',
|
|
|
+ 'select' => 'staff',
|
|
|
+ 'asArray' => true
|
|
|
+ ) );
|
|
|
+ $list2 = array ();
|
|
|
+ foreach ( $executeList as $key => $value ) {
|
|
|
+ $ver = json_decode ( $value ['staff'] );
|
|
|
+
|
|
|
+ foreach ( $ver as $k => $v ) {
|
|
|
+ array_push ( $list2, $v [0] );
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $eidList = file_get_contents ( "protected/config/execute/execute.ini" );
|
|
|
+ $eidList = array_filter ( explode ( ",", $eidList ) );
|
|
|
+
|
|
|
+ $this->executeId = array_merge ( $list2, $eidList );
|
|
|
+ // print_r($this->executeId);
|
|
|
+ $this->verifyId = $list;
|
|
|
+ // $this->staff = $staff->getUserByIdList ( $_COOKIE ["staff"] );
|
|
|
+
|
|
|
+ return "/";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Doo::loadCore ( 'uri/DooUriRouter' );
|
|
|
+ $router = new DooUriRouter ();
|
|
|
+ $routeRs = $router->execute ( Doo::app ()->route, Doo::conf ()->SUBFOLDER );
|
|
|
+
|
|
|
+ if ($routeRs ['1'] != "login") {
|
|
|
+ header ( 'Content-Type:text/html;charset=utf-8' );
|
|
|
+ @header ( "Location: /login" );
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
private function makeTraveDefault($region){
|
|
|
$defaultTraveProvince="";
|
|
|
if($this->staff['category']=="总部"||$this->staff['category']=="总部1"){
|