Skip to content

Commit

Permalink
Merge pull request #21 from matlam/miscellaneous-bugfixes
Browse files Browse the repository at this point in the history
Miscellaneous bugfixes by Matthias Lamerz (@matlam)
  • Loading branch information
Senayan Library Management System (SLiMS) authored Jan 8, 2017
2 parents ba889f7 + 5d2f9a5 commit e3487f0
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 18 deletions.
1 change: 1 addition & 0 deletions admin/admin_template/default-dz/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,7 @@ tr.dataListHeader > td > a {
#memberIDList {
margin-top: -5px;
width: 181px !important;
z-index: 1;
}
.ajaxDDlist {
border-color: #ddd !important;
Expand Down
1 change: 1 addition & 0 deletions admin/admin_template/default/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,7 @@ tr.dataListHeader > td > a {
#memberIDList {
margin-top: -5px;
width: 181px !important;
z-index: 1;
}
.ajaxDDlist {
border-color: #ddd !important;
Expand Down
2 changes: 1 addition & 1 deletion admin/modules/bibliography/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
// field enclosed
$form->addTextField('text', 'fieldEnc', __('Field Enclosed With').'*', ''.htmlentities('"').'', 'style="width: 10%;"');
// number of records to import
$form->addTextField('text', 'recordNum', __('Number of Records To Export (0 for all records)'), '0', 'style="width: 10%;"');
$form->addTextField('text', 'recordNum', __('Number of Records To Import (0 for all records)'), '0', 'style="width: 10%;"');
// records offset
$form->addTextField('text', 'recordOffset', __('Start From Record'), '1', 'style="width: 10%;"');
// output the form
Expand Down
4 changes: 2 additions & 2 deletions admin/modules/bibliography/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,12 @@ function getimagesizefromstring($string_data)
$itemcode .= $chars[1];

$item_insert_sql = sprintf("INSERT IGNORE INTO item (biblio_id, item_code, call_number, coll_type_id)
VALUES (%d, '%s', '%s', %d)", $updateRecordID?$updateRecordID:$last_biblio_id, $itemcode, $data['call_number'], $_POST['collTypeID']);
VALUES (%d, '%s', '%s', %d)", isset($updateRecordID)?$updateRecordID:$last_biblio_id, $itemcode, $data['call_number'], $_POST['collTypeID']);
@$dbs->query($item_insert_sql);
}
}

echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\''.MWB.'bibliography/index.php\', {method: \'post\', addData: \'itemID='.$last_biblio_id.'&detail=true\'});</script>';
echo '<script type="text/javascript">parent.$(\'#mainContent\').simbioAJAX(\''.MWB.'bibliography/index.php\', {method: \'post\', addData: \'itemID='.(isset($updateRecordID)?$updateRecordID:$last_biblio_id).'&detail=true\'});</script>';
exit();
}
exit();
Expand Down
2 changes: 1 addition & 1 deletion admin/modules/bibliography/item_import.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
// field enclosed
$form->addTextField('text', 'fieldEnc', __('Field Enclosed With').'*', ''.htmlentities('"').'', 'style="width: 10%;"');
// number of records to import
$form->addTextField('text', 'recordNum', __('Number of Records To Export (0 for all records)'), '0', 'style="width: 10%;"');
$form->addTextField('text', 'recordNum', __('Number of Records To Import (0 for all records)'), '0', 'style="width: 10%;"');
// records offset
$form->addTextField('text', 'recordOffset', __('Start From Record'), '1', 'style="width: 10%;"');
// output the form
Expand Down
4 changes: 4 additions & 0 deletions admin/modules/bibliography/pop_biblio.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
$_POST['itemID'] = $_GET['itemID'];
}

if (isset($_GET['itemCollID'])) {
$_POST['itemCollID'] = $_GET['itemCollID'];
}

$_GET['inPopUp'] = true;

ob_start();
Expand Down
2 changes: 1 addition & 1 deletion admin/modules/circulation/member_loan_hist.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
'l.item_code AS \''.__('Item Code').'\'',
'b.title AS \''.__('Title').'\'',
'l.loan_date AS \''.__('Loan Date').'\'',
'IF(return_date IS NULL, \'<i>'.__('Not Returned Yet').'</i>\', return_date) AS \''.__('Returned Date').'\'');
'IF(is_return = 0, \'<i>'.__('Not Returned Yet').'</i>\', return_date) AS \''.__('Returned Date').'\'');
$datagrid->setSQLorder("l.loan_date DESC");

$criteria = 'l.member_id=\''.$dbs->escape_string($memberID).'\' ';
Expand Down
1 change: 0 additions & 1 deletion admin/modules/membership/member_AJAX_response.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
// key to authenticate
define('INDEX_AUTH', '1');

sleep(1);
require '../../../sysconfig.inc.php';
// IP based access limitation
require LIB.'ip_based_access.inc.php';
Expand Down
2 changes: 1 addition & 1 deletion admin/modules/reporting/customs/overdued_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
// create datagrid
$reportgrid = new report_datagrid();
$reportgrid->setSQLColumn('m.member_id AS \''.__('Member ID').'\'');
$reportgrid->setSQLorder('l.due_date DESC');
$reportgrid->setSQLorder('MAX(l.due_date) DESC');
$reportgrid->sql_group_by = 'm.member_id';

$overdue_criteria = ' (l.is_lent=1 AND l.is_return=0 AND TO_DAYS(due_date) < TO_DAYS(\''.date('Y-m-d').'\')) ';
Expand Down
2 changes: 1 addition & 1 deletion admin/modules/stock_take/finish.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
echo '<table style="width: 100%; border: 1px solid #666;" cellspacing="0">';
echo '<tr>';
echo '<th class="dataListHeader">' . __('Item Code') . '</th>
<th class="dataListHeader">' . __('Document Title') . '</th>
<th class="dataListHeader">' . __('Title') . '</th>
<th class="dataListHeader">' . __('Classification') . '</th>';
echo '</tr>'."\n";
while ($lost_item_d = $lost_item_q->fetch_row()) {
Expand Down
2 changes: 1 addition & 1 deletion js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ var showDropDown = function(strURL, strElmntID, strAddParams) {
var listObj = $('#'+strElmntID + 'List');
if (inputVal.length < 4) { listObj.hide(); return; }
// populate list ID
jsonToList(strURL, strElmntID, 'inputSearchVal=' + escape(inputVal) + '&' + strAddParams);
jsonToList(strURL, strElmntID, 'inputSearchVal=' + encodeURIComponent(inputVal) + '&' + strAddParams);
if (noResult) { return; }
// show list
listObj.css({'left': inputObjXY.left+'px', 'width': inputObjWidth+'px', 'display': 'block'});
Expand Down
4 changes: 2 additions & 2 deletions lib/minigalnano/createthumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function genContentType($imagefilename)
genContentType($imagefilename);

$target = imagecreatetruecolor($res_width,$res_height);
if (preg_match("/.jpg$/i", $imagefilename)) $source = imagecreatefromjpeg($imagefilename);
if (preg_match("/.jpg$|.jpeg$/i", $imagefilename)) $source = imagecreatefromjpeg($imagefilename);
if (preg_match("/.gif$/i", $imagefilename)) $source = imagecreatefromgif($imagefilename);
if (preg_match("/.png$/i", $imagefilename)) $source = imagecreatefrompng($imagefilename);

Expand All @@ -105,7 +105,7 @@ function genContentType($imagefilename)
imagedestroy($source);

if ($cache['exist'] == false) {
if (preg_match("/.jpg$/i", $imagefilename)) {
if (preg_match("/.jpg$|.jpeg$/i", $imagefilename)) {
imagejpeg($target,null,90);
imagejpeg($target,$cache['file'],90);
}
Expand Down
2 changes: 1 addition & 1 deletion sysconfig.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function stripslashes_deep($value)
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
}
// turn off all error messages for security reason
@ini_set('display_errors', true);
@ini_set('display_errors', false);
// check if safe mode is on
if ((bool) ini_get('safe_mode')) {
define('SENAYAN_IN_SAFE_MODE', 1);
Expand Down
4 changes: 2 additions & 2 deletions template/classic/detail_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<?php endif ?>

<!-- Comment -->
<?php // if(isset($_SESSION['mid'])) : ?>
<?php if(isset($_SESSION['mid']) && $sysconf['comment']['enable']) : ?>

<div class="slims-card slims-card--default">
<div class="slims-card--header">
Expand All @@ -179,4 +179,4 @@
<?php echo showComment($biblio_id); ?>
</div>

<?php // endif ?>
<?php endif ?>
4 changes: 2 additions & 2 deletions template/default/detail_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
============================================= -->
<h3 class="s-detail-type"><?php echo $gmd_name ?></h3>
<h4 class="s-detail-title" itemprop="name" property="name"><?php echo $title ?></h4>
<?php echo $social_shares ?>
<?php if($sysconf['social_shares']) { echo $social_shares; } ?>
<br>
<div class="s-detail-author" itemprop="author" property="author" itemscope itemtype="http://schema.org/Person">
<?php echo $authors ?>
Expand Down Expand Up @@ -177,7 +177,7 @@

<!-- Comment
============================================= -->
<?php if(isset($_SESSION['mid'])) : ?>
<?php if(isset($_SESSION['mid']) && $sysconf['comment']['enable']) : ?>
<h3><i class="fa fa-comments-o"></i> <?php echo __('Comments'); ?></h3>
<?php echo showComment($biblio_id); ?>
<?php endif; ?>
Expand Down
4 changes: 2 additions & 2 deletions template/lightweight/detail_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
============================================= -->
<h3 class="s-detail-type"><?php echo $gmd_name ?></h3>
<h4 class="s-detail-title" itemprop="name" property="name"><?php echo $title ?></h4>
<?php echo $social_shares ?>
<?php if($sysconf['social_shares']) { echo $social_shares; } ?>
<br>
<div class="s-detail-author" itemprop="author" property="author" itemscope itemtype="http://schema.org/Person">
<?php echo $authors ?>
Expand Down Expand Up @@ -177,7 +177,7 @@

<!-- Comment
============================================= -->
<?php if(isset($_SESSION['mid'])) : ?>
<?php if(isset($_SESSION['mid']) && $sysconf['comment']['enable']) : ?>
<h3><i class="fa fa-comments-o"></i> <?php echo __('Comments'); ?></h3>
<?php echo showComment($biblio_id); ?>
<?php endif; ?>
Expand Down

0 comments on commit e3487f0

Please sign in to comment.