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); }
public function actionEdit() { $id = intval(EnvUtil::getRequest("id")); if (empty($id)) { $this->error(IBos::lang("Parameters error", "error"), $this->createUrl("list/index")); } $emailBody = EmailBody::model()->fetchByPk($id); if (empty($emailBody)) { $this->error(Ibos::lang("Email not exists"), $this->createUrl("list/index")); } if (intval($emailBody["fromid"]) !== $this->uid) { $this->error(Ibos::lang("Request tainting", "error"), $this->createUrl("list/index")); } if (EnvUtil::submitCheck("formhash")) { $bodyData = $this->beforeSaveBody(); EmailBody::model()->modify($id, $bodyData); $this->save($id, $bodyData); } else { $emailBody["toids"] = StringUtil::wrapId($emailBody["toids"]); $emailBody["copytoids"] = StringUtil::wrapId($emailBody["copytoids"]); $emailBody["secrettoids"] = StringUtil::wrapId($emailBody["secrettoids"]); if (!empty($emailBody["attachmentid"])) { $emailBody["attach"] = AttachUtil::getAttach($emailBody["attachmentid"]); } $data = array("email" => $emailBody, "allowWebMail" => $this->allowWebMail, "webMails" => $this->webMails, "systemRemind" => Yii::app()->setting->get("setting/emailsystemremind"), "uploadConfig" => AttachUtil::getUploadConfig()); $this->setPageTitle(Ibos::lang("Edit email")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Personal Office")), array("name" => Ibos::lang("Email center"), "url" => $this->createUrl("list/index")), array("name" => Ibos::lang("Edit email")))); $this->render("edit", $data); } }
public function actionDel() { if (!Ibos::app()->request->getIsAjaxRequest()) { $this->error(IBos::lang("Parameters error", "error"), $this->createUrl("schedule/index")); } if (!$this->checkEditPermission()) { $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("No permission to del schedule"))); } $getCalendarId = EnvUtil::getRequest("calendarId"); $calendarId = $this->checkCalendarid($getCalendarId); $type = EnvUtil::getRequest("type"); $allDoptions = array("only", "after", "all"); $getDoption = EnvUtil::getRequest("doption"); $doption = in_array($getDoption, $allDoptions) ? $getDoption : "only"; $getStartTime = EnvUtil::getRequest("CalendarStartTime"); $sTime = empty($getStartTime) ? date("y-m-d h:i", time()) : $getStartTime; if ($type == 0) { $ret = $this->removeCalendar($calendarId); } else { if ($type == 1 || $type == 2) { $calendarId = abs($calendarId); $ret = $this->removeLoopCalendar($calendarId, $type, $doption, $sTime); } else { $ret["isSuccess"] = false; } } $this->ajaxReturn($ret); }
private function beforeSave() { if (!Yii::app()->request->getIsAjaxRequest()) { $this->error(IBos::lang("Parameters error", "error"), $this->createUrl("schedule/index")); } $subject = EnvUtil::getRequest("subject"); $starttime = EnvUtil::getRequest("starttime"); $endtime = EnvUtil::getRequest("endtimes"); $category = EnvUtil::getRequest("category"); $getSetday = EnvUtil::getRequest("setday"); $setday = empty($getSetday) ? date("Y-m-h") : $getSetday; $reply = EnvUtil::getRequest("reply"); $getRBegin = EnvUtil::getRequest("recurringbegin"); $rBegin = empty($getRBegin) ? time() : strtotime($getRBegin); $getREnd = EnvUtil::getRequest("recurringend"); $rEnd = empty($getREnd) ? 0 : strtotime($getREnd); $rType = EnvUtil::getRequest("recurringtype"); $data = array("uid" => $this->uid, "subject" => empty($subject) ? "无标题的活动" : $subject, "uptime" => time(), "starttime" => empty($starttime) ? time() : strtotime($setday . " " . $starttime), "endtime" => empty($endtime) ? strtotime($setday . " 23:59:59") : strtotime($setday . " " . $endtime), "category" => empty($category) ? "-1" : $category, "upuid" => $this->uid); if ($data["endtime"] < $data["starttime"]) { $bigtime = $data["starttime"]; $data["starttime"] = $data["endtime"]; $data["endtime"] = $bigtime; } if ($reply == "true") { $data["instancetype"] = "1"; $data["recurringbegin"] = $rBegin; $data["recurringend"] = $rEnd; if ($data["recurringend"] < $data["recurringbegin"] && $data["recurringend"] != 0) { $bigtime = $data["recurringbegin"]; $data["recurringbegin"] = $data["recurringend"]; $data["recurringend"] = $bigtime; } $data["recurringtype"] = $rType; switch ($data["recurringtype"]) { case "week": $getWeekbox = EnvUtil::getRequest("weekbox"); $weekbox = empty($getWeekbox) ? "1,2,3,4,5,6,7" : $getWeekbox; $data["recurringtime"] = $weekbox; break; case "month": $data["recurringtime"] = EnvUtil::getRequest("month"); break; case "year": $data["recurringtime"] = EnvUtil::getRequest("year"); break; } } return $data; }