当前位置: 首页>>代码示例>>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;未经允许,请勿转载。