diff --git a/Makefile b/Makefile index 583a790dda..a040894b5b 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,8 @@ zentaoxx: cp -r xuan/xxb/module/im zentaoxx/module/ cp -r xuan/xxb/module/client zentaoxx/module/ cp -r xuan/xxb/module/license zentaoxx/module/ + cp -r xuan/xxb/module/owt zentaoxx/module/ + cp xuan/xxb/apischeme.json zentaoxx/ mkdir -p zentaoxx/module/common/view cp -r xuan/xxb/module/common/view/header.modal.html.php zentaoxx/module/common/view cp -r xuan/xxb/module/common/view/marked.html.php zentaoxx/module/common/view @@ -79,9 +81,6 @@ zentaoxx: cp -r xuan/xxb/module/action/ext zentaoxx/module/action cp -r xuan/xxb/config/ext/xxb.php zentaoxx/config/ext/ cp -r xuan/xxb/config/ext/maps.php zentaoxx/config/ext/ - cp -r xuan/xxb/apischeme.json zentaoxx/ - cp $(XUANPATH)/xxb/config/ext/maps.php zentaoxx/config/ext/ - cp $(XUANPATH)/xxb/apischeme.json zentaoxx/ cp -r xuanxuan/config/* zentaoxx/config/ cp -r xuanxuan/module/* zentaoxx/module/ cp -r xuanxuan/www/* zentaoxx/www/ diff --git a/db/zentao.sql b/db/zentao.sql index abb15224af..3144399922 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1138,23 +1138,6 @@ CREATE TABLE IF NOT EXISTS `zt_repo` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; --- DROP TABLE IF EXISTS `zt_relation`; -CREATE TABLE `zt_relation` ( - `id` int(8) NOT NULL AUTO_INCREMENT PRIMARY KEY, - `program` mediumint(8) NOT NULL, - `product` mediumint(8) NOT NULL, - `project` mediumint(8) NOT NULL, - `AType` char(30) NOT NULL, - `AID` mediumint(8) NOT NULL, - `AVersion` char(30) NOT NULL, - `relation` char(30) NOT NULL, - `BType` char(30) NOT NULL, - `BID` mediumint(8) NOT NULL, - `BVersion` char(30) NOT NULL, - `extra` char(30) NOT NULL, - UNIQUE KEY `relation` (`relation`,`AType`,`BType`, `AID`, `BID`) -) ENGINE='MyISAM' DEFAULT CHARSET=utf8; - -- DROP TABLE IF EXISTS `zt_repobranch`; CREATE TABLE IF NOT EXISTS `zt_repobranch` ( `repo` mediumint(8) unsigned NOT NULL, diff --git a/framework/base/router.class.php b/framework/base/router.class.php index ed768a633a..10604d95a2 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1378,7 +1378,7 @@ class baseRouter if(empty($extFiles) and empty($hookFiles)) return $mainModelFile; /* 计算合并之后的modelFile路径。Compute the merged model file path. */ - $extModelPrefix = ($siteExtended and !empty($this->siteCode)) ? $this->siteCode{0} . DS . $this->siteCode : ''; + $extModelPrefix = ($siteExtended and !empty($this->siteCode)) ? $this->siteCode[0] . DS . $this->siteCode : ''; $mergedModelDir = $this->getTmpRoot() . 'model' . DS . ($extModelPrefix ? $extModelPrefix . DS : ''); $mergedModelFile = $mergedModelDir . $moduleName . '.php'; if(!is_dir($mergedModelDir)) mkdir($mergedModelDir, 0755, true); diff --git a/lib/purifier/HTMLPurifier/ChildDef/Custom.php b/lib/purifier/HTMLPurifier/ChildDef/Custom.php index 1047cd8e8b..cc84d89908 100644 --- a/lib/purifier/HTMLPurifier/ChildDef/Custom.php +++ b/lib/purifier/HTMLPurifier/ChildDef/Custom.php @@ -45,7 +45,7 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef protected function _compileRegex() { $raw = str_replace(' ', '', $this->dtd_regex); - if ($raw{0} != '(') { + if ($raw[0] != '(') { $raw = "($raw)"; } $el = '[#a-zA-Z0-9_.-]+'; diff --git a/lib/purifier/HTMLPurifier/TagTransform/Font.php b/lib/purifier/HTMLPurifier/TagTransform/Font.php index 2a186515e2..99e01658cc 100644 --- a/lib/purifier/HTMLPurifier/TagTransform/Font.php +++ b/lib/purifier/HTMLPurifier/TagTransform/Font.php @@ -75,7 +75,7 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform if (isset($attr['size'])) { // normalize large numbers if ($attr['size'] !== '') { - if ($attr['size']{0} == '+' || $attr['size']{0} == '-') { + if ($attr['size'][0] == '+' || $attr['size'][0] == '-') { $size = (int)$attr['size']; if ($size < -2) { $attr['size'] = '-2'; diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index 2478569f16..304c9dbce3 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -124,7 +124,7 @@ class GitRepo $branches = array(); foreach($list as $localBranch) { - if($localBranch{0} == '*') $localBranch = substr($localBranch, 1); + if($localBranch[0] == '*') $localBranch = substr($localBranch, 1); $localBranch = trim($localBranch); if(empty($localBranch))continue; @@ -216,7 +216,7 @@ class GitRepo foreach($list as $line) { if(empty($line)) continue; - if($line{0} == '^') $line = substr($line, 1); + if($line[0] == '^') $line = substr($line, 1); preg_match('/^([0-9a-f]{39,40})\s.*\((\S+)\s+([\d-]+)\s(.*)\s(\d+)\)(.*)$/U', $line, $matches); if(isset($matches[1]) and $matches[1] != $revision) @@ -385,7 +385,7 @@ class GitRepo $line = $lines[$i]; if(strpos($line, '\ No newline at end of file') === 0)continue; - $sign = empty($line) ? '' : $line{0}; + $sign = empty($line) ? '' : $line[0]; if($sign == '-' and $newFile) $sign = '+'; $type = $sign != '-' ? $sign == '+' ? 'new' : 'all' : 'old'; if($sign == '-' || $sign == '+') diff --git a/lib/scm/subversion.class.php b/lib/scm/subversion.class.php index 02e80e8efa..5eb5b3a63f 100644 --- a/lib/scm/subversion.class.php +++ b/lib/scm/subversion.class.php @@ -447,7 +447,7 @@ class Subversion $line = $lines[$i]; if(strpos($line, '\ No newline at end of file') === 0)continue; - $sign = empty($line) ? '' : $line{0}; + $sign = empty($line) ? '' : $line[0]; $type = $sign != '-' ? $sign == '+' ? 'new' : 'all' : 'old'; if($sign == '-' || $sign == '+') $line = substr_replace($line, ' ', 1, 0); diff --git a/lib/wechatapi/wechatapi.class.php b/lib/wechatapi/wechatapi.class.php index 80b4f1bb93..ae867a2117 100644 --- a/lib/wechatapi/wechatapi.class.php +++ b/lib/wechatapi/wechatapi.class.php @@ -59,7 +59,7 @@ class wechatapi $users = array(); foreach($depts->deptList as $deptID) { - $response = $this->queryAPI($this->apiUrl . "user/simplelist?access_token={$this->token}&department_id={$deptID}"); + $response = $this->queryAPI($this->apiUrl . "user/simplelist?access_token={$this->token}&department_id={$deptID}&fetch_child=1"); if($this->isError()) return array('result' => 'fail', 'message' => $this->errors); foreach($response->userlist as $user) $users[$user->name] = $user->userid; diff --git a/lib/zdb/zdb.class.php b/lib/zdb/zdb.class.php index d70f4526f9..fa199a9bad 100644 --- a/lib/zdb/zdb.class.php +++ b/lib/zdb/zdb.class.php @@ -34,10 +34,11 @@ class zdb /** * Get all tables. * + * @param string $type if type is 'base', just get base table. * @access public * @return array */ - public function getAllTables() + public function getAllTables($type = 'base') { global $config; @@ -46,15 +47,42 @@ class zdb while($table = $stmt->fetch(PDO::FETCH_ASSOC)) { $tableType = strtolower($table['Table_type']); - if($tableType != 'base table') continue; + if($type == 'base' and $tableType != 'base table') continue; $tableName = $table["Tables_in_{$config->db->name}"]; - $allTables[$tableName] = 'table'; + $allTables[$tableName] = $tableType == 'base table' ? 'table' : $tableType; } return $allTables; } + /** + * Get table fields. + * + * @param string $table + * @access public + * @return array + */ + public function getTableFields($table) + { + try + { + $this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER); + $sql = "DESC $table"; + $rawFields = $this->dbh->query($sql)->fetchAll(); + $this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL); + } + catch (PDOException $e) + { + $this->sqlError($e); + } + + $fields = array(); + foreach($rawFields as $field) $fields[$field->field] = $field; + + return $fields; + } + /** * Dump db. * diff --git a/module/admin/lang/en.php b/module/admin/lang/en.php index f14dd5fb21..09de919c0c 100644 --- a/module/admin/lang/en.php +++ b/module/admin/lang/en.php @@ -20,7 +20,7 @@ $lang->admin->certifyMobile = 'Verify your cellphone'; $lang->admin->certifyEmail = 'Verify your Email'; $lang->admin->ztCompany = 'Verify your company'; $lang->admin->captcha = 'Verification Code'; -$lang->admin->getCaptcha = 'Get Verification Code'; +$lang->admin->getCaptcha = 'Send Verification Code'; $lang->admin->api = 'API'; $lang->admin->log = 'Log'; @@ -40,13 +40,13 @@ $lang->admin->notice->int = "『%s』should be a positive integer."; $lang->admin->register = new stdclass(); $lang->admin->register->common = 'Bind Account'; -$lang->admin->register->caption = 'Register in ZenTao Community'; -$lang->admin->register->click = 'Register here'; +$lang->admin->register->caption = 'ZenTao Community Signup'; +$lang->admin->register->click = 'Sign Up'; $lang->admin->register->lblAccount = '>= 3 letters and numbers'; $lang->admin->register->lblPasswd = '>= 6 letters and numbers'; -$lang->admin->register->submit = 'Register'; +$lang->admin->register->submit = 'Submit'; $lang->admin->register->bind = "Bind Exsiting Account"; -$lang->admin->register->success = "You have registered!"; +$lang->admin->register->success = "You have signed up!"; $lang->admin->bind = new stdclass(); $lang->admin->bind->caption = 'Link Account'; diff --git a/module/block/view/dashboard.html.php b/module/block/view/dashboard.html.php index 4dffa8ede6..9e5d990734 100644 --- a/module/block/view/dashboard.html.php +++ b/module/block/view/dashboard.html.php @@ -122,14 +122,11 @@ $(function() }) - -global->showAnnual) and empty($config->global->annualShowed)):?> -app->loadLang('misc');?> -var myModalTrigger = new $.zui.ModalTrigger({title:'misc->showAnnual;?>', custom: function(){return misc->annualDesc, $this->createLink('report', 'annualData')));?>}}); +loadModel('misc')->getRemind();?> + +var myModalTrigger = new $.zui.ModalTrigger({title:'misc->remind;?>', custom: function(){return }, width:'600px'}); var result = myModalTrigger.show(); $('#showAnnual').click(function(){myModalTrigger.close()}); -loadModel('setting')->setItem("{$this->app->user->account}.common.global.annualShowed", 1);?> - getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> diff --git a/module/bug/css/x.view.css b/module/bug/css/x.view.css index c1881f1868..794f3a1db3 100644 --- a/module/bug/css/x.view.css +++ b/module/bug/css/x.view.css @@ -1,4 +1,5 @@ .main-actions{display: none} +#main{margin-bottom: 40px;} #mainMenu .pull-left>a{display: none} #mainMenu .pull-left .divider{display: none} #mainMenu .pull-right{display: none} diff --git a/module/ci/lang/en.php b/module/ci/lang/en.php index 4d1df04d71..6222482a2a 100644 --- a/module/ci/lang/en.php +++ b/module/ci/lang/en.php @@ -1,6 +1,6 @@ ci->common = 'CI'; -$lang->ci->job = 'Construction'; +$lang->ci->job = 'Job'; $lang->ci->task = 'Task'; $lang->ci->history = 'History'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index b8365751bf..38172618cb 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -335,7 +335,7 @@ $lang->caselib->menu->caselib = array('link' => 'Case Library|caselib|browse|l $lang->ci = new stdclass(); $lang->ci->menu = new stdclass(); $lang->ci->menu->code = array('link' => 'Code|repo|browse|repoID=%s', 'alias' => 'diff,view,revision,log,blame,showsynccomment'); -$lang->ci->menu->build = array('link' => 'Build|job|browse', 'subModule' => 'compile,job'); +$lang->ci->menu->build = array('link' => 'Compile|job|browse', 'subModule' => 'compile,job'); $lang->ci->menu->jenkins = array('link' => 'Jenkins|jenkins|browse', 'alias' => 'create,edit'); $lang->ci->menu->maintain = array('link' => 'Repo|repo|maintain', 'alias' => 'create,edit'); $lang->ci->menu->rules = array('link' => 'Rule|repo|setrules'); diff --git a/module/common/model.php b/module/common/model.php index 81d73d047f..d7e3093493 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -254,7 +254,7 @@ class commonModel extends model { echo '
  • '; echo ""; - echo "
    " . strtoupper($app->user->account{0}) . "
    \n"; + echo "
    " . strtoupper($app->user->account[0]) . "
    \n"; echo ''; if(isset($lang->user->roleList[$app->user->role])) echo ''; echo '
  • '; @@ -1766,7 +1766,7 @@ EOD; { $timestamp = $queryString['time']; if(strlen($timestamp) > 10) $timestamp = substr($timestamp, 0, 10); - if(strlen($timestamp) != 10 or $timestamp{0} >= '4') $this->response('ERROR_TIMESTAMP'); + if(strlen($timestamp) != 10 or $timestamp[0] >= '4') $this->response('ERROR_TIMESTAMP'); $result = $this->get->token == md5($entry->code . $entry->key . $queryString['time']); if($result) diff --git a/module/common/view/footer.html.php b/module/common/view/footer.html.php index e628acd883..79f40320d2 100755 --- a/module/common/view/footer.html.php +++ b/module/common/view/footer.html.php @@ -22,7 +22,7 @@ $.initSidebar();
    loadModel('score')->getNotice(); ?>
    diff --git a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php index 3db68b4d13..812c3366e6 100644 --- a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php @@ -20,12 +20,13 @@ class xuanxuanMessage extends messageModel $onlybody = isset($_GET['onlybody']) ? $_GET['onlybody'] : ''; unset($_GET['onlybody']); $url = $server . helper::createLink($objectType, 'view', "id=$objectID", 'html'); + $url = "xxc:openInApp/zentao-integrated/" . urlencode($url); $target = ''; if(!empty($object->assignedTo)) $target .= $object->assignedTo; if(!empty($object->mailto)) $target .= ",{$object->mailto}"; $target = trim($target, ','); - $target = $this->dao->select('id')->from(TABLE_USER)->where('account')->in($target)->fetchAll('id'); + $target = $this->dao->select('id')->from(TABLE_USER)->where('account')->in($target)->andWhere('account')->ne($this->app->user->account)->fetchAll('id'); $target = array_keys($target); if($target) $this->loadModel('im')->messageCreateNotify($target, $text, '', '', 'text', $url, array(), array('id' => 'zentao', 'realname' => $this->lang->message->sender, 'name' => $this->lang->message->sender)); diff --git a/xuanxuan/module/misc/ext/control/ajaxsetclientconfig.php b/xuanxuan/module/misc/ext/control/ajaxsetclientconfig.php index 96909d81f0..ae7ab7d0b7 100755 --- a/xuanxuan/module/misc/ext/control/ajaxsetclientconfig.php +++ b/xuanxuan/module/misc/ext/control/ajaxsetclientconfig.php @@ -23,6 +23,8 @@ class myMisc extends misc $loginInfo->ui->defaultUser = new stdclass(); $loginInfo->ui->defaultUser->server = common::getSysURL();; $loginInfo->ui->defaultUser->account = $this->app->user->account; + $loginInfo->ui->defaultUser->lock = false; + $loginInfo->ui->defaultUser->ldap = true; $loginInfo = json_encode($loginInfo); $loginFile = $clientDir . 'config.json'; diff --git a/xuanxuan/module/misc/ext/control/downloadclient.php b/xuanxuan/module/misc/ext/control/downloadclient.php index 9fe18da434..4bd42471e4 100755 --- a/xuanxuan/module/misc/ext/control/downloadclient.php +++ b/xuanxuan/module/misc/ext/control/downloadclient.php @@ -56,6 +56,27 @@ class myMisc extends misc if(strpos($agentOS, 'Mac') !== false) $os = 'mac64'; $this->view->os = $os; + + /* Finish task #6990. */ + $releasedInDB = $this->dao->select('*')->from(TABLE_IM_CLIENT)->where('version')->eq($this->config->xuanxuan->version)->andWhere('status')->eq('released')->fetch(); + if($releasedInDB) + { + foreach(json_decode($releasedInDB->downloads) as $osKey => $link) + { + if(empty($link)) + { + $osKey = strtolower(str_replace('zip', '', $osKey)); + if(isset($this->lang->misc->client->osList[$osKey])) + { + unset($this->lang->misc->client->osList[$osKey]); + } + elseif(strpos($osKey, 'mac') === 0) + { + unset($this->lang->misc->client->osList['mac64']); + } + } + } + } } if($action == 'getPackage') diff --git a/xuanxuan/module/misc/ext/model/xuanxuan.php b/xuanxuan/module/misc/ext/model/xuanxuan.php new file mode 100644 index 0000000000..bfcc0502ba --- /dev/null +++ b/xuanxuan/module/misc/ext/model/xuanxuan.php @@ -0,0 +1,24 @@ +app->loadLang('im'); + $account = str_replace('.', '_', $this->app->user->account); + $xxInstalled = $account . 'installed'; + + if(isset($this->config->xxserver->installed) and $this->config->xuanxuan->turnon and !isset($this->config->xxclient->$xxInstalled) and $this->config->global->flow == 'full') + { + $remind .= '

    ' . $this->lang->im->zentaoClient . '

    '; + $remind .= '

    ' . $this->lang->im->xxClientConfirm . '

    '; + $this->loadModel('setting')->setItem("system.common.xxclient.{$account}installed", 1); + } + elseif(!isset($this->config->xxserver->noticed) and $this->app->user->admin and $this->config->global->flow == 'full' and $this->config->$module->block->initVersion >= '2') + { + $remind .= '

    ' . $this->lang->im->zentaoClient . '

    '; + $remind .= '

    ' . $this->lang->im->xxServerConfirm . '

    '; + $this->loadModel('setting')->setItem("system.common.xxserver.noticed", 1); + } + + return $remind; +} diff --git a/xuanxuan/module/setting/ext/control/xuanxuan.php b/xuanxuan/module/setting/ext/control/xuanxuan.php index eadc14652a..af584d0d93 100644 --- a/xuanxuan/module/setting/ext/control/xuanxuan.php +++ b/xuanxuan/module/setting/ext/control/xuanxuan.php @@ -24,9 +24,9 @@ class setting extends control if(empty($setting->sslkey)) $errors['sslkey'] = $this->lang->im->errorSSLKey; } - if($setting->turnon and strpos($setting->server, '127.0.0.1') !== false) $errors[] = $this->lang->im->xxdServerError; - if(strpos($setting->server, 'https://') !== 0 and strpos($setting->server, 'http://') !== 0) $errors[] = $this->lang->im->xxdSchemeError; - if(empty($setting->server)) $errors[] = $this->lang->im->xxdServerEmpty; + if($setting->turnon and strpos($setting->server, '127.0.0.1') !== false) $errors['server'] = $this->lang->im->xxdServerError; + if(strpos($setting->server, 'https://') !== 0 and strpos($setting->server, 'http://') !== 0) $errors['server'] = $this->lang->im->xxdSchemeError; + if(empty($setting->server)) $errors['server'] = $this->lang->im->xxdServerEmpty; if($errors) $this->send(array('result' => 'fail', 'message' => $errors));