Example #1
0
 public function addLog($assignmentId, $type, $content)
 {
     $uid = Ibos::app()->user->uid;
     $realname = User::model()->fetchRealnameByUid($uid);
     $data = array("assignmentid" => $assignmentId, "uid" => $uid, "time" => TIMESTAMP, "ip" => EnvUtil::getClientIp(), "type" => $type, "content" => $realname . $content);
     return $this->add($data);
 }
Example #2
0
 public static function getCommonTimeScope()
 {
     static $timeScope = array();
     if (empty($timeScope)) {
         $time = EnvUtil::getRequest("time");
         $start = EnvUtil::getRequest("start");
         $end = EnvUtil::getRequest("end");
         if (!empty($time)) {
             if (!in_array($time, array("thisweek", "lastweek", "thismonth", "lastmonth"))) {
                 $time = "thisweek";
             }
         } else {
             if (!empty($start) && !empty($end)) {
                 $start = strtotime($start);
                 $end = strtotime($end);
                 if ($start && $end) {
                     $timeScope = array("timestr" => "custom", "start" => $start, "end" => $end);
                 }
             } else {
                 $time = "thisweek";
             }
         }
         if (empty($timeScope)) {
             $timeScope = DateTimeUtil::getStrTimeScope($time);
             $timeScope["timestr"] = $time;
         }
     }
     return $timeScope;
 }
Example #3
0
 public function actionAddComment()
 {
     if (EnvUtil::submitCheck("formhash")) {
         $widget = Ibos::app()->getWidgetFactory()->createWidget($this, "IWOfficialdocComment");
         return $widget->addComment();
     }
 }
Example #4
0
 public function actionDel()
 {
     if (Ibos::app()->request->isAjaxRequest) {
         $typeid = intval(EnvUtil::getRequest("typeid"));
         if (empty($typeid)) {
             $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Parameters error", "error")));
         }
         $removeSuccess = ReportType::model()->remove($typeid);
         if ($removeSuccess) {
             $reports = Report::model()->fetchRepidAndAidByTypeids($typeid);
             if (!empty($reports)) {
                 if ($reports["aids"]) {
                     AttachUtil::delAttach($reports["aids"]);
                 }
                 ReportRecord::model()->deleteAll("repid IN('{$reports["repids"]}')");
                 Report::model()->deleteAll("repid IN('{$reports["repids"]}')");
             }
             $return["isSuccess"] = true;
             $return["msg"] = Ibos::lang("Del succeed", "message");
         } else {
             $return["isSuccess"] = false;
             $return["msg"] = Ibos::lang("Del failed", "message");
         }
         $this->ajaxReturn($return);
     }
 }
Example #5
0
 public function actionImageManager()
 {
     $path = "data/editor/image/" . Ibos::app()->user->uid;
     $action = EnvUtil::getRequest("action");
     if ($action == "get") {
         if (!defined("SAE_TMP_PATH")) {
             $files = $this->getfiles($path);
             if (!$files) {
                 return null;
             }
             rsort($files, SORT_STRING);
             $str = "";
             foreach ($files as $file) {
                 $str .= "../../../../../../" . $file . "ue_separate_ue";
             }
             echo $str;
         } else {
             $st = new SaeStorage();
             $num = 0;
             while ($ret = $st->getList("data", $path, 100, $num)) {
                 foreach ($ret as $file) {
                     if (preg_match("/\\.(gif|jpeg|jpg|png|bmp)\$/i", $file)) {
                         echo $st->getUrl("data", $file) . "ue_separate_ue";
                     }
                     $num++;
                 }
             }
         }
     }
 }
Example #6
0
 public function actionAdd()
 {
     $flowId = intval(EnvUtil::getRequest("flowid"));
     $flow = new ICFlowType($flowId);
     if (EnvUtil::submitCheck("formhash")) {
         $this->checkFlowAccess($flowId, 1, $this->createUrl("new/add"));
         $this->beforeAdd($_POST, $flow);
         $run = array("name" => $_POST["name"], "flowid" => $flowId, "beginuser" => $this->uid, "begintime" => TIMESTAMP);
         $runId = FlowRun::model()->add($run, true);
         $runProcess = array("runid" => $runId, "processid" => 1, "uid" => $this->uid, "flag" => FlowConst::PRCS_UN_RECEIVE, "flowprocess" => 1, "createtime" => TIMESTAMP);
         FlowRunProcess::model()->add($runProcess);
         if (strstr($flow->autoname, "{N}")) {
             FlowType::model()->updateCounters(array("autonum" => 1), sprintf("flowid = %d", $flowId));
             CacheUtil::rm("flowtype_" . $flowId);
         }
         $runData = array("runid" => $runId, "name" => $_POST["name"], "beginuser" => $this->uid, "begin" => TIMESTAMP);
         $this->handleRunData($flow, $runData);
         $param = array("flowid" => $flowId, "runid" => $runId, "processid" => 1, "flowprocess" => 1, "fromnew" => 1);
         $jumpUrl = $this->createUrl("form/index", array("key" => WfCommonUtil::param($param)));
         $this->ajaxReturn(array("isSuccess" => true, "jumpUrl" => $jumpUrl));
     } else {
         $this->checkFlowAccess($flowId, 1);
         if (!empty($flow->autoname)) {
             $runName = WfNewUtil::replaceAutoName($flow, $this->uid);
         } else {
             $runName = sprintf("%s (%s)", $flow->name, date("Y-m-d H:i:s"));
         }
         $data = array("flow" => $flow->toArray(), "runName" => $runName, "lang" => Ibos::getLangSources());
         $this->renderPartial("add", $data);
     }
 }
Example #7
0
 public function actionEdit()
 {
     if (EnvUtil::submitCheck("emailSubmit")) {
         $setting = array();
         foreach ($this->_fields as $field) {
             if (array_key_exists($field, $_POST)) {
                 $setting[$field] = intval($_POST[$field]);
             } else {
                 $setting[$field] = 0;
             }
         }
         $roles = array();
         if (isset($_POST["role"])) {
             foreach ($_POST["role"] as $role) {
                 if (!empty($role["positionid"]) && !empty($role["size"])) {
                     $positionId = StringUtil::getId($role["positionid"]);
                     $roles[implode(",", $positionId)] = intval($role["size"]);
                 }
             }
         }
         $setting["emailroleallocation"] = serialize($roles);
         foreach ($setting as $key => $value) {
             Setting::model()->updateSettingValueByKey($key, $value);
         }
         CacheUtil::update("setting");
         $this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
     }
 }
Example #8
0
 public function actionIndex()
 {
     $op = EnvUtil::getRequest("op");
     $op = in_array($op, array("dept", "letter")) ? $op : "dept";
     $params = array();
     if ($op == "letter") {
         $params["datas"] = $this->getDataByLetter();
     } else {
         $params["datas"] = $this->getDataByDept();
     }
     $userDatas = array();
     if (!empty($params["datas"])) {
         foreach ($params["datas"] as $datas) {
             $userDatas = $op == "dept" ? array_merge($userDatas, $datas["users"]) : array_merge($userDatas, $datas);
         }
     }
     $params["uids"] = implode(",", ConvertUtil::getSubByKey($userDatas, "uid"));
     $uid = Ibos::app()->user->uid;
     $params["cuids"] = Contact::model()->fetchAllConstantByUid($uid);
     $this->setPageTitle(Ibos::lang("Contact"));
     $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Contact"), "url" => $this->createUrl("defalut/index")), array("name" => Ibos::lang("Company contact"))));
     $view = $op == "letter" ? "letter" : "dept";
     $params["allLetters"] = $this->allLetters;
     $this->render($view, $params);
 }
Example #9
0
 public function actionSetup()
 {
     $formSubmit = EnvUtil::submitCheck("formhash");
     if ($formSubmit) {
         $data =& $_POST;
         foreach (array("sendemail", "sendsms", "sendmessage") as $field) {
             if (!empty($data[$field])) {
                 $ids = array_keys($data[$field]);
                 $idstr = implode(",", $ids);
                 Notify::model()->updateAll(array($field => 1), sprintf("FIND_IN_SET(id,'%s')", $idstr));
                 Notify::model()->updateAll(array($field => 0), sprintf("NOT FIND_IN_SET(id,'%s')", $idstr));
             } else {
                 Notify::model()->updateAll(array($field => 0));
             }
         }
         CacheUtil::update("NotifyNode");
         $this->success(Ibos::lang("Save succeed", "message"));
     } else {
         $nodeList = Notify::model()->getNodeList();
         foreach ($nodeList as &$node) {
             $node["moduleName"] = Module::model()->fetchNameByModule($node["module"]);
         }
         $this->render("setup", array("nodeList" => $nodeList));
     }
 }
Example #10
0
 public function actionSearch()
 {
     $condition = array();
     if (Yii::app()->request->getIsPostRequest()) {
         $search = $_POST["search"];
         $condition = EmailUtil::mergeSearchCondition($search, $this->uid);
         $conditionStr = base64_encode(serialize($condition));
     } else {
         $conditionStr = EnvUtil::getRequest("condition");
         $condition = unserialize(base64_decode($conditionStr));
     }
     if (empty($condition)) {
         $this->error(Ibos::lang("Request tainting", "error"), $this->createUrl("list/index"));
     }
     $emailData = Email::model()->fetchAllByArchiveIds("*", $condition["condition"], $condition["archiveId"], array("e", "eb"), null, null, SORT_DESC, "emailid");
     $count = count($emailData);
     $pages = PageUtil::create($count, $this->getListPageSize(), false);
     $pages->params = array("condition" => $conditionStr);
     $list = array_slice($emailData, $pages->getOffset(), $pages->getLimit(), false);
     foreach ($list as $index => &$mail) {
         $mail["fromuser"] = $mail["fromid"] ? User::model()->fetchRealnameByUid($mail["fromid"]) : "";
     }
     $data = array("list" => $list, "pages" => $pages, "condition" => $conditionStr, "folders" => $this->folders);
     $this->setPageTitle(Ibos::lang("Search result"));
     $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("Search result"))));
     $this->render("search", $data);
 }
Example #11
0
 public function actionCropImg()
 {
     if (EnvUtil::submitCheck("userSubmit")) {
         $params = $_POST;
         if (!isset($params) && empty($params)) {
             return null;
         }
         $tempAvatar = $params["src"];
         $avatarPath = "data/avatar/";
         $avatarBig = UserUtil::getAvatar($params["uid"], "big");
         $avatarMiddle = UserUtil::getAvatar($params["uid"], "middle");
         $avatarSmall = UserUtil::getAvatar($params["uid"], "small");
         if (LOCAL) {
             FileUtil::makeDirs($avatarPath . dirname($avatarBig));
         }
         FileUtil::createFile("data/avatar/" . $avatarBig, "");
         FileUtil::createFile("data/avatar/" . $avatarMiddle, "");
         FileUtil::createFile("data/avatar/" . $avatarSmall, "");
         Ibos::import("ext.ThinkImage.ThinkImage", true);
         $imgObj = new ThinkImage(THINKIMAGE_GD);
         $imgObj->open($tempAvatar)->crop($params["w"], $params["h"], $params["x"], $params["y"])->save($tempAvatar);
         $imgObj->open($tempAvatar)->thumb(180, 180, 1)->save($avatarPath . $avatarBig);
         $imgObj->open($tempAvatar)->thumb(60, 60, 1)->save($avatarPath . $avatarMiddle);
         $imgObj->open($tempAvatar)->thumb(30, 30, 1)->save($avatarPath . $avatarSmall);
         $this->success(Ibos::lang("Upload avatar succeed"), $this->createUrl("home/personal", array("op" => "avatar")));
         exit;
     }
 }
Example #12
0
 private function getData()
 {
     $id = EnvUtil::getRequest("id");
     $aidString = base64_decode(rawurldecode($id));
     if (empty($aidString)) {
         $this->error(Ibos::lang("Parameters error", "error"), "", array("autoJump" => 0));
     }
     $salt = Ibos::app()->user->salt;
     $decodeString = StringUtil::authCode($aidString, "DECODE", $salt);
     $decodeArr = explode("|", $decodeString);
     $count = count($decodeArr);
     if ($count < 3) {
         $this->error(Ibos::lang("Data type invalid", "error"), "", array("autoJump" => 0));
     } else {
         $aid = $decodeArr[0];
         $tableId = $decodeArr[1];
         if (0 <= $tableId && $tableId < 10) {
             $attach = AttachmentN::model()->fetch($tableId, $aid);
         }
         $return = array("decodeArr" => $decodeArr, "attach" => array());
         if (!empty($attach)) {
             $return["attach"] = $attach;
         }
         return $return;
     }
 }
Example #13
0
 public function actionIndex()
 {
     if (isset($_GET["pagesize"])) {
         $this->setListPageSize($_GET["pagesize"]);
     }
     $key = StringUtil::filterCleanHtml(EnvUtil::getRequest("keyword"));
     $fields = array("frp.runid", "frp.processid", "frp.flowprocess", "frp.flag", "frp.opflag", "frp.processtime", "ft.freeother", "ft.flowid", "ft.name as typeName", "ft.type", "ft.listfieldstr", "fr.name as runName", "fr.beginuser", "fr.begintime", "fr.endtime", "fr.focususer");
     $sort = "frp.processtime";
     $group = "frp.runid";
     $condition = array("and", "fr.delflag = 0", "frp.childrun = 0", sprintf("frp.uid = %d", $this->uid), sprintf("FIND_IN_SET(fr.focususer,'%s')", $this->uid));
     if ($key) {
         $condition[] = array("like", "fr.runid", "%{$key}%");
         $condition[] = array("or like", "fr.name", "%{$key}%");
     }
     $count = Ibos::app()->db->createCommand()->select("count(*) as count")->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->group($group)->queryScalar();
     $pages = PageUtil::create($count, $this->getListPageSize());
     if ($key && $count) {
         $pages->params = array("keyword" => $key);
     }
     $offset = $pages->getOffset();
     $limit = $pages->getLimit();
     $list = Ibos::app()->db->createCommand()->select($fields)->from("{{flow_run_process}} frp")->leftJoin("{{flow_run}} fr", "frp.runid = fr.runid")->leftJoin("{{flow_type}} ft", "fr.flowid = ft.flowid")->where($condition)->order($sort)->group($group)->offset($offset)->limit($limit)->queryAll();
     $data = array_merge(array("pages" => $pages), $this->handleList($list));
     $this->setPageTitle(Ibos::lang("My focus"));
     $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Workflow")), array("name" => Ibos::lang(Ibos::lang("My focus")), "url" => $this->createUrl("focus/index")), array("name" => Ibos::lang("List"))));
     $this->render("index", $data);
 }
Example #14
0
 public function actionSave()
 {
     if (EnvUtil::submitCheck("formhash")) {
         $data =& $_POST;
         if (isset($data["type"])) {
             foreach ($data["type"] as $id => $type) {
                 if (empty($data["uid"][$id]) || empty($data["remindtime"][$id])) {
                     continue;
                 }
                 $type = intval($type);
                 $attr = array("type" => intval($type));
                 if (!in_array($type, array(1, 5))) {
                     $attr["reminddate"] = $data["reminddate"][$id];
                 }
                 $attr["remindtime"] = $data["remindtime"][$id];
                 if (substr($id, 0, 1) == "n") {
                     $uid = StringUtil::getId($data["uid"][$id]);
                     $attr["uid"] = implode(",", $uid);
                     $attr["flowid"] = $this->flowid;
                     FlowTimer::model()->add($attr);
                 } else {
                     FlowTimer::model()->modify($id, $attr);
                 }
             }
         }
         if (!empty($data["delid"])) {
             $id = StringUtil::filterStr($data["delid"]);
             FlowTimer::model()->deleteAll("FIND_IN_SET(tid,'{$id}')");
         }
         $this->ajaxReturn(array("isSuccess" => true));
     }
     exit;
 }
Example #15
0
 public function init()
 {
     $uid = intval(EnvUtil::getRequest("uid"));
     $this->uid = $uid ? $uid : Ibos::app()->user->uid;
     $this->upuid = Ibos::app()->user->uid;
     parent::init();
 }
Example #16
0
 public function actionIndex()
 {
     $unit = Setting::model()->fetchSettingValueByKey("unit");
     $formSubmit = EnvUtil::submitCheck("unitSubmit");
     if ($formSubmit) {
         $postData = array();
         if (!empty($_FILES["logo"]["name"])) {
             !empty($unit["logourl"]) && FileUtil::deleteFile($unit["logourl"]);
             $postData["logourl"] = $this->imgUpload("logo");
         } elseif (!empty($_POST["logourl"])) {
             $postData["logourl"] = $_POST["logourl"];
         } else {
             $postData["logourl"] = "";
         }
         $keys = array("phone", "fullname", "shortname", "fax", "zipcode", "address", "adminemail", "systemurl");
         foreach ($keys as $key) {
             if (isset($_POST[$key])) {
                 $postData[$key] = StringUtil::filterCleanHtml($_POST[$key]);
             } else {
                 $postData[$key] = "";
             }
         }
         Setting::model()->updateSettingValueByKey("unit", $postData);
         CacheUtil::update(array("setting"));
         $this->success(Ibos::lang("Save succeed", "message"));
     } else {
         $license = Setting::model()->fetchSettingValueByKey("license");
         $data = array("unit" => unserialize($unit), "license" => $license);
         $this->render("index", $data);
     }
 }
Example #17
0
 public function actionUpdate()
 {
     if (EnvUtil::submitCheck("formhash")) {
         $fieldArr = array("reporttypemanage" => "", "stampenable" => 0, "stampdetails" => "", "pointsystem" => 5, "autoreview" => 0, "autoreviewstamp" => 1);
         foreach ($_POST as $key => $value) {
             if (in_array($key, array_keys($fieldArr))) {
                 $fieldArr[$key] = $value;
             }
         }
         $stampStr = "";
         if (!empty($fieldArr["stampdetails"])) {
             foreach ($fieldArr["stampdetails"] as $score => $stampId) {
                 $stampId = empty($stampId) ? 0 : $stampId;
                 $stampStr .= $stampId . ":" . $score . ",";
             }
         }
         $fieldArr["stampdetails"] = rtrim($stampStr, ",");
         $apprise = EnvUtil::getRequest("apprise");
         if (empty($_POST["stampdetails"][$apprise])) {
             $fieldArr["autoreview"] = 0;
         } else {
             $fieldArr["autoreviewstamp"] = $_POST["stampdetails"][$apprise];
         }
         Setting::model()->modify("reportconfig", array("svalue" => serialize($fieldArr)));
         CacheUtil::update("setting");
         $this->success(Ibos::lang("Update succeed", "message"), $this->createUrl("dashboard/index"));
     }
 }
Example #18
0
 public function actionIndex()
 {
     $shareInfo["sid"] = intval(EnvUtil::getRequest("sid"));
     $shareInfo["stable"] = StringUtil::filterCleanHtml(EnvUtil::getRequest("stable"));
     $shareInfo["initHTML"] = StringUtil::filterDangerTag(EnvUtil::getRequest("initHTML"));
     $shareInfo["curid"] = StringUtil::filterCleanHtml(EnvUtil::getRequest("curid"));
     $shareInfo["curtable"] = StringUtil::filterCleanHtml(EnvUtil::getRequest("curtable"));
     $shareInfo["module"] = StringUtil::filterCleanHtml(EnvUtil::getRequest("module"));
     $shareInfo["isrepost"] = intval(EnvUtil::getRequest("isrepost"));
     if (empty($shareInfo["stable"]) || empty($shareInfo["sid"])) {
         echo "类型和资源ID不能为空";
         exit;
     }
     if (!($oldInfo = Source::getSourceInfo($shareInfo["stable"], $shareInfo["sid"], false, $shareInfo["module"]))) {
         echo "此信息不可以被转发";
         exit;
     }
     empty($shareInfo["module"]) && ($shareInfo["module"] = $oldInfo["module"]);
     if (empty($shareInfo["initHTML"]) && !empty($shareInfo["curid"])) {
         if ($shareInfo["curid"] != $shareInfo["sid"] && $shareInfo["isrepost"] == 1) {
             $curInfo = Source::getSourceInfo($shareInfo["curtable"], $shareInfo["curid"], false, "weibo");
             $userInfo = $curInfo["source_user_info"];
             $shareInfo["initHTML"] = " //@" . $userInfo["realname"] . ":" . $curInfo["source_content"];
             $shareInfo["initHTML"] = str_replace(array("\n", "\r"), array("", ""), $shareInfo["initHTML"]);
         }
     }
     $shareInfo["shareHtml"] = !empty($oldInfo["shareHtml"]) ? $oldInfo["shareHtml"] : "";
     $data = array("shareInfo" => $shareInfo, "oldInfo" => $oldInfo);
     $this->renderPartial("index", $data);
 }
Example #19
0
 public function actionDestroy()
 {
     $id = EnvUtil::getRequest("id");
     $runId = StringUtil::filterStr(StringUtil::filterCleanHtml($id));
     WfHandleUtil::destroy($runId);
     $this->ajaxReturn(array("isSuccess" => true));
 }
Example #20
0
 public function actionIndex()
 {
     $types = EnvUtil::getRequest("updatetype");
     $data = array();
     if (EnvUtil::submitCheck("formhash")) {
         $type = implode(",", $types);
         if (!empty($type)) {
             $this->redirect($this->createUrl("update/index", array("doupdate" => 1, "updatetype" => $type)));
         }
     }
     if (Ibos::app()->request->getIsAjaxRequest()) {
         $op = EnvUtil::getRequest("op");
         if (LOCAL) {
             @set_time_limit(0);
         }
         if ($op == "data") {
             CacheUtil::update();
         }
         if ($op == "static") {
             LOCAL && Ibos::app()->assetManager->republicAll();
             OrgUtil::update();
         }
         if ($op == "module") {
             ModuleUtil::updateConfig();
         }
         Ibos::app()->cache->clear();
         $this->ajaxReturn(array("isSuccess" => true));
     }
     if (EnvUtil::getRequest("doupdate") == 1) {
         $type = explode(",", trim($types, ","));
         $data["doUpdate"] = true;
         foreach ($type as $index => $act) {
             if (!empty($act)) {
                 if (in_array("data", $type)) {
                     unset($type[$index]);
                     $data["typedesc"] = Ibos::lang("Update") . Ibos::lang("Data cache");
                     $data["op"] = "data";
                     break;
                 }
                 if (in_array("static", $type)) {
                     unset($type[$index]);
                     $data["typedesc"] = Ibos::lang("Update") . Ibos::lang("Static cache");
                     $data["op"] = "static";
                     break;
                 }
                 if (in_array("module", $type)) {
                     $data["typedesc"] = Ibos::lang("Update") . Ibos::lang("Module setting");
                     $data["op"] = "module";
                     unset($type[$index]);
                     break;
                 }
             }
         }
         $data["next"] = $this->createUrl("update/index", array("doupdate" => intval(!empty($type)), "updatetype" => implode(",", $type)));
     } else {
         $data["doUpdate"] = false;
     }
     $this->render("index", $data);
 }
Example #21
0
 public function actionUnFollow()
 {
     if (EnvUtil::submitCheck("formhash")) {
         $fid = StringUtil::filterCleanHtml($_POST["fid"]);
         $res = Follow::model()->unFollow(Ibos::app()->user->uid, intval($fid));
         $this->ajaxReturn(array("isSuccess" => !!$res, "msg" => Follow::model()->getError("unFollow")));
     }
 }
Example #22
0
 public function actionDel()
 {
     $verID = intval(EnvUtil::getRequest("verid"));
     if (FlowFormVersion::model()->deleteByPk($verID)) {
         $this->ajaxReturn(array("isSuccess" => true));
     } else {
         $this->ajaxReturn(array("isSuccess" => false));
     }
 }
Example #23
0
 public function actionLicense()
 {
     if (EnvUtil::submitCheck("formhash")) {
         $licensekey = StringUtil::filterCleanHtml(EnvUtil::getRequest("licensekey"));
         $filename = PATH_ROOT . "/data/licence.key";
         @file_put_contents($filename, $licensekey);
         $this->success(Ibos::lang("Save succeed", "message"));
     }
 }
Example #24
0
 public function actionLoadNew()
 {
     $moduleStr = EnvUtil::getRequest("module");
     $moduleStr = urldecode($moduleStr);
     $moduleArr = explode(",", $moduleStr);
     $data = MainUtil::execApiMethod("loadNew", $moduleArr);
     $data["timestamp"] = TIMESTAMP;
     $this->ajaxReturn($data);
 }
Example #25
0
 public function actionCheckRealname()
 {
     $fullname = EnvUtil::getRequest("fullname");
     $fullnameToUnicode = str_replace("%", "\\", $fullname);
     $fullnameToUtf8 = StringUtil::unicodeToUtf8($fullnameToUnicode);
     $realnames = ResumeDetail::model()->fetchAllRealnames();
     $isExist["statu"] = in_array($fullnameToUtf8, $realnames) ? true : false;
     $this->ajaxReturn($isExist);
 }
Example #26
0
 public function actionDel()
 {
     $id = intval(EnvUtil::getRequest("id"));
     if ($id && EnvUtil::submitCheck("formhash")) {
         $flowId = intval(EnvUtil::getRequest("flowid"));
         $status = FlowPermission::model()->deleteAllByAttributes(array("id" => $id, "flowid" => $flowId));
         $this->ajaxReturn(array("isSuccess" => !!$status));
     }
 }
Example #27
0
 public function afterLogin($fromCookie)
 {
     $uid = $this->getId();
     MainUtil::setCookie("lastactivity", TIMESTAMP);
     UserStatus::model()->updateByPk($uid, array("lastip" => EnvUtil::getClientIp(), "lastvisit" => TIMESTAMP, "lastactivity" => TIMESTAMP, "invisible" => 1));
     if (!$fromCookie) {
         Ibos::app()->session->isNew = true;
         Ibos::app()->session->updateSession();
     }
 }
Example #28
0
 public function fetchCommentList()
 {
     $type = $this->getAttributes("type");
     $this->setAttributes(array("inAjax" => 1, "loadmore" => EnvUtil::getRequest("loadmore")));
     if ($type == "reply") {
         $this->setParseView("comment", self::REPLY_LIST_VIEW);
     } else {
         $this->setParseView("comment", self::COMMENT_LIST_VIEW);
     }
     return $this->run();
 }
Example #29
0
 public function actionDelete()
 {
     $catid = EnvUtil::getRequest("catid");
     $category = PositionCategory::model()->fetchByPk($catid);
     $supCategoryNum = PositionCategory::model()->countByAttributes(array("pid" => 0));
     if (!empty($category) && $category["pid"] == 0 && $supCategoryNum == 1) {
         $this->ajaxReturn(array("IsSuccess" => false, "msg" => Ibos::lang("Leave at least a Category")), "json");
     }
     $ret = $this->_category->delete($catid);
     $this->ajaxReturn(array("IsSuccess" => !!$ret), "json");
 }
Example #30
0
 protected function beforeSave()
 {
     $viewExtFields = StringUtil::filterStr($_POST["viewextfields"]);
     $sumFields = StringUtil::filterStr($_POST["sumfields"]);
     $flowConditions = array("flowquerytype" => $_POST["flow_query_type"], "beginuser" => StringUtil::getId($_POST["begin_user"]), "runname" => StringUtil::filterCleanHtml($_POST["run_name"]), "flowstatus" => $_POST["flow_status"], "time1" => $_POST["time1"], "time2" => $_POST["time2"], "time3" => $_POST["time3"], "time4" => $_POST["time4"], "attachname" => StringUtil::filterCleanHtml($_POST["attach_name"]));
     $groupbyFields = array("field" => $_POST["group_field"], "order" => $_POST["group_sort"]);
     $name = StringUtil::filterCleanHtml($_POST["tplname"]);
     $sid = intval(EnvUtil::getRequest("sid"));
     $data = array("flowid" => $this->flowid, "uid" => $this->uid, "tplname" => $this->tplNameExists($name, $sid) ? $name . StringUtil::random(3) : $name, "viewextfields" => $viewExtFields, "sumfields" => $sumFields, "flowconditions" => serialize($flowConditions), "groupbyfields" => serialize($groupbyFields), "condformula" => $_POST["condformula"]);
     return $data;
 }