private function checkIsGuided() { if (Ibos::app()->request->isAjaxRequest) { $uid = Ibos::app()->user->uid; $isadministrator = $uid == 1 ? true : false; $user = User::model()->fetchByAttributes(array("uid" => $uid)); $newcomer = $user["newcomer"]; if (!$newcomer) { $this->ajaxReturn(array("isNewcommer" => false)); } else { if ($uid == 1) { $guideAlias = "application.modules.main.views.default.adminGuide"; $unit = unserialize(Setting::model()->fetchSettingValueByKey("unit")); $data["fullname"] = $unit["fullname"]; $data["shortname"] = $unit["shortname"]; $data["pageUrl"] = $this->getPageUrl(); } else { $data["swfConfig"] = AttachUtil::getUploadConfig($uid); $data["uid"] = $uid; $guideAlias = "application.modules.main.views.default.initGuide"; } $account = unserialize(Setting::model()->fetchSettingValueByKey("account")); $data["account"] = $account; if ($account["mixed"]) { $data["preg"] = "[0-9]+[A-Za-z]+|[A-Za-z]+[0-9]+"; } else { $data["preg"] = "^[A-Za-z0-9\\!\\@\\#\$\\%\\^\\&\\*\\.\\~]{" . $account["minlength"] . ",32}\$"; } $data["lang"] = Ibos::getLangSource("main.default"); $data["assetUrl"] = $this->getAssetUrl(); $guideView = $this->renderPartial($guideAlias, $data, true); $this->ajaxReturn(array("isNewcommer" => true, "guideView" => $guideView, "isadministrator" => $isadministrator)); } } }
public function actionIndex() { $uid = Ibos::app()->user->uid; $params = $this->getUnfinishedDataByUid($uid); $params["uploadConfig"] = AttachUtil::getUploadConfig(); $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("list", $params); }
public function getHeader($lang = array()) { $onlineStatus = UserUtil::getOnlineStatus($this->getUid()); $styleMap = array(-1 => "o-pm-offline", 1 => "o-pm-online"); $data = array("user" => $this->getUser(), "assetUrl" => $this->getAssetUrl("user"), "swfConfig" => AttachUtil::getUploadConfig(), "onlineIcon" => $styleMap[$onlineStatus], "lang" => $lang); if ($this->getIsWeiboEnabled()) { $data["userData"] = UserData::model()->getUserData($this->getUid()); !$this->getIsMe() && ($data["states"] = Follow::model()->getFollowState(Ibos::app()->user->uid, $this->getUid())); } return $this->renderPartial("application.modules.user.views.header", $data, true); }
public function actionIndex() { $data = array(); $data["userData"] = UserData::model()->getUserData($this->uid); $data["activeUser"] = UserData::model()->fetchActiveUsers(); $data["movements"] = Ibos::app()->setting->get("setting/wbmovement"); $data["enableMovementModule"] = WbCommonUtil::getMovementModules(); $data["uploadConfig"] = AttachUtil::getUploadConfig(); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Enterprise weibo")), array("name" => Ibos::lang("Index"), "url" => $this->createUrl("list/index")), array("name" => Ibos::lang("List")))); $var["type"] = isset($_GET["type"]) ? StringUtil::filterCleanHtml($_GET["type"]) : "all"; $var["feedtype"] = isset($_GET["feedtype"]) ? StringUtil::filterCleanHtml($_GET["feedtype"]) : "all"; $var["feedkey"] = isset($_GET["feedkey"]) ? StringUtil::filterCleanHtml(urldecode($_GET["feedkey"])) : ""; $var["loadNew"] = isset($_GET["page"]) ? 0 : 1; $var["loadMore"] = isset($_GET["page"]) ? 0 : 1; $var["loadId"] = 0; $var["nums"] = isset($_GET["page"]) ? WbConst::DEF_LIST_FEED_NUMS : 10; $this->render("index", array_merge($data, $var, $this->getData($var))); }
public function actionEdit() { $op = EnvUtil::getRequest("op"); $repid = intval(EnvUtil::getRequest("repid")); $uid = Ibos::app()->user->uid; if (empty($op) || !in_array($op, array("getEditData", "update"))) { $op = "getEditData"; } if ($op == "getEditData") { if (empty($repid)) { $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("default/index")); } $report = Report::model()->fetchByPk($repid); $reportType = ReportType::model()->fetchByPk($report["typeid"]); if (empty($report)) { $this->error(Ibos::lang("No data found", "error"), $this->createUrl("default/index")); } if ($report["uid"] != $uid) { $this->error(Ibos::lang("Request tainting", "error"), $this->createUrl("default/index")); } $upUid = UserUtil::getSupUid($uid); $record = ReportRecord::model()->fetchAllRecordByRep($report); $attachs = array(); if (!empty($report["attachmentid"])) { $attachs = AttachUtil::getAttach($report["attachmentid"]); } $params = array("report" => $report, "reportType" => $reportType, "upUid" => $upUid, "preAndNextRep" => Report::model()->fetchPreAndNextRep($report), "orgPlanList" => $record["orgPlanList"], "outSidePlanList" => $record["outSidePlanList"], "nextPlanList" => $record["nextPlanList"], "attachs" => $attachs, "uploadConfig" => AttachUtil::getUploadConfig(), "isInstallCalendar" => ModuleUtil::getIsEnabled("calendar")); if (!empty($params["nextPlanList"])) { $firstPlan = $params["nextPlanList"][0]; $params["nextPlanDate"] = array("planBegindate" => $firstPlan["begindate"], "planEnddate" => $firstPlan["enddate"]); } else { $params["nextPlanDate"] = array("planBegindate" => 0, "planEnddate" => 0); } $this->setPageTitle(Ibos::lang("Edit 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("Edit report")))); $this->render("edit", $params); } else { $this->{$op}(); } }
<!--[if lt IE 9]> <link rel="stylesheet" href="<?php echo STATICURL; ?> /css/iefix.css?<?php echo VERHASH; ?> " /> <![endif]--> <!-- load css end --> <!-- JS全局变量--> <script> <?php $gUploadConfig = AttachUtil::getUploadConfig(); $gAccount = UserUtil::getAccountSetting(); ?> var G = { VERHASH: '<?php echo VERHASH; ?> ', SITE_URL: '<?php echo Ibos::app()->setting->get("siteurl"); ?> ', STATIC_URL: '<?php echo STATICURL; ?> ',
public function actionForm() { $key = EnvUtil::getRequest("key"); if ($key) { $this->key = $key; $param = WfCommonUtil::param($key, "DECODE"); $this->_extraAttributes = $param; $this->runid = $param["runid"]; $this->flowid = $param["flowid"]; $this->processid = $param["processid"]; $this->flowprocess = $param["flowprocess"]; } else { $this->ajaxReturn("<script>alert('工作流数据错误,可能已转交或被回退')</script>", "EVAL"); } $flow = new ICFlowType(intval($this->flowid)); if ($_SERVER["REQUEST_METHOD"] == "POST") { $data = array(); $readOnly = $_POST["readonly"]; $hidden = $_POST["hidden"]; $saveflag = $_POST["saveflag"]; $fbAttachmentID = $_POST["fbattachmentid"]; $attachmentID = $_POST["attachmentid"]; $content = isset($_POST["content"]) ? StringUtil::filterCleanHtml($_POST["content"]) : ""; $topflag = $_POST["topflag"]; $this->checkRunAccess($this->runid, $this->processid, $this->createUrl("list/index")); if (FlowRunProcess::model()->getIsOp($this->uid, $this->runid, $this->processid)) { $enablefiledArr = explode(",", $_POST["enablefiled"]); $formData = array(); $structure = $flow->form->parser->structure; foreach ($structure as $index => $item) { if (!in_array("data_" . $item["itemid"], $enablefiledArr)) { continue; } $value = isset($_POST[$index]) ? $_POST[$index] : ""; $formData[$index] = $value; } $formData && $this->handleImgComponent($formData); $formData && FlowDataN::model()->update($this->flowid, $this->runid, $formData); } if (!empty($content) || !empty($fbAttachmentID)) { $fbData = array("runid" => $this->runid, "processid" => $this->processid, "flowprocess" => $this->flowprocess, "uid" => $this->uid, "content" => $content, "attachmentid" => $fbAttachmentID, "edittime" => TIMESTAMP); FlowRunfeedback::model()->add($fbData); AttachUtil::updateAttach($fbAttachmentID, $this->runid); } FlowRun::model()->modify($this->runid, array("attachmentid" => $attachmentID)); AttachUtil::updateAttach($attachmentID, $this->runid); $plugin = FlowProcess::model()->fetchSavePlugin($this->flowid, $this->flowprocess); if (!empty($plugin)) { $pluginFile = "./system/modules/workflow/plugins/save/" . $plugin; if (file_exists($pluginFile)) { include_once $pluginFile; } } switch ($saveflag) { case "save": MainUtil::setCookie("save_flag", 1, 300); $this->ajaxReturn("<script>alert('保存成功')</script>", "EVAL"); break; case "turn": MainUtil::setCookie("turn_flag", 1, 300); break; case "end": case "finish": if ($saveflag == "end") { $param = array("opflag" => 1); } else { $param = array("topflag" => $topflag); } $this->redirect($this->createUrl("handle/complete", array_merge($param, array("key" => $this->key)))); break; default: break; } } else { $this->checkRunDel(); $this->checkIllegal(); $len = strlen($flow->autonum); for ($i = 0; $i < $flow->autolen - $len; $i++) { $flow->autonum = "0" . $flow->autonum; } $runProcess = new ICFlowRunProcess($this->runid, $this->processid, $this->flowprocess, $this->uid); $checkitem = ""; if ($flow->isFixed()) { $process = new ICFlowProcess($this->flowid, $this->flowprocess); if ($runProcess->opflag != 0) { $checkitem = $process->checkitem; } if (0 < $process->allowback) { $isAllowBack = true; } } else { $process = array(); } $run = new ICFlowRun($this->runid); $hasOtherOPUser = FlowRunProcess::model()->getHasOtherOPUser($this->runid, $this->processid, $this->flowprocess, $this->uid); if ($runProcess->flag == self::UN_RECEIVE) { $this->setSelfToHandle($runProcess->id); } if ($runProcess->topflag == 1 && $runProcess->opflag == 1) { FlowRunProcess::model()->updateTop($this->uid, $this->runid, $this->processid, $this->flowprocess); } if ($runProcess->topflag == 2) { if (!$hasOtherOPUser) { $runProcess->opflag = 1; } } if ($this->processid == 1) { FlowRun::model()->modify($this->runid, array("beginuser" => $this->uid, "begintime" => TIMESTAMP)); if (!empty($run->parentrun)) { $this->setParentToHandle($run->parentrun, $this->runid); } } $preProcess = $this->processid - 1; if ($preProcess) { if ($flow->isFree() || $flow->isFixed() && $process->gathernode != self::FORCE) { $this->setProcessDone($preProcess); } } if ($flow->isFixed() && $process->timeout != 0) { if ($runProcess->flag == self::UN_RECEIVE && $this->processid !== 1) { $processBegin = FlowRunProcess::model()->fetchDeliverTime($this->runid, $preProcess); } else { $processBegin = $runProcess->processtime ? $runProcess->processtime : TIMESTAMP; } $timeUsed = TIMESTAMP - $processBegin; } $viewer = new ICFlowFormViewer(array("flow" => $flow, "form" => $flow->getForm(), "run" => $run, "process" => $process, "rp" => $runProcess)); $data = array_merge(array("flow" => $flow->toArray(), "run" => $run->toArray(), "process" => !empty($process) ? $process->toArray() : $process, "checkItem" => $checkitem, "prcscache" => WfCommonUtil::loadProcessCache($this->flowid), "rp" => $runProcess->toArray(), "rpcache" => WfPreviewUtil::getViewFlowData($this->runid, $this->flowid, $this->uid, $remindUid), "fbSigned" => $this->isFeedBackSigned(), "allowBack" => isset($isAllowBack) ? $isAllowBack : false, "timeUsed" => isset($timeUsed) ? $timeUsed : 0, "uploadConfig" => AttachUtil::getUploadConfig()), $viewer->render(true, false, true)); $formdata = array("run" => $data["run"], "flow" => $data["flow"], "enableArr" => "", "valueArr" => "", "emptyArr" => ""); $data["enablefiled"] = array(); if (is_array($data["model"]["itemData"])) { if (isset($data["prcscache"][$data["rp"]["flowprocess"]]["processitem"])) { $enableFiled = explode(",", $data["prcscache"][$data["rp"]["flowprocess"]]["processitem"]); } else { $enableFiled = array(); } foreach ($data["model"]["itemData"] as $k => $v) { if (substr($k, 0, 5) != "data_") { continue; } $data["model"]["structure"][$k]["value"] = $v; if (in_array($data["model"]["structure"][$k]["data-title"], $enableFiled)) { $data["enablefiled"][] = $k; $data["model"]["structure"][$k]["value"] = $data["model"]["eleout"][$k]; $formdata["enableArr"][] = $data["model"]["structure"][$k]; continue; } if ($v != "") { $formdata["valueArr"][] = $data["model"]["structure"][$k]; continue; } $formdata["emptyArr"][] = $data["model"]["structure"][$k]; } } $data["model"] = $this->renderPartial("application.modules.mobile.views.work.form", $formdata, true); $data["model"] .= "<input type=\"hidden\" name=\"key\" value=\"" . $this->key . "\">"; $data["model"] .= "<input type=\"hidden\" name=\"hidden\" value=\"" . $data["hidden"] . "\">"; $data["model"] .= "<input type=\"hidden\" name=\"readonly\" value=\"" . $data["readonly"] . "\">"; $data["model"] .= "<input type=\"hidden\" name=\"attachmentid\" id=\"attachmentid\" value=\"" . $data["run"]["attachmentid"] . "\">"; $data["model"] .= "<input type=\"hidden\" name=\"fbattachmentid\" id=\"fbattachmentid\" value=\"\">"; $data["model"] .= "<input type=\"hidden\" name=\"topflag\" value=\"" . $data["rp"]["opflag"] . "\">"; $data["model"] .= "<input type=\"hidden\" name=\"saveflag\">"; $data["model"] .= "<input type=\"hidden\" name=\"formhash\" value=\"" . FORMHASH . "\">"; $data["model"] .= "<input type=\"hidden\" name=\"enablefiled\" value=\"" . implode(",", $data["enablefiled"]) . "\">"; if ($this->isEnabledAttachment($flow, $run, $process, $runProcess)) { $data["allowAttach"] = true; if (!empty($run->attachmentid)) { $attachPurv = $this->getAttachPriv($flow, $process, $runProcess); $down = $attachPurv["down"]; $edit = $attachPurv["edit"]; $del = $attachPurv["del"]; $data["attachData"] = AttachUtil::getAttach($run->attachmentid, $down, $down, $edit, $del); } } else { $data["allowAttach"] = false; } if ($flow->isFixed() && $process->feedback != 1) { $data["allowFeedback"] = true; $data["feedback"] = WfHandleUtil::loadFeedback($flow->getID(), $run->getID(), $flow->type, $this->uid); } else { $data["allowFeedback"] = false; } if ($flow->isFree() && $runProcess->opflag == "1") { $hasDefault = FlowRunProcess::model()->getHasDefaultStep($this->runid, $this->processid); if (!$hasDefault) { $data["defaultEnd"] = true; } } if ($flow->isFree() && $runProcess->topflag == "2") { if (!$hasOtherOPUser) { $data["otherEnd"] = true; } } $this->ajaxReturn($data, "JSONP"); } }
private function analysis() { $importType = intval(EnvUtil::getRequest("importType")); if ($importType == 1) { $file = $_FILES["importFile"]; if (0 < $file["error"]) { $this->error("上传失败,失败类型:" . $file["error"], $this->createUrl("resume/index")); } if (!preg_match("/.(txt)\$/i", $file["name"], $match)) { $this->error("不支持的文件类型", $this->createUrl("resume/index")); } if ($match[1] == "txt") { header("Content-Type:text/html;charset=utf-8"); $importContent = file_get_contents($file["tmp_name"]); } } elseif ($importType == 2) { $importContent = EnvUtil::getRequest("importContent"); } $code = strtolower(mb_detect_encoding($importContent, array("ASCII", "UTF-8", "GB2312", "GBK", "BIG5"))); if (($code == "gb2312" || $code == "GBK" || $code == "euc-cn") && $code != CHARSET) { $importContent = iconv($code, CHARSET, $importContent); } $config = AnalysisConfig::getAnalconf(); $analysis = new ResumeAnalysis($importContent, $config); $result = $analysis->parse_content(); $result["gender"] = preg_match("/女/", $result["gender"]) ? 2 : 1; $result["maritalstatus"] = preg_match("/是|已/", $result["maritalstatus"]) ? 1 : 0; $result["workyears"] = $result["workyears"] ? intval($result["workyears"]) + 0 : ""; $result["mobile"] = $result["mobile"] ? $result["mobile"] + 0 : ""; $result["height"] = $result["height"] ? $result["height"] + 0 : ""; $result["weight"] = $result["weight"] ? $result["weight"] + 0 : ""; $result["zipcode"] = $result["zipcode"] ? $result["zipcode"] + 0 : ""; $result["qq"] = $result["qq"] ? intval($result["qq"]) + 0 : ""; if ($result["birthday"]) { $result["birthday"] = date("Y-m-d", strtotime($result["birthday"])); } elseif (!empty($result["age"])) { $result["birthday"] = date("Y") - ($result["age"] + 0) . "-00-00"; } $regulars = Regular::model()->fetchAll(); $params = array("importInfo" => CJSON::encode($result), "sidebar" => $this->getSidebar(), "dashboardConfig" => $this->getDashboardConfig(), "uploadConfig" => AttachUtil::getUploadConfig(), "regulars" => CJSON::encode($regulars)); $params["dashboardConfigToJson"] = CJSON::encode($params["dashboardConfig"]); $this->setPageTitle(Ibos::lang("Add resume")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Recruitment management"), "url" => $this->createUrl("resume/index")), array("name" => Ibos::lang("Talent management"), "url" => $this->createUrl("resume/index")), array("name" => Ibos::lang("Add resume")))); $this->render("add", $params); }
public function actionIndex() { $flow = new ICFlowType(intval($this->flowid)); if (EnvUtil::submitCheck("formhash")) { $data = array(); $readOnly = $_POST["readonly"]; $hidden = $_POST["hidden"]; $saveflag = $_POST["saveflag"]; $fbAttachmentId = $_POST["fbattachmentid"]; $attachmentId = $_POST["attachmentid"]; $content = isset($_POST["content"]) ? StringUtil::filterCleanHtml($_POST["content"]) : ""; $topflag = $_POST["topflag"]; $this->checkRunAccess($this->runid, $this->processid, $this->createUrl("list/index")); if (FlowRunProcess::model()->getIsOp($this->uid, $this->runid, $this->processid)) { $formData = array(); $structure = $flow->form->parser->structure; foreach ($structure as $index => $item) { if (StringUtil::findIn($hidden, $item["itemid"]) || StringUtil::findIn($readOnly, $item["itemid"])) { continue; } $value = isset($_POST[$index]) ? $_POST[$index] : ""; $formData[$index] = $value; } $formData && $this->handleImgComponent($formData); $formData && FlowDataN::model()->update($this->flowid, $this->runid, $formData); } if (!empty($content) || !empty($fbAttachmentId)) { $fbData = array("runid" => $this->runid, "processid" => $this->processid, "flowprocess" => $this->flowprocess, "uid" => $this->uid, "content" => $content, "attachmentid" => $fbAttachmentId, "edittime" => TIMESTAMP); FlowRunfeedback::model()->add($fbData); AttachUtil::updateAttach($fbAttachmentId, $this->runid); } FlowRun::model()->modify($this->runid, array("attachmentid" => $attachmentId)); AttachUtil::updateAttach($attachmentId, $this->runid); $plugin = FlowProcess::model()->fetchSavePlugin($this->flowid, $this->flowprocess); if (!empty($plugin)) { $pluginFile = "./system/modules/workflow/plugins/save/" . $plugin; if (file_exists($pluginFile)) { include_once $pluginFile; } } switch ($saveflag) { case "save": MainUtil::setCookie("save_flag", 1); $this->redirect($this->createUrl("form/index", array("key" => $this->key))); break; case "turn": MainUtil::setCookie("turn_flag", 1); $this->redirect($this->createUrl("form/index", array("key" => $this->key))); break; case "end": case "finish": if ($saveflag == "end") { $param = array("opflag" => 1); } else { $param = array("topflag" => $topflag); } $this->redirect($this->createUrl("handle/complete", array_merge($param, array("key" => $this->key)))); break; default: break; } } else { $this->checkRunDel(); $this->checkIllegal(); $len = strlen($flow->autonum); for ($i = 0; $i < $flow->autolen - $len; $i++) { $flow->autonum = "0" . $flow->autonum; } $runProcess = new ICFlowRunProcess($this->runid, $this->processid, $this->flowprocess, $this->uid); $checkitem = ""; if ($flow->isFixed()) { $process = new ICFlowProcess($this->flowid, $this->flowprocess); if ($runProcess->opflag != 0) { $checkitem = $process->checkitem; } if (0 < $process->allowback) { $isAllowBack = $this->isAllowBack($runProcess->parent); } } else { $process = array(); } $run = new ICFlowRun($this->runid); $hasOtherOPUser = FlowRunProcess::model()->getHasOtherOPUser($this->runid, $this->processid, $this->flowprocess, $this->uid); if ($runProcess->flag == FlowConst::PRCS_UN_RECEIVE) { $this->setSelfToHandle($runProcess->id); } if ($runProcess->topflag == 1 && $runProcess->opflag == 1) { FlowRunProcess::model()->updateTop($this->uid, $this->runid, $this->processid, $this->flowprocess); } if ($runProcess->topflag == 2) { if (!$hasOtherOPUser) { $runProcess->opflag = 1; } } if ($this->processid == 1) { FlowRun::model()->modify($this->runid, array("beginuser" => $this->uid, "begintime" => TIMESTAMP)); if (!empty($run->parentrun)) { $this->setParentToHandle($run->parentrun, $this->runid); } } $preProcess = $this->processid - 1; if ($preProcess) { if ($flow->isFree() || $flow->isFixed() && $process->gathernode != 1) { $this->setProcessDone($preProcess); } } if ($flow->isFixed() && $process->timeout != 0) { if ($runProcess->flag == FlowConst::PRCS_UN_RECEIVE && $this->processid != 1) { $processBegin = FlowRunProcess::model()->fetchDeliverTime($this->runid, $preProcess); } else { $processBegin = $runProcess->processtime ? $runProcess->processtime : TIMESTAMP; } $timeUsed = TIMESTAMP - $processBegin; } $viewer = new ICFlowFormViewer(array("flow" => $flow, "form" => $flow->getForm(), "run" => $run, "process" => $process, "rp" => $runProcess)); $data = array_merge(array("flow" => $flow->toArray(), "run" => $run->toArray(), "processid" => $this->processid, "process" => !empty($process) ? $process->toArray() : $process, "checkItem" => $checkitem, "prcscache" => WfCommonUtil::loadProcessCache($this->flowid), "rp" => $runProcess->toArray(), "fbSigned" => $this->isFeedBackSigned(), "allowBack" => isset($isAllowBack) ? $isAllowBack : false, "timeUsed" => isset($timeUsed) ? $timeUsed : 0, "uploadConfig" => AttachUtil::getUploadConfig()), $viewer->render()); if ($this->isEnabledAttachment($flow, $run, $process, $runProcess)) { $data["allowAttach"] = true; if (!empty($run->attachmentid)) { $attachPurv = $this->getAttachPriv($flow, $process, $runProcess); $down = $attachPurv["down"]; $edit = $attachPurv["edit"]; $del = $attachPurv["del"]; $data["attachData"] = AttachUtil::getAttach($run->attachmentid, $down, $down, $edit, $del); } } else { $data["allowAttach"] = false; } if ($flow->isFixed() && $process->feedback != 1 || $flow->isFree()) { $data["allowFeedback"] = true; } else { $data["allowFeedback"] = false; } if ($data["allowBack"]) { $data["backlist"] = $this->getBackList($runProcess->flowprocess); } $data["feedback"] = WfHandleUtil::loadFeedback($flow->getID(), $run->getID(), $flow->type, $this->uid); if ($flow->isFree() && $runProcess->opflag == "1") { $hasDefault = FlowRunProcess::model()->getHasDefaultStep($this->runid, $this->processid); if (!$hasDefault) { $data["defaultEnd"] = true; } } if ($flow->isFree() && $runProcess->topflag == "2") { if (!$hasOtherOPUser) { $data["otherEnd"] = true; } } $this->setPageTitle(Ibos::lang("Handle work")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang("My work"), "url" => $this->createUrl("list/index")), array("name" => Ibos::lang("Handle work")))); $this->render("index", $data); } }
public function actionEdit() { $op = EnvUtil::getRequest("op"); $option = empty($op) ? "default" : $op; $routes = array("default", "update", "verify", "move", "top", "highLight", "clickVote", "back"); if (!in_array($option, $routes)) { $this->error(Ibos::lang("Can not find the path")); } if ($option == "default") { $articleId = EnvUtil::getRequest("articleid"); if (empty($articleId)) { $this->error(Ibos::lang("Parameters error", "error")); } $data = Article::model()->fetchByPk($articleId); if (empty($data)) { $this->error(Ibos::lang("No permission or article not exists")); } $data["publishScope"] = ArticleUtil::joinSelectBoxValue($data["deptid"], $data["positionid"], $data["uid"]); $allowPublish = ArticleCategory::model()->checkIsAllowPublish($data["catid"], Ibos::app()->user->uid); $params = array("data" => $data, "categoryOption" => $this->getCategoryOption(), "uploadConfig" => AttachUtil::getUploadConfig(), "dashboardConfig" => $this->getDashboardConfig(), "allowPublish" => $allowPublish); if (!empty($data["attachmentid"])) { $params["attach"] = AttachUtil::getAttach($data["attachmentid"]); } if ($data["type"] == parent::ARTICLE_TYPE_PICTURE) { $params["pictureData"] = ArticlePicture::model()->fetchPictureByArticleId($articleId); $params["picids"] = ""; foreach ($params["pictureData"] as $k => $value) { $params["pictureData"][$k]["filepath"] = FileUtil::fileName($value["filepath"]); $params["picids"] .= $value["aid"] . ","; } $params["picids"] = substr($params["picids"], 0, -1); } $this->setPageTitle(Ibos::lang("Edit Article")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Information center")), array("name" => Ibos::lang("Article"), "url" => $this->createUrl("default/index")), array("name" => Ibos::lang("Edit Article")))); $this->render("edit", $params); } else { $this->{$option}(); } }
public function actionEdit() { $op = EnvUtil::getRequest("op"); $option = empty($op) ? "default" : $op; $routes = array("default", "update", "setShare"); if (!in_array($option, $routes)) { $this->error(Ibos::lang("Can not find the path"), $this->createUrl("default/index")); } if ($option == "default") { $diaryid = intval(EnvUtil::getRequest("diaryid")); if (empty($diaryid)) { $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("default/index")); } $diary = Diary::model()->fetchByPk($diaryid); if (empty($diary)) { $this->error(Ibos::lang("No data found", "error"), $this->createUrl("default/index")); } if (!ICDiary::checkReadScope(Ibos::app()->user->uid, $diary)) { $this->error(Ibos::lang("You do not have permission to edit the log"), $this->createUrl("default/index")); } $dashboardConfig = Ibos::app()->setting->get("setting/diaryconfig"); if (!empty($dashboardConfig["lockday"])) { $isLock = $dashboardConfig["lockday"] * 24 * 60 * 60 < time() - $diary["addtime"]; if ($isLock) { $this->error(Ibos::lang("The diary is locked"), $this->createUrl("default/index")); } } $data = Diary::model()->fetchDiaryRecord($diary); $isInstallCalendar = ModuleUtil::getIsEnabled("calendar"); $workTime = $this->getWorkTime($isInstallCalendar); $params = array("diary" => ICDiary::processDefaultShowData($diary, $data), "prevAndNextPK" => Diary::model()->fetchPrevAndNextPKByPK($diaryid), "data" => $data, "dashboardConfig" => $dashboardConfig, "uploadConfig" => AttachUtil::getUploadConfig(), "isInstallCalendar" => $isInstallCalendar, "workTime" => $workTime); if (!empty($diary["attachmentid"])) { $params["attach"] = AttachUtil::getAttach($diary["attachmentid"]); } if ($dashboardConfig["sharepersonnel"]) { $shareData = DiaryShare::model()->fetchShareInfoByUid(Ibos::app()->user->uid); $params["defaultShareList"] = $shareData["shareInfo"]; } $this->setPageTitle(Ibos::lang("Edit 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("Edit Diary")))); $this->render("edit", $params); } else { $this->{$option}(); } }
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 static function getView($view) { $currentController = Yii::app()->getController(); $basePath = "application.modules.vote.views.default."; $relatedModule = Ibos::getCurrentModuleName(); $relatedId = EnvUtil::getRequest($relatedModule . "id"); if ($view == "articleView") { $voteData = Vote::model()->fetchVote($relatedModule, $relatedId); $votes = VoteUtil::processVoteData($voteData); if (!empty($votes)) { $voteItemList = $votes["voteItemList"]; $voteType = $voteItemList[0]["type"]; if ($voteType == 1) { $view = "articleTextView"; } elseif ($voteType == 2) { $view = "articleImageView"; } $selectView = $basePath . $view; $votePeopleNumber = Vote::model()->fetchUserVoteCount($relatedModule, $relatedId); $userHasVote = VoteUtil::checkVote($relatedModule, $relatedId); $mothedName = "get" . ucfirst($relatedModule) . "Vote"; $voteStatus = ICVotePlugManager::$mothedName()->getStatus($relatedModule, $relatedId, $votes["vote"]); $votes["vote"]["subject"] = StringUtil::cutStr($votes["vote"]["subject"], 60); $data = array("voteData" => $votes, "votePeopleNumber" => $votePeopleNumber, "userHasVote" => $userHasVote, "voteStatus" => $voteStatus, "attachUrl" => Yii::app()->setting->get("setting/attachurl")); if ($voteStatus == 2) { $partView = null; } else { $partView = $currentController->renderPartial($selectView, $data, true); } } else { $partView = null; } } elseif ($view == "articleAdd") { $selectView = $basePath . $view; $partView = $currentController->renderPartial($selectView, array("uploadConfig" => AttachUtil::getUploadConfig()), true); } elseif ($view == "articleEdit") { $selectView = $basePath . $view; $voteData = Vote::model()->fetchVote($relatedModule, $relatedId); if (!empty($voteData) && isset($voteData["voteItemList"])) { foreach ($voteData["voteItemList"] as $k => $voteItem) { $voteData["voteItemList"][$k]["thumburl"] = FileUtil::fileName($voteItem["picpath"]); } } $data = array("voteData" => $voteData, "uploadConfig" => AttachUtil::getUploadConfig()); $partView = $currentController->renderPartial($selectView, $data, true); } return $partView; }
protected function getAvatar() { return array("user" => $this->getUser(), "swfConfig" => AttachUtil::getUploadConfig($this->getUid())); }
public function actionEdit() { $op = EnvUtil::getRequest("op"); $option = empty($op) ? "default" : $op; $routes = array("default", "update", "top", "highLight", "move", "verify", "back"); if (!in_array($option, $routes)) { $this->error(Ibos::lang("Can not find the path"), $this->createUrl("officialdoc/index")); } if ($option == "default") { $docid = EnvUtil::getRequest("docid"); if (empty($docid)) { $this->error(Ibos::lang("Parameters error", "error")); } $data = Officialdoc::model()->fetch("docid=:docid", array(":docid" => $docid)); if (!empty($data)) { $data["publishScope"] = OfficialdocUtil::joinSelectBoxValue($data["deptid"], $data["positionid"], $data["uid"]); $data["ccScope"] = OfficialdocUtil::joinSelectBoxValue($data["ccdeptid"], $data["ccpositionid"], $data["ccuid"]); $allowPublish = OfficialdocCategory::model()->checkIsAllowPublish($data["catid"], Ibos::app()->user->uid); $params = array("data" => $data, "categoryOption" => $this->getCategoryOption(), "dashboard" => Ibos::app()->setting->get("setting/docconfig"), "uploadConfig" => AttachUtil::getUploadConfig(), "RCData" => RcType::model()->fetchAll(), "allowPublish" => $allowPublish); if (!empty($data["attachmentid"])) { $params["attach"] = AttachUtil::getAttach($data["attachmentid"]); } $this->setPageTitle(Ibos::lang("Edit officialdoc")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Information center")), array("name" => Ibos::lang("Officialdoc"), "url" => $this->createUrl("officialdoc/index")), array("name" => Ibos::lang("Edit officialdoc")))); $this->render("edit", $params); } } else { $this->{$option}(); } }