From 31c72cbbe932560de75149b8edc4ea54c60d00ff Mon Sep 17 00:00:00 2001 From: holan20180123 Date: Mon, 23 Aug 2021 09:29:32 +0800 Subject: [PATCH] * Finish task #41768. --- lib/base/dao/dao.class.php | 380 ++++++++++++++--------------- module/install/control.php | 42 +++- module/install/css/step4.css | 8 + module/install/lang/en.php | 45 +++- module/install/lang/zh-cn.php | 33 +++ module/install/view/step3.html.php | 2 +- module/install/view/step4.html.php | 98 ++------ module/install/view/step5.html.php | 62 ++++- module/install/view/step6.html.php | 33 +++ 9 files changed, 408 insertions(+), 295 deletions(-) create mode 100644 module/install/css/step4.css create mode 100644 module/install/view/step6.html.php diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index b5ef91d834..6582467881 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -5,7 +5,7 @@ * * The author disclaims copyright to this source code. In place of * a legal notice, here is a blessing: - * + * * May you do good and not evil. * May you find forgiveness for yourself and forgive others. * May you share freely, never taking more than you give. @@ -14,7 +14,7 @@ /** * DAO类。 * DAO, data access object. - * + * * @package framework */ class baseDAO @@ -29,7 +29,7 @@ class baseDAO /** * 全局对象$app * The global app object. - * + * * @var object * @access public */ @@ -38,7 +38,7 @@ class baseDAO /** * 全局对象$config * The global config object. - * + * * @var object * @access public */ @@ -47,7 +47,7 @@ class baseDAO /** * 全局对象$lang * The global lang object. - * + * * @var object * @access public */ @@ -56,7 +56,7 @@ class baseDAO /** * 全局对象$dbh * The global dbh(database handler) object. - * + * * @var object * @access public */ @@ -65,7 +65,7 @@ class baseDAO /** * 全局对象$slaveDBH。 * The global slaveDBH(database handler) object. - * + * * @var object * @access public */ @@ -74,7 +74,7 @@ class baseDAO /** * sql对象,用于生成sql语句。 * The sql object, used to create the query sql. - * + * * @var object * @access public */ @@ -83,7 +83,7 @@ class baseDAO /** * 正在使用的表。 * The table of current query. - * + * * @var string * @access public */ @@ -92,7 +92,7 @@ class baseDAO /** * $this->table的别名。 * The alias of $this->table. - * + * * @var string * @access public */ @@ -101,7 +101,7 @@ class baseDAO /** * 查询的字段。 * The fields will be returned. - * + * * @var string * @access public */ @@ -110,7 +110,7 @@ class baseDAO /** * 查询模式,raw模式用于正常的select update等sql拼接操作,magic模式用于findByXXX等魔术方法。 * The query mode, raw or magic. - * + * * This var is used to diff dao::from() with sql::from(). * * @var string @@ -139,7 +139,7 @@ class baseDAO /** * 执行的请求,所有的查询都保存在该数组。 * The queries executed. Every query will be saved in this array. - * + * * @var array * @access public */ @@ -148,7 +148,7 @@ class baseDAO /** * 存放错误的数组。 * The errors. - * + * * @var array * @access public */ @@ -157,7 +157,7 @@ class baseDAO /** * 缓存。 * The cache. - * + * * @var array * @access public */ @@ -185,8 +185,8 @@ class baseDAO /** * 设置$table属性。 * Set the $table property. - * - * @param string $table + * + * @param string $table * @access public * @return void */ @@ -198,8 +198,8 @@ class baseDAO /** * 设置$alias属性。 * Set the $alias property. - * - * @param string $alias + * + * @param string $alias * @access public * @return void */ @@ -211,8 +211,8 @@ class baseDAO /** * 设置$fields属性。 * Set the $fields property. - * - * @param string $fields + * + * @param string $fields * @access public * @return void */ @@ -224,8 +224,8 @@ class baseDAO /** * 设置autoLang项。 * Set autoLang item. - * - * @param bool $autoLang + * + * @param bool $autoLang * @access public * @return void */ @@ -238,7 +238,7 @@ class baseDAO /** * 重置属性。 * Reset the vars. - * + * * @access public * @return void */ @@ -257,7 +257,7 @@ class baseDAO /** * 设置请求模式。像findByxxx之类的方法,使用的是magic模式;其他方法使用的是raw模式。 * Set the query mode. If the method if like findByxxx, the mode is magic. Else, the mode is raw. - * + * * @param string $mode magic|raw * @access public * @return void @@ -269,9 +269,9 @@ class baseDAO /** * 设置请求方法:select|update|insert|delete|replace 。 - * Set the query method: select|update|insert|delete|replace - * - * @param string $method + * Set the query method: select|update|insert|delete|replace + * + * @param string $method * @access public * @return void */ @@ -282,8 +282,8 @@ class baseDAO /** * 开始事务。 - * Begin Transaction - * + * Begin Transaction + * * @access public * @return void */ @@ -294,8 +294,8 @@ class baseDAO /** * 事务回滚。 - * Roll back - * + * Roll back + * * @access public * @return void */ @@ -307,7 +307,7 @@ class baseDAO /** * 提交事务。 * Commits a transaction. - * + * * @access public * @return void */ @@ -319,8 +319,8 @@ class baseDAO /** * select方法,调用sql::select()。 * The select method, call sql::select(). - * - * @param string $fields + * + * @param string $fields * @access public * @return object the dao object self. */ @@ -385,7 +385,7 @@ class baseDAO /** * update方法,调用sql::update()。 * The update method, call sql::update(). - * + * * @param string $table * @access public * @return object the dao object self. @@ -402,7 +402,7 @@ class baseDAO /** * delete方法,调用sql::delete()。 * The delete method, call sql::delete(). - * + * * @access public * @return object the dao object self. */ @@ -417,8 +417,8 @@ class baseDAO /** * insert方法,调用sql::insert()。 * The insert method, call sql::insert(). - * - * @param string $table + * + * @param string $table * @access public * @return object the dao object self. */ @@ -434,8 +434,8 @@ class baseDAO /** * replace方法,调用sql::replace()。 * The replace method, call sql::replace(). - * - * @param string $table + * + * @param string $table * @access public * @return object the dao object self. */ @@ -451,12 +451,12 @@ class baseDAO /** * 设置要操作的表。 * Set the from table. - * - * @param string $table + * + * @param string $table * @access public * @return object the dao object self. */ - public function from($table) + public function from($table) { $this->setTable($table); if($this->mode == 'raw') $this->sqlobj->from($table); @@ -466,8 +466,8 @@ class baseDAO /** * 设置字段。 * Set the fields. - * - * @param string $fields + * + * @param string $fields * @access public * @return object the dao object self. */ @@ -480,8 +480,8 @@ class baseDAO /** * 表别名,相当于sql里的AS。(as是php的关键词,使用alias代替) * Alias a table, equal the AS keyword. (Don't use AS, because it's a php keyword.) - * - * @param string $alias + * + * @param string $alias * @access public * @return object the dao object self. */ @@ -495,7 +495,7 @@ class baseDAO /** * 设置需要更新或插入的数据。 * Set the data to update or insert. - * + * * @param object $data the data object or array * @access public * @return object the dao object self. @@ -503,7 +503,7 @@ class baseDAO public function data($data, $skipFields = '') { if(!is_object($data)) $data = (object)$data; - if($this->autoLang and !isset($data->lang)) + if($this->autoLang and !isset($data->lang)) { $data->lang = $this->app->getClientLang(); if(isset($this->app->config->cn2tw) and $this->app->config->cn2tw and $data->lang == 'zh-tw') $data->lang = 'zh-cn'; @@ -519,7 +519,7 @@ class baseDAO /** * 获取sql字符串。 * Get the sql string. - * + * * @access public * @return string the sql string after process. */ @@ -531,7 +531,7 @@ class baseDAO /** * 打印sql字符串。 * Print the sql string. - * + * * @access public * @return void */ @@ -542,9 +542,9 @@ class baseDAO /** * 查看SQL索引。 - * Explain sql. - * - * @param string $sql + * Explain sql. + * + * @param string $sql * @access public * @return void */ @@ -558,7 +558,7 @@ class baseDAO /** * 处理sql语句,替换表和字段。 * Process the sql, replace the table, fields. - * + * * @access public * @return string the sql string after process. */ @@ -566,7 +566,7 @@ class baseDAO { $sql = $this->sqlobj->get(); - /** + /** * 如果是magic模式,处理表和字段。 * If the mode is magic, process the $fields and $table. **/ @@ -626,8 +626,8 @@ class baseDAO /** * 替换sql常量关键字。 * Process the sql keywords, replace the constants to normal. - * - * @param string $sql + * + * @param string $sql * @access public * @return string the sql string. */ @@ -640,11 +640,11 @@ class baseDAO /** * 设置$dbh,数据库连接句柄。 - * Set the dbh. - * + * Set the dbh. + * * You can use like this: $this->dao->dbh($dbh), thus you can handle two database. * - * @param object $dbh + * @param object $dbh * @access public * @return object the dao object self. */ @@ -657,7 +657,7 @@ class baseDAO /** * 执行SQL语句,返回PDOStatement结果集。 * Query the sql, return the statement object. - * + * * @access public * @return object the PDOStatement object. */ @@ -665,7 +665,7 @@ class baseDAO { /* 如果有错误,返回一个空的PDOStatement对象,确保后续方法能够执行。*/ /* If any error, return an empty statement object to make sure the remain method to execute. */ - if(!empty(dao::$errors)) return new PDOStatement(); + if(!empty(dao::$errors)) return new PDOStatement(); if($sql) { @@ -694,7 +694,7 @@ class baseDAO return $this->dbh->query($sql); } } - catch (PDOException $e) + catch (PDOException $e) { $this->sqlError($e); } @@ -731,8 +731,8 @@ class baseDAO /** * 执行SQL。query()会返回stmt对象,该方法只返回更改或删除的记录数。 * Execute the sql. It's different with query(), which return the stmt object. But this not. - * - * @param string $sql + * + * @param string $sql * @access public * @return int the modified or deleted records. 更改或删除的记录数。 */ @@ -756,7 +756,7 @@ class baseDAO $this->reset(); return $this->dbh->exec($sql); } - catch (PDOException $e) + catch (PDOException $e) { $this->sqlError($e); } @@ -767,7 +767,7 @@ class baseDAO /** * 获取一个记录。 * Fetch one record. - * + * * @param string $field 如果已经设置获取的字段,则只返回这个字段的值,否则返回这个记录。 * if the field is set, only return the value of this field, else return this record * @access public @@ -802,7 +802,7 @@ class baseDAO /** * 获取所有记录。 * Fetch all records. - * + * * @param string $keyField 返回以该字段做键的记录 * the key field, thus the return records is keyed by this field * @access public @@ -845,9 +845,9 @@ class baseDAO /** * 获取所有记录并将按照字段分组。 * Fetch all records and group them by one field. - * - * @param string $groupField 分组的字段 the field to group by - * @param string $keyField 键字段 the field of key + * + * @param string $groupField 分组的字段 the field to group by + * @param string $keyField 键字段 the field of key * @access public * @return array the records. */ @@ -883,9 +883,9 @@ class baseDAO * * 如果没有设置参数,用首末两键作为参数。 * If the keyFiled and valueField not set, use the first and last in the record. - * - * @param string $keyField - * @param string $valueField + * + * @param string $keyField + * @param string $valueField * @access public * @return array */ @@ -907,7 +907,7 @@ class baseDAO if(!$ready) { if(empty($keyField)) $keyField = key($row); - if(empty($valueField)) + if(empty($valueField)) { end($row); $valueField = key($row); @@ -925,7 +925,7 @@ class baseDAO /** * 返回最后插入的ID。 * Return the last insert ID. - * + * * @access public * @return int */ @@ -953,7 +953,7 @@ class baseDAO /** * 解析dao的方法名,处理魔术方法。 * Use it to do some convenient queries. - * + * * @param string $funcName the function name to be called * @param array $funcArgs the params * @access public @@ -963,7 +963,7 @@ class baseDAO { $funcName = strtolower($funcName); - /* + /* * 如果是findByxxx,转换为where条件语句。 * findByxxx, xxx as will be in the where. **/ @@ -985,9 +985,9 @@ class baseDAO $this->sqlobj = sql::select('%s')->from('%s')->where($field, $operator, $value); return $this; } - /* + /* * 获取指定个数的记录:fetch10 获取10条记录。 - * Fetch10. + * Fetch10. **/ elseif(strpos($funcName, 'fetch') !== false) { @@ -1005,13 +1005,13 @@ class baseDAO } return $rows; } - /* + /* * 其他的方法,转到sqlobj对象执行。 * Others, call the method in sql class. **/ else { - /* + /* * 使用$arg0, $arg1... 生成调用的参数。 * Create the max counts of sql class methods, and then create $arg0, $arg1... **/ @@ -1029,7 +1029,7 @@ class baseDAO /** * 检查字段是否满足条件。 * Check a filed is satisfied with the check rule. - * + * * @param string $fieldName the field to check * @param string $funcName the check rule * @param string $condition the condition @@ -1038,7 +1038,7 @@ class baseDAO */ public function check($fieldName, $funcName, $condition = '') { - /* + /* * 如果没数据中没有该字段,直接返回。 * If no this field in the data, return. **/ @@ -1063,28 +1063,28 @@ class baseDAO $fieldLabel = isset($lang->$table->$fieldName) ? $lang->$table->$fieldName : $fieldName; $value = isset($this->sqlobj->data->$fieldName) ? $this->sqlobj->data->$fieldName : null; - /* + /* * 检查唯一性。 * Check unique. **/ if($funcName == 'unique') { $args = func_get_args(); - $sql = "SELECT COUNT(*) AS count FROM $this->table WHERE `$fieldName` = " . $this->sqlobj->quote($value); + $sql = "SELECT COUNT(*) AS count FROM $this->table WHERE `$fieldName` = " . $this->sqlobj->quote($value); if($condition) $sql .= ' AND ' . $condition; try { $row = $this->dbh->query($sql)->fetch(); if($row->count != 0) $this->logError($funcName, $fieldName, $fieldLabel, array($value)); } - catch (PDOException $e) + catch (PDOException $e) { $this->sqlError($e); } } else { - /* + /* * 创建参数。 * Create the params. **/ @@ -1110,10 +1110,10 @@ class baseDAO /** * 检查一个字段是否满足条件。 * Check a field, if satisfied with the condition. - * - * @param string $condition - * @param string $fieldName - * @param string $funcName + * + * @param string $condition + * @param string $fieldName + * @param string $funcName * @access public * @return object the dao object self. */ @@ -1132,9 +1132,9 @@ class baseDAO /** * 批量检查字段。 * Batch check some fileds. - * + * * @param string $fields the fields to check, join with , - * @param string $funcName + * @param string $funcName * @access public * @return object the dao object self. */ @@ -1153,10 +1153,10 @@ class baseDAO /** * 批量检查字段是否满足条件。 * Batch check fields on the condition is true. - * - * @param string $condition - * @param string $fields - * @param string $funcName + * + * @param string $condition + * @param string $fields + * @param string $funcName * @access public * @return object the dao object self. */ @@ -1176,7 +1176,7 @@ class baseDAO /** * 根据数据库结构检查字段。 * Check the fields according the the database schema. - * + * * @param string $skipFields fields to skip checking * @access public * @return object the dao object self. @@ -1205,7 +1205,7 @@ class baseDAO /** * 记录错误到日志。 * Log the error. - * + * * module/common/lang中定义了错误提示信息。 * For the error notice, see module/common/lang. * @@ -1261,7 +1261,7 @@ class baseDAO /** * 判断是否有错误。 * Judge any error or not. - * + * * @access public * @return bool */ @@ -1273,7 +1273,7 @@ class baseDAO /** * 获取错误。 * Get the errors. - * + * * @access public * @return array */ @@ -1298,7 +1298,7 @@ class baseDAO /** * 获取表的字段类型。 * Get the defination of fields of the table. - * + * * @access public * @return array */ @@ -1311,7 +1311,7 @@ class baseDAO $rawFields = $this->dbh->query($sql)->fetchAll(); $this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL); } - catch (PDOException $e) + catch (PDOException $e) { $this->sqlError($e); } @@ -1367,8 +1367,8 @@ class baseDAO /** * Process SQL error by code. - * - * @param object $exception + * + * @param object $exception * @access public * @return void */ @@ -1385,7 +1385,7 @@ class baseDAO /** * SQL类。 * The SQL class. - * + * * @package framework */ class baseSQL @@ -1393,14 +1393,14 @@ class baseSQL /** * 所有方法的最大参数个数。 * The max count of params of all methods. - * + * */ const MAX_ARGS = 3; /** * SQL字符串。 * The sql string. - * + * * @var string * @access public */ @@ -1409,7 +1409,7 @@ class baseSQL /** * 全局变量$dbh。 * The global $dbh. - * + * * @var object * @access public */ @@ -1418,7 +1418,7 @@ class baseSQL /** * 更新或插入日期。 * The data to update or insert. - * + * * @var mix * @access public */ @@ -1427,8 +1427,8 @@ class baseSQL /** * 是否是第一次设置。 * Is the first time to call set. - * - * @var bool + * + * @var bool * @access public; */ public $isFirstSet = true; @@ -1436,7 +1436,7 @@ class baseSQL /** * 是否是在条件语句中。 * If in the logic of judge condition or not. - * + * * @var bool * @access public; */ @@ -1445,7 +1445,7 @@ class baseSQL /** * 条件是否为真。 * The condition is true or not. - * + * * @var bool * @access public; */ @@ -1454,7 +1454,7 @@ class baseSQL /** * WHERE条件嵌套小括号标记。 * If in mark or not. - * + * * @var bool * @access public; */ @@ -1464,16 +1464,16 @@ class baseSQL /** * 是否开启特殊字符转义。 * Magic quote or not. - * + * * @var bool * @access public */ - public $magicQuote; + public $magicQuote; /** * 构造方法。 * The construct function. - * + * * @access public * @return void */ @@ -1487,8 +1487,8 @@ class baseSQL /** * 工厂方法。 * The factory method. - * - * @param string $table + * + * @param string $table * @access public * @return object the sql object. */ @@ -1500,8 +1500,8 @@ class baseSQL /** * select语句。 * The sql is select. - * - * @param string $field + * + * @param string $field * @access public * @return object the sql object. */ @@ -1515,8 +1515,8 @@ class baseSQL /** * update语句。 * The sql is update. - * - * @param string $table + * + * @param string $table * @access public * @return object the sql object. */ @@ -1530,8 +1530,8 @@ class baseSQL /** * insert语句。 * The sql is insert. - * - * @param string $table + * + * @param string $table * @access public * @return object the sql object. */ @@ -1545,8 +1545,8 @@ class baseSQL /** * replace语句。 * The sql is replace. - * - * @param string $table + * + * @param string $table * @access public * @return object the sql object. */ @@ -1560,7 +1560,7 @@ class baseSQL /** * delete语句。 * The sql is delete. - * + * * @access public * @return object the sql object. */ @@ -1574,8 +1574,8 @@ class baseSQL /** * 将关联数组转换为sql语句中 `key` = value 的形式。 * Join the data items by key = value. - * - * @param object $data + * + * @param object $data * @param string $skipFields the fields to skip. * @access public * @return object the sql object. @@ -1587,7 +1587,7 @@ class baseSQL foreach($data as $field => $value) { - if(!preg_match('|^\w+$|', $field)) + if(!preg_match('|^\w+$|', $field)) { unset($data->$field); continue; @@ -1604,8 +1604,8 @@ class baseSQL /** * 在左边添加'('。 * Add an '(' at left. - * - * @param int $count + * + * @param int $count * @access public * @return object the sql object. */ @@ -1620,8 +1620,8 @@ class baseSQL /** * 在右边增加')'。 * Add an ')' at right. - * - * @param int $count + * + * @param int $count * @access public * @return object the sql object. */ @@ -1636,8 +1636,8 @@ class baseSQL /** * SET部分。 * The set part. - * - * @param string $set + * + * @param string $set * @access public * @return object the sql object. */ @@ -1660,8 +1660,8 @@ class baseSQL /** * 创建From部分。 * Create the from part. - * - * @param string $table + * + * @param string $table * @access public * @return object the sql object. */ @@ -1674,8 +1674,8 @@ class baseSQL /** * 创建Alias部分,Alias转为AS。 * Create the Alias part. - * - * @param string $alias + * + * @param string $alias * @access public * @return object the sql object. */ @@ -1688,8 +1688,8 @@ class baseSQL /** * 创建LEFT JOIN部分。 * Create the left join part. - * - * @param string $table + * + * @param string $table * @access public * @return object the sql object. */ @@ -1702,8 +1702,8 @@ class baseSQL /** * 创建ON部分。 * Create the on part. - * - * @param string $condition + * + * @param string $condition * @access public * @return object the sql object. */ @@ -1716,8 +1716,8 @@ class baseSQL /** * 开始条件判断。 * Begin condition judge. - * - * @param bool $condition + * + * @param bool $condition * @access public * @return object the sql object. */ @@ -1731,7 +1731,7 @@ class baseSQL /** * 结束条件判断。 * End the condition judge. - * + * * @access public * @return object the sql object. */ @@ -1745,7 +1745,7 @@ class baseSQL /** * 创建WHERE部分。 * Create the where part. - * + * * @param string $arg1 the field name * @param string $arg2 the operator * @param string $arg3 the value @@ -1768,13 +1768,13 @@ class baseSQL if(!$this->inMark) $this->sql .= ' ' . DAO::WHERE ." $condition "; if($this->inMark) $this->sql .= " $condition "; return $this; - } + } /** * 创建AND部分。 * Create the AND part. - * - * @param string $condition + * + * @param string $condition * @access public * @return object the sql object. */ @@ -1789,8 +1789,8 @@ class baseSQL /** * 创建OR部分。 * Create the OR part. - * - * @param bool $condition + * + * @param bool $condition * @access public * @return object the sql object. */ @@ -1804,8 +1804,8 @@ class baseSQL /** * 创建'='部分。 * Create the '='. - * - * @param string $value + * + * @param string $value * @access public * @return object the sql object. */ @@ -1819,8 +1819,8 @@ class baseSQL /** * 创建'!='。 * Create '!='. - * - * @param string $value + * + * @param string $value * @access public * @return void the sql object. */ @@ -1834,8 +1834,8 @@ class baseSQL /** * 创建'>'。 * Create '>'. - * - * @param string $value + * + * @param string $value * @access public * @return object the sql object. */ @@ -1849,8 +1849,8 @@ class baseSQL /** * 创建'>=' * Create '>='. - * - * @param string $value + * + * @param string $value * @access public * @return object the sql object. */ @@ -1864,8 +1864,8 @@ class baseSQL /** * 创建'<'。 * Create '<'. - * - * @param mixed $value + * + * @param mixed $value * @access public * @return object the sql object. */ @@ -1879,8 +1879,8 @@ class baseSQL /** * 创建 '<='。 * Create '<='. - * - * @param mixed $value + * + * @param mixed $value * @access public * @return object the sql object. */ @@ -1894,9 +1894,9 @@ class baseSQL /** * 创建"between and"。 * Create "between and" - * - * @param string $min - * @param string $max + * + * @param string $min + * @param string $max * @access public * @return object the sql object. */ @@ -1912,7 +1912,7 @@ class baseSQL /** * 创建IN部分。 * Create in part. - * + * * @param string|array $ids ','分割的字符串或者数组 list string by ',' or an array * @access public * @return object the sql object. @@ -1927,7 +1927,7 @@ class baseSQL /** * 创建'NOT IN'部分。 * Create not in part. - * + * * @param string|array $ids list string by ',' or an array * @access public * @return object the sql object. @@ -1942,8 +1942,8 @@ class baseSQL /** * 创建LIKE部分。 * Create the like by part. - * - * @param string $string + * + * @param string $string * @access public * @return object the sql object. */ @@ -1957,8 +1957,8 @@ class baseSQL /** * 创建NOT LIKE部分。 * Create the not like by part. - * - * @param string $string + * + * @param string $string * @access public * @return object the sql object. */ @@ -1972,8 +1972,8 @@ class baseSQL /** * 创建ORDER BY部分。 * Create the order by part. - * - * @param string $order + * + * @param string $order * @access public * @return object the sql object. */ @@ -2027,8 +2027,8 @@ class baseSQL /** * 创建LIMIT部分。 * Create the limit part. - * - * @param string $limit + * + * @param string $limit * @access public * @return object the sql object. */ @@ -2051,8 +2051,8 @@ class baseSQL /** * 创建GROUP BY部分。 * Create the groupby part. - * - * @param string $groupBy + * + * @param string $groupBy * @access public * @return object the sql object. */ @@ -2071,8 +2071,8 @@ class baseSQL /** * 创建HAVING部分。 * Create the having part. - * - * @param string $having + * + * @param string $having * @access public * @return object the sql object. */ @@ -2086,7 +2086,7 @@ class baseSQL /** * 获取SQL字符串。 * Get the sql string. - * + * * @access public * @return string */ @@ -2098,8 +2098,8 @@ class baseSQL /** * 对字段加转义。 * Quote a var. - * - * @param mixed $value + * + * @param mixed $value * @access public * @return mixed */ diff --git a/module/install/control.php b/module/install/control.php index 8381d2542a..1e9048a39a 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -167,12 +167,45 @@ class install extends control } /** - * Create company, admin. + * Set system mode. * * @access public * @return void */ public function step4() + { + if(!empty($_POST)) + { + $this->loadModel('setting')->setItem('system.common.global.mode', $this->post->mode); // Update mode. + die(js::locate(inlink('step5'), 'parent')); + } + + $this->app->loadLang('upgrade'); + + if(isset($this->config->bizVersion)) + { + $this->lang->install->introductionContent = sprintf($this->lang->install->introductionContent, $this->lang->bizName, $this->lang->bizName); + } + elseif(isset($this->config->proVersion)) + { + $this->lang->install->introductionContent = sprintf($this->lang->install->introductionContent, $this->lang->proName, $this->lang->proName); + } + else + { + $this->lang->install->introductionContent = sprintf($this->lang->install->introductionContent, $this->lang->pmsName, $this->lang->pmsName); + } + + $this->view->title = $this->lang->install->introduction; + $this->display(); + } + + /** + * Create company, admin. + * + * @access public + * @return void + */ + public function step5() { if(!empty($_POST)) { @@ -183,14 +216,13 @@ class install extends control if(dao::isError()) echo js::alert($this->lang->install->errorImportDemoData); $this->loadModel('setting')->updateVersion($this->config->version); - $this->loadModel('setting')->setItem('system.common.global.mode', $this->post->mode); // update mode $this->loadModel('setting')->setItem('system.common.global.flow', $this->post->flow); $this->loadModel('setting')->setItem('system.common.safe.mode', '1'); $this->loadModel('setting')->setItem('system.common.safe.changeWeak', '1'); $this->loadModel('setting')->setItem('system.common.global.cron', 1); - die(js::locate(inlink('step5'), 'parent')); + die(js::locate(inlink('step6'), 'parent')); } - + $this->app->loadLang('upgrade'); $this->view->title = $this->lang->install->getPriv; @@ -211,7 +243,7 @@ class install extends control * @access public * @return void */ - public function step5() + public function step6() { $this->view->title = $this->lang->install->success; $this->display(); diff --git a/module/install/css/step4.css b/module/install/css/step4.css new file mode 100644 index 0000000000..f164401d3a --- /dev/null +++ b/module/install/css/step4.css @@ -0,0 +1,8 @@ +.block-content {width: 100%;} +.block-content .block-details {width: 45%; display: inline-table; margin-top: 20px;} +.block-content .block-right {margin-left: 5%;} +.block-content .block-details .block-title {font-size: 14px;} +.block-content .block-details i {color: rgb(22, 169, 248); font-size: 20px;} +.introduction-link a {margin: 30px;} +#selectedModeTips, .select-mode {margin-top: 20px;} +.select-mode .radio-inline {margin-right: 30px;} diff --git a/module/install/lang/en.php b/module/install/lang/en.php index 629663eaa9..2856587fe5 100644 --- a/module/install/lang/en.php +++ b/module/install/lang/en.php @@ -40,6 +40,35 @@ Twitter: ZenTao ALM You are installing ZenTao %s. EOT; +global $config; +$lang->install->introduction = "Zentao {$this->config->version} Introduction"; +$lang->install->howToUse = "How do you like to use ZenTao?"; +$lang->install->introductionContent = << +

Welcome to %s

+

ZenTao %s provides two management modes, the classic mode and the program mode. The former is relatively simplified with only two core features, the product and the project, and the latter is a brand-new mode with all the core features. You can choose a mode according to your needs.

+
+

Program

Program is a set of interrelated and coordinated projects. It is at the top and strategic level with multi-level projects.

+
+

Product

+

Product defines "what" and focuses on requirements. You can manage user requirements, software requirements, plans and releases.

+

+
+

Project

+

Project defines "how" and focuses on tasks of the project within the specified time, budget and quality. It is at a campaign level.

+
+
+

Execution

+

Execution are iterations/sprints or stages of a project. The task are done in executions. It is the combat-level management.

+

+
+ + +EOT; + $lang->install->newReleased = "Notice: Official Website has the latest version%s, released on %s."; $lang->install->or = 'Or'; $lang->install->checking = 'System Checkup'; @@ -180,6 +209,9 @@ EOT; $lang->install->product = array('chanzhi', 'zdoo', 'ydisk', 'meshiot'); +$lang->install->modeList['classic'] = 'Classic mode'; +$lang->install->modeList['new'] = 'Program mode'; + $lang->install->promotion = "Products also from EasyCorp:"; $lang->install->chanzhi = new stdclass(); @@ -208,19 +240,6 @@ $lang->install->zdoo->desc = << EOD; - - - - - - - - - - - - - $lang->install->ydisk = new stdclass(); $lang->install->ydisk->name = 'YDisk'; $lang->install->ydisk->logo = 'images/main/ydisk.ico'; diff --git a/module/install/lang/zh-cn.php b/module/install/lang/zh-cn.php index 988abbab0d..cd40fe1f9e 100644 --- a/module/install/lang/zh-cn.php +++ b/module/install/lang/zh-cn.php @@ -40,6 +40,36 @@ $lang->install->links = <<%s。 EOT; +global $config; +$lang->install->introduction = "禅道{$this->config->version}版本功能介绍"; +$lang->install->howToUse = "请问您计划如何使用禅道的新版本呢"; +$lang->install->introductionContent = << +

尊敬的用户您好,欢迎您使用禅道%s。

+

禅道%s提供了两种使用模式, 一种是精典管理模式,功能较为精简,提供了产品和项目两个核心功能;另一种是全新项目集管理模式,具备所有核心功能。如下是相关功能介绍,您可以根据需要选择使用的模式。

+
+

项目集

项目集是一组相互关联,且被协调管理的项目集合,可以进行多层级管理,属于战略层面的管理。

+
+

产品

+

产品是定义做什么,主要是管理需求,通过产品可以管理用户需求、研发需求、计划以及发布。

+

+
+

项目

+

项目是定义如何做,主要是在规定的时间、预算和质量目标范围内完成项目的各种工作,属于战役层面的管理。

+
+
+

执行

+

我们把一个项目下的多个迭代/冲刺或阶段统称为执行,通过执行去完成项目的任务,属于战斗层面的管理。

+

+
+ + +EOT; + + $lang->install->newReleased = "提示:官网网站已有最新版本%s, 发布日期于 %s。"; $lang->install->or = '或者'; $lang->install->checking = '系统检查'; @@ -180,6 +210,9 @@ EOT; $lang->install->product = array('chanzhi', 'zdoo', 'xuanxuan', 'ydisk', 'meshiot'); +$lang->install->modeList['classic'] = '经典管理模式'; +$lang->install->modeList['new'] = '全新项目集管理模式'; + $lang->install->promotion = "为您推荐易软天创旗下其他产品:"; $lang->install->chanzhi = new stdclass(); diff --git a/module/install/view/step3.html.php b/module/install/view/step3.html.php index cfd76d0011..b447670166 100644 --- a/module/install/view/step3.html.php +++ b/module/install/view/step3.html.php @@ -77,7 +77,7 @@ EOT; ?> - + diff --git a/module/install/view/step4.html.php b/module/install/view/step4.html.php index b44e26980c..c29651d1ec 100644 --- a/module/install/view/step4.html.php +++ b/module/install/view/step4.html.php @@ -1,90 +1,34 @@ - * @package ZenTaoPMS - * @version $Id: step4.html.php 4129 2013-01-18 01:58:14Z wwccss $ + * @author Yuchun Li + * @package install + * @version $Id$ + * @link http://www.zentao.net */ ?> -
-