| 1 |
<?php |
| 2 |
$title = "Panel Admina Technicznego"; |
| 3 |
$title1 = $title; |
| 4 |
require_once("includes/head.php"); |
| 5 |
|
| 6 |
/** |
| 7 |
* Get the localization for game |
| 8 |
*/ |
| 9 |
require_once("languages/".$player -> lang."/tech.php"); |
| 10 |
|
| 11 |
if ($player->rank != 'Techniczny') { |
| 12 |
error (NOT_TECH); |
| 13 |
} |
| 14 |
|
| 15 |
/** |
| 16 |
* Reported bugs |
| 17 |
*/ |
| 18 |
if (isset($_GET['view']) && $_GET['view'] == 'bugreport') |
| 19 |
{ |
| 20 |
/** |
| 21 |
* Bugs list |
| 22 |
*/ |
| 23 |
if (!isset($_GET['step'])) |
| 24 |
{ |
| 25 |
$oldFetchMode = $db -> SetFetchMode(ADODB_FETCH_NUM); |
| 26 |
$arrBugs = $db -> GetAll('SELECT `id`, `sender`, `title`, `type`, `location`, `programmer_id` FROM `bugreport` WHERE `resolution`=0 ORDER BY `id`'); |
| 27 |
$db -> SetFetchMode($oldFetchMode); |
| 28 |
$smarty -> assign_by_ref('Bugs', $arrBugs); |
| 29 |
} |
| 30 |
/** |
| 31 |
* Edit bug |
| 32 |
*/ |
| 33 |
else |
| 34 |
{ |
| 35 |
if (!preg_match("#^[1-9][0-9]*$#", $_GET['step'])) |
| 36 |
{ |
| 37 |
error(ERROR); |
| 38 |
} |
| 39 |
$oldFetchMode = $db -> SetFetchMode(ADODB_FETCH_NUM); |
| 40 |
$arrBug = $db -> GetRow('SELECT `id`, `sender`, `title`, `type`, `location`, `desc`, `programmer_id` FROM `bugreport` WHERE `id`='.$_GET['step']); |
| 41 |
if (empty($arrBug)) |
| 42 |
{ |
| 43 |
error(ERROR); |
| 44 |
} |
| 45 |
require_once('includes/bbcode.php'); |
| 46 |
$arrBug[5] = htmltobbcode($arrBug[5]); |
| 47 |
$arrActions = array('fixed', 'notbug', 'workforme', 'moreinfo', 'duplicate'); |
| 48 |
$arrProgrammerName = $db -> GetRow('SELECT `user` FROM `players` WHERE `id`='.$arrBug[6]); |
| 49 |
$db -> SetFetchMode($oldFetchMode); |
| 50 |
if (!empty($arrProgrammerName)) |
| 51 |
{ |
| 52 |
$smarty -> assign_by_ref('Programmer', $arrProgrammerName[0]); |
| 53 |
} |
| 54 |
$strType = $arrBug[3] == 'text' ? BUG_TEXT : BUG_CODE; |
| 55 |
$smarty -> assign_by_ref('Options', $arrOptions); |
| 56 |
$smarty -> assign_by_ref('Actions', $arrActions); |
| 57 |
$smarty -> assign_by_ref('Bug', $arrBug); |
| 58 |
$smarty -> assign_by_ref('BugType', $strType); |
| 59 |
$smarty -> assign('BugMessage', ''); |
| 60 |
if (isset($_POST['programmer']) && $_POST['programmer'] == 1) |
| 61 |
{ |
| 62 |
$db -> Execute('UPDATE `bugreport` SET `programmer_id`='.$player -> id.' WHERE `id`='.$_GET['step']); |
| 63 |
$smarty -> assign('BugMessage', BUG_TAKEN.'<br /><br />'); |
| 64 |
} |
| 65 |
if (isset($_POST['programmer']) && $_POST['programmer'] == 0) |
| 66 |
{ |
| 67 |
$db -> Execute('UPDATE `bugreport` SET `programmer_id`=0 WHERE `id`='.$_GET['step']); |
| 68 |
$smarty -> assign('BugMessage', BUG_LEFT.'<br />'); |
| 69 |
} |
| 70 |
/** |
| 71 |
* Set bug status |
| 72 |
*/ |
| 73 |
if (isset($_POST['actions'])) |
| 74 |
{ |
| 75 |
if (!in_array($_POST['actions'], $arrActions)) |
| 76 |
{ |
| 77 |
error(ERROR); |
| 78 |
} |
| 79 |
$strInfo = YOUR_BUG.$arrBug[2].B_ID.$_GET['step']; |
| 80 |
$strDate = $db -> DBDate($newdate); |
| 81 |
$intKey = array_search($_POST['actions'], $arrActions); |
| 82 |
switch ($intKey) { |
| 83 |
case 0 : |
| 84 |
$strInfo = $strInfo.HAS_FIXED; |
| 85 |
$strMessage = HAS_FIXED2; |
| 86 |
$strAuthor = '<b><a href="view.php?view='.$player -> id.'">'.$player -> user."</a></b>, ID <b>".$player -> id.'</b>'; |
| 87 |
$strDesc = T_BUG.$strType."): ".$arrBug[2]. REPORTED_BY.$arrBug[1]; |
| 88 |
$db -> Execute("INSERT INTO `changelog` (`author`, `location`, `text`, `date`, `lang`) VALUES('".$strAuthor."', '".$arrBug[4]."', '".$strDesc."', ".$strDate.", '".$player -> lang."')"); |
| 89 |
break; |
| 90 |
case 1 : |
| 91 |
$strInfo = $strInfo.NOT_BUG3; |
| 92 |
$strMessage = NOT_BUG2; |
| 93 |
break; |
| 94 |
case 2 : |
| 95 |
$strInfo = $strInfo.WORK_FOR_ME2; |
| 96 |
$strMessage = WORK_FOR_ME3; |
| 97 |
break; |
| 98 |
case 3 : |
| 99 |
$strInfo = $strInfo.MORE_INFO2; |
| 100 |
$strMessage = MORE_INFO3; |
| 101 |
break; |
| 102 |
case 4 : |
| 103 |
$strInfo = $strInfo.BUG_DOUBLE2; |
| 104 |
$strMessage = BUG_DOUBLE3; |
| 105 |
} |
| 106 |
$db -> Execute("DELETE FROM `bugreport` WHERE `id`=".$_GET['step']); |
| 107 |
if (isset($_POST['bugcomment']) && !empty($_POST['bugcomment'])) |
| 108 |
{ |
| 109 |
$strInfo = $strInfo." <b>".BUG_COMMENT.":</b> ".$_POST['bugcomment']; |
| 110 |
} |
| 111 |
$db -> Execute("INSERT INTO `log` (`owner`, `log`, `czas`) VALUES(".$arrBug[1].", '".$strInfo."', ".$strDate.")"); |
| 112 |
error($strMessage); |
| 113 |
} |
| 114 |
} |
| 115 |
} |
| 116 |
|
| 117 |
if (!isset($_GET['view'])) |
| 118 |
{ |
| 119 |
$_GET['view'] = ''; |
| 120 |
} |
| 121 |
if (!isset($_GET['step'])) |
| 122 |
{ |
| 123 |
$_GET['step'] = ''; |
| 124 |
} |
| 125 |
|
| 126 |
/** |
| 127 |
* Assign variables and display page |
| 128 |
*/ |
| 129 |
$smarty -> assign(array('View' => $_GET['view'], |
| 130 |
'Step' => $_GET['step'])); |
| 131 |
$smarty -> display ('tech.tpl'); |
| 132 |
|
| 133 |
require_once("includes/foot.php"); |
| 134 |
?> |