Skip to content
Permalink
Browse files

[23] Added function for install all sql patches. Fix subtype menu, if…

… select other param.

Signed-off-by: Ivan <Dfyztimy@list.ru>
  • Loading branch information...
Hantet committed Jul 7, 2010
1 parent 68f852a commit 307e82bd817a6911e590af0acd49f47dc1d47f8b
Showing with 53 additions and 4 deletions.
  1. +5 −3 config.php
  2. +11 −0 index.php
  3. +28 −0 install.php
  4. +1 −0 lib/classes.php
  5. +6 −1 lib/html.php
  6. +1 −0 sql/realmd_bugtracker.sql
  7. +1 −0 sql/updates/realmd_revision_23.sql
@@ -43,14 +43,16 @@ function get($id)
"searchlimit" => 10,
"lang" => 8,
/*##################################################################################################
## Announce of updates
## Admin settings
## CheckVersion: Check new version in git page of project (boolean).
## version: Current version of bug-tracker. Do not change!
## checkdiff: Different in days for recheck updates.
## installquery: Count of query for install. Do not change!
##################################################################################################*/
"CheckVersion" => false,
"version" => 22,
"checkdiff" => 2
"version" => 23,
"checkdiff" => 2,
"installquery" => 212
);
if(in_array($id,array_keys($arr)))
@@ -6,6 +6,7 @@
$body = new body;
$cfg = new config;
$sql = new sql;
if(isset($_COOKIE['wul']) && isset($_COOKIE['wup']) && $_COOKIE['wul'] != '' && $_COOKIE['wup'] != '')
$user = $body->cookies();
@@ -15,6 +16,16 @@
if(isset($_POST['login']) && isset($_POST['passw']) && $user['id'] == "-1")
$body->failedlogin();
if(file_exists("install.php"))
{
if($sql->exe($cfg->get("realmd"),"SELECT 1 FROM `bt_message`"))
$body->block('Внимание!<br><br>Необходимо удалить файл <b>install.php</b> в корневой директории баг-трекера.');
else
$body->install();
$body->end();
exit();
}
if($user['id'] != "-1")
$body->success();
@@ -0,0 +1,28 @@
<?php
require_once("config.php");
require_once("lib/classes.php");
$body = new body;
$cfg = new config;
$sql = new sql;
$str = '';
$fp = fopen('sql/realmd_bugtracker.sql','r');
if($fp)
while(!feof($fp))
$str.= fgets($fp, 999);
$i = 0;
$exp = explode(";",$str);
do
{
if(!$sql->exe($cfg->get("realmd"),$exp[$i]))
break;
$i++;
}while($exp[$i]);
if($i == $cfg->get("installquery"))
echo 'Установка успешно завершена!<br>Выполнено запросов к БД: '.$i.'<br><br>';
else
echo 'При установке возникли ошибки!<br>Успешно выполнено запросов: '.$i.'.<br>Не применившихся запросов: '.($cfg->get("installquery")-$i).'<br><br>';
echo '<a href="index.php">На главную</a>';
?>
@@ -41,6 +41,7 @@ public function PercentList($id=0);
interface html
{
function install();
function send();
function viewall($int);
function viewdate($int);
@@ -43,7 +43,7 @@ public function send()
<tr id="var11" style="display:none;">
<td class="block2">Подтип: </td>
<td align="right">
<select class="input" onchange="next(11)" id="subtype"><option DISABLED SELECTED>--</option>';$main->LoadSubType();echo '<option DISABLED>--</option><option value="-1">Другое</option></select>
<select class="input" onchange="next(11)" id="subtype"><option DISABLED SELECTED>--</option>';$main->LoadSubType();echo '</select>
</td>
</tr>
<tr id="var2" style="display:none;">
@@ -597,6 +597,11 @@ public function cookies()
$main = new main;
return $main->cookies(addslashes($_COOKIE['wul']),addslashes($_COOKIE['wup']));
}
public function install()
{
$main = new main;
$this->block('Здравствуйте!<br><br>Для работы баг-трекера требуется создать несколько таблиц в базе данных.<br><a href="install.php">Начать установку!</a>');
}
public function inject($code)
{
global $user;
@@ -102,6 +102,7 @@ INSERT INTO `bt_status` VALUES ('2', 'Реализация');
INSERT INTO `bt_status` VALUES ('1', 'Решение');
INSERT INTO `bt_status` VALUES ('3', 'Отбракован');
INSERT INTO `bt_status` VALUES ('4', 'Готово');
INSERT INTO `bt_status` VALUES ('5', 'Дубль');

DROP TABLE IF EXISTS `bt_zone_id`;
CREATE TABLE `bt_zone_id` (
@@ -0,0 +1 @@
INSERT INTO `bt_status` (`id`, `name`) VALUES ('5', 'Дубль');

0 comments on commit 307e82b

Please sign in to comment.
You can’t perform that action at this time.