Skip to content

Commit

Permalink
Fixed: error on publisher and place when saving bibliography
Browse files Browse the repository at this point in the history
  • Loading branch information
dicarve committed May 6, 2013
1 parent f46df89 commit 6acb157
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion admin/admin_template/default/index_template.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div id="header">
<div id="headerImage">&nbsp;</div>
<div id="libraryName">
<?php echo $sysconf['library_name']; ?>
<a href="./index.php"><?php echo $sysconf['library_name']; ?></a>
</div>
<div id="librarySubName">
<?php echo $sysconf['library_subname']; ?>
Expand Down
9 changes: 5 additions & 4 deletions admin/modules/bibliography/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@

// check publisher
// echo stripos($_POST['publisherID'], 'NEW:');
if (stripos($_POST['publisherID'], 'NEW:') == 0) {
if (stripos($_POST['publisherID'], 'NEW:') === 0) {
$new_publisher = str_ireplace('NEW:', '', trim(strip_tags($_POST['publisherID'])));
$new_id = utility::getID($dbs, 'mst_publisher', 'publisher_id', 'publisher_name', $new_publisher);
$data['publisher_id'] = $new_id;
} else {
$data['publisher_id'] = (integer)$_POST['publisherID'];
$data['publisher_id'] = intval($_POST['publisherID']);
}

$data['publish_year'] = trim($dbs->escape_string(strip_tags($_POST['year'])));
Expand All @@ -122,13 +122,14 @@
$data['call_number'] = trim($dbs->escape_string(strip_tags($_POST['callNumber'])));
$data['language_id'] = trim($dbs->escape_string(strip_tags($_POST['languageID'])));
// check place
if (stripos($_POST['placeID'], 'NEW:') == 0) {
if (stripos($_POST['placeID'], 'NEW:') === 0) {
$new_place = str_ireplace('NEW:', '', trim(strip_tags($_POST['placeID'])));
$new_id = utility::getID($dbs, 'mst_place', 'place_id', 'place_name', $new_place);
$data['publish_place_id'] = $new_id;
} else {
$data['publish_place_id'] = (integer)$_POST['placeID'];
$data['publish_place_id'] = intval($_POST['placeID']);
}

$data['notes'] = trim($dbs->escape_string(strip_tags($_POST['notes'], '<br><p><div><span><i><em><strong><b><code>s')));
$data['opac_hide'] = ($_POST['opacHide'] == '0')?'literal{0}':'1';
$data['promoted'] = ($_POST['promote'] == '0')?'literal{0}':'1';
Expand Down

0 comments on commit 6acb157

Please sign in to comment.