|
From: Benjamin C. <bc...@us...> - 2002-10-28 22:03:30
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv989a
Modified Files:
attachment.php bug.php
Log Message:
Use translated strings for bug history.
Index: attachment.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/attachment.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- attachment.php 18 May 2002 02:59:32 -0000 1.19
+++ attachment.php 28 Oct 2002 22:03:21 -0000 1.20
@@ -10,12 +10,12 @@
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
-//
+//
// phpBugTracker is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with phpBugTracker; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -26,7 +26,7 @@
function del_attachment($attachid) {
global $db, $HTTP_SERVER_VARS;
-
+
if (list($filename, $mimetype) = grab_attachment($attachid)) {
$db->query("delete from ".TBL_ATTACHMENT." where attachment_id = $attachid");
unlink($filename);
@@ -36,7 +36,7 @@
function grab_attachment($attachid) {
global $db, $STRING;
-
+
if (!is_numeric($attachid)) {
show_text($STRING['bad_attachment'], true);
return false;
@@ -48,7 +48,7 @@
show_text($STRING['bad_attachment'], true);
return false;
}
- $filename = join('/',array(ATTACHMENT_PATH,
+ $filename = join('/',array(ATTACHMENT_PATH,
$ainfo['project_id'], "{$ainfo['bug_id']}-{$ainfo['file_name']}"));
if (!is_readable($filename)) {
show_text($STRING['bad_attachment'], true);
@@ -59,8 +59,8 @@
function add_attachment($bugid, $description) {
global $db, $HTTP_POST_FILES, $now, $u, $STRING, $t, $_pv;
-
- if (!isset($HTTP_POST_FILES['attachment']) ||
+
+ if (!isset($HTTP_POST_FILES['attachment']) ||
$HTTP_POST_FILES['attachment']['tmp_name'] == 'none') {
show_attachment_form($bugid, $STRING['give_attachment']);
return;
@@ -72,7 +72,7 @@
show_attachment_form($bugid, $STRING['attachment_too_large']);
return;
}
-
+
$projectid = $db->getOne("select project_id from ".TBL_BUG." where bug_id = $bugid");
if (!$projectid) {
show_text($STRING['nobug'], true);
@@ -89,7 +89,7 @@
return;
}
}
-
+
$filepath = ATTACHMENT_PATH;
$tmpfilename = $HTTP_POST_FILES['attachment']['tmp_name'];
$filename = "$bugid-{$HTTP_POST_FILES['attachment']['name']}";
@@ -118,9 +118,9 @@
$db->query("insert into ".TBL_ATTACHMENT." (attachment_id, bug_id, file_name, ".
"description, file_size, mime_type, created_by, created_date) values (".
join(', ', array($db->nextId(TBL_ATTACHMENT), $bugid,
- $db->quote($HTTP_POST_FILES['attachment']['name']),
- $db->quote(stripslashes($description)),
- $HTTP_POST_FILES['attachment']['size'],
+ $db->quote($HTTP_POST_FILES['attachment']['name']),
+ $db->quote(stripslashes($description)),
+ $HTTP_POST_FILES['attachment']['size'],
$db->quote($HTTP_POST_FILES['attachment']['type']), $u, $now)).")");
if ($_pv['use_js']) {
@@ -132,29 +132,29 @@
function show_attachment_form($bugid, $error = '') {
global $db, $t, $STRING;
-
- if (!is_numeric($bugid)) {
+
+ if (!is_numeric($bugid)) {
show_text($STRING['nobug'], true);
return;
}
-
+
$bugexists = $db->getOne("select count(*) from ".TBL_BUG." where bug_id = $bugid");
- if (!$bugexists) {
+ if (!$bugexists) {
show_text($STRING['nobug'], true);
return;
}
-
+
$t->assign(array(
'error' => $error,
'bugid' => $bugid,
- 'description' => isset($description)
+ 'description' => isset($description)
? htmlspecialchars(stripslashes($description)) : '',
- 'max_size' => ini_get('upload_max_filesize') < ATTACHMENT_MAX_SIZE
+ 'max_size' => ini_get('upload_max_filesize') < ATTACHMENT_MAX_SIZE
? number_format(ini_get('upload_max_filesize'))
: number_format(ATTACHMENT_MAX_SIZE)
));
$t->wrap('bugattachmentform.html', 'addattachment');
-}
+}
if (isset($_gv['del'])) {
if (!$perm->have_perm('Administrator')) {
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- bug.php 28 Oct 2002 21:43:41 -0000 1.124
+++ bug.php 28 Oct 2002 22:03:23 -0000 1.125
@@ -172,7 +172,7 @@
$db->query('insert into '.TBL_BUG_HISTORY.
' (bug_id, changed_field, old_value, new_value, created_by, created_date)'.
- " values (". join(', ', array($buginfo['bug_id'], $db->quote($field),
+ " values (". join(', ', array($buginfo['bug_id'], $db->quote($STRING['BUGDISPLAY'][$field]),
$db->quote(stripslashes($oldvalue)),
$db->quote(stripslashes($newvalue)), $u, $now)).")");
$t->assign(array(
@@ -188,8 +188,8 @@
}
// Handle versions other than version
- $versions = array ('to_be_closed_in_version' => 'ToBeClosedInVersion',
- 'closed_in_version' => 'ClosedInVersion');
+ $versions = array ('to_be_closed_in_version' => 'tobeclosedinversion',
+ 'closed_in_version' => 'closedinversion');
foreach($versions as $field => $field_name) {
if (isset($buginfo[$field.'_id'])) {
@@ -233,7 +233,7 @@
$db->query('insert into '.TBL_BUG_HISTORY.
' (bug_id, changed_field, old_value, new_value, created_by, created_date)'.
" values (". join(', ', array($buginfo['bug_id'],
- $db->quote($STRING['BUGDISPLAY']['AssignedTo']),
+ $db->quote($STRING['BUGDISPLAY']['assignedto']),
$db->quote($oldassignedto), $db->quote($assignedto), $u, $now)).")");
} else {
$assignedtostat = ' ';
|