1
0

modeAction.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php
  2. class modeClassAction extends ActionNot
  3. {
  4. public function init123Action()
  5. {
  6. $aid = (int)$this->get('adminid');
  7. $token = $this->get('token');
  8. $aid = m('login')->autologin($aid, $token);
  9. if($aid==0){
  10. $this->mweblogin(1);
  11. }
  12. $this->getlogin(1);
  13. }
  14. public function initAction()
  15. {
  16. $this->mweblogin(0);
  17. }
  18. public function defaultAction()
  19. {
  20. $fn = $this->get('fn');
  21. $title = $this->rock->jm->base64decode($this->get('title'));
  22. if($title!='')$this->title = $title;
  23. $path = P.'/task/mode/html/'.$fn.'.html';
  24. if(!file_exists($path))exit('not found '.$fn.'');
  25. $this->displayfile = $path;
  26. }
  27. //移动端页面详情
  28. public function xAction()
  29. {
  30. $num = $this->get('modenum');
  31. if($num=='')$num=$this->get('num');
  32. $mid = (int)$this->get('mid');
  33. if($num=='' || $mid==0)exit('无效请求');
  34. $arr = m('flow')->getdatalog($num, $mid, 1);
  35. $pagetitle = $arr['title'];
  36. $this->title = $arr['title'];
  37. if($pagetitle=='')$pagetitle = $arr['modename'];
  38. $this->smartydata['arr'] = $arr;
  39. $spagepath = P.'/flow/page/viewpage_'.$num.'_1.html';
  40. if(!file_exists($spagepath))$spagepath = P.'/flow/page/viewpage_'.$num.'.html';
  41. if(!file_exists($spagepath)){
  42. $spagepath = '';
  43. }
  44. $this->smartydata['spagepath'] = $spagepath;
  45. $this->smartydata['pagetitle'] = $pagetitle;
  46. $inputjspath = P.'/flow/input/inputjs/mode_'.$num.'.js';
  47. if(!file_exists($inputjspath)){
  48. $inputjspath = '';
  49. }
  50. $this->smartydata['inputjspath'] = $inputjspath;
  51. $this->assign('inputobj', c('input'));
  52. $jswxsdk = '0';
  53. if($this->rock->web=='wxbro' && !isempt($this->option->getval('weixinqy_corpid')))$jswxsdk='1';
  54. $this->assign('jswxsdk', $jswxsdk);
  55. }
  56. //pc端页面详情
  57. public function pAction()
  58. {
  59. $num = $this->get('modenum');
  60. if($num=='')$num=$this->get('num');
  61. $mid = (int)$this->get('mid');
  62. if($num=='' || $mid==0)exit('无效请求');
  63. $stype = $this->get('stype');
  64. $arr = m('flow')->getdatalog($num, $mid, 0);
  65. $pagetitle = $arr['title'];
  66. $this->title = $arr['title'];
  67. if($pagetitle=='')$pagetitle = $arr['modename'];
  68. $this->smartydata['arr'] = $arr;
  69. $spagepath = P.'/flow/page/viewpage_'.$num.'_0.html';
  70. if(!file_exists($spagepath))$spagepath = P.'/flow/page/viewpage_'.$num.'.html';
  71. if(!file_exists($spagepath)){
  72. $spagepath = '';
  73. }
  74. $this->smartydata['spagepath'] = $spagepath;
  75. $this->smartydata['pagetitle'] = $pagetitle;
  76. $this->assign('stype', $stype);
  77. if($stype=='word'){
  78. m('file')->fileheader($arr['modename'].'.doc');
  79. }
  80. $this->smartydata['bordercolor'] = getconfig('bcolorxiang', '#888888');
  81. $inputjspath = P.'/flow/input/inputjs/mode_'.$num.'.js';
  82. if(!file_exists($inputjspath)){
  83. $inputjspath = '';
  84. }
  85. $this->smartydata['inputjspath'] = $inputjspath;
  86. $this->smartydata['xiangwidth'] = $this->option->getval('xiangwidth', 700);
  87. $issetprint = file_exists(''.P.'/flow/page/view_'.$num.'_2.html');
  88. if(COMPANYNUM && !$issetprint)$issetprint = file_exists(''.P.'/flow/page/view_'.$num.'_'.COMPANYNUM.'_2.html');
  89. $this->smartydata['issetprint'] = $issetprint;
  90. $this->assign('inputobj', c('input'));
  91. }
  92. //下载
  93. public function downAction()
  94. {
  95. $this->display = false;
  96. $id = (int)$this->jm->gettoken('id');
  97. m('file')->show($id);
  98. }
  99. //打印的
  100. public function tAction()
  101. {
  102. $num = $this->get('modenum');
  103. if($num=='')$num=$this->get('num');
  104. $mid = (int)$this->get('mid');
  105. if($num=='' || $mid==0)exit('无效请求');
  106. $stype = $this->get('stype');
  107. $path = ''.P.'/flow/page/view_'.$num.'_2.html';
  108. if(COMPANYNUM && !file_exists($path))$path = ''.P.'/flow/page/view_'.$num.'_'.COMPANYNUM.'_2.html';
  109. if(!file_exists($path))return '没有设置打印模版';
  110. $arr = m('flow')->initflow($num, $mid)->getdatalog(0, 2);
  111. $pagetitle = $arr['title'];
  112. $this->title = $arr['title'];
  113. if($pagetitle=='')$pagetitle = $arr['modename'];
  114. $this->smartydata['arr'] = $arr;
  115. $spagepath = P.'/flow/page/viewpage_'.$num.'_2.html';
  116. if(!file_exists($spagepath))$spagepath = P.'/flow/page/viewpage_'.$num.'.html';
  117. if(!file_exists($spagepath)){
  118. $spagepath = '';
  119. }
  120. $this->smartydata['spagepath'] = $spagepath;
  121. $this->smartydata['pagetitle'] = $pagetitle;
  122. $this->assign('stype', $stype);
  123. $this->assign('printlx', $this->get('printlx'));
  124. if($stype=='word'){
  125. m('file')->fileheader($arr['modename'].'.doc');
  126. }
  127. $this->smartydata['xiangwidth'] = $this->option->getval('xiangwidth', 700);
  128. }
  129. //导出页面
  130. public function eAction()
  131. {
  132. $num = $this->get('num');
  133. $event = $this->get('event');
  134. $stype = $this->get('stype');
  135. $arr = m('flow')->printexecl($num, $event);
  136. $this->title = $arr['moders']['name'];
  137. $urlstr = '?a=e&num='.$num.'&event='.$event.'';
  138. $this->assign('arr', $arr);
  139. $this->assign('urlstr', $urlstr);
  140. $this->assign('stype', $stype);
  141. if($stype!=''){
  142. $filename = $this->title;
  143. header('Content-type:application/vnd.ms-excel');
  144. header('Content-disposition:attachment;filename='.iconv("utf-8","gb2312",$filename).'.'.$stype.'');
  145. }
  146. }
  147. //邮件上打开详情
  148. public function aAction()
  149. {
  150. $num = $this->get('num');
  151. $mid = $this->get('mid');
  152. $act = 'p';
  153. if($this->rock->ismobile())$act='x';
  154. $url = 'task.php?a='.$act.'&num='.$num.'&mid='.$mid.'';
  155. $this->rock->location($url);
  156. }
  157. }
粤ICP备19079148号