Exemplo n.º 1
0
 /**
  * @Title: setDbhaSmsgType
  * @Description: todo(右下角系统提示信息点击确定后操作)
  * @author jiangx
  * @date 2013-7-9
  * @throws
  */
 public function setDbhaSmsgType()
 {
     // 		foreach ($_POST['datalist'] as $key => $val) {
     // 			$model = D($key);
     // 			$model->where('id in ( '. $val .' )')->setField('isread', 1);
     // 		}
     // 		$this->transaction_model->commit();//事务提交
     $data = getTaskulous();
     $_SESSION['popupTaskulous'] = md5(serialize($data));
     exit('1');
 }
Exemplo n.º 2
0
 /**
  * @Title: getAllScheduleList
  * @Description: todo(右下角系统提示信息)
  * @author jiangx
  * @date 2013-7-9
  * @throws
  */
 public function getAllScheduleList()
 {
     //任务预超期提醒开始:夏凤琴7200表示的是任务提前两个小时提醒
     /* $ismistaskmsg = true; //表示要提醒
     		 if ($_SESSION['Mis_Task_Beforehand_Exceed']) {
     		if(($time - $_SESSION['Mis_Task_Beforehand_Exceed']) < 7200){
     		$ismistaskmsg = false;
     		}
     		}
     		if ($ismistaskmsg) {
     		$Mis_Task_Map = array();
     		$Mis_Task_Map['executeuser'] = $_SESSION[C('USER_AUTH_KEY')];
     		$Mis_Task_Map['executingstatus'] = array('not in','7,6');
     		$model = D('MisTaskInformationView');
     		$resultMisTask = $model->where($Mis_Task_Map)->select();
     		foreach ($resultMisTask as  $key=>$value) {
     		$nowM = $value['enddate']-time();
     		if ($nowM <= 7200) {
     		$recipientListID = array($value['executeuser'],$value['trackuser'],$value['createid']);
     		$messageContent = '<p style="width: auto;float:none;">您好!</p><br/>';
     		$messageTitle = "任务预超期提醒";
     		if ($nowM <0) {
     		$messageTitle = "任务超期提醒";
     		$messageContent .= '<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;任务“'. $value['title'] .'”,已经超期,请知晓 。</p><br/>';
     		}else {
     		$messageTitle = "任务预超期提醒";
     		$messageContent .= '<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;任务“'. $value['title'] .'”,即将超期,请知晓 。</p><br/>';
     		}
     		$messageContent .= '
     		<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>任务详细情况:</strong></p>
     		<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>任务名称:</strong>'. $value['title'] .'</p><br/>
     		<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>任务负责人员:</strong>' . getFieldBy($value['executeuser'],'id','name','User') . '</p><br/>
     		<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>任务跟踪人员:</strong>' . getFieldBy($value['trackuser'],'id','name','User') . '</p><br/>
     		<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>计划开始时间:</strong>' . date('Y-m-d',$value['begindate']) . '</p><br/>
     		<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>计划结束时间:</strong>' . date('Y-m-d',$value['enddate']) . '</p><br/>
     		<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>任务描述:</strong>' . ($value['remark'] ? $value['remark'] : "(无)") . '</p><br/>
     		<p style="width: auto;float:none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果您有任何疑问,请联系' . getFieldBy($value['createid'],'id','name','User') . '。</p><br/>
     		<p style="width: auto;float:none;">&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>';
     		$yesOrNo = $this->pushMessage($recipientListID,$messageTitle,$messageContent);
     		if ($yesOrNo){
     		$_SESSION['Mis_Task_Beforehand_Exceed'] = time();
     		}
     		}
     		}
     		} */
     //任务预超期提醒结束:夏凤琴
     $usermodel = D("User");
     $hasmsg = $usermodel->where("id=" . $_SESSION[C('USER_AUTH_KEY')])->field('isnewmsg')->find();
     if ($hasmsg['isnewmsg'] == 0) {
         $rehtml["html"] = 0;
         $rehtml['date'] = $hasmsg;
         $rehtml['datalist'] = 0;
         echo json_encode($rehtml);
         exit;
     }
     $html = '';
     $moduleNameList = array();
     // 			$file =  DConfig_PATH . "/System/ProcessModelsConfig.inc.php";
     // 			$arr = require $file;
     $arr = getTaskulous();
     $scheduleList = array();
     $datalist = array();
     $data = getTaskulous();
     $md5 = md5(serialize($data));
     if ($_SESSION['popupTaskulous'] !== $md5) {
         unset($_SESSION['popupTaskulous']);
         //待办事项
         foreach ($arr as $k => $v) {
             if (!in_array($v['tablename'], array_keys($moduleNameList))) {
                 // 					if ($_SESSION["a"] == 1 ||  $_SESSION[strtolower($v['tablename'])."_waitaudit"]) {
                 $moduleNameList[$v['tablename']] = 1;
                 $model = D($v['tablename']);
                 $map = array();
                 if (method_exists($action, '_filter')) {
                     $action->_filter($map);
                 }
                 $map['status'] = 1;
                 $map['_string'] = 'FIND_IN_SET(  ' . $_SESSION[C('USER_AUTH_KEY')] . ', curAuditUser )';
                 //$map['isread'] = 0;
                 $idarr = $model->where($map)->getField('id', true);
                 if (count($idarr) > 0) {
                     $new = array();
                     $new['model'] = $v['tablename'];
                     $new['name'] = getFieldBy($v['tablename'], 'name', 'title', 'node');
                     $new['href'] = __APP__ . "/" . $v['tablename'] . "/index/default/2";
                     $new['count'] = count($idarr);
                     //$datalist[$v['model']] = '0';
                     //foreach ($idarr as $val) {
                     //	$datalist[$v['model']] .= "," . $val;
                     //}
                     $scheduleList[] = $new;
                 }
                 // 					}
             }
         }
     }
     if ($scheduleList) {
         $this->assign('msgscheduleList', $scheduleList);
         $html = $this->fetch("sysgmsgschedule");
         $rehtml["html"] = $html;
         $rehtml['date'] = $hasmsg;
         $rehtml['datalist'] = 0;
         //$datalist;
         echo json_encode($rehtml);
         exit;
     }
 }
 /**
  * @Title: getWillWorks
  * @Description: todo(OA助手获取我的待办任务)
  * @author 杨东
  * @date 2013-3-15 下午5:02:51
  * @throws
  */
 private function getWillWorks()
 {
     $arr = array();
     $html = '';
     // 		$file =  DConfig_PATH . "/System/ProcessModelsConfig.inc.php";
     // 		$arr = require $file;
     $moduleNameList = array();
     $arr = getTaskulous();
     $rutrunDataArr = array();
     $num = 0;
     //ruturnDataArr数组的顺序
     foreach ($arr as $k => $v) {
         if (!in_array($v['tablename'], array_keys($moduleNameList))) {
             // 				if ($_SESSION["a"] == 1 || $_SESSION[strtolower($v['tablename'])."_waitaudit"]) {
             $moduleNameList[$v['tablename']] = 1;
             $model = D($v['tablename']);
             $map = array();
             $action = A($v['tablename']);
             if (method_exists($action, '_filter')) {
                 $action->_filter($map);
             }
             $map['status'] = 1;
             $map['_string'] = 'FIND_IN_SET(  ' . $_SESSION[C('USER_AUTH_KEY')] . ', curAuditUser )';
             $count = $model->where($map)->count('id');
             if ($count) {
                 $m = strtolower(trim(preg_replace("/[A-Z]/", "_\\0", $v['tablename']), "_"));
                 if ($_SESSION[strtolower($m . '_index')] || isset($_SESSION['a'])) {
                     $ntdata = 1;
                 } else {
                     $ntdata = 0;
                 }
                 $rutrunDataArr[$num]['name'] = getFieldBy($v['tablename'], 'name', 'title', 'node');
                 $rutrunDataArr[$num]['title'] = getFieldBy($v['tablename'], 'name', 'title', 'node');
                 $rutrunDataArr[$num]['count'] = $count;
                 $rutrunDataArr[$num]['urldata'] = $v['tablename'] . ",index,default,2" . ";" . $v['tablename'] . ";" . $v['tablename'];
                 //$html .= '<li><a class="clearfix" rel="'.$v['model'].'" target="navTab" title="'.$v['name'].'" href="'.__APP__.'/'.$v['model'].'/index/default/2"><span>'.$v['name'].'</span> <em>共 '.$count.' 条</em></a></li>';
                 $num++;
             }
             // 				}
         }
     }
     return $rutrunDataArr;
 }
Exemplo n.º 4
0
 /**
  * @Title: getAllScheduleList
  * @Description: todo(右下角系统提示信息)
  * @author jiangx
  * @date 2013-7-9
  * @throws
  */
 public function getAllScheduleList()
 {
     $html = '';
     $moduleNameList = array();
     $arr = getTaskulous();
     //审批提醒
     $scheduleList = array();
     //项目执行提醒
     $datalist = array();
     foreach ($arr as $k => $v) {
         if (!in_array($v['tablename'], array_keys($moduleNameList))) {
             //if ($_SESSION["a"] == 1 ||  $_SESSION[strtolower($v['tablename'])."_waitaudit"]) {
             $moduleNameList[$v['tablename']] = 1;
             $model = D($v['tablename']);
             $map = array();
             if (method_exists($action, '_filter')) {
                 $action->_filter($map);
             }
             $map['status'] = 1;
             $map['_string'] = 'FIND_IN_SET(  ' . $_SESSION[C('USER_AUTH_KEY')] . ', curAuditUser )';
             //$map['isread'] = 0;
             $idarr = $model->where($map)->getField('id', true);
             if (count($idarr) > 0) {
                 $new = array();
                 $new['model'] = $v['tablename'];
                 $new['name'] = getFieldBy($v['tablename'], 'name', 'title', 'node');
                 $new['href'] = __APP__ . "/" . $v['tablename'] . "/index/default/7";
                 $new['count'] = count($idarr);
                 //$datalist[$v['model']] = '0';
                 //foreach ($idarr as $val) {
                 //	$datalist[$v['model']] .= "," . $val;
                 //}
                 $scheduleList[] = $new;
             }
         }
     }
     $MisWorkExecutingModel = D("MisWorkExecuting");
     $projectlist = $MisWorkExecutingModel->getUserWorkExecutList();
     if ($projectlist['count'] > 0) {
         foreach ($projectlist['list'] as $key => $val) {
             if ($val['count']) {
                 $new = array();
                 $new['model'] = $val['tablename'];
                 $new['name'] = $val['title'];
                 $new['href'] = __APP__ . "/" . $val['tablename'] . "/index" . $val['condition'];
                 $new['count'] = $val['count'];
                 $scheduleList[] = $new;
             }
         }
     }
     //定时任务 单据提醒
     //查询定时任务
     $MisSystemDataRemindMasViewModel = D("MisSystemDataRemindMasView");
     $map = array();
     $map['userid'] = $_SESSION[C('USER_AUTH_KEY')];
     $map['status'] = 1;
     $map['substatus'] = 1;
     $map['operation'] = 1;
     $map['issend'] = 0;
     //$map['sendtime']=time();
     $MisSystemDataRemindMasList = $MisSystemDataRemindMasViewModel->where($map)->find();
     if ($MisSystemDataRemindMasList) {
         $new = array();
         $new['model'] = $MisSystemDataRemindMasList['modelname'];
         $new['name'] = getFieldBy($MisSystemDataRemindMasList['modelname'], "name", "title", "node");
         $new['href'] = __APP__ . "/" . $MisSystemDataRemindMasList['modelname'] . "/view/id/" . $MisSystemDataRemindMasList['pkey'];
         $new['msginfo'] = $MisSystemDataRemindMasList['msginfo'];
         $new['chinese'] = getFieldBy($MisSystemDataRemindMasList['modelname'], "name", "title", "node");
         $megList[] = $new;
     }
     if ($scheduleList) {
         $this->assign('msgscheduleList', $scheduleList);
         $this->assign("megList", $megList);
         $html = $this->fetch("sysgmsgschedule");
         $rehtml["html"] = $html;
         $rehtml['date'] = $hasmsg;
         $rehtml['datalist'] = 0;
         //$datalist;
         echo json_encode($rehtml);
         exit;
     }
 }