public function renderIndex() { $data = array("todo" => $this->loadTodo(), "lang" => Ibos::getLangSource("workflow.default"), "assetUrl" => Ibos::app()->assetManager->getAssetsUrl("workflow")); $viewAlias = "application.modules.workflow.views.indexapi.workflow"; $return["workflow"] = Ibos::app()->getController()->renderPartial($viewAlias, $data, true); return $return; }
public function renderIndex() { $data = array("articles" => $this->loadNewArticle(), "lang" => Ibos::getLangSource("article.default"), "assetUrl" => Ibos::app()->assetManager->getAssetsUrl("article")); $viewAlias = "application.modules.article.views.indexapi.article"; $return["article"] = Ibos::app()->getController()->renderPartial($viewAlias, $data, true); return $return; }
protected function getSidebar() { $sidebarAlias = "application.modules.calendar.views.sidebar"; $params = array("hasSubUid" => UserUtil::hasSubUid(Ibos::app()->user->uid), "lang" => Ibos::getLangSource("calendar.default")); $sidebarView = $this->renderPartial($sidebarAlias, $params, true); return $sidebarView; }
public function renderIndex() { $data = array("schedules" => $this->loadNewSchedules(), "lant" => Ibos::getLangSource("calendar.default"), "assetUrl" => Yii::app()->assetManager->getAssetsUrl("calendar")); $viewAlias = "application.modules.calendar.views.indexapi.schedule"; $return["calendar"] = Yii::app()->getController()->renderPartial($viewAlias, $data, true); return $return; }
public function renderIndex() { $data = array("docs" => $this->loadNewDoc(), "lang" => Ibos::getLangSource("officialdoc.default"), "assetUrl" => Yii::app()->assetManager->getAssetsUrl("officialdoc")); $viewAlias = "application.modules.officialdoc.views.indexapi.officialdoc"; $return["officialdoc"] = Yii::app()->getController()->renderPartial($viewAlias, $data, true); return $return; }
public static function getIncentiveWord() { $words = Ibos::getLangSource("incentiveword"); $luckyOne = array_rand($words); $source = $words[$luckyOne]; return Ibos::lang("Custom title", "main.default") . $source[array_rand($source)]; }
protected function showDetail() { $repid = intval(EnvUtil::getRequest("repid")); $isShowTitle = EnvUtil::getRequest("isShowTitle"); $fromController = EnvUtil::getRequest("fromController"); $report = Report::model()->fetchByPk($repid); $uid = Ibos::app()->user->uid; Report::model()->addReaderuid($report, $uid); $record = ReportRecord::model()->fetchAllRecordByRep($report); $attachs = array(); if (!empty($report["attachmentid"])) { $attachs = AttachUtil::getAttach($report["attachmentid"], true, true, false, false, true); } $readers = array(); if (!empty($report["readeruid"])) { $readerArr = explode(",", $report["readeruid"]); $readers = User::model()->fetchAllByPk($readerArr); } $stampUrl = ""; if ($report["stamp"] != 0) { $stamp = Stamp::model()->fetchStampById($report["stamp"]); $stampUrl = FileUtil::fileName(Stamp::STAMP_PATH) . $stamp; } $report["addtime"] = ConvertUtil::formatDate($report["addtime"], "u"); $params = array("lang" => Ibos::getLangSource("report.default"), "repid" => $repid, "report" => $report, "uid" => $uid, "orgPlanList" => $record["orgPlanList"], "outSidePlanList" => $record["outSidePlanList"], "nextPlanList" => $record["nextPlanList"], "attachs" => $attachs, "readers" => $readers, "stampUrl" => $stampUrl, "fromController" => $fromController, "isShowTitle" => $isShowTitle, "allowComment" => $this->getIsAllowComment($fromController)); $detailAlias = "application.modules.report.views.detail"; $detailView = $this->renderPartial($detailAlias, $params, true); $this->ajaxReturn(array("data" => $detailView, "isSuccess" => true)); }
public function renderIndex() { $return = array(); $viewAlias = "application.modules.report.views.indexapi.report"; $uid = Ibos::app()->user->uid; $reports = Report::model()->fetchAllRepByUids($uid); if (!empty($reports)) { $reports = $this->handleIconUrl($reports); } $subUidArr = User::model()->fetchSubUidByUid($uid); $subUidStr = implode(",", $subUidArr); $subReports = Report::model()->fetchAll("FIND_IN_SET(`uid`, '{$subUidStr}') OR FIND_IN_SET({$uid}, `toid`)"); if (!empty($subReports)) { $subReports = $this->handleIconUrl($subReports, true); } $data = array("reports" => $reports, "subReports" => $subReports, "lang" => Ibos::getLangSource("report.default"), "assetUrl" => Yii::app()->assetManager->getAssetsUrl("report")); foreach ($this->_indexTab as $tab) { $data["tab"] = $tab; if ($tab == "reportPersonal") { $return[$tab] = Yii::app()->getController()->renderPartial($viewAlias, $data, true); } else { if ($tab == "reportAppraise" && (0 < count($subUidArr) || !empty($subReports))) { $return[$tab] = Yii::app()->getController()->renderPartial($viewAlias, $data, true); } } } return $return; }
public function getSidebar() { $sidebarAlias = "application.modules.recruit.views.resume.sidebar"; $params = array("lang" => Ibos::getLangSource("recruit.default"), "statModule" => Ibos::app()->setting->get("setting/statmodules")); $sidebarView = $this->renderPartial($sidebarAlias, $params, false); return $sidebarView; }
public function run() { $id = $this->getController()->getId(); $action = $this->getController()->getAction()->getId(); $data = array("inPersonal" => $id == "stats" && $action == "personal", "inReview" => $id == "stats" && $action == "review", "hasSub" => $this->getHasSub(), "lang" => Ibos::getLangSource("report.default")); $this->render(self::VIEW, $data); }
public function getSidebar() { $sidebarAlias = "application.modules.report.views.sidebar"; $uid = Ibos::app()->user->uid; $params = array("statModule" => Ibos::app()->setting->get("setting/statmodules"), "lang" => Ibos::getLangSource("report.default"), "reportTypes" => ReportType::model()->fetchAllTypeByUid($uid)); $sidebarView = $this->renderPartial($sidebarAlias, $params); return $sidebarView; }
public function getSidebar() { $uid = Ibos::app()->user->uid; $deptArr = UserUtil::getManagerDeptSubUserByUid($uid); $sidebarAlias = "application.modules.report.views.stats.sidebar"; $params = array("lang" => Ibos::getLangSource("report.default"), "deptArr" => $deptArr, "dashboardConfig" => $this->getReportConfig(), "statModule" => Ibos::app()->setting->get("setting/statmodules")); $sidebarView = $this->renderPartial($sidebarAlias, $params, false); return $sidebarView; }
public function actionApplist() { $detailAlias = "application.modules.app.views.default.applist"; $category = AppCategory::model()->fetchAllSort(); foreach ($category as $key => $value) { $category[$key]["count"] = App::model()->count("catid = {$value["catid"]}"); } $params = array("lang" => Ibos::getLangSource("app.default"), "assetUrl" => Ibos::app()->assetManager->getAssetsUrl("app"), "category" => $category, "appCount" => App::model()->count("appid")); $detailView = $this->renderPartial($detailAlias, $params, true); echo $detailView; }
public function renderIndex() { $data = array("lant" => Ibos::getLangSource("recruit.default"), "assetUrl" => Yii::app()->assetManager->getAssetUrl("recruit")); foreach ($this->_indexTab as $tab) { $data["recruits"] = $this->loadRecruit($tab); $data["tab"] = $tab; } $viewAlias = "application.modules.recruit.views.indexapi.recruit"; $return["recruit"] = Yii::app()->getController()->renderPartial($viewAlias, $data, true); return $return; }
public function renderIndex() { $return = array(); $viewAlias = "application.modules.email.views.indexapi.email"; $data["lang"] = Ibos::getLangSource("email.default"); $data["assetUrl"] = Ibos::app()->assetManager->getAssetsUrl("email"); foreach ($this->_indexTab as $tab) { $data["emails"] = $this->loadEmail($tab); $data["tab"] = $tab; $return[$tab] = Ibos::app()->getController()->renderPartial($viewAlias, $data, true); } return $return; }
public function renderIndex() { $return = array(); $viewAlias = "application.modules.assignment.views.indexapi.assignment"; $uid = Ibos::app()->user->uid; $chargeData = Assignment::model()->fetchUnfinishedByChargeuid($uid); $designeeData = Assignment::model()->fetchUnfinishedByDesigneeuid($uid); $data = array("chargeData" => AssignmentUtil::handleListData($chargeData), "designeeData" => AssignmentUtil::handleListData($designeeData), "lang" => Ibos::getLangSource("assignment.default"), "assetUrl" => Ibos::app()->assetManager->getAssetsUrl("assignment")); foreach ($this->_indexTab as $tab) { $data["tab"] = $tab; $data[$tab] = Ibos::app()->getController()->renderPartial($viewAlias, $data, true); } return $data; }
public function actionEdit() { if (!EnvUtil::submitCheck("updatesubmit")) { $assignmentId = intval(EnvUtil::getRequest("id")); $checkRes = $this->checkAvailableById($assignmentId); if (!$checkRes["isSuccess"]) { $this->ajaxReturn($checkRes); } $assignment = Assignment::model()->fetchByPk($assignmentId); $uid = Ibos::app()->user->uid; if ($uid != $assignment["designeeuid"]) { $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("You donot have permission to edit"))); } if (!empty($assignment["attachmentid"])) { $assignment["attachs"] = AttachUtil::getAttach($assignment["attachmentid"]); } $assignment["starttime"] = empty($assignment["starttime"]) ? "" : date("Y-m-d H:i", $assignment["starttime"]); $assignment["endtime"] = empty($assignment["endtime"]) ? "" : date("Y-m-d H:i", $assignment["endtime"]); $assignment["chargeuid"] = StringUtil::wrapId($assignment["chargeuid"]); $assignment["participantuid"] = StringUtil::wrapId($assignment["participantuid"]); $assignment["lang"] = Ibos::getLangSource("assignment.default"); $assignment["assetUrl"] = Ibos::app()->assetManager->getAssetsUrl("assignment"); $editAlias = "application.modules.assignment.views.default.edit"; $editView = $this->renderPartial($editAlias, $assignment, true); echo $editView; } else { $assignmentId = intval(EnvUtil::getRequest("id")); $assignment = Assignment::model()->fetchByPk($assignmentId); $this->beforeSave($_POST); $uid = Ibos::app()->user->uid; $data = $this->handlePostData(); $data["updatetime"] = TIMESTAMP; $updateSuccess = Assignment::model()->updateByPk($assignmentId, $data); if ($updateSuccess) { AttachUtil::updateAttach($data["attachmentid"]); if ($data["chargeuid"] != $assignment["chargeuid"]) { $chargeuid = StringUtil::getId($_POST["chargeuid"]); $participantuid = StringUtil::getId($_POST["participantuid"]); $uidArr = array_merge($participantuid, $chargeuid); $this->sendNotify($assignmentId, $data["subject"], $uidArr, "assignment_new_message"); } $this->addStepComment($assignmentId, Ibos::lang("Eidt the assignment")); AssignmentLog::model()->addLog($assignmentId, "edit", Ibos::lang("Eidt the assignment")); $this->ajaxReturn(array("isSuccess" => true, "msg" => Ibos::lang("Update succeed", "message"))); } else { $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Update failed", "message"))); } } }
public function getSidebar($getUid, $getUser) { $uid = Ibos::app()->user->uid; if (!empty($getUid)) { $subUids = $getUid; } elseif (!empty($getUser)) { $subUids = ConvertUtil::getSubByKey($getUser, "uid"); } else { $subUids = UserUtil::getAllSubs($uid, "", true); } $deptArr = UserUtil::getManagerDeptSubUserByUid($uid); $sidebarAlias = "application.modules.report.views.review.sidebar"; $params = array("statModule" => Ibos::app()->setting->get("setting/statmodules"), "lang" => Ibos::getLangSource("report.default"), "deptArr" => $deptArr, "dashboardConfig" => $this->getReportConfig(), "reportTypes" => ReportType::model()->fetchAllTypeByUid($subUids)); $sidebarView = $this->renderPartial($sidebarAlias, $params, false); return $sidebarView; }
public function actionIndex() { $formSubmit = EnvUtil::submitCheck("dateSetupSubmit"); if ($formSubmit) { $data = array("dateformat" => $_POST["dateFormat"], "timeformat" => $_POST["timeFormat"], "dateconvert" => $_POST["dateConvert"], "timeoffset" => $_POST["timeOffset"]); foreach ($data as $sKey => $sValue) { Setting::model()->updateSettingValueByKey($sKey, $sValue); } CacheUtil::update(array("setting")); $this->success(Ibos::lang("Save succeed", "message")); } else { $date = Setting::model()->fetchSettingValueByKeys("dateformat,dateconvert,timeformat,timeoffset"); $data = array("timeZone" => Ibos::getLangSource("dashboard.timeZone"), "date" => $date); $this->render("index", $data); } }
public function run() { $data = array("typeid" => EnvUtil::getRequest("typeid"), "lang" => Ibos::getLangSource("report.default"), "deptArr" => UserUtil::getManagerDeptSubUserByUid(Ibos::app()->user->uid), "dashboardConfig" => ReportUtil::getSetting(), "deptRoute" => $this->inStats() ? "stats/review" : "review/index", "userRoute" => $this->inStats() ? "stats/review" : "review/personal"); $this->render(self::VIEW, $data); }
public function printContact() { $datas = $this->getDataByDept(); $params = array("datas" => $datas, "lang" => Ibos::getLangSource("contact.default"), "uint" => Ibos::app()->setting->get("setting/unit"), "assetUrl" => Ibos::app()->assetManager->getAssetsUrl("contact")); $detailAlias = "application.modules.contact.views.default.print"; $detailView = $this->renderPartial($detailAlias, $params, true); $this->ajaxReturn(array("view" => $detailView, "isSuccess" => true)); }
public function run() { $data = array("lang" => Ibos::getLangSource("recruit.default")); $this->render(self::VIEW, $data); }
protected function makeUserSelect($runId, $index, $process, $name, $flowId, $processId) { $lang = Ibos::getLangSource("workflow.default"); $tablestr = ""; if ($index) { $display = "none;"; } else { $display = ""; } if ($process["childflow"] != 0) { $flow = FlowType::model()->fetchByPk($process["childflow"]); if ($flow) { $type = $flow["type"]; } if ($type == 2) { $process["prcs_id_next"] = ""; } $subfp = FlowProcess::model()->fetchProcess($process["childflow"], 1); if ($subfp) { $prcsuser = WfHandleUtil::getPrcsUser($process["childflow"], $processId); } else { $prcsuser = ""; } $prcsuser = sprintf("[%s]", !empty($prcsuser) ? StringUtil::iImplode($prcsuser) : ""); if (empty($subfp["uid"]) && empty($subfp["deptid"]) && empty($subfp["positionid"])) { $nopriv = $lang["Not set step permissions"]; } $tablestr = " <div style='display:{$display};' id='user_select_{$index}'>\r\n <div class=\"control-group first-group\">\r\n <label class=\"control-label\">{$lang["Host"]}</label>\r\n <div class=\"controls\">\r\n <strong>{$name} {$nopriv}</strong>\r\n <input type=\"hidden\" name=\"topflag{$index}\" value=\"0\">\r\n <input id=\"prcs_user_op{$index}\" name=\"prcs_user_op{$index}\" type=\"text\" />\r\n </div>\r\n </div>\r\n <div class=\"control-group\">\r\n <label class=\"control-label\">{$lang["Agent"]}</label>\r\n <div class=\"controls\">\r\n <input id=\"prcs_user{$index}\" name=\"prcs_user{$index}\" type=\"text\" />\r\n </div>\r\n </div>\r\n </div>\r\n <script>\r\n\t\t\t\t\$(function(){\r\n\t\t\t\t\tvar prcsData{$index} = {$prcsuser};\r\n\t\t\t\t\t\$('#prcs_user_op{$index}').userSelect({\r\n\t\t\t\t\t\tbox:\$('<div id=\"prcs_user_op_box{$index}\"></div>').appendTo(document.body),\r\n\t\t\t\t\t\tdata:Ibos.data.includes(prcsData{$index}),\r\n\t\t\t\t\t\ttype:'user',\r\n\t\t\t\t\t\tmaximumSelectionSize:'1'\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\$('#prcs_user{$index}').userSelect({\r\n\t\t\t\t\t\tbox:\$('<div id=\"prcs_user_box{$index}\"></div>').appendTo(document.body),\r\n\t\t\t\t\t\tdata:Ibos.data.includes(prcsData{$index}),\r\n\t\t\t\t\t\ttype:'user'\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t</script>"; } else { if (empty($process["uid"]) && empty($process["deptid"]) && empty($process["positionid"])) { $nopriv = $lang["Not set step permissions"]; } $prcsOpUser = $prcsUserAuto = ""; $deptArr = DepartmentUtil::loadDepartment(); if ($process["autotype"] == 1) { $uid = FlowRun::model()->fetchBeginUserByRunID($runId); $prcsuser = User::model()->fetchByUid($uid); if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $prcsuser["uid"]) || StringUtil::findIn($process["deptid"], $prcsuser["alldeptid"]) || StringUtil::findIn($process["positionid"], $prcsuser["allposid"])) { $prcsOpUser = $prcsuser["uid"]; $prcsUserAuto = $prcsuser["uid"] . ","; } } elseif (in_array($process["autotype"], array(2, 4, 5, 6))) { if ($process["autobaseuser"] != 0) { $baseUid = FlowRunProcess::model()->fetchBaseUid($runId, $process["autobaseuser"]); $baseuser = User::model()->fetchByUid($baseUid); $autodept = $baseuser["deptid"]; } else { $autodept = Ibos::app()->user->deptid; } if (0 < intval($autodept)) { if ($process["autotype"] == 2) { $tmpdept = $autodept; } else { if ($process["autotype"] == 4 || $process["autotype"] == 6) { $tmpdept = $deptArr[$autodept]["pid"] == 0 ? $autodept : $deptArr[$autodept]["pid"]; } elseif ($process["autotype"] == 5) { $deptStr = Department::model()->queryDept($autodept, true); $temp = explode(",", $deptStr); $count = count($temp); $dept = isset($temp[$count - 2]) ? $temp[$count - 2] : $autodept; if ($deptArr[$dept]["pid"] != 0) { $tmpdept = $deptArr[$dept]["deptid"]; } else { $tmpdept = $autodept; } } } $manager = $deptArr[$tmpdept]["manager"]; if ($process["autotype"] == 4 || $process["autotype"] == 6) { $leader = $deptArr[$autodept]["leader"]; $subleader = $deptArr[$autodept]["subleader"]; if ($leader != "0" && $process["autotype"] == 4) { $manager = $leader; } if ($subleader != "0" && $process["autotype"] == 6) { $manager = $subleader; } } if (!empty($manager)) { $muser = User::model()->fetchByUid($manager); if (!empty($muser)) { if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $muser["uid"]) || StringUtil::findIn($process["deptid"], $muser["alldeptid"]) || StringUtil::findIn($process["positionid"], $muser["allposid"])) { $prcsUserAuto = $muser["uid"] . ","; } if ($prcsUserAuto != "") { $prcsOpUser = strtok($prcsUserAuto, ","); } } } else { $userPerMax = ""; foreach (User::model()->fetchAllOtherManager($tmpdept) as $user) { $user = User::model()->fetchByUid($user["uid"]); $uid = $user["uid"]; $position = $user["allposid"]; if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $uid) || StringUtil::findIn($process["deptid"], $user["alldeptid"]) || StringUtil::findIn($process["positionid"], $position)) { if ($userPerMax == "") { $prcsOpUser = $uid; $prcsUserAuto .= $uid . ","; $userPerMax = $position; } elseif ($position == $userPerMax) { $prcsUserAuto .= $uid . ","; } } } } } } elseif ($process["autotype"] == 3) { $autouserop = User::model()->fetchByUid($process["autouserop"]); if (!empty($autouserop)) { if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $autouserop["uid"]) || StringUtil::findIn($process["deptid"], $autouserop["alldeptid"]) || StringUtil::findIn($process["positionid"], $autouserop["allposid"])) { $prcsOpUser = $autouserop["uid"]; } } if (!empty($process["autouser"])) { foreach (User::model()->fetchAllByUids(explode(",", trim($process["autouser"], ","))) as $user) { if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $user["uid"]) || StringUtil::findIn($process["deptid"], $user["alldeptid"]) || StringUtil::findIn($process["positionid"], $user["allposid"])) { $prcsUserAuto .= $user["uid"] . ","; } } } } elseif ($process["autotype"] == 7) { if (is_numeric($process["autouser"])) { $itemData = FlowDataN::model()->fetchItem($process["autouser"], $process["flowid"], $runId); $tmp = strtok($itemData, ","); $userarr = array(); while ($tmp) { $userarr[$tmp] = array(); $tmp = strtok(","); } $tempArray = explode(",", trim($itemData, ",")); foreach ($tempArray as $key => $value) { if (is_numeric($value)) { $value = User::model()->fetchRealnameByUid($value, ""); $tempArray[$key] = $value; } } foreach (User::model()->fetchAllByRealnames($tempArray) as $k => $v) { $dept = Department::model()->queryDept($v["alldeptid"]); if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $v["uid"]) || StringUtil::findIn($process["deptid"], $dept) || StringUtil::findIn($process["positionid"], $v["allposid"])) { $prcsUserAuto .= $v["uid"] . ","; } } if ($prcsUserAuto != "") { $prcsOpUser = strtok($prcsUserAuto, ","); } } } else { if ($process["autotype"] == 8 && is_numeric($process["autouser"])) { $uid = FlowRunProcess::model()->fetchBaseUid($runId, $process["autouser"]); if ($uid) { $temp = User::model()->fetchByUid($uid); if ($temp) { if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $temp["uid"]) || StringUtil::findIn($process["deptid"], $temp["alldeptid"]) || StringUtil::findIn($process["positionid"], $temp["allposid"])) { $prcsOpUser = $prcsUserAuto = $temp["uid"]; $prcsUserAuto .= ","; } } } } elseif ($process["autotype"] == 9) { $main = Ibos::app()->user->deptid; foreach (User::model()->fetchAllFitDeptUser($main) as $k => $v) { if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $v["uid"]) || StringUtil::findIn($process["deptid"], $v["alldeptid"]) || StringUtil::findIn($process["positionid"], $v["allposid"])) { $prcsUserAuto .= $v["uid"] . ","; } } if (!empty($prcsUserAuto)) { $prcsOpUser = strtok($prcsUserAuto, ","); } } elseif ($process["autotype"] == 10) { $main = Ibos::app()->user->deptid; $deptStr = Department::model()->queryDept($main, true); $temp = explode(",", $deptStr); $count = count($temp); $dept = isset($temp[$count - 2]) ? $temp[$count - 2] : $main; if ($deptArr[$dept]["pid"] != 0) { $tmpdept = $deptArr[$dept]["deptid"]; } else { $tmpdept = $main; } foreach (User::model()->fetchAllFitDeptUser($tmpdept) as $k => $v) { if ($process["deptid"] == "alldept" || StringUtil::findIn($process["uid"], $v["uid"]) || StringUtil::findIn($process["deptid"], $v["alldeptid"]) || StringUtil::findIn($process["positionid"], $v["allposid"])) { $prcsUserAuto .= $v["uid"] . ","; } } if (!empty($prcsUserAuto)) { $prcsOpUser = strtok($prcsUserAuto, ","); } } else { if ($process["uid"] != "" && $process["deptid"] == "" && $process["positionid"] == "") { $prcsUserArr = explode(",", $process["uid"]); $prcsUserCount = count($prcsUserArr) - 1; if ($prcsUserCount == 1) { $prcsUserAuto = $process["uid"]; $prcsOpUser = $prcsUserAuto; } } } } $prcsuser = WfHandleUtil::getPrcsUser($flowId, $process["processid"]); $prcsuser = sprintf("[%s]", !empty($prcsuser) ? StringUtil::iImplode($prcsuser) : ""); if ($process["userlock"] != 1) { $attr = 'islock="1"'; } else { $attr = ''; } if (!empty($prcsOpUser)) { $prcsOpUser = StringUtil::wrapId($prcsOpUser); } if (!empty($prcsUserAuto)) { $prcsUserAuto = StringUtil::wrapId(StringUtil::filterStr($prcsUserAuto)); } $tablestr = " <div class=\"control-group\" style=\"display:{$display};\" id='user_select_{$index}'>\r\n <div class=\"control-group first-group\">\r\n <label class=\"control-label\">{$lang["Host"]}</label>\r\n <div class=\"controls\">\r\n\t\t\t\t\t<input type=\"hidden\" name=\"topflag{$index}\" value=\"{$process["topdefault"]}\">\r\n\t\t\t\t\t<input id=\"prcs_user_op{$index}\" {$attr} name=\"prcs_user_op{$index}\" value=\"{$prcsOpUser}\" type=\"text\" />\r\n\t\t\t\t</div>\r\n </div>\r\n <div class=\"control-group\">\r\n <label class=\"control-label\">{$lang["Agent"]}</label>\r\n <div class=\"controls\">\r\n\t\t\t\t\t<input id=\"prcs_user{$index}\" {$attr} name=\"prcs_user{$index}\" value=\"{$prcsUserAuto}\" type=\"text\" />\r\n\t\t\t\t</div>\r\n </div>\r\n </div>\r\n <script>\r\n \$(function(){\r\n\t\t\t\tvar prcsData{$index} = {$prcsuser};\r\n var puo = \$('#prcs_user_op{$index}');\r\n var pu = \$('#prcs_user{$index}');\r\n\t\t\t\tvar topdef = '{$process["topdefault"]}';\r\n puo.userSelect({\r\n box:\$('<div id=\"prcs_user_op_box{$index}\"></div>').appendTo(document.body),\r\n data:Ibos.data.includes(prcsData{$index}),\r\n\t\t\t\t\ttype:'user',\r\n maximumSelectionSize:'1'\r\n });\r\n if(puo.attr('islock')==1 || topdef != 0){\r\n puo.userSelect('setReadOnly');\r\n } \r\n pu.userSelect({\r\n\t\t\t\t\tbox:\$('<div id=\"prcs_user_box{$index}\"></div>').appendTo(document.body),\r\n data:Ibos.data.includes(prcsData{$index}),\r\n\t\t\t\t\ttype:'user'\r\n });\r\n if(pu.attr('islock')==1){\r\n pu.userSelect('setReadOnly');\r\n }\r\n });\r\n </script>"; } return $tablestr; }
public static function getWeek() { $lang = Ibos::getLangSource("date"); $mapping = array($lang["Weekday"] . $lang["Chinese day"], $lang["Weekday"] . $lang["One"], $lang["Weekday"] . $lang["Two"], $lang["Weekday"] . $lang["Three"], $lang["Weekday"] . $lang["Four"], $lang["Weekday"] . $lang["Five"], $lang["Weekday"] . $lang["Six"]); return $mapping[date("w", TIMESTAMP)]; }
public function run() { $data = array("lang" => Ibos::getLangSource("report.default"), "id" => $this->getController()->getId()); $this->render(self::VIEW, $data); }
public function run() { $module = $this->getController()->getModule()->getId(); $data = array("type" => $this->getType(), "uid" => implode(",", $this->getUid()), "lang" => Ibos::getLangSource("report.default"), "reportTypes" => ReportType::model()->fetchSysType()); $this->render(self::VIEW, $data); }
protected function getItemConfig() { $lang = Ibos::getLangSource("workflow.item"); return array("calc" => $lang["Calculate control"], "text" => $lang["Single input box"], "auto" => $lang["Macro control"], "date" => $lang["Calendar control"], "checkbox" => $lang["Check box"], "user" => $lang["User control"], "textarea" => $lang["Multiline input box"], "select" => $lang["Dropdown menu"], "auto" => $lang["Macro control"], "fetch" => $lang["Data selection control"], "form-data" => $lang["Form data control"], "listview" => $lang["List control"], "qrcode" => $lang["Qr code control"], "sign" => $lang["Signature control"], "progressbar" => $lang["Progressbar control"], "imgupload" => $lang["Image upload control"], "fileupload" => $lang["Attach upload control"], "radio" => $lang["Radio buttons"], "label" => $lang["Label text"]); }
protected function remind($assignmentId) { if (EnvUtil::submitCheck("remindsubmit")) { if ($this->getIsInstallCalendar()) { $uid = Ibos::app()->user->uid; $remindTime = strtotime(EnvUtil::getRequest("remindTime")); $remindContent = EnvUtil::getRequest("remindContent"); $calendar = array("subject" => $remindContent, "starttime" => $remindTime, "endtime" => $remindTime + 1800, "uid" => $uid, "upuid" => $uid, "lock" => 1, "category" => 5); $oldCalendarids = AssignmentRemind::model()->fetchCalendarids($assignmentId, $uid); Calendars::model()->deleteAll(sprintf("uid = %d AND FIND_IN_SET(`calendarid`, '%s')", $uid, implode(",", $oldCalendarids))); $cid = Calendars::model()->add($calendar, true); AssignmentRemind::model()->deleteAll("assignmentid = {$assignmentId} AND uid = {$uid}"); AssignmentRemind::model()->add(array("assignmentid" => $assignmentId, "calendarid" => $cid, "remindtime" => $remindTime, "uid" => $uid, "content" => $remindContent)); $this->ajaxReturn(array("isSuccess" => true, "msg" => Ibos::lang("Operation succeed", "message"))); } else { $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Not installed calendar to support remind"))); } } else { $remind = AssignmentRemind::model()->fetch(sprintf("uid = %d AND assignmentid = %d", Ibos::app()->user->uid, $assignmentId)); $remindtime = empty($remind) ? TIMESTAMP : $remind["remindtime"]; $params = array("reminddate" => date("Y-m-d", $remindtime), "remindtime" => date("H:i", $remindtime), "content" => empty($remind) ? "" : $remind["content"], "lang" => Ibos::getLangSource("assignment.default")); $remindAlias = "application.modules.assignment.views.default.remind"; $editView = $this->renderPartial($remindAlias, $params, true); echo $editView; } }
public static function getTime($secs, $format = "dhis") { $day = floor($secs / 86400); $hour = floor($secs % 86400 / 3600); $min = floor($secs % 3600 / 60); $sec = floor($secs % 60); $lang = Ibos::getLangSource("date"); $timestr = ""; if (0 < $day && stristr($format, "d")) { $timestr .= $day . $lang["Day"]; } if (0 < $hour && stristr($format, "h")) { $timestr .= $hour . $lang["Hour"]; } if (0 < $min && stristr($format, "i")) { $timestr .= $min . $lang["Min"]; } if (0 < $sec && stristr($format, "s")) { $timestr .= $sec . $lang["Sec"]; } return $timestr; }
public function actionLog() { $formSubmit = EnvUtil::submitCheck("securitySubmit"); if ($formSubmit) { CacheUtil::update(array("setting")); $this->success(Ibos::lang("Save succeed", "message")); } else { $data = array(); $levels = array("admincp", "banned", "illegal", "login"); $level = EnvUtil::getRequest("level"); $filterAct = EnvUtil::getRequest("filteract"); $timeScope = EnvUtil::getRequest("timescope"); if (!in_array($level, $levels)) { $level = "admincp"; } $conArr = array("level" => $level); $condition = "level = '{$level}'"; if (!empty($filterAct)) { $condition .= sprintf(" AND category = 'module.dashboard.%s'", $filterAct); $conArr["filteract"] = $filterAct; } else { $condition .= " AND 1"; } if (!empty($timeScope)) { $start = EnvUtil::getRequest("start"); $end = EnvUtil::getRequest("end"); $tableId = intval($timeScope); $conArr["timescope"] = $tableId; if (!empty($start) && !empty($end)) { $conArr["start"] = $start; $conArr["end"] = $end; $start = strtotime($tableId . "-" . $start); $end = strtotime($tableId . "-" . $end); $condition .= sprintf(" AND `logtime` BETWEEN %d AND %d", $start, $end); } elseif (!empty($start)) { $conArr["start"] = $start; $start = strtotime($tableId . "-" . $start); $condition .= sprintf(" AND `logtime` > %d", $start); } elseif (!empty($end)) { $conArr["end"] = $end; $end = strtotime($tableId . "-" . $end); $condition .= sprintf(" AND `logtime` < %d", $end); } } else { $tableId = 0; $lastMonth = strtotime("last month"); $condition .= sprintf(" AND `logtime` BETWEEN %d AND %d", $lastMonth, TIMESTAMP); } $count = Log::countByTableId($tableId, $condition); $pages = PageUtil::create($count, 20); $log = Log::fetchAllByList($tableId, $condition, $pages->getLimit(), $pages->getOffset()); $data["log"] = $log; $data["pages"] = $pages; if ($level == "admincp") { $data["actions"] = Ibos::getLangSource("dashboard.actions"); } $data["filterAct"] = $filterAct; $data["level"] = $level; $data["archive"] = Log::getAllArchiveTableId(); $data["con"] = $conArr; $this->render("log", $data); } }