本文整理汇总了PHP中Ibos类的典型用法代码示例。如果您正苦于以下问题:PHP Ibos类的具体用法?PHP Ibos怎么用?PHP Ibos使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ibos类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addLog
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);
}
示例2: handleList
protected function handleList($runProcess)
{
$allProcess = FlowProcess::model()->fetchAllProcessSortByFlowId();
foreach ($runProcess as &$run) {
$run["user"] = User::model()->fetchByUid($run["beginuser"]);
$rp = FlowRunProcess::model()->fetchCurrentNextRun($run["runid"], $this->uid);
if (!empty($rp)) {
$run["processid"] = $rp["processid"];
$run["flowprocess"] = $rp["flowprocess"];
$run["opflag"] = $rp["opflag"];
$run["flag"] = $rp["flag"];
}
if ($run["type"] == 1) {
if (isset($allProcess[$run["flowid"]][$run["flowprocess"]]["name"])) {
$run["stepname"] = $allProcess[$run["flowid"]][$run["flowprocess"]]["name"];
} else {
$run["stepname"] = Ibos::lang("Process steps already deleted");
}
} else {
$run["stepname"] = Ibos::lang("Step", "", array("{step}" => $run["processid"]));
}
$param = array("runid" => $run["runid"], "flowid" => $run["flowid"], "processid" => $run["processid"], "flowprocess" => $run["flowprocess"]);
$run["key"] = WfCommonUtil::param($param);
}
return array("list" => $runProcess);
}
示例3: 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");
}
}
}
}
示例4: actionUpdate
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"));
}
}
示例5: parse
public function parse($isUpdate = false)
{
Ibos::import("application.extensions.simple_html_dom", true);
if ($isUpdate) {
$model = preg_replace("/\\s+data-id\\s?=\\s?\"?\\d+\"?/i", "", $this->printmodel);
$max = 0;
} else {
$model = $this->printmodel;
$max = intval($this->itemmax);
}
$elements = array();
$doc = new simple_html_dom();
$doc->load($model, true, true, CHARSET);
$items = $doc->find("ic");
$config = $this->getItemConfig();
if (!empty($items) && !empty($config)) {
$this->refactor($items, $config, $max, $elements);
}
$html = $doc->save();
$this->_cache = $elements;
CacheUtil::set("form_" . $this->ID, $elements);
$form["printmodelshort"] = $html;
if ($max != $this->itemmax) {
$form["itemmax"] = $max;
}
$doc->clear();
FlowFormType::model()->modify($this->ID, $form);
}
示例6: checkVote
public static function checkVote($relatedModule, $relatedId, $uid = 0)
{
$result = false;
$uid = empty($uid) ? Ibos::app()->user->uid : $uid;
$condition = "relatedmodule=:relatedmodule AND relatedid=:relatedid";
$params = array(":relatedmodule" => $relatedModule, ":relatedid" => $relatedId);
$vote = Vote::model()->fetch($condition, $params);
if (!empty($vote)) {
$voteid = $vote["voteid"];
$voteItemList = VoteItem::model()->fetchAll("voteid=:voteid", array(":voteid" => $voteid));
foreach ($voteItemList as $voteItem) {
$itemid = $voteItem["itemid"];
$itemCountList = VoteItemCount::model()->fetchAll("itemid=:itemid", array(":itemid" => $itemid));
if (!empty($itemCountList) && 0 < count($itemCountList)) {
foreach ($itemCountList as $itemCount) {
if ($itemCount["uid"] == $uid) {
$result = true;
break;
}
}
}
}
}
return $result;
}
示例7: getNews
public function getNews($id)
{
$gUid = Ibos::app()->user->uid;
$article = Article::model()->fetchByPk($id);
$attribute = ICArticle::getShowData($article);
return $attribute;
}
示例8: actionIndex
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);
}
}
示例9: getData
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;
}
}
示例10: actionSearch
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);
}
示例11: handleListData
protected function handleListData(&$list)
{
foreach ($list as &$ver) {
$ver["value"] = $ver["id"];
$ver["text"] = Ibos::lang("Form version text", "", array("{num}" => $ver["mark"], "{date}" => date("Y-m-d H:i:s", $ver["time"])));
}
}
示例12: update
public static function update($cacheName = "")
{
$updateList = empty($cacheName) ? array() : (is_array($cacheName) ? $cacheName : array($cacheName));
if (!$updateList) {
$cacheDir = Ibos::getPathOfAlias(self::CACHE_ALIAS);
$cacheDirHandle = dir($cacheDir);
while ($entry = $cacheDirHandle->read()) {
$isProviderFile = preg_match("/^([\\_\\w]+)CacheProvider\\.php\$/", $entry, $matches) && substr($entry, -4) == ".php" && is_file($cacheDir . "/" . $entry);
if (!in_array($entry, array(".", "..")) && $isProviderFile) {
$class = basename($matches[0], ".php");
if (class_exists($class)) {
Ibos::app()->attachBehavior("onUpdateCache", array("class" => self::CACHE_ALIAS . "." . $class));
}
}
}
} else {
foreach ($updateList as $entry) {
$owner = ucfirst($entry) . "CacheProvider";
if (class_exists($owner)) {
Ibos::app()->attachBehavior("onUpdateCache", array("class" => self::CACHE_ALIAS . "." . $owner));
}
}
}
if (Ibos::app()->hasEventHandler("onUpdateCache")) {
Ibos::app()->raiseEvent("onUpdateCache", new CEvent(Ibos::app()));
}
}
示例13: renderIndex
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;
}
示例14: actionIndex
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);
}
示例15: actionPost
public function actionPost()
{
if (EnvUtil::submitCheck("formhash")) {
$return = array("data" => Ibos::lang("Operation succeed", "message"), "IsSuccess" => true);
if (empty($_POST["touid"])) {
$return["data"] = Ibos::lang("Message receiver cannot be empty");
$return["IsSuccess"] = false;
$this->ajaxReturn($return);
}
if (trim(StringUtil::filterCleanHtml($_POST["content"])) == "") {
$return["data"] = Ibos::lang("Message content cannot be empty");
$return["IsSuccess"] = false;
$this->ajaxReturn($return);
}
$_POST["touid"] = implode(",", StringUtil::getUid($_POST["touid"]));
if (isset($_POST["type"])) {
!in_array($_POST["type"], array(MessageContent::ONE_ON_ONE_CHAT, MessageContent::MULTIPLAYER_CHAT)) && ($_POST["type"] = null);
} else {
$_POST["type"] = null;
}
$_POST["content"] = StringUtil::filterDangerTag($_POST["content"]);
$res = MessageContent::model()->postMessage($_POST, Yii::app()->user->uid);
if ($res) {
$this->ajaxReturn($return);
} else {
$return["IsSuccess"] = false;
$return["data"] = MessageContent::model()->getError("message");
$this->ajaxReturn($return);
}
}
}