Skip to content

Commit

Permalink
Merge branch 'master' of github.com:slims/slims7_cendana
Browse files Browse the repository at this point in the history
  • Loading branch information
Arif Syamsudin committed May 9, 2013
2 parents 91f304d + b15e170 commit 75abe3e
Show file tree
Hide file tree
Showing 21 changed files with 168 additions and 121 deletions.
8 changes: 7 additions & 1 deletion admin/admin_template/default/index_template.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@

var timeOut = null;
jQuery('#mainMenu .menuCurrent, #mainMenu .home').bind('mouseover', function() {
var subMenu = jQuery('#sidepan');
var menu = jQuery(this);
var menuPos = menu.position();
jQuery('#sidepan').css({left: menuPos.left+'px'}).slideDown().bind('mouseover', function() {
var submenuHeight = subMenu.height();
var browserHeight = $(window).height();
if (submenuHeight >= browserHeight) {
submenuHeight = browserHeight-100;
}
subMenu.css({left: menuPos.left+'px', height: submenuHeight+'px', "max-height": submenuHeight+'px'}).slideDown().bind('mouseover', function() {
clearTimeout(timeOut);
});
}).bind('mouseout', function() {
Expand Down
2 changes: 0 additions & 2 deletions admin/admin_template/default/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,6 @@ submenu
overflow: hidden;
position: fixed;
bottom: 45px;
height: 300px;
max-height: 300px;
display: none;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
Expand Down
2 changes: 1 addition & 1 deletion admin/admin_template/printed_settings.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function loadPrintSettings($dbs, $type) {
if ($barcode_settings_q->num_rows) {
$barcode_settings_d = $barcode_settings_q->fetch_row();
if ($barcode_settings_d[0]) {
$barcode_settings = unserialize($barcode_settings_d[0]);
$barcode_settings = @unserialize($barcode_settings_d[0]);
foreach ($barcode_settings as $setting_name => $val) {
$sysconf['print'][$type][$setting_name] = $val;
}
Expand Down
2 changes: 1 addition & 1 deletion admin/modules/bibliography/dl_print.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
// chunk label array
$chunked_label_arrays = array_chunk($label_data_array, $sysconf['print']['label']['items_per_row']);
// create html ouput of images
$html_str = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
$html_str = '<!DOCTYPE html>'."\n";
$html_str .= '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Document Label Print Result</title>'."\n";
$html_str .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
$html_str .= '<meta http-equiv="Pragma" content="no-cache" /><meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, post-check=0, pre-check=0" /><meta http-equiv="Expires" content="Sat, 26 Jul 1997 05:00:00 GMT" />';
Expand Down
13 changes: 12 additions & 1 deletion admin/modules/bibliography/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@
$can_write = utility::havePrivilege('bibliography', 'w');

if (!$can_read) {
die('<div class="errorBox">'.__('You are not authorized to view this section').'</div>');
die('<div class="errorBox">'.__('You are not authorized to view this section').'</div>');
}

if ($sysconf['index']['type'] == 'index') {
require MDLBS.'system/biblio_indexer.inc.php';
// create biblio_indexer class instance
$indexer = new biblio_indexer($dbs);
}

// max chars in line for file operations
Expand Down Expand Up @@ -202,6 +208,11 @@
$dbs->query($item_sql);
}
}

// create biblio index
if ($sysconf['index']['type'] == 'index') {
$indexer->makeIndex($biblio_id);
}
}
$row_count++;
}
Expand Down
45 changes: 27 additions & 18 deletions admin/modules/bibliography/marcimport.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
// max chars in line for file operations
$max_chars = 1024*100;

if ($sysconf['index']['type'] == 'index') {
require MDLBS.'system/biblio_indexer.inc.php';
// create biblio_indexer class instance
$indexer = new biblio_indexer($dbs);
}

if (isset($_POST['doImport'])) {
// check for form validity
if (!$_FILES['importFile']['name']) {
Expand Down Expand Up @@ -111,26 +117,25 @@
$data['input_date'] = $input_date;
$data['last_update'] = $input_date;

echo '<pre>';
echo "\n";
$title_fld = $record->getField('245');
// Main title
$title_main = $title_fld->getSubfields('a');
// echo $title_main[0]->getData();
$data['title'] = $title_main[0]->getData();
$data['title'] = $dbs->escape_string(trim($title_main[0]->getData()));
// Sub title
$subtitle = $title_fld->getSubfields('b');
if (isset($subtitle[0])) {
// echo 'Subtitle: '.$subtitle[0]->getData();
$data['title'] .= $subtitle[0]->getData();
$data['title'] .= $dbs->escape_string(trim($subtitle[0]->getData()));
}

// Statement of Responsibility
$sor = $title_fld->getSubfields('c');
if (isset($sor[0])) {
$data['title'] .= $sor[0]->getData();
// $data['title'] .= $sor[0]->getData();
$data['sor'] = $dbs->escape_string(trim($sor[0]->getData()));
// echo "\n"; echo 'Statement of responsibility: '.$sor[0]->getData();
$data['sor_id'] = utility::getID($dbs, 'mst_sor', 'sor_id', 'sor', $sor[0]->getData(), $sor_cache);
// $data['sor_id'] = utility::getID($dbs, 'mst_sor', 'sor_id', 'sor', $sor[0]->getData(), $sor_cache);
}

// Edition
Expand All @@ -140,11 +145,11 @@
$ed2 = $ed_fld->getSubfields('b');
if (isset($ed[0])) {
// echo "\n"; echo 'Edition: '.$ed[0]->getData();
$data['edition'] = $ed[0]->getData();
$data['edition'] = $dbs->escape_string(trim($ed[0]->getData()));
}
if (isset($ed2[0])) {
// echo "\n"; echo 'Edition: '.$ed[0]->getData();
$data['edition'] .= $ed2[0]->getData();
$data['edition'] .= $dbs->escape_string(trim($ed2[0]->getData()));
}
}

Expand Down Expand Up @@ -234,7 +239,7 @@
$series = $series_fld->getSubfields('a');
if (isset($series[0])) {
// echo "\n"; echo 'Series: '.$series[0]->getData();
$data['series_title'] = $series[0]->getData();
$data['series_title'] = $dbs->escape_string(trim($series[0]->getData()));
}
}

Expand All @@ -247,18 +252,18 @@
if ($note_fld) {
$notes = $note_fld->getSubfields('a');
if (isset($notes[0])) {
$data['notes'] .= $notes[0]->getData();
$data['notes'] .= $dbs->escape_string(trim($notes[0]->getData()));
}
}
}
}

// insert biblio data
$sql_op->insert('biblio', $data);
// echo '<p>'.$sql_op->error.'</p><p>&nbsp;</p>';
echo '<p>'.$sql_op->error.'</p><p>&nbsp;</p>';
$biblio_id = $sql_op->insert_id;
if ($biblio_id < 1) {
continue;
continue;
}
$updated_row++;

Expand All @@ -272,7 +277,7 @@
if (isset($subject[0])) {
// echo $subject[0]->getData();
$subject_type = 't';
$subject_id = getSubjectID($subject[0]->getData(), $subject_type, $subject_cache);
$subject_id = getSubjectID($dbs->escape_string(trim($subject[0]->getData())), $subject_type, $subject_cache);
@$dbs->query("INSERT IGNORE INTO biblio_topic (biblio_id, topic_id, level) VALUES ($biblio_id, $subject_id, 1)");
}
}
Expand All @@ -285,7 +290,7 @@
$mes = $me_fld->getSubfields('a');
if (isset($me[0])) {
// echo 'Main entry: '.$me[0]->getData();
$author_id = utility::getID($dbs, 'mst_author', 'author_id', 'author_name', $me[0]->getData(), $author_cache);
$author_id = utility::getID($dbs, 'mst_author', 'author_id', 'author_name', $dbs->escape_string(trim($me[0]->getData())), $author_cache);
@$dbs->query("INSERT IGNORE INTO biblio_author (biblio_id, author_id, level) VALUES ($biblio_id, $author_id, 1)");
}
}
Expand All @@ -307,22 +312,26 @@
$author = $auth_fld->getSubfields('a');
if (isset($author[0])) {
// echo $author[0]->getData();
$author_id = getAuthorID($author[0]->getData(), $author_type, $author_cache);
$author_id = getAuthorID($dbs->escape_string(trim($author[0]->getData())), $author_type, $author_cache);
@$dbs->query("INSERT IGNORE INTO biblio_author (biblio_id, author_id, level) VALUES ($biblio_id, $author_id, 1)");
}
}
}
}

echo '</pre>';
// create biblio index
if ($sysconf['index']['type'] == 'index') {
$indexer->makeIndex($biblio_id);
}

}

$end_time = time();
$import_time_sec = $end_time-$start_time;
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', 'Importing '.$updated_row.' MARC records from file : '.$_FILES['importFile']['name']);
echo '<script type="text/javascript">'."\n";
echo 'parent.$(\'#importInfo\').html(\'<strong>'.$updated_row.'</strong> records updated successfully to item database, from record <strong>'.$_POST['recordOffset'].' in '.$import_time_sec.' second(s)</strong>\');'."\n";
echo 'parent.$(\'#importInfo\').css( {\'display\': \'block\'} );'."\n";
echo 'top.jQuery(\'#importInfo\').html(\'<strong>'.$updated_row.'</strong> records updated successfully to item database, from record <strong>'.$_POST['recordOffset'].' in '.$import_time_sec.' second(s)</strong>\');'."\n";
echo 'top.jQuery(\'#importInfo\').css( {display: \'block\'} );'."\n";
echo '</script>';
exit();
}
Expand Down
52 changes: 26 additions & 26 deletions admin/modules/membership/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
define('DB_ACCESS', 'fa');

if (!defined('SB')) {
// main system configuration
require '../../../sysconfig.inc.php';
// start the session
require SB.'admin/default/session.inc.php';
// main system configuration
require '../../../sysconfig.inc.php';
// start the session
require SB.'admin/default/session.inc.php';
}
// IP based access limitation
require LIB.'ip_based_access.inc.php';
Expand Down Expand Up @@ -128,30 +128,30 @@
$data['input_date'] = date('Y-m-d');
$data['last_update'] = date('Y-m-d');
if (!empty($_FILES['image']) AND $_FILES['image']['size']) {
// create upload object
$upload = new simbio_file_upload();
$upload->setAllowableFormat($sysconf['allowed_images']);
$upload->setMaxSize($sysconf['max_image_upload']*1024); // approx. 100 kb
$upload->setUploadDir(IMGBS.'persons');
// give new name for upload file
$new_filename = 'member_'.$data['member_id'];
$upload_status = $upload->doUpload('image', $new_filename);
if ($upload_status == UPLOAD_SUCCESS) {
$data['member_image'] = $dbs->escape_string($upload->new_filename);
}
// create upload object
$upload = new simbio_file_upload();
$upload->setAllowableFormat($sysconf['allowed_images']);
$upload->setMaxSize($sysconf['max_image_upload']*1024); // approx. 100 kb
$upload->setUploadDir(IMGBS.'persons');
// give new name for upload file
$new_filename = 'member_'.$data['member_id'];
$upload_status = $upload->doUpload('image', $new_filename);
if ($upload_status == UPLOAD_SUCCESS) {
$data['member_image'] = $dbs->escape_string($upload->new_filename);
}
} else if (!empty($_POST['base64picstring'])) {
list($filedata, $filedom) = explode('#image/type#', $_POST['base64picstring']);
$new_filename = 'member_'.$data['member_id'].'.'.strtolower($filedom);

if (file_put_contents(IMGBS.'persons/'.$new_filename, base64_decode($filedata))) {
$data['member_image'] = $dbs->escape_string($new_filename);
if (!defined('UPLOAD_SUCCESS')) define('UPLOAD_SUCCESS', 1);
$upload_status = UPLOAD_SUCCESS;
}
}
list($filedata, $filedom) = explode('#image/type#', $_POST['base64picstring']);
$new_filename = 'member_'.$data['member_id'].'.'.strtolower($filedom);

if (file_put_contents(IMGBS.'persons/'.$new_filename, base64_decode($filedata))) {
$data['member_image'] = $dbs->escape_string($new_filename);
if (!defined('UPLOAD_SUCCESS')) define('UPLOAD_SUCCESS', 1);
$upload_status = UPLOAD_SUCCESS;
}
}
// password confirmation
if (($mpasswd1 AND $mpasswd2) AND ($mpasswd1 === $mpasswd2)) {
$data['mpasswd'] = 'literal{MD5(\''.$mpasswd2.'\')}';
$data['mpasswd'] = 'literal{MD5(\''.$mpasswd2.'\')}';
}

// create sql op object
Expand Down Expand Up @@ -456,7 +456,7 @@
$str_input .= '<embed name="src" src="'.SWB.'lib/flex/ShotSLiMSMemberPicture.swf" height="280px" width="100%"/>';
$str_input .= '</object>';
$form->addAnything(__('Photo'), $str_input);

// member email
$form->addTextField('text', 'memberEmail', __('E-mail'), $rec_d['member_email'], 'style="width: 40%;"');
// member password
Expand Down
9 changes: 5 additions & 4 deletions admin/modules/reporting/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
FROM `biblio` AS b
INNER JOIN mst_gmd AS gmd ON b.gmd_id = gmd.gmd_id
GROUP BY b.gmd_id HAVING total_titles>0 ORDER BY COUNT(biblio_id) DESC');
$stat_data = '<div class="chartLink"><a class="notAJAX" href="#" onclick="openHTMLpop(\''.MWB.'reporting/charts_report.php?chart=total_title_gmd\', 700, 470, \''.__('Total Titles By Medium/GMD').'\')">'.__('Show in chart/plot').'</a></div>';
$stat_data = '<div class="chartLink"><a class="notAJAX openPopUp" href="'.MWB.'reporting/charts_report.php?chart=total_title_gmd" width="700" height="470" title="'.__('Total Titles By Medium/GMD').'">'.__('Show in chart/plot').'</a></div>';
while ($data = $stat_query->fetch_row()) {
$stat_data .= '<strong>'.$data[0].'</strong> : '.$data[1];
$stat_data .= ', ';
Expand All @@ -98,7 +98,7 @@
GROUP BY i.coll_type_id
HAVING total_items >0
ORDER BY COUNT(item_id) DESC');
$stat_data = '<div class="chartLink"><a class="notAJAX" href="#" onclick="openHTMLpop(\''.MWB.'reporting/charts_report.php?chart=total_title_colltype\', 700, 470, \''.__('Total Items By Collection Type').'\')">'.__('Show in chart/plot').'</a></div>';
$stat_data = '<div class="chartLink"><a class="notAJAX openPopUp" href="'.MWB.'reporting/charts_report.php?chart=total_title_colltype" width="700" height="470" title="'.__('Total Items By Collection Type').'">'.__('Show in chart/plot').'</a></div>';
while ($data = $stat_query->fetch_row()) {
$stat_data .= '<strong>'.$data[0].'</strong> : '.$data[1];
$stat_data .= ', ';
Expand Down Expand Up @@ -136,7 +136,8 @@
// if we are in print mode
if (isset($_GET['print'])) {
// html strings
$html_str = '<html><head><title>'.$sysconf['library_name'].' Membership General Statistic Report</title>';
$html_str = '<!DOCTYPE html>';
$html_str .= '<html><head><title>'.$sysconf['library_name'].' Membership General Statistic Report</title>';
$html_str .= '<style type="text/css">'."\n";
$html_str .= 'body {padding: 0.2cm}'."\n";
$html_str .= 'body * {color: black; font-size: 11pt;}'."\n";
Expand All @@ -156,7 +157,7 @@
$file_write = @file_put_contents(REPBS.'biblio_stat_print_result.html', $html_str);
if ($file_write) {
// open result in new window
echo '<script type="text/javascript">parent.openWin(\''.SWB.FLS.'/'.REP.'/biblio_stat_print_result.html\', \'popMemberReport\', 800, 500, true)</script>';
echo '<script type="text/javascript">top.$.colorbox({href: "'.SWB.FLS.'/'.REP.'/biblio_stat_print_result.html", height: 800, width: 500})</script>';
} else { utility::jsAlert('ERROR! Loan statistic report failed to generate, possibly because '.REPBS.' directory is not writable'); }
exit();
}
Expand Down
9 changes: 5 additions & 4 deletions admin/modules/reporting/loan_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
INNER JOIN biblio AS b ON i.biblio_id=b.biblio_id
INNER JOIN mst_gmd AS gmd ON b.gmd_id=gmd.gmd_id
GROUP BY b.gmd_id ORDER BY COUNT(loan_id) DESC');
$report_d = '<div class="chartLink"><a class="notAJAX" href="#" onclick="openHTMLpop(\''.MWB.'reporting/charts_report.php?chart=total_loan_gmd\', 700, 470, \''.__('Total Loan By GMD/Medium').'\')">'.__('Show in chart/plot').'</a></div>';
$report_d = '<div class="chartLink"><a class="notAJAX openPopUp" href="'.MWB.'reporting/charts_report.php?chart=total_loan_gmd" width="700" height="470" title="'.__('Total Loan By GMD/Medium').'">'.__('Show in chart/plot').'</a></div>';
while ($data = $report_q->fetch_row()) {
$report_d .= '<strong>'.$data[0].'</strong> : '.$data[1].', ';
}
Expand All @@ -69,7 +69,7 @@
INNER JOIN item AS i ON l.item_code=i.item_code
INNER JOIN mst_coll_type AS ct ON i.coll_type_id=ct.coll_type_id
GROUP BY i.coll_type_id ORDER BY COUNT(loan_id) DESC');
$report_d = '<div class="chartLink"><a class="notAJAX" href="#" onclick="openHTMLpop(\''.MWB.'reporting/charts_report.php?chart=total_loan_colltype\', 700, 470, \''.__('Total Loan By Collection Type').'\')">'.__('Show in chart/plot').'</a></div>';
$report_d = '<div class="chartLink"><a class="notAJAX openPopUp" href="'.MWB.'reporting/charts_report.php?chart=total_loan_colltype" width="700" height="470" title="'.__('Total Loan By Collection Type').'">'.__('Show in chart/plot').'</a></div>';
while ($data = $report_q->fetch_row()) {
$report_d .= '<strong>'.$data[0].'</strong> : '.$data[1].', ';
}
Expand Down Expand Up @@ -129,7 +129,8 @@
// if we are in print mode
if (isset($_GET['print'])) {
// html strings
$html_str = '<html><head><title>'.$sysconf['library_name'].' Membership General Statistic Report</title>';
$html_str = '<!DOCTYPE html>';
$html_str .= '<html><head><title>'.$sysconf['library_name'].' Membership General Statistic Report</title>';
$html_str .= '<style type="text/css">'."\n";
$html_str .= 'body {padding: 0.2cm}'."\n";
$html_str .= 'body * {color: black; font-size: 11pt;}'."\n";
Expand All @@ -149,7 +150,7 @@
$file_write = @file_put_contents(REPBS.'loan_stat_print_result.html', $html_str);
if ($file_write) {
// open result in new window
echo '<script type="text/javascript">parent.openWin(\''.SWB.FLS.'/'.REP.'/loan_stat_print_result.html\', \'popMemberReport\', 800, 500, true)</script>';
echo '<script type="text/javascript">top.$.colorbox({href: "'.SWB.FLS.'/'.REP.'/loan_stat_print_result.html", width: 800, height: 500})</script>';
} else { utility::jsAlert('ERROR! Loan statistic report failed to generate, possibly because '.REPBS.' directory is not writable'); }
exit();
}
Expand Down
7 changes: 4 additions & 3 deletions admin/modules/reporting/member_report.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
LEFT JOIN member AS m ON mt.member_type_id=m.member_type_id
WHERE TO_DAYS(expire_date)>TO_DAYS(\''.date('Y-m-d').'\')
GROUP BY m.member_type_id ORDER BY COUNT(member_id) DESC');
$report_d = '<div class="chartLink"><a class="notAJAX" href="#" onclick="openHTMLpop(\''.MWB.'reporting/charts_report.php?chart=total_member_by_type\', 700, 470, \''.__('Total Members By Membership Type').'\')">'.__('Show in chart/plot').'</a></div>';;
$report_d = '<div class="chartLink"><a class="notAJAX openPopUp" href="'.MWB.'reporting/charts_report.php?chart=total_member_by_type" width="700" height="470" title="'.__('Total Members By Membership Type').'">'.__('Show in chart/plot').'</a></div>';;
while ($data = $report_q->fetch_row()) {
$report_d .= '<strong>'.$data[0].'</strong> : '.$data[1].', ';
}
Expand Down Expand Up @@ -105,7 +105,8 @@
// if we are in print mode
if (isset($_GET['print'])) {
// html strings
$html_str = '<html><head><title>'.$sysconf['library_name'].' Membership General Statistic Report</title>';
$html_str = '<!DOCTYPE html>';
$html_str .= '<html><head><title>'.$sysconf['library_name'].' Membership General Statistic Report</title>';
$html_str .= '<style type="text/css">'."\n";
$html_str .= 'body {padding: 0.2cm}'."\n";
$html_str .= 'body * {color: black; font-size: 11pt;}'."\n";
Expand All @@ -125,7 +126,7 @@
$file_write = @file_put_contents(REPBS.'member_stat_print_result.html', $html_str);
if ($file_write) {
// open result in new window
echo '<script type="text/javascript">parent.openWin(\''.SWB.FLS.'/'.REP.'/member_stat_print_result.html\', \'popMemberReport\', 800, 500, true)</script>';
echo '<script type="text/javascript">top.$.colorbox({href: "'.SWB.FLS.'/'.REP.'/member_stat_print_result.html", width: 800, height: 500})</script>';
} else { utility::jsAlert('ERROR! Membership statistic report failed to generate, possibly because '.REPBS.' directory is not writable'); }
exit();
}
Expand Down
Loading

0 comments on commit 75abe3e

Please sign in to comment.