Browse Source

短信类型增加

NoNZero 8 years ago
parent
commit
dbe3a48238

+ 2 - 0
protected/config/routes.conf.php

@@ -37,6 +37,7 @@ $route['*']['/rproject/:pid/section/:pmid/detail'] = array('RProjectController',
 $route['*']['/rproject/:pmid/measure/detail'] = array('RProjectController', 'proMeasure');
 $route['*']['/rproject/:pid/section/:pmid/report/:mpid'] = array('RProjectController', 'proReport');
 $route['*']['/rproject/:pid/section/:pmid/files'] = array('RProjectController', 'proSectionFiles');
+$route['*']['/rproject/:pid/section/:pmid/files/recover'] = array('RProjectController', 'proSectionFilesRecover');
 $route['*']['/rproject/section/get/:iaid/attachment'] = array('RProjectController', 'proSectionGetFiles');
 $route['*']['/rproject/:pid/section/:pmid/files/num/:numpname/page/:pindex'] = array('RProjectController', 'proSectionFiles');
 $route['*']['/rproject/:pid/section/:pmid/files/user/:userid/page/:pindex'] = array('RProjectController', 'proSectionFiles');
@@ -53,6 +54,7 @@ $route['get']['/sproject/:pid/section'] = array('SProjectController', 'proSectio
 $route['get']['/sproject/:pid/section/:pmid/detail'] = array('SProjectController', 'proDetail');
 $route['get']['/sproject/:pid/section/measure'] = array('SProjectController', 'proMeasure');
 $route['*']['/sproject/:pid/section/:pmid/files'] = array('SProjectController', 'proSectionFiles');
+$route['*']['/sproject/:pid/section/:pmid/files/recover'] = array('SProjectController', 'proSectionFilesRecover');
 $route['*']['/sproject/:pid/section/:pmid/files/num/:numpname/page/:pindex'] = array('SProjectController', 'proSectionFiles');
 $route['*']['/sproject/:pid/section/:pmid/files/user/:userid/page/:pindex'] = array('SProjectController', 'proSectionFiles');
 $route['*']['/sproject/:pid/section/:pmid/files/num/:numpname/user/:userid/page/:pindex'] = array('SProjectController', 'proSectionFiles');

+ 96 - 0
protected/controller/RProjectController.php

@@ -366,6 +366,102 @@ class RProjectController extends DooController
     }
 
 
+    function proSectionFilesRecover()
+    {
+        if (isset($_POST['optype']) && ($_POST['optype'] == 'reconvery') && isset($_POST['imnid'])) {
+            $imnidArray = $this->itemmeasurenum->getRowData($_POST['imnid']);
+            if ($imnidArray['iaid'] > 0) {
+                $this->itemmeasurenum->recoveryDel($_POST['imnid']);
+                echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
+                die();
+            }
+        }
+
+        if (isset($_POST['optype']) && ($_POST['optype'] == 'del') && isset($_POST['imnid'])) {
+            $imnidArray = $this->itemmeasurenum->getRowData($_POST['imnid']);
+            if ($imnidArray['iaid'] > 0) {
+                $iaidArray = $this->itemfle->getItemFile($imnidArray['iaid']);
+                if ($iaidArray['ownerid'] == $this->auth->getUid()) {
+                    $this->itemfle->delItem($imnidArray['iaid']);
+                    $this->itemmeasurenum->delItemIAID($imnidArray['iaid']);
+                    echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
+                    die();
+                } else {
+                    echo json_encode(array('status' => 2), JSON_UNESCAPED_UNICODE);
+                    die();
+                }
+            }
+        }
+
+        // 面包屑导航项目
+        $this->data['currproArray'] = $this->data['allproArray'] = NULL;
+        $this->data['pmid'] = $this->params['pmid'];
+        $allproArray = $this->project->getAll();
+        foreach ($allproArray as $kk => $vv) {
+            if ($vv['pid'] == $this->params['pid']) {
+                $this->data['currproArray'] = $vv;
+            } else {
+                $this->data['allproArray'][] = $vv;
+            }
+        }
+// 面包屑导航合同
+        $conArray = $this->contractact->getAll();
+        $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
+        if (isset($measureArray['stid'])) {
+            foreach ($conArray as $kkk => $vvv) {
+                if ($vvv['stid'] == $measureArray['stid']) {
+                    $this->data['currconArray'] = $vvv;
+                } else {
+                    if ($vvv['pid'] == $this->params['pid'])
+                        $this->data['allconArray'][] = $vvv;
+                }
+            }
+        } else {
+            $this->data['currconArray'] = $this->data['allconArray'] = NULL;
+        }
+// 面包屑导航标段
+        $this->data['curractmeasureArray'] = NULL;
+        $this->data['allactmeasureArray'] = [];
+        $actmeasureArray = $this->actmeasure->getAll();
+        foreach ($actmeasureArray as $kkkk => $vvvv) {
+            if ($vvvv['stid'] == $measureArray['stid']) {
+                if (($vvvv['pmid'] == $this->params['pmid'])) {
+                    $this->data['curractmeasureArray'] = $vvvv;
+                } else {
+                    $this->data['allactmeasureArray'][] = $vvvv;
+                }
+            }
+        }
+
+        $totalArchive = $this->itemmeasurenum->getCount($this->params['pmid']);
+        if ($totalArchive) {
+            $pager = new DooPager(Doo::conf()->APP_URL . 'rproject/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/recover/page', $totalArchive, 1, 1);
+            $pager->setCss('', 'disabled', 'active');
+            if (isset($this->params['pindex']))
+                $pager->paginate(intval($this->params['pindex']));
+            else
+                $pager->paginate(1);
+            $this->data['itemMeasureArray'] = $this->itemmeasurenum->getItemMeasureNumDel($pager->limit, $this->params['pmid']);
+        }
+
+
+        foreach ($this->data['itemMeasureArray'] as $k => $v) {
+            $fileArray = $this->itemfle->getItemFile($v['iaid']);
+            $this->data['itemMeasureArray'][$k]['realname'] = $this->profile->getProWithUid($v['ownerid'])['name'];
+            $this->data['itemMeasureArray'][$k]['delname'] = $this->profile->getProWithUid($v['deluid'])['name'];
+            $this->data['itemMeasureArray'][$k]['pmname'] = $this->actmeasure->getRowByPmid($v['pmid'])['pmname'];
+            $this->data['itemMeasureArray'][$k]['filename'] = $fileArray['filename'];
+            $this->data['itemMeasureArray'][$k]['fileext'] = $fileArray['fileext'];
+            $this->data['itemMeasureArray'][$k]['tips'] = $v['tips'];
+            $this->data['itemMeasureArray'][$k]['filepath'] = $fileArray['filepath'];
+        }
+        $this->data['pid'] = $this->params['pid'];
+        $this->data['pmid'] = $this->params['pmid'];
+        $this->data['mpid'] = $this->params['mpid'];
+        $this->data['pager'] = $pager->output;
+        $this->render('r-project-section-files-recover', $this->data, TRUE);
+    }
+
     /**
      * @return actMeasure
      */

+ 96 - 0
protected/controller/SProjectController.php

@@ -434,6 +434,102 @@ class SProjectController extends DooController
         $this->render('s-project-section-files', $this->data, TRUE);
     }
 
+    function proSectionFilesRecover()
+    {
+        if (isset($_POST['optype']) && ($_POST['optype'] == 'reconvery') && isset($_POST['imnid'])) {
+            $imnidArray = $this->itemmeasurenum->getRowData($_POST['imnid']);
+            if ($imnidArray['iaid'] > 0) {
+                $this->itemmeasurenum->recoveryDel($_POST['imnid']);
+                echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
+                die();
+            }
+        }
+
+        if (isset($_POST['optype']) && ($_POST['optype'] == 'del') && isset($_POST['imnid'])) {
+            $imnidArray = $this->itemmeasurenum->getRowData($_POST['imnid']);
+            if ($imnidArray['iaid'] > 0) {
+                $iaidArray = $this->itemfle->getItemFile($imnidArray['iaid']);
+                if ($iaidArray['ownerid'] == $this->auth->getUid()) {
+                    $this->itemfle->delItem($imnidArray['iaid']);
+                    $this->itemmeasurenum->delItemIAID($imnidArray['iaid']);
+                    echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
+                    die();
+                } else {
+                    echo json_encode(array('status' => 2), JSON_UNESCAPED_UNICODE);
+                    die();
+                }
+            }
+        }
+
+        // 面包屑导航项目
+        $this->data['currproArray'] = $this->data['allproArray'] = NULL;
+        $this->data['pmid'] = $this->params['pmid'];
+        $allproArray = $this->project->getAll();
+        foreach ($allproArray as $kk => $vv) {
+            if ($vv['pid'] == $this->params['pid']) {
+                $this->data['currproArray'] = $vv;
+            } else {
+                $this->data['allproArray'][] = $vv;
+            }
+        }
+// 面包屑导航合同
+        $conArray = $this->contractact->getAll();
+        $measureArray = $this->actmeasure->getRowByPmid($this->params['pmid']);
+        if (isset($measureArray['stid'])) {
+            foreach ($conArray as $kkk => $vvv) {
+                if ($vvv['stid'] == $measureArray['stid']) {
+                    $this->data['currconArray'] = $vvv;
+                } else {
+                    if ($vvv['pid'] == $this->params['pid'])
+                        $this->data['allconArray'][] = $vvv;
+                }
+            }
+        } else {
+            $this->data['currconArray'] = $this->data['allconArray'] = NULL;
+        }
+// 面包屑导航标段
+        $this->data['curractmeasureArray'] = NULL;
+        $this->data['allactmeasureArray'] = [];
+        $actmeasureArray = $this->actmeasure->getAll();
+        foreach ($actmeasureArray as $kkkk => $vvvv) {
+            if ($vvvv['stid'] == $measureArray['stid']) {
+                if (($vvvv['pmid'] == $this->params['pmid'])) {
+                    $this->data['curractmeasureArray'] = $vvvv;
+                } else {
+                    $this->data['allactmeasureArray'][] = $vvvv;
+                }
+            }
+        }
+
+        $totalArchive = $this->itemmeasurenum->getCount($this->params['pmid']);
+        if ($totalArchive) {
+            $pager = new DooPager(Doo::conf()->APP_URL . 'sproject/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/recover/page', $totalArchive, 1, 1);
+            $pager->setCss('', 'disabled', 'active');
+            if (isset($this->params['pindex']))
+                $pager->paginate(intval($this->params['pindex']));
+            else
+                $pager->paginate(1);
+            $this->data['itemMeasureArray'] = $this->itemmeasurenum->getItemMeasureNumDel($pager->limit, $this->params['pmid']);
+        }
+
+
+        foreach ($this->data['itemMeasureArray'] as $k => $v) {
+            $fileArray = $this->itemfle->getItemFile($v['iaid']);
+            $this->data['itemMeasureArray'][$k]['realname'] = $this->profile->getProWithUid($v['ownerid'])['name'];
+            $this->data['itemMeasureArray'][$k]['delname'] = $this->profile->getProWithUid($v['deluid'])['name'];
+            $this->data['itemMeasureArray'][$k]['pmname'] = $this->actmeasure->getRowByPmid($v['pmid'])['pmname'];
+            $this->data['itemMeasureArray'][$k]['filename'] = $fileArray['filename'];
+            $this->data['itemMeasureArray'][$k]['fileext'] = $fileArray['fileext'];
+            $this->data['itemMeasureArray'][$k]['tips'] = $v['tips'];
+            $this->data['itemMeasureArray'][$k]['filepath'] = $fileArray['filepath'];
+        }
+        $this->data['pid'] = $this->params['pid'];
+        $this->data['pmid'] = $this->params['pmid'];
+        $this->data['mpid'] = $this->params['mpid'];
+        $this->data['pager'] = $pager->output;
+        $this->render('s-project-section-files-recover', $this->data, TRUE);
+    }
+
 }
 
 ?>

+ 6 - 6
protected/view/r-project-section-files-recover.html

@@ -267,11 +267,11 @@
                 cache: false,
                 contentType: false,
                 data: form_data,
-                url: "/project/{{pid}}/section/{{pmid}}/files",
+                url: "/rproject/{{pid}}/section/{{pmid}}/files",
                 processData: false,
                 success: function (data) {
                     if (data['status'] == 1) {
-                        window.location.href = "{{rootUrl}}project/{{pid}}/section/{{pmid}}/files";
+                        window.location.href = "{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/files";
                     }
                 }
             });
@@ -284,11 +284,11 @@
                 dataType: "json",
                 cache: false,
                 data: {"imnid": imnid, "optype": 'reconvery'},
-                url: "/project/{{pid}}/section/{{pmid}}/files/recover",
+                url: "/rproject/{{pid}}/section/{{pmid}}/files/recover",
                 success: function (data) {
                     if (data['status'] == 1) {
                         $("#file-replace").show();
-                        window.location.href = "{{rootUrl}}project/{{pid}}/section/{{pmid}}/files/recover";
+                        window.location.href = "{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/files/recover";
                     }
                 }
             });
@@ -301,11 +301,11 @@
                 dataType: "json",
                 cache: false,
                 data: {"imnid": imnid, "optype": 'del'},
-                url: "/project/{{pid}}/section/{{pmid}}/files/recover",
+                url: "/rproject/{{pid}}/section/{{pmid}}/files/recover",
                 success: function (data) {
                     if (data['status'] == 1) {
                         $("#file-del").hide();
-                        window.location.href = "{{rootUrl}}project/{{pid}}/section/{{pmid}}/files/recover";
+                        window.location.href = "{{rootUrl}}rproject/{{pid}}/section/{{pmid}}/files/recover";
                     }
                     if (data['status'] == 2) {
                         $("#file-del2").show();

+ 3 - 3
protected/view/r-project-section-files.html

@@ -183,8 +183,8 @@
                                         data-toggle="modal"><i class="icon-time icon-white"></i>历史版本
                                 </button>
                                 &nbsp;&nbsp;&nbsp;&nbsp;
-                                <button id="del_{{itemMeasureArray' value.imnid}}"
-                                        imnid="{{itemMeasureArray' value.imnid}}" class="btn btn-mini btn-danger"
+                                <button id="del"
+                                        imnid="" class="btn btn-mini btn-danger"
                                         type="button" href="#file-del"
                                         data-toggle="modal"><i class="icon-remove icon-white"></i>删除
                                 </button>
@@ -317,7 +317,7 @@
             $("#upimnid").val(imnid);
         });
 
-        $("button[id^='del_']").click(function () {
+        $("#del").click(function () {
             var imnid = $(this).attr('imnid');
             $.ajax({
                 type: "POST",

+ 6 - 6
protected/view/s-project-section-files-recover.html

@@ -267,11 +267,11 @@
                 cache: false,
                 contentType: false,
                 data: form_data,
-                url: "/project/{{pid}}/section/{{pmid}}/files",
+                url: "/sproject/{{pid}}/section/{{pmid}}/files",
                 processData: false,
                 success: function (data) {
                     if (data['status'] == 1) {
-                        window.location.href = "{{rootUrl}}project/{{pid}}/section/{{pmid}}/files";
+                        window.location.href = "{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/files";
                     }
                 }
             });
@@ -284,11 +284,11 @@
                 dataType: "json",
                 cache: false,
                 data: {"imnid": imnid, "optype": 'reconvery'},
-                url: "/project/{{pid}}/section/{{pmid}}/files/recover",
+                url: "/sproject/{{pid}}/section/{{pmid}}/files/recover",
                 success: function (data) {
                     if (data['status'] == 1) {
                         $("#file-replace").show();
-                        window.location.href = "{{rootUrl}}project/{{pid}}/section/{{pmid}}/files/recover";
+                        window.location.href = "{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/files/recover";
                     }
                 }
             });
@@ -301,11 +301,11 @@
                 dataType: "json",
                 cache: false,
                 data: {"imnid": imnid, "optype": 'del'},
-                url: "/project/{{pid}}/section/{{pmid}}/files/recover",
+                url: "/sproject/{{pid}}/section/{{pmid}}/files/recover",
                 success: function (data) {
                     if (data['status'] == 1) {
                         $("#file-del").hide();
-                        window.location.href = "{{rootUrl}}project/{{pid}}/section/{{pmid}}/files/recover";
+                        window.location.href = "{{rootUrl}}sproject/{{pid}}/section/{{pmid}}/files/recover";
                     }
                     if (data['status'] == 2) {
                         $("#file-del2").show();

+ 4 - 4
protected/view/s-project-section-files.html

@@ -85,7 +85,7 @@
                         value="{{owneridArray' value.iaid}}">{{owneridArray' value.name}}</option>
                         <!-- endloop -->
                     </select>
-                    <a href="/rproject/{{pid}}/section/{{pmid}}/files/recover" class="fR">附件回收站</a>
+                    <a href="/sproject/{{pid}}/section/{{pmid}}/files/recover" class="fR">附件回收站</a>
                 </form>
             </div>
             <!--筛选工具-->
@@ -183,8 +183,8 @@
                                         data-toggle="modal"><i class="icon-time icon-white"></i>历史版本
                                 </button>
                                 &nbsp;&nbsp;&nbsp;&nbsp;
-                                <button id="del_{{itemMeasureArray' value.imnid}}"
-                                        imnid="{{itemMeasureArray' value.imnid}}" class="btn btn-mini btn-danger"
+                                <button id="del"
+                                        imnid="" class="btn btn-mini btn-danger"
                                         type="button" href="#file-del"
                                         data-toggle="modal"><i class="icon-remove icon-white"></i>删除
                                 </button>
@@ -317,7 +317,7 @@
             $("#upimnid").val(imnid);
         });
 
-        $("button[id^='del_']").click(function () {
+        $("#del").click(function () {
             var imnid = $(this).attr('imnid');
             $.ajax({
                 type: "POST",

+ 5 - 5
protected/view/w-project-section-files.html

@@ -34,8 +34,7 @@
                         </a>
                         <ul class="dropdown-menu">
                             <!-- loop allconArray -->
-                            <li><a href="{{rootUrl}}project/{{currproArray.pid}}/section">{{allconArray'
-                                value.stname}}</a></li>
+                            <li><a href="{{rootUrl}}project/{{currproArray.pid}}/section">{{allconArray' value.stname}}</a></li>
                             <!-- endloop -->
                         </ul>
                     </li>
@@ -180,8 +179,8 @@
                                         data-toggle="modal"><i class="icon-time icon-white"></i>历史版本
                                 </button>
                                 &nbsp;&nbsp;&nbsp;&nbsp;
-                                <button id="del_{{itemMeasureArray' value.imnid}}"
-                                        imnid="{{itemMeasureArray' value.imnid}}" class="btn btn-mini btn-danger"
+                                <button id="del"
+                                        imnid="" class="btn btn-mini btn-danger"
                                         type="button" href="#file-del"
                                         data-toggle="modal"><i class="icon-remove icon-white"></i>删除
                                 </button>
@@ -307,6 +306,7 @@
             $(".filesDetail").show();
             $("#fid").val(imnid);
             $("#iaid").val(iaid);
+            $("#del").attr("imnid", imnid);
         });
 
         $("a[id^='dropdown_']").click(function () {
@@ -314,7 +314,7 @@
             $("#upimnid").val(imnid);
         });
 
-        $("button[id^='del_']").click(function () {
+        $("#del").click(function () {
             var imnid = $(this).attr('imnid');
             $.ajax({
                 type: "POST",