|
@@ -8,6 +8,10 @@ Doo::loadClass('contractact');
|
|
|
Doo::loadClass('actmeasure');
|
|
|
Doo::loadClass('numofperact');
|
|
|
Doo::loadClass('measureauditact');
|
|
|
+Doo::loadClass('itemmeasurenum');
|
|
|
+Doo::loadClass('itemfile');
|
|
|
+Doo::loadClass('attachment');
|
|
|
+Doo::loadHelper('DooPager');
|
|
|
|
|
|
/**
|
|
|
* MainController
|
|
@@ -15,11 +19,13 @@ Doo::loadClass('measureauditact');
|
|
|
*
|
|
|
* @author darkredz
|
|
|
*/
|
|
|
-class SProjectController extends DooController {
|
|
|
+class SProjectController extends DooController
|
|
|
+{
|
|
|
|
|
|
- private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $measureauditact;
|
|
|
+ private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $numofperact, $measureauditact, $itemmeasurenum, $itemfle, $att;
|
|
|
|
|
|
- public function beforeRun($resource, $action) {
|
|
|
+ public function beforeRun($resource, $action)
|
|
|
+ {
|
|
|
// $uGroups = $this->profile->getProWithUid($this->auth->getUid());
|
|
|
// $falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
|
|
|
// if (!$falg)
|
|
@@ -29,12 +35,13 @@ class SProjectController extends DooController {
|
|
|
$falg = Doo::acl()->isAllowed($uGroups['groups'], $resource, $action);
|
|
|
if (!$falg)
|
|
|
return Doo::acl()->defaultFailedRoute;
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return Doo::acl()->defaultFailedRoute;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function __construct() {
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
$this->auth = new Auth();
|
|
|
$this->attfile = new attFile();
|
|
|
$this->profile = new Profile();
|
|
@@ -43,6 +50,9 @@ class SProjectController extends DooController {
|
|
|
$this->actmeasure = new actMeasure();
|
|
|
$this->numofperact = new NumofperAct();
|
|
|
$this->measureauditact = new MeasureauditAct();
|
|
|
+ $this->itemmeasurenum = new ItemMeasureNumpofper();
|
|
|
+ $this->itemfle = new ItemFile();
|
|
|
+ $this->att = new attachment();
|
|
|
$this->data['rootUrl'] = Doo::conf()->APP_URL;
|
|
|
$this->data['currChannle'] = 's';
|
|
|
$this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
|
|
@@ -58,7 +68,8 @@ class SProjectController extends DooController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function index() {
|
|
|
+ public function index()
|
|
|
+ {
|
|
|
$this->data['conArray'] = NULL;
|
|
|
$conArray = $this->actmeasure->getGroupProject($this->auth->getUid());
|
|
|
if (isset($conArray)) {
|
|
@@ -86,7 +97,8 @@ class SProjectController extends DooController {
|
|
|
$this->render('s-project', $this->data, TRUE);
|
|
|
}
|
|
|
|
|
|
- public function proOverview() {
|
|
|
+ public function proOverview()
|
|
|
+ {
|
|
|
// $this->data['pros'] = $this->project->getAll();
|
|
|
// if (isset($_POST['pname']) && $_POST['pname']) {
|
|
|
// $this->project->insertProject($_POST['pname']);
|
|
@@ -96,7 +108,8 @@ class SProjectController extends DooController {
|
|
|
$this->render('w-project-detail', $this->data);
|
|
|
}
|
|
|
|
|
|
- public function proSection() {
|
|
|
+ public function proSection()
|
|
|
+ {
|
|
|
$proArray = $this->actmeasure->getGroupProject($this->auth->getUid());
|
|
|
foreach ($proArray as $v) {
|
|
|
$pidArray[] = $v['pid'];
|
|
@@ -166,7 +179,8 @@ class SProjectController extends DooController {
|
|
|
$this->render('s-project-section', $this->data, TRUE);
|
|
|
}
|
|
|
|
|
|
- public function proDetail() {
|
|
|
+ public function proDetail()
|
|
|
+ {
|
|
|
$this->data['currproArray'] = $this->data['allproArray'] = NULL;
|
|
|
$proArray = $this->actmeasure->getGroupProject($this->auth->getUid());
|
|
|
foreach ($proArray as $v) {
|
|
@@ -222,12 +236,14 @@ class SProjectController extends DooController {
|
|
|
}
|
|
|
}
|
|
|
$this->data['pid'] = $this->params['pid'];
|
|
|
+ $this->data['pmid'] = $this->params['pmid'];
|
|
|
// 获取当前合同段的期数
|
|
|
// $this->data['allNumArray'] = $this->numofperact->getNumByStid(1);
|
|
|
$this->render('s-project-section-detail', $this->data, TRUE);
|
|
|
}
|
|
|
|
|
|
- public function proMeasure() {
|
|
|
+ public function proMeasure()
|
|
|
+ {
|
|
|
$MpidArray = $this->measureauditact->getRowByMpid(1);
|
|
|
foreach ($MpidArray as $key => $value) {
|
|
|
$uidArray = $value['uid'];
|
|
@@ -236,7 +252,8 @@ class SProjectController extends DooController {
|
|
|
$this->render('s-project-section-measure', $this->data);
|
|
|
}
|
|
|
|
|
|
- Function fNumber($number) {
|
|
|
+ Function fNumber($number)
|
|
|
+ {
|
|
|
if ($number == '')
|
|
|
Return "-";
|
|
|
$nlen = strlen($number);
|
|
@@ -252,7 +269,8 @@ class SProjectController extends DooController {
|
|
|
Return $fNumber;
|
|
|
}
|
|
|
|
|
|
- public function welcome() {
|
|
|
+ public function welcome()
|
|
|
+ {
|
|
|
// if (!$this->auth->isLoggedIn())
|
|
|
// return Doo::conf()->APP_URL;
|
|
|
if ($this->profile->getProWithUid($_SESSION['uid'])['userid'])
|
|
@@ -266,7 +284,8 @@ class SProjectController extends DooController {
|
|
|
$this->render('welcome', $this->data);
|
|
|
}
|
|
|
|
|
|
- public function prolist() {
|
|
|
+ public function prolist()
|
|
|
+ {
|
|
|
// if (!$this->auth->isLoggedIn())
|
|
|
// return Doo::conf()->APP_URL;
|
|
|
// $proArray = new stdClass();
|
|
@@ -284,6 +303,233 @@ class SProjectController extends DooController {
|
|
|
$this->render('s-project', $this->data);
|
|
|
}
|
|
|
|
|
|
+ function proSectionFiles()
|
|
|
+ {
|
|
|
+ if (isset($_POST['optype']) && ($_POST['optype'] == 'replace') && ($_POST['imnid'])) {
|
|
|
+ $imnidArray = $this->itemmeasurenum->getRowData($_POST['imnid']);
|
|
|
+ if ($imnidArray['iaid'] > 0) {
|
|
|
+ $fileArray = $this->upItemFile('file')[0];
|
|
|
+ if (isset($fileArray['filepath'])) {
|
|
|
+ $itemArray = $this->itemfle->getItemFile($imnidArray['iaid']);
|
|
|
+ if (isset($itemArray)) {
|
|
|
+ if ($itemArray['oldiaid'] > 0) {
|
|
|
+ $oldiaid = $itemArray['oldiaid'];
|
|
|
+ } else {
|
|
|
+ $oldiaid = $imnidArray['iaid'];
|
|
|
+ }
|
|
|
+ $postArray = array('ownerid' => $this->auth->getUid(), 'pid' => $itemArray['pid'], 'pmid' => $itemArray['pmid'], 'filename' => $fileArray['filename'], 'filesize' => $fileArray['filesize'], 'fileext' => $fileArray['fileext'], 'filepath' => $fileArray['filepath'], 'oldiaid' => $oldiaid);
|
|
|
+ $iaid = $this->itemfle->insertItemFileRecord($postArray);
|
|
|
+ if ($iaid > 1) {
|
|
|
+ $this->itemmeasurenum->updateIAID($imnidArray['iaid'], $iaid);
|
|
|
+ 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) {
|
|
|
+ $this->itemmeasurenum->updateDeltag($_POST['imnid'], $this->auth->getUid());
|
|
|
+ echo json_encode(array('status' => 1), JSON_UNESCAPED_UNICODE);
|
|
|
+ die();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isset($_POST['filename']) && isset($_POST['filedesc']) && isset($_POST['upimnid'])) {
|
|
|
+ $filename = $_POST['filename'];
|
|
|
+ $filedesc = $_POST['filedesc'];
|
|
|
+ $imnidArray = $this->itemmeasurenum->getRowData($_POST['upimnid']);
|
|
|
+ if ($imnidArray['iaid'] > 0) {
|
|
|
+ $this->itemmeasurenum->updateItemFields($_POST['upimnid'], $filedesc);
|
|
|
+ $this->itemfle->updateItemFields($imnidArray['iaid'], $filename);
|
|
|
+ echo json_encode(array('status' => 1), 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 选取查询
|
|
|
+ $groupArray = $this->numofperact->getGroupByLastOne2($this->params['pmid']);
|
|
|
+ $this->data['groupArray'] = $groupArray;
|
|
|
+ $owneridArray = $this->itemfle->getGroupOwnerid($this->params['pmid']);
|
|
|
+ foreach ($owneridArray as $k => $v) {
|
|
|
+ $this->data['owneridArray'][$k]['name'] = $this->profile->getProWithUid($v['ownerid'])['name'];
|
|
|
+ $this->data['owneridArray'][$k]['iaid'] = $v['iaid'];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+// 分页
|
|
|
+ $totalArchive = $this->itemmeasurenum->getCount($this->params['pmid'], 0, $this->params['numpname'], $this->params['userid']);
|
|
|
+ if ($totalArchive) {
|
|
|
+ if ($this->params['numpname'] && $this->params['userid']) {
|
|
|
+ $pager = new DooPager(Doo::conf()->APP_URL . 'project/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/num/' . $this->params['numpname'] . '/user/' . $this->params['userid'] . '/page', $totalArchive, 30, 100);
|
|
|
+ } elseif ($this->params['numpname']) {
|
|
|
+ $pager = new DooPager(Doo::conf()->APP_URL . 'project/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/num/' . $this->params['numpname'] . '/page', $totalArchive, 30, 100);
|
|
|
+ } elseif ($this->params['userid']) {
|
|
|
+ $pager = new DooPager(Doo::conf()->APP_URL . 'project/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/user/' . $this->params['userid'] . '/page', $totalArchive, 30, 100);
|
|
|
+ } else {
|
|
|
+ $pager = new DooPager(Doo::conf()->APP_URL . 'project/' . $this->params['pmid'] . '/section/' . $this->params['pmid'] . '/files/page', $totalArchive, 30, 100);
|
|
|
+ }
|
|
|
+ $pager->setCss('', 'disabled', 'active');
|
|
|
+ if (isset($this->params['pindex']))
|
|
|
+ $pager->paginate(intval($this->params['pindex']));
|
|
|
+ else
|
|
|
+ $pager->paginate(1);
|
|
|
+ $this->data['itemMeasureArray'] = $this->itemmeasurenum->getItemMeasureNum($this->params['pmid'], $pager->limit, $this->params['numpname'], $this->params['userid']);
|
|
|
+ }
|
|
|
+
|
|
|
+ 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]['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['pid'] = $this->params['pid'];
|
|
|
+ $this->data['pmid'] = $this->params['pmid'];
|
|
|
+ $this->data['mpid'] = $this->params['mpid'];
|
|
|
+ $this->data['user'] = $this->params['userid'];
|
|
|
+ $this->data['num'] = $this->params['numpname'];
|
|
|
+ $this->data['pager'] = $pager->output;
|
|
|
+ $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);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
?>
|