public function actionAdd() { $op = EnvUtil::getRequest("op"); if (!in_array($op, array("new", "save"))) { $op = "new"; } if ($op == "new") { $typeid = intval(EnvUtil::getRequest("typeid")); if (!$typeid) { $typeid = 1; } $uid = Ibos::app()->user->uid; $upUid = UserUtil::getSupUid($uid); $reportType = ReportType::model()->fetchByPk($typeid); $summaryAndPlanDate = ReportUtil::getDateByIntervalType($reportType["intervaltype"], $reportType["intervals"]); $subject = ICReport::handleShowSubject($reportType, strtotime($summaryAndPlanDate["summaryBegin"]), strtotime($summaryAndPlanDate["summaryEnd"])); $lastRep = Report::model()->fetchLastRepByUidAndTypeid($uid, $typeid); $orgPlanList = array(); if (!empty($lastRep)) { $orgPlanList = ReportRecord::model()->fetchRecordByRepidAndPlanflag($lastRep["repid"], 2); } $params = array("typeid" => $typeid, "summaryAndPlanDate" => $summaryAndPlanDate, "intervals" => $reportType["intervals"], "intervaltype" => $reportType["intervaltype"], "subject" => $subject, "upUid" => StringUtil::wrapId($upUid), "uploadConfig" => AttachUtil::getUploadConfig(), "orgPlanList" => $orgPlanList, "isInstallCalendar" => ModuleUtil::getIsEnabled("calendar")); $this->setPageTitle(Ibos::lang("Add 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("Add report")))); $this->render("add", $params); } else { $this->{$op}(); } }
public function actionEdit() { $id = intval(EnvUtil::getRequest("id")); if ($id) { if (EnvUtil::submitCheck("formhash")) { $this->beforeSave(); unset($_POST["id"]); $data = FlowPermission::model()->create(); $status = FlowPermission::model()->modify($id, $data); $this->ajaxReturn(array("isSuccess" => !!$status)); } else { $per = FlowPermission::model()->fetchByPk($id); if (!empty($per)) { if ($per["deptid"] == "alldept") { $users = "c_0"; } else { $users = StringUtil::wrapId($per["uid"], "u") . "," . StringUtil::wrapId($per["deptid"], "d") . "," . StringUtil::wrapId($per["positionid"], "p"); } $isCustom = !in_array($per["scope"], array("selforg", "alldept", "selfdeptall", "selfdept")); $data = array("per" => $per, "lang" => Ibos::getLangSources(), "custom" => $isCustom, "users" => StringUtil::filterStr($users)); $this->renderPartial("edit", $data); } else { $this->ajaxReturn(Ibos::lang("Parameters error", "error"), "eval"); } } } }
public function actionEdit() { if (!$this->flowid) { $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("type/index")); } if (EnvUtil::submitCheck("typeSubmit")) { $this->beforeSave(); $data = FlowType::model()->create(); FlowType::model()->modify($this->flowid, $data); $catId = intval($_POST["catid"]); $this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("type/index", array("catid" => $catId, "flowid" => $this->flowid))); } else { $flow = FlowType::model()->fetchByPk($this->flowid); if (empty($flow)) { $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("type/index")); } if (!WfCommonUtil::checkDeptPurv($this->uid, $flow["deptid"], $flow["catid"])) { $this->error(Ibos::lang("Permission denied"), $this->createUrl("list/index")); } if (!empty($flow["deptid"])) { $flow["deptid"] = StringUtil::wrapId($flow["deptid"], "d"); } else { $flow["deptid"] = ""; } $readonly = FlowRun::model()->countAllByFlowId($this->flowid); $formName = FlowFormType::model()->fetchFormNameByFormId($flow["formid"]); $formList = FlowFormType::model()->fetchAllOnOptListByUid($this->uid, $this->category); $data = array("flow" => $flow, "readonly" => !!$readonly, "formName" => $formName, "formList" => $formList, "category" => $this->category, "catId" => $this->catid); $this->setPageTitle(Ibos::lang("Workflow manager")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang("Workflow manager"), "url" => $this->createUrl("type/index")), array("name" => Ibos::lang("Edit flow")))); $this->render("edit", $data); } }
public function actionEdit() { $sid = EnvUtil::getRequest("sid"); if (EnvUtil::submitCheck("formhash")) { $data = $this->beforeSave(); FlowQueryTpl::model()->modify($sid, $data); $this->ajaxReturn(array("isSuccess" => true)); } else { $data = $this->handleTplData($this->flowid); $tpl = FlowQueryTpl::model()->fetchByPk(intval($sid)); $tpl["flow"] = unserialize($tpl["flowconditions"]); if (!empty($tpl["flow"]["beginuser"])) { $tpl["flow"]["beginuser"] = StringUtil::wrapId($tpl["flow"]["beginuser"]); } $tpl["group"] = unserialize($tpl["groupbyfields"]); $tpl["viewfields"] = !empty($tpl["viewextfields"]) ? explode(",", $tpl["viewextfields"]) : array(); if (!empty($tpl["condformula"])) { $conArr = explode("\\n", $tpl["condformula"]); } else { $conArr = array(); } $data["tpl"] = $tpl; $data["conArr"] = $conArr; $this->renderPartial("edit", $data); } }
public function actionSearch() { $flowId = intval(EnvUtil::getRequest("flowid")); $seqId = intval(EnvUtil::getRequest("id")); if (!$flowId && !$seqId) { $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("query/advanced")); } $data = array(); if ($seqId) { $edit = true; $tpl = FlowQueryTpl::model()->fetchByPk($seqId); if ($tpl) { $flow = new ICFlowType(intval($tpl["flowid"])); $tpl["flow"] = unserialize($tpl["flowconditions"]); if (!empty($tpl["flow"]["beginuser"])) { $tpl["flow"]["beginuser"] = StringUtil::wrapId($tpl["flow"]["beginuser"]); } $tpl["group"] = unserialize($tpl["groupbyfields"]); $tpl["viewfields"] = !empty($tpl["viewextfields"]) ? explode(",", $tpl["viewextfields"]) : array(); if (!empty($tpl["condformula"])) { $conArr = explode("\\n", $tpl["condformula"]); } else { $conArr = array(); } } else { $this->error(Ibos::lang("Record does not exists", "error"), $this->createUrl("query/advanced")); } } else { $flow = new ICFlowType($flowId); $edit = false; $tpl = $conArr = array(); } $formStructure = $flow->form->parser->getStructure(); $defTitleArr = array(array("key" => "runid", "title" => Ibos::lang("Flow no")), array("key" => "runname", "title" => Ibos::lang("Flow subject/num")), array("key" => "runstatus", "title" => Ibos::lang("Flow status")), array("key" => "rundate", "title" => Ibos::lang("Flow begin date")), array("key" => "runtime", "title" => Ibos::lang("Flow begin time"))); $titleArr = array(); $table = "flow_data_" . $flow->getID(); foreach ($formStructure as $structure) { if ($structure["data-type"] == "sign" || $structure["data-type"] == "label") { continue; } $titleIdentifier = sprintf("%s.%s", $table, "data_" . $structure["itemid"]); $structure["data-title"] = stripslashes(str_replace(array("<", ">"), array("<", ">"), $structure["data-title"])); $titleArr[] = array("key" => $titleIdentifier, "title" => $structure["data-title"]); } $data["deftitle"] = $defTitleArr; $data["title"] = $titleArr; $this->setPageTitle(Ibos::lang("specify query conditions")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang("Work query"), "url" => $this->createUrl("query/index")), array("name" => Ibos::lang("Advanced query"), "url" => $this->createUrl("query/advanced")), array("name" => Ibos::lang("specify query conditions")))); $tpls = FlowQueryTpl::model()->fetchAllBySearch($flow->getID(), $this->uid); $data["flow"] = $flow->toArray(); $data["tpls"] = $tpls; $data["edit"] = $edit; $data["tpl"] = $tpl; $data["conArr"] = $conArr; $data["id"] = $seqId; $this->render("search", $data); }
private function getEditData() { if (Yii::app()->request->isAjaxRequest) { $interviewid = EnvUtil::getRequest("interviewid"); $interview = ResumeInterview::model()->fetchByPk($interviewid); $interview["interviewtime"] = date("Y-m-d", $interview["interviewtime"]); $interview["interviewer"] = StringUtil::wrapId($interview["interviewer"]); $this->ajaxReturn($interview); } }
public function fetchAllByFlowId($flowId) { $list = $this->fetchAllByAttributes(array("flowid" => intval($flowId))); foreach ($list as &$timer) { $timer["value"] = StringUtil::wrapId($timer["uid"]); $timer["period"] = $timer["type"]; $timer["id"] = $timer["tid"]; $timer["date"] = $timer["remindtime"]; if (!in_array($timer["type"], array(1, 5))) { $timer["selected"] = $timer["reminddate"]; } } return $list; }
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"))); } } }
private static function initUser($users) { $userList = ""; foreach ($users as $uid => $user) { $deptStr = $posStr = ""; if (!empty($user["alldeptid"])) { $deptStr = StringUtil::wrapId($user["alldeptid"], "d"); } if (!empty($user["allposid"])) { $posStr = StringUtil::wrapId($user["allposid"], "p"); } $userList .= "{id: 'u_{$uid}', text: '{$user["realname"]}', name: '{$user["realname"]}', iconSkin: 'user', type: 'user', enable: 1, imgUrl:'{$user["avatar_small"]}',spaceurl:'{$user["space_url"]}',department:'{$deptStr}',position: '{$posStr}'},\n"; } return rtrim($userList, ",\n"); }
public function actionAdd() { $op = EnvUtil::getRequest("op"); $option = empty($op) ? "default" : $op; $routes = array("default", "save", "planFromSchedule"); if (!in_array($option, $routes)) { $this->error(Ibos::lang("Can not find the path"), $this->createUrl("default/index")); } if ($option == "default") { $todayDate = date("Y-m-d"); if (array_key_exists("diaryDate", $_GET)) { $todayDate = $_GET["diaryDate"]; if (strtotime(date("Y-m-d")) < strtotime($todayDate)) { $this->error(Ibos::lang("No new permissions"), $this->createUrl("default/index")); } } $todayTime = strtotime($todayDate); $uid = Ibos::app()->user->uid; if (Diary::model()->checkDiaryisAdd($todayTime, $uid)) { $this->error(Ibos::lang("Do not repeat to add"), $this->createUrl("default/index")); } $diaryRecordList = DiaryRecord::model()->fetchAllByPlantime($todayTime); $originalPlanList = $outsidePlanList = array(); foreach ($diaryRecordList as $diaryRecord) { if ($diaryRecord["planflag"] == 1) { $originalPlanList[] = $diaryRecord; } else { $outsidePlanList[] = $diaryRecord; } } $dashboardConfig = Ibos::app()->setting->get("setting/diaryconfig"); $isInstallCalendar = ModuleUtil::getIsEnabled("calendar"); $workTime = $this->getWorkTime($isInstallCalendar); $params = array("originalPlanList" => $originalPlanList, "outsidePlanList" => $outsidePlanList, "dateWeekDay" => DiaryUtil::getDateAndWeekDay($todayDate), "nextDateWeekDay" => DiaryUtil::getDateAndWeekDay(date("Y-m-d", strtotime("+1 day", $todayTime))), "dashboardConfig" => $dashboardConfig, "todayDate" => $todayDate, "uploadConfig" => AttachUtil::getUploadConfig(), "isInstallCalendar" => $isInstallCalendar, "workTime" => $workTime); if ($dashboardConfig["sharepersonnel"]) { $data = DiaryShare::model()->fetchShareInfoByUid($uid); $params["defaultShareList"] = $data["shareInfo"]; $params["deftoid"] = StringUtil::wrapId($data["deftoid"]); } $this->setPageTitle(Ibos::lang("Add 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("Add Diary")))); $this->render("add", $params); } else { $this->{$option}(); } }
public function actionEdit() { $formSubmit = EnvUtil::submitCheck("approvalSubmit"); if ($formSubmit) { $id = intval(EnvUtil::getRequest("id")); $data = $this->handleSaveData($_POST); Approval::model()->modify($id, $data); $this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("approval/index")); } else { $id = EnvUtil::getRequest("id"); $approval = Approval::model()->fetchByPk($id); $approval["level1"] = StringUtil::wrapId($approval["level1"]); $approval["level2"] = StringUtil::wrapId($approval["level2"]); $approval["level3"] = StringUtil::wrapId($approval["level3"]); $approval["level4"] = StringUtil::wrapId($approval["level4"]); $approval["level5"] = StringUtil::wrapId($approval["level5"]); $approval["free"] = StringUtil::wrapId($approval["free"]); $params = array("approval" => $approval); $this->render("edit", $params); } }
public static function processDefaultShowData($diary) { $dashboardConfig = Yii::app()->setting->get("setting/diaryconfig"); $lockday = $dashboardConfig["lockday"] ? intval($dashboardConfig["lockday"]) : 0; $todayTime = (int) strtotime(date("Y-m-d", time())); $diaryTime = (int) $diary["diarytime"]; $diffDay = ($todayTime - $diaryTime) / (24 * 60 * 60); if (0 < $lockday && $lockday < $diffDay) { $diary["editIsLock"] = 1; } else { $diary["editIsLock"] = 0; } $diary["addtime"] = date("Y-m-d H:i:s", $diary["addtime"]); $diary["originalDiarytime"] = $diary["diarytime"]; $diary["diarytime"] = DiaryUtil::getDateAndWeekDay(date("Y-m-d", $diary["diarytime"])); $diary["nextDiarytime"] = DiaryUtil::getDateAndWeekDay(date("Y-m-d", $diary["nextdiarytime"])); $diary["realname"] = User::model()->fetchRealnameByUid($diary["uid"]); $diary["departmentName"] = Department::model()->fetchDeptNameByUid($diary["uid"]); $diary["shareuid"] = StringUtil::wrapId($diary["shareuid"]); return $diary; }
public function actionCategory() { if (EnvUtil::submitCheck("formhash")) { if (isset($_POST["name"])) { foreach ($_POST["name"] as $id => $val) { if (!empty($val)) { $data = array("name" => StringUtil::filterCleanHtml($val), "sort" => intval($_POST["sort"][$id]), "deptid" => !empty($_POST["deptid"][$id]) ? implode(",", StringUtil::getId($_POST["deptid"][$id])) : ""); FlowCategory::model()->modify(intval($id), $data); } } } if (isset($_POST["newname"])) { foreach ($_POST["newname"] as $id => $val) { if (!empty($val)) { $data = array("name" => StringUtil::filterCleanHtml($val), "sort" => intval($_POST["newsort"][$id]), "deptid" => !empty($_POST["newdeptid"][$id]) ? implode(",", StringUtil::getId($_POST["newdeptid"][$id])) : ""); FlowCategory::model()->add($data); } } } if (!empty($_POST["delid"])) { $id = StringUtil::filterStr($_POST["delid"]); if (!FlowCategory::model()->del($id)) { $this->error(Ibos::lang("Category delete require")); } } $this->success(Ibos::lang("Operation succeed", "message")); } else { $categorys = FlowCategory::model()->fetchAll(array("order" => "sort ASC")); foreach ($categorys as $key => &$cat) { if ($cat["deptid"] !== "") { $cat["deptid"] = StringUtil::wrapId($cat["deptid"], "d"); } $cat["flownums"] = FlowType::model()->countByAttributes(array("catid" => $cat["catid"])); $cat["formnums"] = FlowFormType::model()->countByAttributes(array("catid" => $cat["catid"])); } $this->render("category", array("list" => $categorys)); } }
private function getEditData() { if (Yii::app()->request->isAjaxRequest) { $contactid = EnvUtil::getRequest("contactid"); $contact = ResumeContact::model()->fetchByPk($contactid); $contact["inputtime"] = date("Y-m-d", $contact["inputtime"]); $contact["upuid"] = StringUtil::wrapId($contact["input"]); $this->ajaxReturn($contact); } }
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; }
</label> <div class="controls span8"> <input type="text" name="positionid" value="<?php echo StringUtil::wrapId($user['positionid'], 'p'); ?> " id="user_position"> </div> </div> <div id="auxiliary_pos_wrap" class="control-group" style="display: none;"> <label class="control-label"><?php echo $lang['Ancillary position']; ?> </label> <div class="controls span8"> <input type="text" name="auxiliarypos" value="<?php echo StringUtil::wrapId($user['auxiliarypos'], 'p'); ?> " id="auxiliary_position"> </div> </div> <?php if ($user['uid'] !== '1') { ?> <div class="control-group"> <label class="control-label"><?php echo $lang['Account status']; ?> </label> <div class="controls span8"> <label class="radio radio-inline"> <input type="radio" value="0" <?php
protected function handleFormData($list) { $return = array(); if (!empty($list)) { $depts = DepartmentUtil::loadDepartment(); $undefined = Ibos::lang("Undefined"); $sysdept = Ibos::lang("Form sys dept"); foreach ($list as $form) { if (!empty($form["formid"]) && WfCommonUtil::checkDeptPurv($this->uid, $form["deptid"])) { $form["id"] = $form["formid"]; $form["name"] = $form["formname"]; $form["catelog"] = $form["catid"]; if (!isset($form["flow"]) || empty($form["flow"])) { $form["flow"] = $undefined; } $form["department"] = isset($depts[$form["deptid"]]) ? $depts[$form["deptid"]]["deptname"] : $sysdept; $form["departmentId"] = !empty($form["deptid"]) ? StringUtil::wrapId($form["deptid"], "d") : ""; $return[] = $form; } } } return $return; }
<div class="mcr"> <div class="page-list"> <div class="ctform"> <div class="mb"> <input type="text" name="subject" id="" value="<?php echo $report["subject"]; ?> "> </div> <div> <label><?php echo $lang["Reporting to"]; ?> "</label> <input type="text" name="toid" id="rp_to" value="<?php echo StringUtil::wrapId($report["toid"]); ?> "> <div id="rp_to_box"></div> </div> </div> <div class="page-list-mainer"> <table class="rp-detail-table"> <!-- 工作小结 --> <tbody id="rp_complete"> <tr> <td colspan="3"> <div class="fill-ss"> <div class="pull-right"> <div class="calendar-group pull-left"> <div class="datepicker form_datetime" id="date_summary_start">
protected function handleBase(&$data) { if ($data["prcs"]["deptid"] == "alldept") { $data["prcs"]["prcsuser"] = "******"; } else { $uid = StringUtil::wrapId($data["prcs"]["uid"]); $deptId = StringUtil::wrapId($data["prcs"]["deptid"], "d"); $posId = StringUtil::wrapId($data["prcs"]["positionid"], "p"); $prcsUser = sprintf("%s,%s,%s", $uid, $deptId, $posId); $data["prcs"]["prcsuser"] = StringUtil::filterStr($prcsUser); } $data["prcs"]["autouserop"] = StringUtil::wrapId($data["prcs"]["autouserop"]); $data["prcs"]["autouser"] = StringUtil::wrapId($data["prcs"]["autouser"]); if (!empty($data["prcs"]["attachpriv"])) { $data["prcs"]["attachpriv"] = explode(",", $data["prcs"]["attachpriv"]); } else { $data["prcs"]["attachpriv"] = array(); } }
public static function getJsConstantUids($uid) { $inEnabledContact = ModuleUtil::getIsEnabled("contact"); $cUids = $inEnabledContact ? Contact::model()->fetchAllConstantByUid($uid) : array(); $cUidStr = empty($cUids) ? "" : StringUtil::wrapId($cUids); return empty($cUidStr) ? "" : CJSON::encode(explode(",", $cUidStr)); }
</div> </div> <button type="button" class="o-am-plus" title="<?php echo $lang["Release"]; ?> " data-action="addTask"></button> </div> </div> <a href="javascript:;" class="am-publish-toggle"></a> </div> <!-- 高级模式 --> <div class="am-publish-dt"> <div class="row mb"> <div class="span4"> <input type="text" name="chargeuid" id="am_charge" value="<?php echo StringUtil::wrapId(Ibos::app()->user->uid); ?> "> </div> <div class="span4"> <div class="input-group datepicker pull-left" id="am_starttime"> <span class="input-group-addon"><?php echo $lang["From"]; ?> </span> <a href="javascript:;" class="datepicker-btn"></a> <input type="text" class="datepicker-input" name="starttime" id="am_starttime_input" placeholder="<?php echo $lang["When to start"]; ?> "> </div>
</div> </div> <!-- 应聘岗位 --> <div class="span4" data-expand-target="recruittargetposition" <?php if (!$dashboardConfig["recruittargetposition"]["visi"]) { echo 'style="display: none;"'; } ?> > <div class="control-group"> <label for=""><?php echo $lang["Job candidates"]; ?> </label> <input type="text" name="positionid" id="recruittargetposition" value="<?php echo StringUtil::wrapId($resumeDetail["positionid"], "p"); ?> "> </div> </div> <!-- 期望月薪 --> <div class="span4" data-expand-target="recruitexpectsalary" <?php if (!$dashboardConfig["recruitexpectsalary"]["visi"]) { echo 'style="display: none;"'; } ?> > <div class="control-group"> <label for=""><?php echo $lang["Salary expectations"]; ?>
public function actionAdd() { MainUtil::checkLicenseLimit(); if (EnvUtil::submitCheck("userSubmit")) { $origPass = filter_input(INPUT_POST, "password", FILTER_SANITIZE_STRING); $_POST["salt"] = StringUtil::random(6); $_POST["password"] = !empty($origPass) ? md5(md5($origPass) . $_POST["salt"]) : ""; $_POST["createtime"] = TIMESTAMP; $_POST["guid"] = StringUtil::createGuid(); $this->dealWithSpecialParams(); $data = User::model()->create(); $newId = User::model()->add($data, true); if ($newId) { UserCount::model()->add(array("uid" => $newId)); $ip = Ibos::app()->setting->get("clientip"); UserStatus::model()->add(array("uid" => $newId, "regip" => $ip, "lastip" => $ip)); UserProfile::model()->add(array("uid" => $newId)); if (!empty($_POST["auxiliarydept"])) { $deptIds = StringUtil::getId($_POST["auxiliarydept"]); $this->handleAuxiliaryDept($newId, $deptIds, $_POST["deptid"]); } if (!empty($_POST["auxiliarypos"])) { $posIds = StringUtil::getId($_POST["auxiliarypos"]); $this->handleAuxiliaryPosition($newId, $posIds, $_POST["positionid"]); } $newUser = User::model()->fetchByPk($newId); $users = UserUtil::loadUser(); $users[$newId] = UserUtil::wrapUserInfo($newUser); User::model()->makeCache($users); OrgUtil::update(); OrgUtil::hookSyncUser($newId, $origPass, 1); $this->success(Ibos::lang("Save succeed", "message"), $this->createUrl("user/index")); } else { $this->error(Ibos::lang("Add user failed"), $this->createUrl("user/index")); } } else { $deptid = ""; $manager = ""; $account = Ibos::app()->setting->get("setting/account"); if ($account["mixed"]) { $preg = "[0-9]+[A-Za-z]+|[A-Za-z]+[0-9]+"; } else { $preg = "^[A-Za-z0-9\\!\\@\\#\$\\%\\^\\&\\*\\.\\~]{" . $account["minlength"] . ",32}\$"; } if ($deptid = EnvUtil::getRequest("deptid")) { $deptid = StringUtil::wrapId(EnvUtil::getRequest("deptid"), "d"); $manager = StringUtil::wrapId(Department::model()->fetchManagerByDeptid(EnvUtil::getRequest("deptid")), "u"); } $this->setPageTitle(Ibos::lang("Add user")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Organization"), "url" => $this->createUrl("department/index")), array("name" => Ibos::lang("User manager"), "url" => $this->createUrl("user/index")), array("name" => Ibos::lang("Add user")))); $this->render("add", array("deptid" => $deptid, "manager" => $manager, "passwordLength" => $account["minlength"], "preg" => $preg)); } }
public static function joinSelectBoxValue($deptid, $positionid, $uid) { $tmp = array(); if (!empty($deptid)) { if ($deptid == "alldept") { return "c_0"; } $tmp[] = StringUtil::wrapId($deptid, "d"); } if (!empty($positionid)) { $tmp[] = StringUtil::wrapId($positionid, "p"); } if (!empty($uid)) { $tmp[] = StringUtil::wrapId($uid, "u"); } return implode(",", $tmp); }
" /> </form> </div> <div class="page-list-footer"> <?php $this->widget('IWPage', array('pages' => $pages)); ?> </div> </div> <!-- Mainer content --> </div> </div> <script> Ibos.app.setPageParam({ 'dataUid': '<?php echo StringUtil::wrapId(Yii::app()->user->uid); ?> ' }) </script> <script src='<?php echo $assetUrl; ?> /js/message.js?<?php echo VERHASH; ?> '></script> <script src='<?php echo $assetUrl; ?>
?> <?php foreach ($setting['emailroleallocation'] as $key => $value) { ?> <div class="mbs"> <input type="text" name="role[<?php echo $key; ?> ][positionid]" data-id="<?php echo $key; ?> " id="roleallocation_<?php echo $key; ?> " value="<?php echo StringUtil::wrapId($key, 'p'); ?> "> <div id="roleallocation_<?php echo $key; ?> _box"></div> </div> <div class="input-group mbs"> <input type="text" name="role[<?php echo $key; ?> ][size]" value="<?php echo $value; ?> ">
</option> </select> </div> </div> <div class="control-group" id="custom_department" <?php if (!$custom) { echo ' style="display:none;"'; } ?> > <div class="controls"> <input type="text" name="scopedept" <?php if ($custom) { ?> value="<?php echo StringUtil::wrapId($per["scope"], "d"); ?> "<?php } ?> id="custom_department_select"> </div> </div> </form> </div> <script> (function() { var $wrap = $("#auth_rule_setting"); $wrap.find(".radio input").label(); $("#auth_for").userSelect({ data: Ibos.data.get(),
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); } }
echo $random; ?> " alt="<?php echo $user["realname"]; ?> " width="180" height="180" /> </span> <?php } ?> <?php if (Ibos::app()->user->uid !== $user["uid"]) { ?> <a href="javascript:Ui.showPmDialog(['<?php echo StringUtil::wrapId($user["uid"], "u"); ?> '],{url:'<?php echo Ibos::app()->createUrl("message/pm/post"); ?> '});Ibos.userCard.hide();" class="private-letter" title="<?php echo $lang["Send message"]; ?> "> <i class="o-private-letter <?php echo $onlineIcon; ?> "></i> </a> <?php }
protected function get() { if (Ibos::app()->request->getIsAjaxRequest()) { $id = EnvUtil::getRequest("id"); if ($id == 0) { $result = Ibos::app()->setting->get("setting/unit"); } else { $result = Department::model()->fetchByPk($id); $result["manager"] = StringUtil::wrapId(array($result["manager"])); $result["leader"] = StringUtil::wrapId(array($result["leader"])); $result["subleader"] = StringUtil::wrapId(array($result["subleader"])); } $this->ajaxReturn($result, "json"); } }