當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Application_Model_User::checkPermissionByRoleName方法代碼示例

本文整理匯總了PHP中Application_Model_User::checkPermissionByRoleName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application_Model_User::checkPermissionByRoleName方法的具體用法?PHP Application_Model_User::checkPermissionByRoleName怎麽用?PHP Application_Model_User::checkPermissionByRoleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Application_Model_User的用法示例。


在下文中一共展示了Application_Model_User::checkPermissionByRoleName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: indexAction

 public function indexAction()
 {
     $this->view->customerAdmin = 0;
     if (Application_Model_User::checkPermissionByRoleName('客戶管理員') || Application_Model_User::checkPermissionByRoleName('係統管理員')) {
         $this->view->customerAdmin = 1;
     }
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:7,代碼來源:CustomercontactController.php

示例2: indexAction

 public function indexAction()
 {
     $user_session = new Zend_Session_Namespace('user');
     $this->view->defaultCurrency = '';
     $this->view->bpartnerAdminDisabled = 1;
     $this->view->supplierAdmin = 0;
     $this->view->customerAdmin = 0;
     $this->view->editDisable = 1;
     $this->view->user_id = 0;
     if (isset($user_session->user_info)) {
         $this->view->user_id = $user_session->user_info['user_id'];
         if (Application_Model_User::checkPermissionByRoleName('業務夥伴管理員')) {
             $this->view->bpartnerAdminDisabled = 0;
             $this->view->editDisable = 0;
         }
         if (Application_Model_User::checkPermissionByRoleName('供應商管理員') || Application_Model_User::checkPermissionByRoleName('係統管理員')) {
             $this->view->supplierAdmin = 1;
             $this->view->editDisable = 0;
         }
         if (Application_Model_User::checkPermissionByRoleName('客戶管理員') || Application_Model_User::checkPermissionByRoleName('係統管理員')) {
             $this->view->customerAdmin = 1;
             $this->view->editDisable = 0;
         }
     }
     $currency = new Erp_Model_Setting_Currency();
     $this->view->defaultCurrency = $currency->getDefaultCurrency();
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:27,代碼來源:PricelistController.php

示例3: indexAction

 public function indexAction()
 {
     $user_session = new Zend_Session_Namespace('user');
     $this->view->salesDisable = 1;
     $this->view->pmDisable = 1;
     $this->view->adminDisable = 1;
     $this->view->user_id = 0;
     if (isset($user_session->user_info)) {
         $this->view->user_id = $user_session->user_info['user_id'];
         if ($user_session->user_info['isSuperAdmin']) {
             $this->view->salesDisable = 0;
             $this->view->pmDisable = 0;
             $this->view->adminDisable = 0;
         } else {
             if (Application_Model_User::checkPermissionByRoleName('產品中心-市場') || Application_Model_User::checkPermissionByRoleName('產品中心-工程師')) {
                 $this->view->salesDisable = 0;
             }
             if (Application_Model_User::checkPermissionByRoleName('產品中心-PM')) {
                 $this->view->adminDisable = 0;
                 $this->view->salesDisable = 0;
                 $this->view->pmDisable = 0;
             }
             /* if(Application_Model_User::checkPermissionByRoleName('產品中心-審核')){
                    $this->view->reviewDisable = 0;
                } */
             if (Application_Model_User::checkPermissionByRoleName('係統管理員')) {
                 $this->view->salesDisable = 0;
                 $this->view->pmDisable = 0;
                 $this->view->adminDisable = 0;
             }
         }
     }
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:33,代碼來源:CatalogController.php

示例4: indexAction

 public function indexAction()
 {
     $user_session = new Zend_Session_Namespace('user');
     $this->view->user_id = 0;
     $this->view->accessViewTotal = 0;
     if (isset($user_session->user_info)) {
         $this->view->user_id = $user_session->user_info['user_id'];
         if (Application_Model_User::checkPermissionByRoleName('係統管理員') || Application_Model_User::checkPermissionByRoleName('財務人員')) {
             $this->view->accessViewTotal = 1;
         }
     }
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:12,代碼來源:StatisticsController.php

示例5: indexAction

 public function indexAction()
 {
     $user_session = new Zend_Session_Namespace('user');
     $user_id = $user_session->user_info['user_id'];
     $user_number = $user_session->user_info['user_number'];
     if (isset($user_session->user_info)) {
         $this->view->user_id = $user_id;
         if (Application_Model_User::checkPermissionByRoleName('係統管理員')) {
             $this->view->admin = 1;
         }
     }
     // 獲取默認日期範圍(最近3個月)
     $time = time();
     $this->view->default_date_from = date('Y-m-01', strtotime(date('Y', $time) . '-' . (date('m', $time) - 1) . '-01'));
     $this->view->default_date_to = date('Y-m-t', strtotime(date('Y', $time) . '-' . (date('m', $time) + 1) . '-01'));
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:16,代碼來源:Setting.php

示例6: indexAction

 public function indexAction()
 {
     $user_session = new Zend_Session_Namespace('user');
     $this->view->hraAdmin = 0;
     $this->view->user_id = 0;
     if (isset($user_session->user_info)) {
         $this->view->user_id = $user_session->user_info['user_id'];
         if ($user_session->user_info['isSuperAdmin']) {
             $this->view->hraAdmin = 1;
         } else {
             if (Application_Model_User::checkPermissionByRoleName('係統管理員') || Application_Model_User::checkPermissionByRoleName('人事主管')) {
                 $this->view->hraAdmin = 1;
             }
         }
     }
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:16,代碼來源:AttendanceController.php

示例7: getData

 public function getData($condition)
 {
     $where = "t1.apply_time >= '" . $condition['date_from'] . " 00:00:00' and t1.apply_time <= '" . $condition['date_to'] . " 23:59:59'";
     if ($condition['key'] != '') {
         $where .= " and (t3.cname like '%" . $condition['key'] . "%' or t3.ename like '%" . $condition['key'] . "%' or t3.number like '%" . $condition['key'] . "%')";
     }
     $sql = $this->select()->setIntegrityCheck(false)->from(array('t1' => $this->_name))->joinLeft(array('t2' => $this->_dbprefix . 'seal'), "t1.seal_id = t2.id", array('seal_name' => 'name'))->joinLeft(array('t3' => $this->_dbprefix . 'user'), "t1.apply_user = t3.id", array())->joinLeft(array('t4' => $this->_dbprefix . 'employee'), "t4.id = t3.employee_id", array('apply_user_name' => 'cname'))->joinLeft(array('t5' => $this->_dbprefix . 'user'), "t1.review_user = t5.id", array())->joinLeft(array('t6' => $this->_dbprefix . 'employee'), "t6.id = t5.employee_id", array('review_user_name' => 'cname'))->order(array('t1.review_state', 't1.apply_time desc'));
     if (!Application_Model_User::checkPermissionByRoleName('印章管理員') && !Application_Model_User::checkPermissionByRoleName('係統管理員')) {
         $user_session = new Zend_Session_Namespace('user');
         $user_id = $user_session->user_info['user_id'];
         $sql->where("apply_user = " . $user_id . " or review_user = " . $user_id);
     }
     $total = $this->fetchAll($sql)->count();
     if ($condition['option'] != 'csv') {
         $sql->limitPage($condition['page'], $condition['limit']);
     }
     $data = $this->fetchAll($sql)->toArray();
     for ($i = 0; $i < count($data); $i++) {
         switch ($data[$i]['state']) {
             case 1:
                 $data[$i]['state'] = '新申請';
                 break;
             case 2:
                 $data[$i]['state'] = '批準';
                 break;
             case 3:
                 $data[$i]['state'] = '拒絕';
                 break;
             default:
                 $data[$i]['state'] = '無';
                 break;
         }
     }
     if ($condition['option'] == 'csv') {
         $data_csv = array();
         $title = array('cnt' => '#', 'state' => '狀態', 'seal_name' => '印章', 'apply_reason' => '事由', 'review_user' => '審核人', 'review_time' => '審核時間', 'review_opinion' => '審核意見', 'apply_user' => '申請人', 'apply_time' => '申請時間', 'remark' => '備注');
         array_push($data_csv, $title);
         $i = 0;
         foreach ($data as $d) {
             $i++;
             $info = array('cnt' => $i, 'state' => $d['state'], 'seal_name' => $d['seal_name'], 'apply_reason' => $d['apply_reason'], 'review_user' => $d['review_user'], 'review_time' => $d['review_time'], 'review_opinion' => $d['review_opinion'], 'apply_user' => $d['apply_user'], 'apply_time' => $d['apply_time'], 'remark' => $d['remark']);
             array_push($data_csv, $info);
         }
         return $data_csv;
     }
     return array('total' => $total, 'rows' => $data);
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:47,代碼來源:Sealuse.php

示例8: indexAction

 public function indexAction()
 {
     $user_session = new Zend_Session_Namespace('user');
     $this->view->typeEditDisable = 1;
     $this->view->accessViewOrder = 0;
     $this->view->user_id = 0;
     if (isset($user_session->user_info)) {
         $this->view->user_id = $user_session->user_info['user_id'];
         if (Application_Model_User::checkPermissionByRoleName('係統管理員') || Application_Model_User::checkPermissionByRoleName('供應商管理員')) {
             $this->view->typeEditDisable = 0;
             $this->view->accessViewOrder = 1;
         } else {
             if (Application_Model_User::checkPermissionByRoleName('采購訂單明細查看')) {
                 $this->view->accessViewOrder = 1;
             }
         }
     }
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:18,代碼來源:OrderController.php

示例9: indexAction

 public function indexAction()
 {
     $user_session = new Zend_Session_Namespace('user');
     $this->view->canReplyPlan = 0;
     $this->view->canReplySales = 0;
     $this->view->user_id = 0;
     if (isset($user_session->user_info)) {
         $this->view->user_id = $user_session->user_info['user_id'];
         if (Application_Model_User::checkPermissionByRoleName('係統管理員')) {
             $this->view->canReplyPlan = 1;
             $this->view->canReplySales = 1;
         }
         if (Application_Model_User::checkPermissionByRoleName('計劃人員')) {
             $this->view->canReplyPlan = 1;
         }
         if (Application_Model_User::checkPermissionByRoleName('銷售人員')) {
             $this->view->canReplySales = 1;
         }
     }
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:20,代碼來源:OrderController.php

示例10: getMy

 /**
  * 獲取BOM列表
  */
 public function getMy($type, $where, $myId, $start, $limit)
 {
     // 該我審批的
     $sql3 = $this->select()->setIntegrityCheck(false)->from(array('t1' => $this->_name))->join(array('t2' => $this->_dbprefix . 'review'), "t1.id = t2.file_id and t2.finish_flg = 0 and (t2.type = 'updbom' or t2.type = 'devbom' or t2.type = 'ecobom')", array())->joinLeft(array('t3' => $this->_dbprefix . 'employee'), "t1.create_user = t3.id", array('creater' => 'cname'))->joinLeft(array('t4' => $this->_dbprefix . 'codemaster'), "t4.code = t1.reason_type and t4.type=6", array('reason_type_name' => 'text'))->where("t1.state = 'Reviewing' and (t2.actual_user is null or !(FIND_IN_SET({$myId},t2.actual_user))) and (FIND_IN_SET({$myId}, t2.plan_user))")->where($where);
     $ids = $this->getMyReviewing($myId);
     if ($ids) {
         $sql3->where("t2.id in ({$ids})");
     }
     // 我申請的
     $sql1 = $this->select()->setIntegrityCheck(false)->from(array('t1' => $this->_name))->joinLeft(array('t3' => $this->_dbprefix . 'employee'), "t1.create_user = t3.id", array('creater' => 'cname'))->joinLeft(array('t4' => $this->_dbprefix . 'codemaster'), "t4.code = t1.reason_type and t4.type=6", array('reason_type_name' => 'text'))->where($where);
     if (!Application_Model_User::checkPermissionByRoleName('文件管理員') && !Application_Model_User::checkPermissionByRoleName('物料管理員') && !Application_Model_User::checkPermissionByRoleName('係統管理員')) {
         $sql1 = $sql1->where("(t1.state = 'Reviewing' or t1.state = 'Return' or t1.state = 'Draft' or t1.state = 'Active') and t1.create_user = {$myId}");
     } else {
         $sql1 = $sql1->where("(t1.state = 'Reviewing' or t1.state = 'Return' or t1.state = 'Active') or (t1.state = 'Draft' and t1.create_user = {$myId})");
     }
     // 我審批過的
     $sql2 = $this->select()->setIntegrityCheck(false)->from(array('t1' => $this->_name))->joinLeft(array('t3' => $this->_dbprefix . 'employee'), "t1.create_user = t3.id", array('creater' => 'cname'))->joinLeft(array('t4' => $this->_dbprefix . 'codemaster'), "t4.code = t1.reason_type and t4.type=6", array('reason_type_name' => 'text'))->where("t1.state = 'Reviewing' or t1.state = 'Return' or t1.state = 'Active'")->where($where);
     $ids = $this->getMyReviewed($myId);
     if ($ids) {
         $sql2->where("t1.id in ({$ids})");
     }
     if ($type == 1) {
         $sqlArray = array($sql1);
     } else {
         if ($type == 2) {
             $sqlArray = array($sql2);
         } else {
             if ($type == 3) {
                 $sqlArray = array($sql3);
             } else {
                 $sqlArray = array($sql3, $sql1, $sql2);
             }
         }
     }
     $selectUnion = $this->select()->union($sqlArray, Zend_Db_Select::SQL_UNION)->order('state DESC')->order('update_time desc')->limit($limit, $start);
     $data = $this->fetchAll($selectUnion)->toArray();
     return $data;
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:41,代碼來源:Updbom.php

示例11: indexAction

 public function indexAction()
 {
     $user_session = new Zend_Session_Namespace('user');
     $this->view->bpartnerAdminDisabled = 1;
     $this->view->supplierAdmin = 0;
     $this->view->customerAdmin = 0;
     $this->view->supplierView = 0;
     $this->view->customerView = 0;
     $this->view->user_id = 0;
     if (isset($user_session->user_info)) {
         $this->view->user_id = $user_session->user_info['user_id'];
         if ($user_session->user_info['isSuperAdmin']) {
             $this->view->bpartnerAdminDisabled = 0;
             $this->view->supplierAdmin = 1;
             $this->view->customerAdmin = 1;
             $this->view->supplierView = 1;
             $this->view->customerView = 1;
         } else {
             if (Application_Model_User::checkPermissionByRoleName('業務夥伴管理員')) {
                 $this->view->bpartnerAdminDisabled = 0;
                 $this->view->supplierView = 1;
                 $this->view->customerView = 1;
             }
             if (Application_Model_User::checkPermissionByRoleName('業務夥伴-查看-供應商')) {
                 $this->view->supplierView = 1;
             }
             if (Application_Model_User::checkPermissionByRoleName('業務夥伴-查看-客戶')) {
                 $this->view->customerView = 1;
             }
             if (Application_Model_User::checkPermissionByRoleName('供應商管理員') || Application_Model_User::checkPermissionByRoleName('係統管理員')) {
                 $this->view->supplierAdmin = 1;
             }
             if (Application_Model_User::checkPermissionByRoleName('客戶管理員') || Application_Model_User::checkPermissionByRoleName('係統管理員')) {
                 $this->view->customerAdmin = 1;
             }
         }
     }
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:38,代碼來源:BpartnerController.php

示例12: indexAction

 public function indexAction()
 {
     $user_session = new Zend_Session_Namespace('user');
     $user_id = $user_session->user_info['user_id'];
     $user_number = $user_session->user_info['user_number'];
     $this->view->hraAdmin = 0;
     $this->view->user_id = 0;
     $request = $this->getRequest()->getParams();
     $this->view->active_tab = isset($request['active_tab']) ? $request['active_tab'] : 0;
     if (isset($user_session->user_info)) {
         $this->view->user_id = $user_id;
         if ($user_session->user_info['isSuperAdmin']) {
             $this->view->hraAdmin = 1;
         } else {
             if (Application_Model_User::checkPermissionByRoleName('係統管理員') || Application_Model_User::checkPermissionByRoleName('人事主管')) {
                 $this->view->hraAdmin = 1;
             }
         }
     }
     $user = new Application_Model_User();
     $member = new Admin_Model_Member();
     // 獲取部門主管
     $manager = $user->getManagerUser($user_session->user_info['user_id']);
     $this->view->default_manager_id = $manager[0]['id'];
     // 獲取總經理
     /* $leader = $member->getMemberWithNoManagerByName('總經理');
        $this->view->default_leader_id = $leader[0]['user_id']; */
     // 獲取公司領導
     /* $leader = $user->getLeaderList();
        $this->view->default_leader_id = $leader[0]['id']; */
     // 獲取當前用戶剩餘假期
     $this->view->vacation_qty_left = $this->getVacaionLeftQty($user_id);
     // 獲取默認日期範圍(最近3個月)
     $time = time();
     $this->view->default_date_from = date('Y-m-01', strtotime(date('Y', $time) . '-' . (date('m', $time) - 1) . '-01'));
     $this->view->default_date_to = date('Y-m-t', strtotime(date('Y', $time) . '-' . (date('m', $time) + 1) . '-01'));
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:37,代碼來源:AttendanceController.php

示例13: getMyCount

 public function getMyCount($type, $where, $myId)
 {
     $sql3 = $this->select()->setIntegrityCheck(false)->from(array('t1' => $this->_name))->join(array('t2' => $this->_dbprefix . 'review'), "t1.id = t2.file_id and t2.finish_flg = 0 and t2.type = 'bom'", array())->joinLeft(array('t3' => $this->_dbprefix . 'employee'), "t1.create_user = t3.id", array('creater' => 'cname'))->where("t1.state != 'Deleted'")->where($where);
     $ids = $this->getMyReviewing($myId);
     if ($ids) {
         $sql3->where("t2.id in ({$ids})");
     }
     $sql1 = $this->select()->setIntegrityCheck(false)->from(array('t1' => $this->_name))->joinLeft(array('t3' => $this->_dbprefix . 'employee'), "t1.create_user = t3.id", array('creater' => 'cname'))->where($where);
     if (!Application_Model_User::checkPermissionByRoleName('BOM管理員') && !Application_Model_User::checkPermissionByRoleName('係統管理員')) {
         $sql1 = $sql1->where("(t1.state = 'Reviewing' or t1.state = 'Return' or t1.state = 'Draft' or t1.state = 'Active') and t1.create_user = {$myId}");
     } else {
         $sql1 = $sql1->where("(t1.state = 'Reviewing' or t1.state = 'Return' or t1.state = 'Active') or (t1.state = 'Draft' and t1.create_user = {$myId})");
     }
     $sql2 = $this->select()->setIntegrityCheck(false)->from(array('t1' => $this->_name))->joinLeft(array('t3' => $this->_dbprefix . 'employee'), "t1.create_user = t3.id", array('creater' => 'cname'))->where("t1.state != 'Deleted'")->where($where);
     $ids = $this->getMyReviewed($myId);
     if ($ids) {
         $sql2->where("t1.id in ({$ids})");
     }
     if ($type == 1) {
         $sqlArray = array($sql1);
     } else {
         if ($type == 2) {
             $sqlArray = array($sql2);
         } else {
             if ($type == 3) {
                 $sqlArray = array($sql3);
             } else {
                 $sqlArray = array($sql1, $sql2, $sql3);
             }
         }
     }
     $selectUnion = $this->select()->union($sqlArray, Zend_Db_Select::SQL_UNION)->order('state DESC')->order('update_time desc');
     $data = $this->fetchAll($selectUnion)->count();
     return $data;
 }
開發者ID:xindalu,項目名稱:evolve,代碼行數:35,代碼來源:Newbom.php

示例14: getData

 public function getData($condition, $receive_id = null, $type = '采購收貨')
 {
     $sql = $this->select()->setIntegrityCheck(false)->from(array('t1' => $this->_name))->joinLeft(array('t2' => $this->_dbprefix . 'user'), "t1.create_user = t2.id", array())->joinLeft(array('t3' => $this->_dbprefix . 'employee'), "t2.employee_id = t3.id", array('creater' => 'cname'))->joinLeft(array('t4' => $this->_dbprefix . 'user'), "t1.update_user = t4.id", array())->joinLeft(array('t5' => $this->_dbprefix . 'employee'), "t4.employee_id = t5.id", array('updater' => 'cname'))->where("t1.type = '" . $type . "'");
     if ($receive_id) {
         $sql->where("t1.id = " . $receive_id);
         return $this->fetchRow($sql)->toArray();
     } else {
         if ($condition['date_from']) {
             $sql->where("t1.create_time >= '" . $condition['date_from'] . " 00:00:00'");
         }
         if ($condition['date_to']) {
             $sql->where("t1.create_time <= '" . $condition['date_to'] . " 23:59:59'");
         }
         if ($condition['key']) {
             $sql->where("t1.number like '%" . $condition['key'] . "%' \n                        or t1.description like '%" . $condition['key'] . "%' \n                        or t1.remark like '%" . $condition['key'] . "%'");
             // or t8.name like '%".$condition['key']."%'
         }
         $total = $this->fetchAll($sql)->count();
         $sql->order(array('t1.number desc', 't1.create_time desc'));
         if ($condition['type'] != 'csv') {
             $sql->limitPage($condition['page'], $condition['limit']);
         }
         $data = $this->fetchAll($sql)->toArray();
         $receive_items = new Erp_Model_Purchse_Receiveitems();
         for ($i = 0; $i < count($data); $i++) {
             $data[$i]['create_time'] = strtotime($data[$i]['create_time']);
             $data[$i]['update_time'] = strtotime($data[$i]['update_time']);
             $orderInfo = $receive_items->getOrderNumbersByReceiveId($data[$i]['id'], $type);
             $data[$i]['order_number'] = implode(',', $orderInfo['order_number']);
             if ($type == '采購收貨') {
                 $suppliers = array();
                 foreach ($orderInfo['supplier'] as $s) {
                     if (!in_array($s, $suppliers)) {
                         array_push($suppliers, $s);
                     }
                 }
                 $data[$i]['supplier'] = implode(',', $suppliers);
             } else {
                 $customers = array();
                 foreach ($orderInfo['customer'] as $c) {
                     if (!in_array($c, $customers)) {
                         array_push($customers, $c);
                     }
                 }
                 $data[$i]['customer'] = implode(',', $customers);
             }
         }
         if ($condition['type'] == 'csv') {
             $data_csv = array();
             $showAmount = false;
             if (Application_Model_User::checkPermissionByRoleName('係統管理員') || Application_Model_User::checkPermissionByRoleName('財務人員') || ($type = '采購收貨' || ($type = '采購退貨' || ($type = '調撥'))) && Application_Model_User::checkPermissionByRoleName('采購人員') || ($type = '銷售交貨' && Application_Model_User::checkPermissionByRoleName('銷售人員'))) {
                 $showAmount = true;
             }
             if ($showAmount) {
                 if (isset($condition['action_type']) && $condition['action_type'] == '采購收貨') {
                     $title = array('cnt' => '#', 'number' => '收貨單號', 'order_number' => '采購訂單', 'total' => '金額', 'supplier' => '供應商', 'date' => '收貨日期', 'description' => '描述', 'remark' => '備注', 'creater' => '收貨人', 'create_time' => '收貨時間');
                 } else {
                     if (isset($condition['action_type']) && $condition['action_type'] == '銷售交貨') {
                         $title = array('cnt' => '#', 'number' => '交貨單號', 'order_number' => '銷售訂單', 'total' => '金額', 'customer' => '客戶', 'date' => '交貨日期', 'description' => '描述', 'remark' => '備注', 'creater' => '交貨人', 'create_time' => '交貨時間');
                     } else {
                         $title = array('cnt' => '#', 'transaction_type' => '庫存交易類別', 'number' => '單據號', 'date' => '單據日期', 'total' => '金額', 'description' => '描述', 'remark' => '備注', 'creater' => '製單人', 'create_time' => '製單時間');
                     }
                 }
             } else {
                 if (isset($condition['action_type']) && $condition['action_type'] == '采購收貨') {
                     $title = array('cnt' => '#', 'number' => '收貨單號', 'order_number' => '采購訂單', 'supplier' => '供應商', 'date' => '收貨日期', 'description' => '描述', 'remark' => '備注', 'creater' => '收貨人', 'create_time' => '收貨時間');
                 } else {
                     if (isset($condition['action_type']) && $condition['action_type'] == '銷售交貨') {
                         $title = array('cnt' => '#', 'number' => '交貨單號', 'order_number' => '銷售訂單', 'customer' => '客戶', 'date' => '交貨日期', 'description' => '描述', 'remark' => '備注', 'creater' => '交貨人', 'create_time' => '交貨時間');
                     } else {
                         $title = array('cnt' => '#', 'transaction_type' => '庫存交易類別', 'number' => '單據號', 'date' => '單據日期', 'description' => '描述', 'remark' => '備注', 'creater' => '製單人', 'create_time' => '製單時間');
                     }
                 }
             }
             array_push($data_csv, $title);
             $i = 0;
             foreach ($data as $d) {
                 $i++;
                 if ($showAmount) {
                     if (isset($condition['action_type']) && $condition['action_type'] == '采購收貨') {
                         $info = array('cnt' => $i, 'number' => $d['number'], 'order_number' => $d['order_number'], 'total' => $d['total'], 'supplier' => $d['supplier'], 'date' => $d['date'], 'description' => $d['description'], 'remark' => $d['remark'], 'creater' => $d['creater'], 'create_time' => date('Y-m-d H:i:s', $d['create_time']));
                     } else {
                         if (isset($condition['action_type']) && $condition['action_type'] == '銷售交貨') {
                             $info = array('cnt' => $i, 'number' => $d['number'], 'order_number' => $d['order_number'], 'total' => $d['total'], 'customer' => $d['customer'], 'date' => $d['date'], 'description' => $d['description'], 'remark' => $d['remark'], 'creater' => $d['creater'], 'create_time' => date('Y-m-d H:i:s', $d['create_time']));
                         } else {
                             $info = array('cnt' => $i, 'transaction_type' => $d['transaction_type'], 'number' => $d['number'], 'date' => $d['date'], 'total' => $d['total'], 'description' => $d['description'], 'remark' => $d['remark'], 'creater' => $d['creater'], 'create_time' => date('Y-m-d H:i:s', $d['create_time']));
                         }
                     }
                 } else {
                     if (isset($condition['action_type']) && $condition['action_type'] == '采購收貨') {
                         $info = array('cnt' => $i, 'number' => $d['number'], 'order_number' => $d['order_number'], 'supplier' => $d['supplier'], 'date' => $d['date'], 'description' => $d['description'], 'remark' => $d['remark'], 'creater' => $d['creater'], 'create_time' => date('Y-m-d H:i:s', $d['create_time']));
                     } else {
                         if (isset($condition['action_type']) && $condition['action_type'] == '銷售交貨') {
                             $info = array('cnt' => $i, 'number' => $d['number'], 'order_number' => $d['order_number'], 'customer' => $d['customer'], 'date' => $d['date'], 'description' => $d['description'], 'remark' => $d['remark'], 'creater' => $d['creater'], 'create_time' => date('Y-m-d H:i:s', $d['create_time']));
                         } else {
                             $info = array('cnt' => $i, 'transaction_type' => $d['transaction_type'], 'number' => $d['number'], 'date' => $d['date'], 'description' => $d['description'], 'remark' => $d['remark'], 'creater' => $d['creater'], 'create_time' => date('Y-m-d H:i:s', $d['create_time']));
                         }
                     }
                 }
                 array_push($data_csv, $info);
//.........這裏部分代碼省略.........
開發者ID:xindalu,項目名稱:evolve,代碼行數:101,代碼來源:Receive.php

示例15: reviewAction


//.........這裏部分代碼省略.........
                 $plan_user = $reviewRow['plan_user'];
                 $actual_user = $reviewRow['actual_user'];
                 $actual_user = !$actual_user ? $user : $actual_user . "," . $user;
                 // 檢查計劃審核人和實際審核人是否一致
                 $planA = explode(',', $plan_user);
                 $actualA = explode(',', $actual_user);
                 $passFlg = true;
                 foreach ($planA as $u) {
                     if ($u && !in_array($u, $actualA)) {
                         $passFlg = false;
                     }
                 }
                 if ($passFlg) {
                     $finish_flg = 1;
                     $finish_time = $now;
                 } else {
                     $finish_flg = 0;
                     $finish_time = null;
                 }
             }
             // 審核情況
             $reviewData = array("actual_user" => $actual_user, "finish_time" => $finish_time, "finish_flg" => $finish_flg);
         } else {
             if ($pass == 3) {
                 // 轉審
                 $finish_flg = 0;
                 if ($method == 2) {
                     // 處理方式為任意時,一個人轉審之後其他人員也刪除
                     $plan_user = str_replace('E', '', $val->transfer_id);
                 } else {
                     // 更改審核情況中的審核人
                     $plan_users = explode(',', $reviewRow['plan_user']);
                     // 審核人不在審核人列表中,並且是管理員,則替換所有人
                     if (!in_array($user, $plan_users) && (Application_Model_User::checkPermissionByRoleName('物料管理員') || Application_Model_User::checkPermissionByRoleName('係統管理員'))) {
                         $plan_users = array(str_replace('E', '', $val->transfer_id));
                     } else {
                         for ($i = 0; $i < count($plan_users); $i++) {
                             if ($plan_users[$i] == $user) {
                                 $plan_users[$i] = str_replace('E', '', $val->transfer_id);
                                 break;
                             }
                         }
                     }
                     $plan_user = implode(',', $plan_users);
                 }
                 // 審核情況
                 $reviewData = array("plan_user" => $plan_user, "method" => 1);
             } else {
                 // 退回
                 $actual_user = null;
                 $finish_time = null;
                 $finish_flg = 0;
                 // 退回選項
                 $return = $reviewRow['return'];
                 if ($return == 2) {
                     // 退到初始狀態
                     // 需更新的審核記錄: 所有
                     $reviewWhere = "type = 'materiel' and file_id = {$id}";
                     // 審核情況更新數據
                     $reviewData = array("actual_user" => $actual_user, "finish_time" => $finish_time, "finish_flg" => $finish_flg);
                     // 文件狀態不更新
                 } else {
                     if ($return == 4) {
                         // 退到本階段開始
                         // 需更新的審核記錄
                         $reviewWhere = "type = 'materiel' and finish_flg = 0 and file_id = {$id}";
開發者ID:xindalu,項目名稱:evolve,代碼行數:67,代碼來源:ApplyController.php


注:本文中的Application_Model_User::checkPermissionByRoleName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。