|
@@ -9,6 +9,7 @@ Doo::loadClass('numofperact');
|
|
|
Doo::loadClass('measureauditact');
|
|
|
Doo::loadClass('itemmeasurenum');
|
|
|
Doo::loadClass('itemfile');
|
|
|
+Doo::loadClass('attachment');
|
|
|
|
|
|
/* * proDetail
|
|
|
* MainController
|
|
@@ -20,7 +21,7 @@ Doo::loadClass('itemfile');
|
|
|
class ProjectController extends DooController
|
|
|
{
|
|
|
|
|
|
- private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审批</span>', 'checking' => '<span class = "colOrange">审批中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>'), $itemmeasurenum, $itemfle;
|
|
|
+ private $data, $auth, $attfile, $profile, $project, $contractact, $actmeasure, $measureauditact, $numofperact, $statusArray = array('uncheck' => '<span class = "colGray">未审批</span>', 'checking' => '<span class = "colOrange">审批中</span>', 'checked' => '<span class = "colGreen">审批通过</span>', 'checkno' => '<span class = "colRed">审批不通过</span>'), $itemmeasurenum, $itemfle, $att;
|
|
|
|
|
|
public function beforeRun($resource, $action)
|
|
|
{
|
|
@@ -46,6 +47,7 @@ class ProjectController extends DooController
|
|
|
$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'] = 'p';
|
|
|
$this->data['user'] = $this->profile->getProWithUid($this->auth->getUid());
|
|
@@ -355,6 +357,29 @@ class ProjectController extends DooController
|
|
|
|
|
|
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) {
|
|
@@ -489,6 +514,19 @@ class ProjectController extends DooController
|
|
|
$this->render('w-project-section-files-recover', $this->data, TRUE);
|
|
|
}
|
|
|
|
|
|
+ function getItemFileHistory()
|
|
|
+ {
|
|
|
+ if ($this->params['iaid']) {
|
|
|
+ $iaidArray = $this->itemfle->getItemFile($this->params['iaid']);
|
|
|
+ if ($iaidArray['oldiaid'] > 0) {
|
|
|
+ $oldiaidArray = $this->itemfle->getFileHistory($iaidArray['oldiaid']);
|
|
|
+ foreach ($oldiaidArray as $k => $v) {
|
|
|
+ $htmlstr = '<div class="media"><div class="pull-left"><h4>#1</h4></div><div class="media-body"><h5>陈特 上传于 2016-10-10 10:10</h5><a href="#" target="_blank">QQ截图20160629164352.png</a></div></div>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Function fNumber($number)
|
|
|
{
|
|
|
if ($number == '')
|
|
@@ -680,26 +718,6 @@ class ProjectController extends DooController
|
|
|
$this->render('welcome', $this->data);
|
|
|
}
|
|
|
|
|
|
- public function prolist()
|
|
|
- {
|
|
|
-// if (!$this->auth->isLoggedIn())
|
|
|
-// return Doo::conf()->APP_URL;
|
|
|
-// $proArray = new stdClass();
|
|
|
-// $jsonpath = pathinfo($this->attfile->getMaxRow()['filepath']);
|
|
|
-// $extPathdir = Doo::conf()->SITE_PATH . $jsonpath['dirname'] . '/' . $jsonpath['filename'];
|
|
|
-// if ($handle = opendir($extPathdir)) {
|
|
|
-// while (false !== ($file = readdir($handle))) {
|
|
|
-// $filename = pathinfo($file);
|
|
|
-// if ($filename['extension'] == 'json')
|
|
|
-// $proArray = json_decode(file_get_contents($extPathdir . '/' . $file));
|
|
|
-// }
|
|
|
-// closedir($handle);
|
|
|
-// }
|
|
|
-// $this->data['proArray'] = null;
|
|
|
- $this->render('s-project
|
|
|
-
|
|
|
- ', $this->data);
|
|
|
- }
|
|
|
|
|
|
// ajax提取密码名称
|
|
|
public function getAjaxSection()
|
|
@@ -709,6 +727,11 @@ class ProjectController extends DooController
|
|
|
echo json_encode($_POST);
|
|
|
}
|
|
|
|
|
|
+ function upItemFile($fildname, $param = 'doc, docx, xls, xlsx, png, zip')
|
|
|
+ {
|
|
|
+ $this->att->setUploadDir();
|
|
|
+ return $this->att->uploadMut($fildname, $param);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
?>
|