From 2f58499feeef2998bedd013a32b51b6a0011ebb9 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Tue, 28 Dec 2021 16:26:08 +0800 Subject: [PATCH] * Fix bugs for compatible 8.0. --- module/design/control.php | 2 +- module/program/model.php | 2 +- module/project/model.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/design/control.php b/module/design/control.php index 129deb37be..cc945d7328 100644 --- a/module/design/control.php +++ b/module/design/control.php @@ -78,7 +78,7 @@ class design extends control /* Print top and right actions. */ $this->lang->TRActions = '
'; - if($this->config->maxVersion and common::hasPriv('design', 'submit')) + if(isset($this->config->maxVersion) and common::hasPriv('design', 'submit')) { $this->lang->TRActions .= '
'; $this->lang->TRActions .= html::a($this->createLink('design', 'submit', "productID=$productID", '', true), " {$this->lang->design->submit}", '', "class='btn btn-secondary iframe'"); diff --git a/module/program/model.php b/module/program/model.php index 30b797bdf2..37b5617434 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -589,7 +589,7 @@ class programModel extends model ->setDefault('openedDate', helper::now()) ->setIF($this->post->acl == 'open', 'whitelist', '') ->setIF($this->post->delta == 999, 'end', LONG_TIME) - ->setIF($this->post->budget != 0, 'budget', round($this->post->budget, 2)) + ->setIF($this->post->budget != 0, 'budget', round((float)$this->post->budget, 2)) ->add('type', 'program') ->join('whitelist', ',') ->stripTags($this->config->program->editor->create['id'], $this->config->allowedTags) diff --git a/module/project/model.php b/module/project/model.php index d1f2bb0a88..7993bec39c 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -763,7 +763,7 @@ class projectModel extends model ->setIF($this->post->delta == 999, 'end', LONG_TIME) ->setIF($this->post->delta == 999, 'days', 0) ->setIF($this->post->acl == 'open', 'whitelist', '') - ->setIF($this->post->budget != 0, 'budget', round($this->post->budget, 2)) + ->setIF($this->post->budget != 0, 'budget', round((float)$this->post->budget, 2)) ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', helper::now()) ->setDefault('team', substr($this->post->name, 0, 30))