diff --git a/db/update3.3.sql b/db/update3.3.sql index 4c9a17395f..1ff3b23e22 100644 --- a/db/update3.3.sql +++ b/db/update3.3.sql @@ -9,6 +9,7 @@ UPDATE `zt_action` SET `read` = '1'; CREATE TABLE IF NOT EXISTS `zt_webapp` ( `id` mediumint(9) NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL default '0', `appid` mediumint(9) NOT NULL, `module` mediumint(9) NOT NULL, `name` varchar(100) NOT NULL, diff --git a/db/zentao.sql b/db/zentao.sql index ec32d6a6dc..55c512f2d9 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -675,6 +675,7 @@ CREATE TABLE IF NOT EXISTS `zt_userTPL` ( --DROP TABLE IF EXISTS `zt_webapp`; CREATE TABLE IF NOT EXISTS `zt_webapp` ( `id` mediumint(9) NOT NULL auto_increment, + `company` mediumint(8) unsigned NOT NULL default '0', `appid` mediumint(9) NOT NULL, `module` mediumint(9) NOT NULL, `name` varchar(100) NOT NULL, diff --git a/module/webapp/control.php b/module/webapp/control.php index 91311b177f..b58ae91399 100644 --- a/module/webapp/control.php +++ b/module/webapp/control.php @@ -153,7 +153,7 @@ class webapp extends control { if($confirm == 'no') die(js::confirm($this->lang->webapp->confirmDelete, inlink('uninstall', "webappID=$webappID&confirm=yes"))); - $this->dao->delete()->from(TABLE_WEBAPP)->where('id')->eq($webappID)->exec(false); + $this->dao->delete()->from(TABLE_WEBAPP)->where('id')->eq($webappID)->exec(); die(js::reload('parent')); } @@ -166,6 +166,6 @@ class webapp extends control */ public function ajaxAddView($webappID) { - $this->dao->update(TABLE_WEBAPP)->set('views=views+1')->where('id')->eq($webappID)->exec(false); + $this->dao->update(TABLE_WEBAPP)->set('views=views+1')->where('id')->eq($webappID)->exec(); } } diff --git a/module/webapp/model.php b/module/webapp/model.php index fb4f92d4de..9cb9fccacb 100644 --- a/module/webapp/model.php +++ b/module/webapp/model.php @@ -163,7 +163,7 @@ class webappModel extends model { $webapps = $this->dao->select('*')->from(TABLE_WEBAPP) ->beginIF($module != 0)->where('module')->eq($module)->fi() - ->fetchAll($key, false); + ->fetchAll($key); $localIcons = array(); foreach($webapps as $webapp) { @@ -192,7 +192,7 @@ class webappModel extends model */ public function getLocalAppByID($webappID) { - return $this->dao->select('*')->from(TABLE_WEBAPP)->where('id')->eq($webappID)->fetch('', false); + return $this->dao->select('*')->from(TABLE_WEBAPP)->where('id')->eq($webappID)->fetch(); } /** @@ -219,7 +219,7 @@ class webappModel extends model $installWebapp->addedBy = $this->app->user->account; $installWebapp->addedDate = helper::now(); - $this->dao->insert(TABLE_WEBAPP)->data($installWebapp, false)->autocheck()->exec(false); + $this->dao->insert(TABLE_WEBAPP)->data($installWebapp)->autocheck()->exec(); return $this->dao->lastInsertID(); } @@ -233,7 +233,7 @@ class webappModel extends model public function update($webappID) { $data = fixer::input('post')->get(); - $this->dao->update(TABLE_WEBAPP)->data($data, false)->where('id')->eq($webappID)->exec(false); + $this->dao->update(TABLE_WEBAPP)->data($data)->where('id')->eq($webappID)->exec(); } /** @@ -250,17 +250,17 @@ class webappModel extends model ->add('addedDate', helper::now()) ->add('author', $this->app->user->account) ->remove('files')->get(); - $this->dao->insert(TABLE_WEBAPP)->data($data, false) + $this->dao->insert(TABLE_WEBAPP)->data($data) ->autocheck() ->batchCheck($this->config->webapp->create->requiredFields, 'notempty') - ->exec(false); + ->exec(); if(!dao::isError()) { $webappID = $this->dao->lastInsertID(); if($_FILES) { $fileTitle = $this->loadModel('file')->saveUpload('webapp', $webappID); - $this->dao->update(TABLE_WEBAPP)->set('icon')->eq(key($fileTitle))->where('id')->eq($webappID)->exec(false); + $this->dao->update(TABLE_WEBAPP)->set('icon')->eq(key($fileTitle))->where('id')->eq($webappID)->exec(); } return $webappID; }