Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch 10 #142

Open
wants to merge 100 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
47ed861
Merge branch 'develop' into 'master'
idoalit Apr 12, 2021
daa21ea
Fix: unsaved data member
idoalit Jun 23, 2021
99f4e70
Fix: blank screen after login failed
idoalit Jun 24, 2021
3ceacb2
Change return type in doc
idoalit Jun 24, 2021
3e456ab
Validate url next destination
idoalit Jun 24, 2021
77daff8
Change path check order
idoalit Jun 24, 2021
d29ade1
Add: file password field
idoalit Jun 24, 2021
5c813af
Merge branch 'develop' of https://gitlab.com/slims/slims9_bulian into…
idoalit Jun 24, 2021
f36838e
Update installer
idoalit Jun 24, 2021
7a96181
Change quotes server
idoalit Jun 25, 2021
5708db4
Fix: ignore holiday fines
idoalit Jun 30, 2021
619fac8
Update senayan.sql
buitenzorg812 Jun 30, 2021
c0cab74
Fix: unable download backup file from user not admin
idoalit Jul 1, 2021
e46d314
Merge remote-tracking branch 'origin/develop' into develop
idoalit Jul 1, 2021
c7329a5
fix holiday settings
heroesoebekti Jul 16, 2021
5e85c89
Update translation
buitenzorg812 Jul 21, 2021
cea27fc
Fix: PHP Warning
idoalit Jul 31, 2021
b0d7132
Make parameter as optional
idoalit Jul 31, 2021
30b555f
Fix: constanta already defined
idoalit Aug 1, 2021
f8e7922
Fix: notice empty array
idoalit Aug 1, 2021
f2880de
Fix: deprecated order params
idoalit Aug 1, 2021
b2281a0
Update import.php
buitenzorg812 Aug 13, 2021
97b1c52
Fix: unrelated item after import csv
idoalit Aug 13, 2021
57f2b84
Update item_import.php
buitenzorg812 Aug 13, 2021
3198acd
Fix: search marc export
idoalit Aug 13, 2021
6707533
Prevent hidden biblio to show in home page
idoalit Aug 13, 2021
eae9ba4
Update changes.txt
buitenzorg812 Aug 13, 2021
1a5ab5b
Show line break at comment
idoalit Aug 13, 2021
72b1fb1
Alter table on next upgrade
idoalit Aug 13, 2021
809d388
Merge branch 'develop' of https://gitlab.com/slims/slims9_bulian into…
idoalit Aug 13, 2021
e48709b
Update translation
buitenzorg812 Sep 8, 2021
33248fa
Update translation
buitenzorg812 Sep 8, 2021
6082b09
Add : Rule to prevent git-dumper etc
drajathasan Sep 13, 2021
b62def9
Update import.php
nalamapu Sep 24, 2021
8cb854b
Add : Escape string in publish year
drajathasan Oct 8, 2021
50271a0
Fix : Undefined index: destination in dev mode
drajathasan Oct 13, 2021
550dd12
Merge pull request #102 from drajathasan/patch-3
idoalit Oct 13, 2021
7d1841d
Merge pull request #103 from drajathasan/patch-4
idoalit Oct 13, 2021
1bf578d
Merge pull request #99 from drajathasan/patch-2
idoalit Oct 13, 2021
f83c45d
Merge pull request #100 from nalamapu/patch-5
idoalit Oct 13, 2021
854e7c5
Merge branch 'develop' of https://github.com/slims/slims9_bulian into…
idoalit Oct 13, 2021
8750d43
Add : filter to escape some character
drajathasan Oct 14, 2021
b0a132e
Resolve conflict while merging
idoalit Oct 20, 2021
d43db58
Merge branch 'develop' of https://github.com/slims/slims9_bulian into…
idoalit Oct 21, 2021
9f695f6
Merge branch 'develop' of https://github.com/slims/slims9_bulian into…
idoalit Oct 24, 2021
8ce14fb
set environment to development
idoalit Oct 24, 2021
68453aa
check uncommon keyword to prevent sql injection
idoalit Oct 24, 2021
758fee7
Update changes.txt
buitenzorg812 Oct 25, 2021
1babb7c
Update changes.txt
buitenzorg812 Oct 25, 2021
5d8fe28
Resolve #26 Can not delete password for attachment
idoalit Oct 25, 2021
f60b0db
Merge branch 'develop' of https://gitlab.com/slims/slims9_bulian into…
idoalit Oct 25, 2021
c9da957
At least it is not easy to see
idoalit Oct 25, 2021
7b6b397
Add hook at visitor
idoalit Oct 26, 2021
a9fc669
fix image cover
heroesoebekti Oct 26, 2021
7ea509b
update holiday dayname
heroesoebekti Oct 26, 2021
4c25658
update replace image cover filename with title
heroesoebekti Oct 26, 2021
df28d15
Add : GUI for mail testing
drajathasan Oct 27, 2021
ca168c8
Add : System Environment Settings
drajathasan Oct 27, 2021
18029f1
Merge branch 'develop' into master
idoalit Oct 27, 2021
70b39e8
Merge pull request #106 from drajathasan/master
idoalit Oct 27, 2021
bdb68a6
Merge from github
idoalit Oct 27, 2021
efa3de9
Add : load hook at after and before content load
drajathasan Oct 28, 2021
5e0e108
Update sysconfig.env.inc.php
buitenzorg812 Nov 6, 2021
46b5f5e
Allow post to UCS via https
idoalit Nov 7, 2021
51fc38b
Add : GuzzleHtp library
drajathasan Nov 15, 2021
d73ce5b
Change : http_request with GuzzleHttp
drajathasan Nov 15, 2021
f556739
Merge pull request #109 from drajathasan/master
idoalit Nov 19, 2021
ed7f353
Merge pull request #111 from drajathasan/master
idoalit Nov 19, 2021
d90aa84
Update translation
buitenzorg812 Nov 25, 2021
5c192b3
Update translation
buitenzorg812 Nov 25, 2021
0e3f45e
Fix : Bootstrap drop down
drajathasan Nov 26, 2021
88beba5
Merge pull request #113 from drajathasan/patch-1
idoalit Nov 26, 2021
dd8769a
Fix : Removing too strict rule
drajathasan Nov 30, 2021
145b7d2
Fix : image not found at visitor counter
drajathasan Dec 1, 2021
1f43161
Merge pull request #117 from drajathasan/develop
idoalit Dec 3, 2021
61e3188
Fix : change user picture after first upload without logout
drajathasan Dec 4, 2021
2ebaab2
Merge branch 'slims:develop' into develop
drajathasan Dec 4, 2021
20fc080
Merge pull request #118 from drajathasan/develop
idoalit Dec 4, 2021
1e7e6d9
Maybe session image is url
idoalit Dec 9, 2021
7a753bb
Merge branch 'develop' of https://github.com/slims/slims9_bulian into…
idoalit Dec 9, 2021
8a57297
Fix: oai2 with not default database port
idoalit Dec 16, 2021
08421c8
Added plugin ability to register menu into group
idoalit Dec 18, 2021
fb25984
Add method alias to register hook
idoalit Dec 18, 2021
8a412d9
Add export to spreadsheet on items title list
idoalit Dec 22, 2021
d82e013
Initialize search engine to plugin system
idoalit Jan 1, 2022
9f2bbdd
Get global config
idoalit Jan 2, 2022
e9c45ea
Update view
idoalit Jan 2, 2022
a65f2cc
Add: xml result
idoalit Jan 2, 2022
6360253
Add SearchBiblioEngine
idoalit Jan 3, 2022
16d75a7
Update set criteria method
idoalit Jan 3, 2022
bc475d3
Fix get config result is null
idoalit Jan 3, 2022
ff5e446
Merge branch 'develop' of https://github.com/slims/slims9_bulian into…
idoalit Jan 4, 2022
60d28ce
Merge pull request #104 from drajathasan/patch-5
idoalit Feb 10, 2022
2721373
Merge pull request #116 from drajathasan/patch-2
idoalit Feb 10, 2022
89fd3f1
Update circulation_base_lib.inc.php
buitenzorg812 Feb 23, 2022
4fb9e04
Update holiday.php
buitenzorg812 Feb 23, 2022
1cd53bb
Update holiday.php
buitenzorg812 Feb 23, 2022
2aac5b7
Update holiday.php
buitenzorg812 Feb 23, 2022
2249b10
Merge branch 'develop' of https://gitlab.com/slims/slims9_bulian into…
idoalit Mar 17, 2022
df73df1
Update member_fines_list.php
nalamapu Mar 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
Order allow,deny
</FilesMatch>

<IfModule mod_rewrite.c>
RewriteEngine On
# Protect hidden directory from vulnerability scanner
RewriteRule (^|/)\.([^/]+)(/|$) - [L,F]
RewriteRule (^|/)([^/]+)~(/|$) - [L,F]
</IfModule>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

Expand Down
10 changes: 9 additions & 1 deletion admin/admin_template/akasia-dz/index_template.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,15 @@
<div class="s-user">
<div class="s-user-frame">
<a href="<?php echo MWB.'system/app_user.php?changecurrent=true&action=detail'; ?>" class="s-user-photo">
<img src="<?php echo '../lib/minigalnano/createthumb.php?filename='.IMG.'/persons/'.urlencode(urlencode($_SESSION['upict'])).'&width=200'?>" alt="Photo <?php echo $_SESSION['realname']?>">
<?php
if (filter_var($_SESSION['upict'], FILTER_VALIDATE_URL)) {
$user_image_url = $_SESSION['upict'];
} else {
$user_image = $_SESSION['upict'] && file_exists(IMGBS . 'persons/' . $_SESSION['upict']) ? $_SESSION['upict'] : 'person.png';
$user_image_url = '../lib/minigalnano/createthumb.php?filename=' . IMG . '/persons/' . urlencode(urlencode($user_image)) . '&width=200';
}
?>
<img src="<?= $user_image_url ?>" alt="Photo <?php echo $_SESSION['realname'] ?>">
</a>
</div>
<h4 class="s-user-name"><?php echo $_SESSION['realname']?></h4>
Expand Down
10 changes: 9 additions & 1 deletion admin/admin_template/akasia/index_template.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,15 @@
<div class="s-user">
<div class="s-user-frame">
<a href="<?php echo MWB.'system/app_user.php?changecurrent=true&action=detail'; ?>" class="s-user-photo">
<img src="<?php echo '../lib/minigalnano/createthumb.php?filename='.IMG.'/persons/'.urlencode(urlencode($_SESSION['upict'])).'&width=200'?>" alt="Photo <?php echo $_SESSION['realname']?>">
<?php
if (filter_var($_SESSION['upict'], FILTER_VALIDATE_URL)) {
$user_image_url = $_SESSION['upict'];
} else {
$user_image = $_SESSION['upict'] && file_exists(IMGBS . 'persons/' . $_SESSION['upict']) ? $_SESSION['upict'] : 'person.png';
$user_image_url = '../lib/minigalnano/createthumb.php?filename=' . IMG . '/persons/' . urlencode(urlencode($user_image)) . '&width=200';
}
?>
<img src="<?= $user_image_url ?>" alt="Photo <?php echo $_SESSION['realname'] ?>">
</a>
</div>
<h4 class="s-user-name"><?php echo $_SESSION['realname']?></h4>
Expand Down
12 changes: 10 additions & 2 deletions admin/admin_template/default/index_template.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<script type="text/javascript" src="<?php echo JWB; ?>jquery.imgareaselect/scripts/jquery.imgareaselect.pack.js"></script>
<script type="text/javascript" src="<?php echo JWB; ?>webcam.js"></script>
<script type="text/javascript" src="<?php echo JWB; ?>scanner.js"></script>
<script type="text/javascript" src="<?php echo SWB; ?>js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?php echo SWB; ?>js/popper.min.js"></script>
<script type="text/javascript" src="<?php echo SWB; ?>js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?php echo JWB; ?>toastr/toastr.min.js"></script>
<script type="text/javascript" src="<?php echo $sysconf['admin_template']['dir'].'/'.$sysconf['admin_template']['theme']; ?>/js/smooth-scrollbar.js"></script>
<script type="text/javascript" src="<?php echo $sysconf['admin_template']['dir'].'/'.$sysconf['admin_template']['theme']; ?>/js/overscroll.js"></script>
Expand Down Expand Up @@ -64,7 +64,15 @@
<div class="s-user" id="profile">
<div class="s-user-frame">
<a href="<?php echo MWB.'system/app_user.php?changecurrent=true&action=detail'; ?>" class="s-user-photo subMenuItem">
<img src="<?php echo '../lib/minigalnano/createthumb.php?filename='.IMG.'/persons/'.urlencode(urlencode($_SESSION['upict'])).'&width=200'?>" alt="Photo <?php echo $_SESSION['realname']?>">
<?php
if (filter_var($_SESSION['upict'], FILTER_VALIDATE_URL)) {
$user_image_url = $_SESSION['upict'];
} else {
$user_image = $_SESSION['upict'] && file_exists(IMGBS . 'persons/' . $_SESSION['upict']) ? $_SESSION['upict'] : 'person.png';
$user_image_url = '../lib/minigalnano/createthumb.php?filename=' . IMG . '/persons/' . urlencode(urlencode($user_image)) . '&width=200';
}
?>
<img src="<?= $user_image_url ?>" alt="Photo <?php echo $_SESSION['realname'] ?>">
</a>
</div>
<a href="<?php echo MWB.'system/app_user.php?changecurrent=true&action=detail'; ?>">
Expand Down
10 changes: 9 additions & 1 deletion admin/admin_template/nightmode/index_template.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@
<div class="s-user" id="profile">
<div class="s-user-frame">
<a href="<?php echo MWB.'system/app_user.php?changecurrent=true&action=detail'; ?>" class="s-user-photo subMenuItem">
<img src="<?php echo '../lib/minigalnano/createthumb.php?filename='.IMG.'/persons/'.urlencode(urlencode($_SESSION['upict'])).'&width=200'?>" alt="Photo <?php echo $_SESSION['realname']?>">
<?php
if (filter_var($_SESSION['upict'], FILTER_VALIDATE_URL)) {
$user_image_url = $_SESSION['upict'];
} else {
$user_image = $_SESSION['upict'] && file_exists(IMGBS . 'persons/' . $_SESSION['upict']) ? $_SESSION['upict'] : 'person.png';
$user_image_url = '../lib/minigalnano/createthumb.php?filename=' . IMG . '/persons/' . urlencode(urlencode($user_image)) . '&width=200';
}
?>
<img src="<?= $user_image_url ?>" alt="Photo <?php echo $_SESSION['realname'] ?>">
</a>
</div>
<a href="<?php echo MWB.'system/app_user.php?changecurrent=true&action=detail'; ?>">
Expand Down
6 changes: 3 additions & 3 deletions admin/modules/bibliography/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@

// first field is header
if (isset($_POST['header']) && $n < 1) {
$n++;
$n++; continue;
} else {
// send query
$dbs->query($sql_str);
Expand Down Expand Up @@ -246,7 +246,7 @@
<h2><?php echo __('Import Tool'); ?></h2>
</div>
<div class="infoBox">
<?php echo __('Import for bibliographics data from CSV file. For guide on CVS fields order and format please refer to documentation or visit <a href="http://slims.web.id" target="_blank">Official Website</a>'); ?>
<?php echo __('Import for bibliographics data from CSV file. For guide on CSV fields order and format please refer to documentation or visit <a href="http://slims.web.id" target="_blank">Official Website</a>'); ?>
</div>
</div>
</div>
Expand Down Expand Up @@ -294,4 +294,4 @@
let fileName = $(this).val().replace(/\\/g, '/').replace(/.*\//, '');
$(this).parent('.custom-file').find('.custom-file-label').text(fileName);
});
</script>
</script>
12 changes: 10 additions & 2 deletions admin/modules/bibliography/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,25 @@ function getimagesizefromstring($string_data)
$image_upload->setAllowableFormat($sysconf['allowed_images']);
$image_upload->setMaxSize($sysconf['max_image_upload'] * 1024);
$image_upload->setUploadDir(IMGBS . 'docs');

$img_title = $data['title'].'_'.date("YmdHis");
if(strlen($data['title']) > 70){
$img_title = substr($data['title'], 0, 70).'_'.date("YmdHis");
}

$new_filename = strtolower('cover_'. preg_replace("/[^a-zA-Z0-9]+/", "-", $img_title));
// upload the file and change all space characters to underscore
$img_upload_status = $image_upload->doUpload('image', preg_replace('@\s+@i', '_', $_FILES['image']['name']));
$img_upload_status = $image_upload->doUpload('image', $new_filename);
if ($img_upload_status == UPLOAD_SUCCESS) {
$data['image'] = $dbs->escape_string($image_upload->new_filename);
// write log
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', $_SESSION['realname'] . ' upload image file ' . $image_upload->new_filename);
utility::jsToastr('Bibliography', __('Image Uploaded Successfully'), 'success');
} else {
// write log
$data['image'] = NULL;
utility::writeLogs($dbs, 'staff', $_SESSION['uid'], 'bibliography', 'ERROR : ' . $_SESSION['realname'] . ' FAILED TO upload image file ' . $image_upload->new_filename . ', with error (' . $image_upload->error . ')');
utility::jsToastr('Bibliography', __('Image Uploaded Failed'), 'error');
utility::jsToastr('Bibliography', __('Image Uploaded Failed').'<br/>'.$image_upload->error, 'error');
}
} else if (!empty($_POST['base64picstring'])) {
list($filedata, $filedom) = explode('#image/type#', $_POST['base64picstring']);
Expand Down
39 changes: 24 additions & 15 deletions admin/modules/bibliography/item_import.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,30 +133,39 @@
$item_status = utility::getID($dbs, 'mst_item_status', 'item_status_id', 'item_status_name', $field[9], $stat_id_cache);
$item_status = $item_status?'\''.$item_status.'\'':'NULL';
$site = $field[10]?'\''.$field[10].'\'':'NULL';
$source = $field[11]?'\''.$field[11].'\'':'NULL';
$source = $field[11]?'\''.$field[11].'\'':'0';
$invoice = $field[12]?'\''.$field[12].'\'':'NULL';
$price = $field[13]?'\''.$field[13].'\'':'NULL';
$price_currency = $field[14]?'\''.$field[14].'\'':'NULL';
$invoice_date = $field[15]?'\''.$field[15].'\'':'NULL';
$input_date = '\''.$field[16].'\'';
$last_update = '\''.$field[17].'\'';

// sql insert string
$sql_str = "INSERT INTO item (item_code, call_number, coll_type_id,
inventory_code, received_date, supplier_id,
order_no, location_id, order_date, item_status_id, site,
source, invoice, price, price_currency, invoice_date,
input_date, last_update)
VALUES ($item_code, $call_number, $coll_type,
$inventory_code, $received_date, $supplier,
$order_no, $location, $order_date, $item_status, $site,
$source, $invoice, $price, $price_currency, $invoice_date,
$input_date, $last_update)";
$input_date = $field[16]?'\''.$field[16].'\'':'\''.date('Y-m-d H:i:s').'\'';
$last_update = $field[17]?'\''.$field[17].'\'':'\''.date('Y-m-d H:i:s').'\'';
$title = $field[18];

// first field is header
if (isset($_POST['header']) && $n < 1) {
$n++;
continue;
} else {

// get biblio_id
$b_q = $dbs->query(sprintf("select biblio_id from biblio where title = '%s'", $title));
if($b_q->num_rows < 1) continue;
$b_d = $b_q->fetch_row();
$biblio_id = $b_d[0];

// sql insert string
$sql_str = "INSERT INTO item (biblio_id, item_code, call_number, coll_type_id,
inventory_code, received_date, supplier_id,
order_no, location_id, order_date, item_status_id, site,
source, invoice, price, price_currency, invoice_date,
input_date, last_update)
VALUES ($biblio_id, $item_code, $call_number, $coll_type,
$inventory_code, $received_date, $supplier,
$order_no, $location, $order_date, $item_status, $site,
$source, $invoice, $price, $price_currency, $invoice_date,
$input_date, $last_update)";

// send query
// die($sql_str);
$dbs->query($sql_str);
Expand Down
4 changes: 2 additions & 2 deletions admin/modules/bibliography/marcexport.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@
require LIB.'biblio_list_index.inc.php';
}
// table spec
$table_spec = 'search_biblio';
$table_spec = 'search_biblio AS `index`';
$datagrid->setSQLColumn('biblio_id',
'title AS \''.__('Title').'\'',
'author AS \''.__('Author').'\'');
} else {
require LIB.'biblio_list.inc.php';
// table spec
$table_spec = 'search_biblio';
$table_spec = 'search_biblio AS `index`';
$datagrid->setSQLColumn('biblio_id',
'title AS \''.__('Title').'\'',
'author AS \''.__('Author').'\'');
Expand Down
11 changes: 10 additions & 1 deletion admin/modules/bibliography/pop_attach.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
$fdata['file_url'] = $dbs->escape_string($url);
$fdata['file_dir'] = $dbs->escape_string($file_dir);
$fdata['file_desc'] = $dbs->escape_string(trim(strip_tags($_POST['fileDesc'])));
if(isset($_POST['fileKey']) && trim($_POST['fileKey']) !== '')
$fdata['file_key'] = $dbs->escape_string(trim(strip_tags($_POST['fileKey'])));
$fdata['mime_type'] = $sysconf['mimetype'][$file_ext];
$fdata['input_date'] = date('Y-m-d H:i:s');
$fdata['last_update'] = $fdata['input_date'];
Expand All @@ -110,6 +112,8 @@
$fdata['file_url'] = $dbs->escape_string($fdata['file_name']);
$fdata['file_dir'] = 'literal{NULL}';
$fdata['file_desc'] = $dbs->escape_string(trim(strip_tags($_POST['fileDesc'])));
if(isset($_POST['fileKey']) && trim($_POST['fileKey']) !== '')
$fdata['file_key'] = $dbs->escape_string(trim(strip_tags($_POST['fileKey'])));
$fdata['mime_type'] = 'text/uri-list';
$fdata['input_date'] = date('Y-m-d H:i:s');
$fdata['last_update'] = $fdata['input_date'];
Expand Down Expand Up @@ -144,7 +148,10 @@
// file biblio access update
$update1 = $sql_op->update('biblio_attachment', array('access_type' => $data['access_type'], 'access_limit' => $data['access_limit'], 'placement' => $data['placement']), 'biblio_id='.$updateBiblioID.' AND file_id='.$fileID);
// file description update
$update2 = $sql_op->update('files', array('file_title' => $title, 'file_url' => $url, 'file_desc' => $dbs->escape_string(trim($_POST['fileDesc']))), 'file_id='.$fileID);
$file_desc_update = array('file_title' => $title, 'file_url' => $url, 'file_desc' => $dbs->escape_string(trim($_POST['fileDesc'])));
if(isset($_POST['fileKey']))
$file_desc_update['file_key'] = $dbs->escape_string(trim(strip_tags($_POST['fileKey'])));
$update2 = $sql_op->update('files', $file_desc_update, 'file_id='.$fileID);
if ($update1) {
utility::jsToastr('File Attachment', __('File Attachment data updated!'), 'success');
echo '<script type="text/javascript">';
Expand Down Expand Up @@ -243,6 +250,8 @@

// file description
$form->addTextField('textarea', 'fileDesc', __('Description'), $file_attach_d['file_desc']??'', 'rows="2" class="form-control"');
// file key
$form->addTextField('textarea', 'fileKey', __('File Password'), $file_attach_d['file_key']??'', 'rows="2" class="form-control"');
// file access
$acctype_options[] = array('public', __('Public'));
$acctype_options[] = array('private', __('Private'));
Expand Down
25 changes: 13 additions & 12 deletions admin/modules/bibliography/ucs_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,25 @@
$to_sent['node_info'] = $sysconf['ucs'];
$to_sent['node_data'] = $data;
// create HTTP request
$http_request = new http_request();
// send HTTP POST request
$server_addr = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : (isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : gethostbyname($_SERVER['SERVER_NAME']));
if (isset($sysconf['ucs']['serverversion']) && $sysconf['ucs']['serverversion'] < 3) {
$http_request->send_http_request($sysconf['ucs']['serveraddr'].'/uc-ops.php', $server_addr, $to_sent, 'POST', 'text/json');
} else {
$http_request->send_http_request($sysconf['ucs']['serveraddr'].'/ucs.php', $server_addr, $to_sent, 'POST', 'text/json');
}
$http_request = new \GuzzleHttp\Client();
$http_param = ['body' => json_encode($to_sent), 'http_errors' => false];

if (isset($sysconf['ucs']['serverversion']) && $sysconf['ucs']['serverversion'] < 3) {
$request = $http_request->request('POST', $sysconf['ucs']['serveraddr'].'/uc-ops.php', $http_param);
} else {
$request = $http_request->request('POST', $sysconf['ucs']['serveraddr'].'/ucs.php', $http_param);
}

// below is for debugging purpose only
// die(json_encode(array('status' => 'RAW', 'message' => $http_request->body())));
// die(json_encode(array('status' => 'RAW', 'message' => $request->getBody())));

// check for http request error
if ($req_error = $http_request->error()) {
die(json_encode(array('status' => 'HTTP_REQUEST_ERROR', 'message' => $req_error['message'])));
if ($request->getStatusCode() != '200') {
die(json_encode(array('status' => 'HTTP_REQUEST_ERROR', 'message' => 'HTTP Request error with code : ' . $request->getStatusCode())));
}

// print out body of request result
echo $http_request->body();
echo $request->getBody();
exit();
} else {
die(json_encode(array('status' => 'NO_BIBLIO_SELECTED', 'message' => 'Please select bibliographic data to update!')));
Expand Down
19 changes: 9 additions & 10 deletions admin/modules/bibliography/ucs_upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
$sql = "SELECT
b.biblio_id, b.title, b.spec_detail_info, gmd.gmd_code, gmd.gmd_name, b.edition,
b.isbn_issn, publ.publisher_name, b.publish_year,
b.collation, b.series_title, b.call_number, lang.language_id,
b.collation, b.series_title, b.call_number, b.image, lang.language_id,
lang.language_name, pl.place_name, b.classification, b.notes, fr.frequency
FROM biblio AS b
LEFT JOIN mst_gmd AS gmd ON b.gmd_id=gmd.gmd_id
Expand Down Expand Up @@ -103,26 +103,25 @@
$to_sent['node_info'] = $sysconf['ucs'];
$to_sent['node_data'] = $data;
// create HTTP request
$http_request = new http_request();
// send HTTP POST request
$server_addr = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : (isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : gethostbyname($_SERVER['SERVER_NAME']));
$http_request = new \GuzzleHttp\Client();
$http_param = ['body' => json_encode($to_sent), 'http_errors' => false];

if (isset($sysconf['ucs']['serverversion']) && $sysconf['ucs']['serverversion'] < 3) {
$http_request->send_http_request($sysconf['ucs']['serveraddr'].'/ucpoll.php', $server_addr, $to_sent, 'POST', 'text/json');
$request = $http_request->request('POST', $sysconf['ucs']['serveraddr'].'/ucpoll.php', $http_param);
} else {
$http_request->send_http_request($sysconf['ucs']['serveraddr'].'/ucs.php', $server_addr, $to_sent, 'POST', 'text/json');
$request = $http_request->request('POST', $sysconf['ucs']['serveraddr'].'/ucs.php', $http_param);
}

// below is for debugging purpose only
// die(json_encode(array('status' => 'RAW', 'message' => $http_request->body())));
// die(json_encode(array('status' => 'RAW', 'message' => $request->getBody())));

// check for http request error
if ($req_error = $http_request->error()) {
die(json_encode(array('status' => 'HTTP_REQUEST_ERROR', 'message' => $req_error['message'])));
if ($request->getStatusCode() != '200') {
die(json_encode(array('status' => 'HTTP_REQUEST_ERROR', 'message' => 'HTTP Request error with code : ' . $request->getStatusCode())));
}

// print out body of request result
echo $http_request->body();
echo $request->getBody();
exit();
} else {
die(json_encode(array('status' => 'NO_DATA', 'message' => 'No Data to be uploaded to Union Catalog Server')));
Expand Down
Loading