Skip to content

Commit

Permalink
Modified is_duplicate_category(). Reversed the arguments.
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@937 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Kenzaburo Ito committed May 11, 2002
1 parent 05f37c2 commit 74b5579
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core_category_API.php
Expand Up @@ -10,7 +10,7 @@
# --------------------
# checks to see if the category is a duplicate
# we do it this way because each different project can have the same category names
function is_duplicate_category( $p_category, $p_project_id ) {
function is_duplicate_category( $p_project_id, $p_category ) {
global $g_mantis_project_category_table;

$query = "SELECT COUNT(*)
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeLog
Expand Up @@ -53,6 +53,7 @@ Mantis
* Modified delete file attachments to chmod( 0775 ) so write permissions are granted.
* Modified get_view_redirect_url() call on bug_assign.php to handle redirects better.
* Modified search to look in bugnotes.
* Modified is_duplicate_category(). Reversed the arguments.
* Added Hungarian translation.
* Added Japanese translation.
* Added Czech translation.
Expand Down
2 changes: 1 addition & 1 deletion manage_proj_cat_add.php
Expand Up @@ -16,7 +16,7 @@
}

$result = 0;
$duplicate = is_duplicate_category( $f_category, $f_project_id );
$duplicate = is_duplicate_category( $f_project_id, $f_category );
# check for empty case or duplicate
if ( !empty( $f_category )&& !$duplicate ) {
# insert category
Expand Down
2 changes: 1 addition & 1 deletion manage_proj_cat_copy.php
Expand Up @@ -17,7 +17,7 @@
$t_category = $row["category"];
$t_category = addslashes( $t_category );

if ( !is_duplicate_category( $t_category, $f_new_project_id ) ) {
if ( !is_duplicate_category( $f_new_project_id, $t_category ) ) {
category_add( $f_new_project_id, $t_category );
}
}
Expand Down
4 changes: 2 additions & 2 deletions manage_proj_cat_update.php
Expand Up @@ -15,7 +15,7 @@
$result = 0;
$query = "";
# check for duplicate
if ( !is_duplicate_category( $f_category, $f_project_id ) ) {
if ( !is_duplicate_category( $f_project_id, $f_category ) ) {
# update category
$query = "UPDATE $g_mantis_project_category_table
SET category='$f_category'
Expand Down Expand Up @@ -58,7 +58,7 @@
<?php
if ( $result ) { # SUCCESS
PRINT "$s_operation_successful<p>";
} else if ( is_duplicate_category( $f_category, $f_project_id )) {
} else if ( is_duplicate_category( $f_project_id, $f_category )) {
PRINT $MANTIS_ERROR[ERROR_DUPLICATE_CATEGORY]."<p>";
} else { # FAILURE
print_sql_error( $query );
Expand Down

0 comments on commit 74b5579

Please sign in to comment.