public function actionSubList()
 {
     if (EnvUtil::getRequest("op") == "getsubordinates") {
         $this->getsubordinates();
         exit;
     }
     $getUid = intval(EnvUtil::getRequest("uid"));
     if (!$getUid) {
         $deptArr = UserUtil::getManagerDeptSubUserByUid(Ibos::app()->user->uid);
         if (!empty($deptArr)) {
             $firstDept = reset($deptArr);
             $uid = $firstDept["user"][0]["uid"];
         } else {
             $this->error(IBos::lang("You do not subordinate"), $this->createUrl("schedule/index"));
         }
     } else {
         $uid = $getUid;
     }
     if (!UserUtil::checkIsSub(Ibos::app()->user->uid, $uid)) {
         $this->error(Ibos::lang("No permission to view schedule"), $this->createUrl("schedule/index"));
     }
     $params = $this->getUnfinishedDataByUid($uid);
     $this->setPageTitle(Ibos::lang("Assignment"));
     $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Assignment"), "url" => $this->createUrl("unfinished/index")), array("name" => Ibos::lang("Unfinished list"))));
     $this->render("sublist", $params);
 }
Beispiel #2
0
 public function actionSubSchedule()
 {
     $op = EnvUtil::getRequest("op");
     if ($op == "getsubordinates") {
         $this->getsubordinates();
     } elseif ($op == "list") {
         $this->getList();
     } else {
         $workTime = Ibos::app()->setting->get("setting/calendarworkingtime");
         $workingtime = explode(",", $workTime);
         $setting = array("worktimestart" => $workingtime[0], "worktimeend" => $workingtime[1], "allowAdd" => CalendarUtil::getIsAllowAdd(), "allowEdit" => CalendarUtil::getIsAllowEdit());
         $getUid = EnvUtil::getRequest("uid");
         if (!$getUid) {
             $deptArr = UserUtil::getManagerDeptSubUserByUid($this->uid);
             if (!empty($deptArr)) {
                 $firstDept = reset($deptArr);
                 $uid = $firstDept["user"][0]["uid"];
             } else {
                 $this->error(IBos::lang("You do not subordinate"), $this->createUrl("schedule/index"));
             }
         } else {
             $uid = $getUid;
         }
         if (!UserUtil::checkIsSub(Ibos::app()->user->uid, $uid)) {
             $this->error(Ibos::lang("No permission to view schedule"), $this->createUrl("schedule/index"));
         }
         $data = array("setting" => $setting, "user" => User::model()->fetchByUid($uid), "supUid" => UserUtil::getSupUid($this->uid));
         $this->setPageTitle(Ibos::lang("Subordinate schedule"));
         $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Calendar arrangement"), "url" => $this->createUrl("schedule/index")), array("name" => Ibos::lang("Subordinate schedule"))));
         $this->render("subschedule", $data);
     }
 }
Beispiel #3
0
 public static function checkPermission($report, $uid)
 {
     $toid = explode(",", $report["toid"]);
     if ($report["uid"] == $uid || in_array($uid, $toid) || UserUtil::checkIsSub($uid, $report["uid"])) {
         return true;
     } else {
         return false;
     }
 }
 protected function checkIsSup($assignment)
 {
     $uid = Ibos::app()->user->uid;
     $participantuid = explode(",", $assignment["participantuid"]);
     if (UserUtil::checkIsSub($uid, $assignment["designeeuid"])) {
         return true;
     }
     if (UserUtil::checkIsSub($uid, $assignment["chargeuid"])) {
         return true;
     }
     foreach ($participantuid as $puid) {
         if (UserUtil::checkIsSub($uid, $puid)) {
             return true;
         }
     }
     return false;
 }
Beispiel #5
0
 public function actionSubTask()
 {
     if (!UserUtil::checkIsSub(Ibos::app()->user->uid, $this->uid)) {
         $this->error(Ibos::lang("No permission to view task"), $this->createUrl("task/index"));
     }
     $postComp = EnvUtil::getRequest("complete");
     $this->complete = empty($postComp) ? 0 : $postComp;
     if (EnvUtil::getRequest("param") == "search") {
         $this->search();
     }
     $this->_condition = CalendarUtil::joinCondition($this->_condition, "uid = " . $this->uid);
     $data = Tasks::model()->fetchTaskByComplete($this->_condition, $this->complete);
     $data["complete"] = $this->complete;
     $data["user"] = User::model()->fetchByUid($this->uid);
     $data["supUid"] = UserUtil::getSupUid($this->uid);
     $data["allowEditTask"] = CalendarUtil::getIsAllowEidtTask();
     $this->setPageTitle(Ibos::lang("Subordinate task"));
     $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Calendar arrangement"), "url" => $this->createUrl("schedule/index")), array("name" => Ibos::lang("Subordinate task"))));
     $this->render("subtask", $data);
 }
Beispiel #6
0
 private function personal()
 {
     $uid = Ibos::app()->user->uid;
     $typeid = EnvUtil::getRequest("typeid");
     $getUid = intval(EnvUtil::getRequest("uid"));
     $condition = "uid = '{$getUid}'";
     if (!UserUtil::checkIsSub($uid, $getUid)) {
         $condition .= " AND FIND_IN_SET('{$uid}', toid )";
     }
     if (!empty($typeid)) {
         $condition .= " AND typeid = '{$typeid}'";
     }
     if (EnvUtil::getRequest("param") == "search") {
         $this->search();
     }
     $this->_condition = ReportUtil::joinCondition($this->_condition, $condition);
     $paginationData = Report::model()->fetchAllByPage($this->_condition);
     $params = array("dashboardConfig" => Ibos::app()->setting->get("setting/reportconfig"), "typeid" => $typeid, "pagination" => $paginationData["pagination"], "reportList" => ICReport::handelListData($paginationData["data"]), "reportCount" => Report::model()->count("uid = '{$getUid}'"), "commentCount" => Report::model()->count("uid='{$getUid}' AND isreview=1"), "user" => User::model()->fetchByUid($getUid), "supUid" => UserUtil::getSupUid($getUid));
     $this->setPageTitle(Ibos::lang("Review subordinate report"));
     $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Work report"), "url" => $this->createUrl("default/index")), array("name" => Ibos::lang("Subordinate personal report"))));
     $this->render("personal", $params);
 }
Beispiel #7
0
 public function actionShow()
 {
     $diaryid = intval(EnvUtil::getRequest("diaryid"));
     $uid = Ibos::app()->user->uid;
     if (empty($diaryid)) {
         $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("share/index"));
     }
     $diary = Diary::model()->fetchByPk($diaryid);
     if (empty($diary)) {
         $this->error(Ibos::lang("No data found"), $this->createUrl("share/index"));
     }
     if (!ICDiary::checkScope($uid, $diary)) {
         $this->error(Ibos::lang("You do not have permission to view the log"), $this->createUrl("share/index"));
     }
     Diary::model()->addReaderuidByPK($diary, $uid);
     $data = Diary::model()->fetchDiaryRecord($diary);
     $params = array("diary" => ICDiary::processDefaultShowData($diary), "prevAndNextPK" => Diary::model()->fetchPrevAndNextPKByPK($diary["diaryid"]), "data" => $data);
     if (!empty($diary["attachmentid"])) {
         $params["attach"] = AttachUtil::getAttach($diary["attachmentid"], true, true, false, false, true);
         $params["count"] = 0;
     }
     $params["allowComment"] = $this->issetSharecomment() || UserUtil::checkIsSub($uid, $diary["uid"]) ? 1 : 0;
     if (!empty($diary["readeruid"])) {
         $readerArr = explode(",", $diary["readeruid"]);
         $params["readers"] = User::model()->fetchAllByPk($readerArr);
     } else {
         $params["readers"] = "";
     }
     if (!empty($diary["stamp"])) {
         $params["stampUrl"] = Stamp::model()->fetchStampById($diary["stamp"]);
     }
     $params["sharecomment"] = $this->issetSharecomment();
     $this->setPageTitle(Ibos::lang("Show share diary"));
     $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Work diary"), "url" => $this->createUrl("default/index")), array("name" => Ibos::lang("Show share diary"))));
     $this->render("show", $params);
 }
Beispiel #8
0
 private function handleAuid($uid, $attentionUids)
 {
     $aUids = is_array($attentionUids) ? $attentionUids : implode(",", $attentionUids);
     $ret["subUid"] = array();
     $ret["aUid"] = array();
     if (!empty($aUids)) {
         foreach ($aUids as $aUid) {
             if (UserUtil::checkIsSub($uid, $aUid)) {
                 $ret["subUid"][] = $aUid;
             } else {
                 $ret["aUid"][] = $aUid;
             }
         }
     }
     return $ret;
 }
Beispiel #9
0
 private function remind()
 {
     if (Ibos::app()->request->isAjaxRequest) {
         $date = EnvUtil::getRequest("date");
         $dateTime = strtotime($date);
         $getUids = trim(EnvUtil::getRequest("uids"), ",");
         $uidArr = explode(",", $getUids);
         $uid = Ibos::app()->user->uid;
         if (empty($uidArr)) {
             $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("No user to remind")));
         }
         foreach ($uidArr as $subUid) {
             if (!UserUtil::checkIsSub($uid, $subUid)) {
                 $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("No permission to remind")));
             }
         }
         $dashboardConfig = $this->getDiaryConfig();
         $config = array("{name}" => User::model()->fetchRealnameByUid($uid), "{title}" => Ibos::lang("Remind title", "", array("y" => date("Y", $dateTime), "m" => date("m", $dateTime), "d" => date("d", $dateTime))), "{content}" => $dashboardConfig["remindcontent"]);
         if (0 < count($uidArr)) {
             Notify::model()->sendNotify($uidArr, "diary_message", $config, $uid);
         }
         $todayTime = strtotime(date("Y-m-d"));
         MainUtil::setCookie("reminded_" . $dateTime, md5($dateTime), $todayTime + 24 * 60 * 60 - TIMESTAMP);
         $this->ajaxReturn(array("isSuccess" => true, "msg" => Ibos::lang("Remind succeed")));
     }
 }
 protected function checkTaskPermission()
 {
     if (!$this->checkIsMe() && (!UserUtil::checkIsSub(Ibos::app()->user->uid, $this->uid) || !CalendarUtil::getIsAllowEidtTask())) {
         return false;
     } else {
         return true;
     }
 }
Beispiel #11
0
 public static function checkReviewScope($uid, $diary)
 {
     if (isset($diary["uid"]) && UserUtil::checkIsSub($uid, $diary["uid"])) {
         return true;
     } else {
         return false;
     }
 }
Beispiel #12
0
 protected function getIsAllowComment($controller, $uid, $diary)
 {
     $ret = 0;
     if ($controller == "review") {
         $ret = 1;
     } else {
         if ($controller == "share" || $controller == "attention") {
             $ret = $this->issetSharecomment() || UserUtil::checkIsSub($uid, $diary["uid"]) ? 1 : 0;
         }
     }
     return $ret;
 }