|
@@ -478,10 +478,10 @@ class inputAction extends Action
|
|
|
$oldrs = m($moders['table'])->getone($mid);
|
|
|
$this->rs = $oldrs;
|
|
|
$this->gongsiarr = array();
|
|
|
-
|
|
|
- $fieldarr = m('flow_element')->getrows("`mid`='$modeid' and `iszb`=0 $stwhe",'fields,fieldstype,id,name,dev,data,isbt,islu,attr,iszb,issou,gongsi,placeholder,lens','`sort`');
|
|
|
+
|
|
|
+ $fieldarr = m('flow_element')->getrows("`mid`='$modeid' and `iszb`=0 $stwhe",'fields,fieldstype,name,dev,data,isbt,islu,attr,iszb,issou,gongsi,placeholder,lens','`sort`');
|
|
|
$fieldarr = $this->flow->flowfieldarr($fieldarr, $this->ismobile);
|
|
|
-
|
|
|
+
|
|
|
$modelu = '';
|
|
|
$fieldstypearr = array();
|
|
|
foreach($fieldarr as $k=>$rs){
|
|
@@ -502,7 +502,7 @@ class inputAction extends Action
|
|
|
$this->fieldarr[$rs['fields']] = $rs;
|
|
|
if($rs['islu']==1)$fieldstypearr[] = $rs['fieldstype'];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
$this->smartydata['fieldsjson'] = json_encode($fieldarr);
|
|
|
$this->moders = $moders;
|
|
|
$zbshu = 0;
|
|
@@ -512,7 +512,6 @@ class inputAction extends Action
|
|
|
$zbshu = count($tableas);
|
|
|
}
|
|
|
$path = ''.P.'/flow/page/input_'.$num.'.html';
|
|
|
-
|
|
|
if(COMPANYNUM){
|
|
|
$path1 = ''.P.'/flow/page/input_'.$num.'_'.COMPANYNUM.'.html';
|
|
|
if(file_exists($path1))$path = $path1;
|
|
@@ -522,7 +521,6 @@ class inputAction extends Action
|
|
|
|
|
|
$isupfile = 0;
|
|
|
$nameaas = explode(',', $moders['names']); //子表名
|
|
|
-
|
|
|
//PC端
|
|
|
if($this->ismobile==0){
|
|
|
$content = $pclucont;
|
|
@@ -566,7 +564,7 @@ class inputAction extends Action
|
|
|
$this->actclss->rs = $this->rs;
|
|
|
$this->actclss->ismobile= $this->ismobile;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//初始表单插件元素
|
|
|
$this->fieldarrall = $this->fieldarr;
|
|
|
$this->inputobj = c('input');
|
|
@@ -582,9 +580,8 @@ class inputAction extends Action
|
|
|
$this->fieldarrall['base_name'] = array('name'=>arrvalue($chufarr,'base_name','申请人'));
|
|
|
$this->fieldarrall['base_deptname'] = array('name'=>arrvalue($chufarr,'base_deptname','申请人部门'));
|
|
|
$this->fieldarrall['file_content'] = array('name'=>arrvalue($chufarr,'file_content','相关文件'));
|
|
|
-
|
|
|
+
|
|
|
preg_match_all('/\{(.*?)\}/', $content, $list);
|
|
|
-
|
|
|
foreach($list[1] as $k=>$nrs){
|
|
|
$str = $this->inputobj->getfieldcont($nrs, $this->actclss);
|
|
|
$content = str_replace('{'.$nrs.'}', $str, $content);
|
|
@@ -653,11 +650,14 @@ class inputAction extends Action
|
|
|
$this->smartydata['mid'] = $mid;
|
|
|
$this->smartydata['isflow'] = $isflow;
|
|
|
$this->smartydata['showtype'] = $this->get('showtype');
|
|
|
+
|
|
|
$this->smartydata['zbnamearr'] = $nameaas;
|
|
|
$this->smartydata['zbshu'] = $zbshu;//子表数
|
|
|
$this->smartydata['isupfile'] = $isupfile;//是否有上传
|
|
|
$this->assign('inputobj', c('input'));
|
|
|
|
|
|
+
|
|
|
+
|
|
|
$this->smartydata['course'] = $course;
|
|
|
$inpwhere = $this->flow->inputwidth;
|
|
|
if($inpwhere<200)$inpwhere = $this->option->getval('inputwidth', 750);
|
|
@@ -827,19 +827,19 @@ class inputAction extends Action
|
|
|
$barr['souarr'] = $this->flow->flowsearchfields();
|
|
|
$rows = $this->flow->viewjinfields($rows);//禁看字段处理
|
|
|
$farrl = array();
|
|
|
- foreach($this->flow->fieldsarra as $k2=>$rs2){
|
|
|
- if($rs2['fieldstype']=='uploadimg')$farrl[$rs2['fields']]=$rs2['fieldstype'];
|
|
|
- }
|
|
|
-
|
|
|
+ foreach ($this->flow->fieldsarra as $k2 => $rs2) {
|
|
|
+ $farrl[$rs2['fields']] = $rs2['fieldstype'];
|
|
|
+ }
|
|
|
+
|
|
|
if($rows)foreach($rows as $k1=>$rs1){
|
|
|
foreach($farrl as $fid=>$flx){
|
|
|
if(isset($rs1[$fid])){
|
|
|
$val = $rs1[$fid];
|
|
|
- if($flx=='uploadimg'){
|
|
|
- $val = $this->rock->gethttppath($val);
|
|
|
- $rows[$k1][$fid] = $val;
|
|
|
- //if($this->flow->modeid>92)$val='<img src="'.$val.'" height="60">';
|
|
|
- }
|
|
|
+ if ($flx == 'uploadimg') {
|
|
|
+ $rows[$k1][$fid] = $this->rock->gethttppath($val);
|
|
|
+ }
|
|
|
+ //单独处理列表字段
|
|
|
+ $rows[$k1][$fid] = $this->handleRows($val, $fid, $flx, $table);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1134,6 +1134,62 @@ class inputAction extends Action
|
|
|
}
|
|
|
return 'ok';
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 作者: qiuzijian
|
|
|
+ * 注释: 单独处理列表字段
|
|
|
+ * @param $val 字段值
|
|
|
+ * @param $fid 字段名
|
|
|
+ * @param $flx 字段类型
|
|
|
+ * @param $table 对应表
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function handleRows($val, $fid, $flx, $table)
|
|
|
+ {
|
|
|
+ $flow_set = m('flow_set')->getone("`table`='" . $table . "'");
|
|
|
+ $flow_element = m('flow_element')->getone("`mid`=" . $flow_set['id'] . " and `fields`='" . $fid . "'");
|
|
|
+
|
|
|
+ //radio处理数据选项展示
|
|
|
+ if ($flx == 'uploadimg' && in_array($flx, ['radio', 'select']) && strstr($flow_element['data'], '|')) {
|
|
|
+ $data = explode(',', $flow_element['data']);
|
|
|
+ $data_split = [];
|
|
|
+ foreach ($data as $dv) {
|
|
|
+ $data_split[explode('|', $dv)[0]] = explode('|', $dv)[1];
|
|
|
+ }
|
|
|
+ $val = $data_split[$val];
|
|
|
+ }
|
|
|
+
|
|
|
+ //uploadimg处理数据选项展示
|
|
|
+ if ($flx == 'uploadimg' && $fid == 'picture') {
|
|
|
+ $val = '<img src="' . $this->rock->gethttppath($val) . '" height="60">';
|
|
|
+ }
|
|
|
+
|
|
|
+ //拼图模块分类方法getClassifyList处理
|
|
|
+ if ($flow_element['data'] == 'getClassifyList') {
|
|
|
+ $query = m('ptfl')->getone('`id`=' . $val);
|
|
|
+ $val = $query['title'];
|
|
|
+ }
|
|
|
+
|
|
|
+ //拼图模块分类方法getSpecialList处理
|
|
|
+ if ($flow_element['data'] == 'getSpecialList') {
|
|
|
+ $query = m('ptzt')->getone('`id`=' . $val);
|
|
|
+ $val = $query['name'];
|
|
|
+ }
|
|
|
+
|
|
|
+ //拼图模块员工编号字段staff_num处理
|
|
|
+ if ($fid == 'staff_num') {
|
|
|
+ $query = m('admin')->getone("`num`='" . $val . "'");
|
|
|
+ $val = $query['name'];
|
|
|
+ }
|
|
|
+
|
|
|
+ //拼图模块员工编号字段picture_id处理
|
|
|
+ if ($fid == 'picture_id') {
|
|
|
+ $query = m('tpsc')->getone('`id`=' . $val);
|
|
|
+ $val = '<img src="' . $this->rock->gethttppath($query['picture']) . '" height="60">';
|
|
|
+ }
|
|
|
+
|
|
|
+ return $val;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class inputClassAction extends inputAction{}
|