diff --git a/db/update21.7.sql b/db/update21.7.sql index a4a3c4849c..5fcb5df031 100644 --- a/db/update21.7.sql +++ b/db/update21.7.sql @@ -1,11 +1,15 @@ CREATE TABLE IF NOT EXISTS `zt_actionproduct` ( `action` mediumint(8) unsigned NOT NULL, - `product` mediumint(8) unsigned NOT NULL, + `product` mediumint(8) unsigned NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; CREATE INDEX `action_product` ON `zt_actionproduct`(`action`, `product`); -ALTER TABLE `zt_actionrecent` ADD INDEX `vision_date` (`vision`, `date`); ALTER TABLE `zt_actionrecent` DROP INDEX `date`; +ALTER TABLE `zt_actionrecent` ADD INDEX `vision_date` (`vision`, `date`); +ALTER TABLE `zt_actionrecent` ADD INDEX `execution` (`execution`); -ALTER TABLE `zt_action` ADD INDEX `vision_date` (`vision`, `date`); ALTER TABLE `zt_action` DROP INDEX `date`; +ALTER TABLE `zt_action` DROP INDEX `project`; +ALTER TABLE `zt_action` ADD INDEX `vision_date` (`vision`, `date`); +ALTER TABLE `zt_action` ADD INDEX `execution` (`execution`); +ALTER TABLE `zt_action` ADD INDEX `project` (`project`); diff --git a/module/action/model.php b/module/action/model.php index 407fb127d9..c428e75034 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1211,7 +1211,7 @@ class actionModel extends model $docLibList = $this->dao->select('*')->from(TABLE_DOCLIB)->where('id')->in($docLibIdList)->fetchAll('id'); foreach($docLibList as $docLib) { - if(!$this->checkPrivLib($docLib)) unset($docLibList[$lib->id]); + if(!$this->checkPrivLib($docLib)) unset($docLibList[$docLib->id]); } } diff --git a/module/execution/control.php b/module/execution/control.php index 2f13d2ae81..43548b7ece 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2571,6 +2571,8 @@ class execution extends control */ public function dynamic(int $executionID = 0, string $type = 'today', string $param = '', int $recTotal = 0, string $date = '', string $direction = 'next') { + if(empty($type)) $type = 'today'; + /* Save session. */ $uri = $this->app->getURI(true); $this->session->set('productList', $uri, 'product'); diff --git a/module/product/control.php b/module/product/control.php index dc8d3d2478..5a606ae10a 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -497,6 +497,7 @@ class product extends control */ public function dynamic(int $productID = 0, string $type = 'today', int $param = 0, int $recTotal = 0, string $date = '', string $direction = 'next') { + if(empty($type)) $type = 'today'; $this->loadModel('action'); /* Save env data. */ diff --git a/module/project/control.php b/module/project/control.php index d149e07841..2b618570c2 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -747,6 +747,8 @@ class project extends control */ public function dynamic(int $projectID = 0, string $type = 'today', string $param = '', int $recTotal = 0, int $date = 0, string $direction = 'next') { + if(empty($type)) $type = 'today'; + $this->loadModel('execution'); $this->project->setMenu($projectID);