public function actionIndex() { $config = Yii::app()->setting->get("setting/recruitconfig"); $result = array(); $allFieldRuleType = Regular::model()->fetchAllFieldRuleType(); foreach ($config as $configName => $configValue) { list($visi, $fieldRule) = explode(",", $configValue); $result[$configName]["visi"] = $visi; $result[$configName]["fieldrule"] = $fieldRule; if (in_array($fieldRule, $allFieldRuleType)) { $regular = Regular::model()->fetchFieldRuleByType($fieldRule); } elseif ($fieldRule == "notrequirement") { $regular["type"] = "notrequirement"; $regular["desc"] = Ibos::lang("Not requirement"); } else { $regular["type"] = $regular["desc"] = $fieldRule; } $result[$configName]["regulartype"] = $regular["type"]; $result[$configName]["regulardesc"] = $regular["desc"]; } $notRequirementRegulars = array(array("type" => "notrequirement", "desc" => Ibos::lang("Not requirement"))); $sysRegulars = Regular::model()->fetchAll(); $result["regular"] = array_merge($notRequirementRegulars, $sysRegulars); $this->render("index", array("config" => $result)); }
protected function handleFormItem(&$data) { $p = $data["prcs"]; $processItem = !empty($p["processitem"]) ? explode(",", $p["processitem"]) : array(); $hiddenItem = !empty($p["hiddenitem"]) ? explode(",", $p["hiddenitem"]) : array(); $microItem = !empty($p["processitemauto"]) ? explode(",", $p["processitemauto"]) : array(); $checkField = $checkRule = array(); if (!empty($p["checkitem"])) { $items = explode(",", $p["checkitem"]); foreach ($items as $index => $item) { list($checkField[$index], $checkRule[$index]) = explode("=", $item); } } $data["check"] = $data["prcsItem"] = $data["microItem"] = $data["hiddenItem"] = $data["parentField"] = array(); foreach ($data["structure"] as &$config) { if ($config["data-type"] !== "label") { $title = $config["data-title"]; $id = $config["itemid"]; if (in_array($title, $processItem)) { $data["prcsItem"][] = $id; } if (in_array($title, $microItem)) { $data["microItem"][] = $id; } if (in_array($title, $hiddenItem)) { $data["hiddenItem"][] = $id; } if (in_array($title, $checkField)) { $index = array_search($title, $checkField); $index & ($data["check"][$id] = $checkRule[$index]); } if ($config["data-type"] != "sign") { $data["parentField"][] = $title; } $config["desc"] = $this->getFormFieldDesc($config, $data["lang"]); } } if (strstr($p["processitem"], "[A@],")) { $data["prcsItem"][] = "a"; } if (!empty($data["check"])) { $data["checkStr"] = CJSON::encode($data["check"]); } $data["checkList"] = Regular::model()->fetchAll(); $data["allItemName"] = WfFormUtil::getAllItemName($data["structure"], array(), "[A@],[B@]"); }
private function analysis() { $importType = intval(EnvUtil::getRequest("importType")); if ($importType == 1) { $file = $_FILES["importFile"]; if (0 < $file["error"]) { $this->error("上传失败,失败类型:" . $file["error"], $this->createUrl("resume/index")); } if (!preg_match("/.(txt)\$/i", $file["name"], $match)) { $this->error("不支持的文件类型", $this->createUrl("resume/index")); } if ($match[1] == "txt") { header("Content-Type:text/html;charset=utf-8"); $importContent = file_get_contents($file["tmp_name"]); } } elseif ($importType == 2) { $importContent = EnvUtil::getRequest("importContent"); } $code = strtolower(mb_detect_encoding($importContent, array("ASCII", "UTF-8", "GB2312", "GBK", "BIG5"))); if (($code == "gb2312" || $code == "GBK" || $code == "euc-cn") && $code != CHARSET) { $importContent = iconv($code, CHARSET, $importContent); } $config = AnalysisConfig::getAnalconf(); $analysis = new ResumeAnalysis($importContent, $config); $result = $analysis->parse_content(); $result["gender"] = preg_match("/女/", $result["gender"]) ? 2 : 1; $result["maritalstatus"] = preg_match("/是|已/", $result["maritalstatus"]) ? 1 : 0; $result["workyears"] = $result["workyears"] ? intval($result["workyears"]) + 0 : ""; $result["mobile"] = $result["mobile"] ? $result["mobile"] + 0 : ""; $result["height"] = $result["height"] ? $result["height"] + 0 : ""; $result["weight"] = $result["weight"] ? $result["weight"] + 0 : ""; $result["zipcode"] = $result["zipcode"] ? $result["zipcode"] + 0 : ""; $result["qq"] = $result["qq"] ? intval($result["qq"]) + 0 : ""; if ($result["birthday"]) { $result["birthday"] = date("Y-m-d", strtotime($result["birthday"])); } elseif (!empty($result["age"])) { $result["birthday"] = date("Y") - ($result["age"] + 0) . "-00-00"; } $regulars = Regular::model()->fetchAll(); $params = array("importInfo" => CJSON::encode($result), "sidebar" => $this->getSidebar(), "dashboardConfig" => $this->getDashboardConfig(), "uploadConfig" => AttachUtil::getUploadConfig(), "regulars" => CJSON::encode($regulars)); $params["dashboardConfigToJson"] = CJSON::encode($params["dashboardConfig"]); $this->setPageTitle(Ibos::lang("Add resume")); $this->setPageState("breadCrumbs", array(array("name" => Ibos::lang("Recruitment management"), "url" => $this->createUrl("resume/index")), array("name" => Ibos::lang("Talent management"), "url" => $this->createUrl("resume/index")), array("name" => Ibos::lang("Add resume")))); $this->render("add", $params); }
public static function format(array $values) { return '"' . parent::format($values) . '"'; }