本文整理汇总了PHP中StringUtil::wrapId方法的典型用法代码示例。如果您正苦于以下问题:PHP StringUtil::wrapId方法的具体用法?PHP StringUtil::wrapId怎么用?PHP StringUtil::wrapId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringUtil
的用法示例。
在下文中一共展示了StringUtil::wrapId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAdd
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}();
}
}
示例2: actionEdit
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");
}
}
}
}
示例3: actionEdit
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);
}
}
示例4: actionEdit
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);
}
}
示例5: actionSearch
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);
}
示例6: getEditData
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);
}
}
示例7: fetchAllByFlowId
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;
}
示例8: actionEdit
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")));
}
}
}
示例9: initUser
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");
}
示例10: actionAdd
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}();
}
}
示例11: actionEdit
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);
}
}
示例12: processDefaultShowData
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;
}
示例13: actionCategory
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));
}
}
示例14: getEditData
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);
}
}
示例15: makeUserSelect
//.........这里部分代码省略.........
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;
}