?> <?php } ?> <br> <!-- If Member Logged ============================================= --> <h2><?php echo __('Information'); ?> </h2> <hr/> <p><?php echo utility::isMemberLogin() ? $header_info : $info; ?> </p> <br/> <!-- Show if clustering search is enabled ============================================= --> <?php if (isset($_GET['keywords']) && !empty($_GET['keywords'])) { if ($sysconf['enable_search_clustering']) { ?> <h2><?php echo __('Search Cluster'); ?> </h2>
/** * Method to make an output of document records * * @return string */ protected function makeOutput() { global $sysconf; // init the result buffer $_buffer = ''; // keywords from last search $_keywords = ''; // loop data $_i = 0; if (!$this->resultset) { return '<div class="errorBox">Query error : ' . $this->query_error . '</div>'; } if (isset($_GET['keywords'])) { $_keywords = urlencode(trim(urldecode($_GET['keywords']))); } // include biblio list HTML template callback include SB . $sysconf['template']['dir'] . '/' . $sysconf['template']['theme'] . '/biblio_list_template.php'; $settings = ''; $settings = get_object_vars($this); $settings['keywords'] = $_keywords; while ($_biblio_d = $this->resultset->fetch_assoc()) { $_buffer .= biblio_list_format($this->obj_db, $_biblio_d, $_i, $settings, $return_back); $_i++; } // free resultset memory $this->resultset->free_result(); // paging if ($this->num_rows > $this->num2show) { $_paging = '<div class="biblioPaging">' . simbio_paging::paging($this->num_rows, $this->num2show, 5) . '</div>'; } else { $_paging = ''; } $_biblio_list = ''; $_is_member_logged_in = utility::isMemberLogin() && $this->enable_mark; if ($_paging) { $_biblio_list .= $_paging; } if ($_is_member_logged_in) { $_submit = '<div class="biblioMarkFormAction"><input type="submit" name="markBiblio" value="' . __('Put marked selection into basket') . '" /></div>'; $_biblio_list .= '<form class="biblioMarkForm" method="post" action="index.php?p=member#biblioBasket">'; $_biblio_list .= $_submit; } $_biblio_list .= $_buffer; if ($_is_member_logged_in) { $_biblio_list .= $_submit; $_biblio_list .= '</form>'; } if ($_paging) { $_biblio_list .= $_paging; } return $_biblio_list; }
$sql_q = 'SELECT att.*, f.* FROM biblio_attachment AS att LEFT JOIN files AS f ON att.file_id=f.file_id WHERE att.file_id=' . $fileID . ' AND att.biblio_id=' . $biblioID . ' AND att.access_type=\'public\''; /* die('SELECT att.*, f.* FROM biblio_attachment AS att LEFT JOIN files AS f ON att.file_id=f.file_id WHERE att.file_id='.$fileID.' AND att.biblio_id='.$biblioID.' AND att.access_type=\'public\''); */ $file_q = $dbs->query($sql_q); $file_d = $file_q->fetch_assoc(); if ($file_q->num_rows > 0) { $file_loc = REPOBS . '/' . $file_d['file_dir'] . '/' . $file_d['file_name']; if (file_exists($file_loc)) { // check access limit if ($file_d['access_limit']) { if (utility::isMemberLogin()) { $allowed_mem_types = @unserialize($file_d['access_limit']); if (!in_array($_SESSION['m_member_type_id'], $allowed_mem_types)) { # Access to file restricted # Member logged in but doesnt have privilege to download header("location:index.php"); exit; } } else { header("location:index.php"); exit; } } if ($file_d['mime_type'] == 'application/pdf') { $swf = basename($file_loc); $swf = sha1($swf);
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ // be sure that this file not accessed directly if (!defined('INDEX_AUTH')) { die("can not access this file directly"); } elseif (INDEX_AUTH != 1) { die("can not access this file directly"); } // IP based access limitation do_checkIP('opac'); do_checkIP('opac-member'); // required file require LIB . 'member_logon.inc.php'; // check if member already logged in $is_member_login = utility::isMemberLogin(); $info = __('Welcome to Member\'s Area where you can view your current loan information and view your membership status.'); // member's password changing flags define('CURR_PASSWD_WRONG', -1); define('PASSWD_NOT_MATCH', -2); define('CANT_UPDATE_PASSWD', -3); // if member is logged out if (isset($_GET['logout']) && $_GET['logout'] == '1') { // write log utility::writeLogs($dbs, 'member', $_SESSION['email'], 'Login', $_SESSION['member_name'] . ' Log Out from address ' . $_SERVER['REMOTE_ADDR']); // completely destroy session cookie simbio_security::destroySessionCookie(null, MEMBER_COOKIES_NAME, SWB, false); header('Location: index.php?p=member'); header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); header('Pragma: no-cache');
/** * * Format bibliographic item list for OPAC display * * @param object $dbs * @param array $biblio_detail * @param int $n * @param array $settings * @param array $return_back * * return string * */ function biblio_list_format($dbs, $biblio_detail, $n, $settings = array(), &$return_back = array()) { global $label_cache, $sysconf; // init output var $output = ''; $title = $biblio_detail['title']; $biblio_id = $biblio_detail['biblio_id']; $detail_url = SWB . 'index.php?p=show_detail&id=' . $biblio_id . '&keywords=' . $settings['keywords']; $cite_url = SWB . 'index.php?p=cite&id=' . $biblio_id . '&keywords=' . $settings['keywords']; $title_link = '<a href="' . $detail_url . '" class="titleField" itemprop="name" property="name" title="' . __('View record detail description for this title') . '">' . $title . '</a>'; // label if ($settings['show_labels'] and !empty($biblio_detail['labels'])) { $labels = @unserialize($biblio_detail['labels']); if ($labels !== false) { foreach ($labels as $label) { if (!isset($label_cache[$label[0]]['name'])) { $label_q = $dbs->query('SELECT label_name, label_desc, label_image FROM mst_label AS lb WHERE lb.label_name=\'' . $label[0] . '\''); $label_d = $label_q->fetch_row(); $label_cache[$label[0]] = array('name' => $label_d[0], 'desc' => $label_d[1], 'image' => $label_d[2]); } if (isset($label[1]) && $label[1]) { $title_link .= ' <a itemprop="name" property="name" href="' . $label[1] . '" target="_blank"><img src="' . SWB . IMAGES_DIR . '/labels/' . $label_cache[$label[0]]['image'] . '" title="' . $label_cache[$label[0]]['desc'] . '" alt="' . $label_cache[$label[0]]['desc'] . '" align="middle" class="labels" border="0" /></a>'; } else { $title_link .= ' <img src="' . SWB . IMG . '/labels/' . $label_cache[$label[0]]['image'] . '" title="' . $label_cache[$label[0]]['desc'] . '" alt="' . $label_cache[$label[0]]['desc'] . '" align="middle" class="labels" />'; } } } } // button $xml_button = ''; $detail_button = '<a href="' . $detail_url . '" class="detailLink slims-button slims-button--flat slims-button--blue" title="' . __('View record detail description for this title') . '">' . __('Record Detail') . '</a>'; if ($settings['xml_detail']) { $xml_button = '<a href="' . $detail_url . '&inXML=true" class="xmlDetailLink slims-button slims-button--flat slims-button--default" title="View record detail description in XML Format" target="_blank">XML Detail</a>'; } // citation button $cite_button = '<a href="' . $cite_url . '" class="openPopUp citationLink slims-button slims-button--circle slims-button--flat slims-button--default" title="Citation for: ' . substr($title, 0, 50) . '" target="_blank"><i class="material-icons">description</i></a>'; // cover images var $image_cover = ''; if ($sysconf['tg']['type'] == 'minigalnano') { if (!empty($biblio_detail['image']) && !defined('LIGHTWEIGHT_MODE')) { $book_image = urlencode($biblio_detail['image']); $image_loc = '../../images/docs/' . $book_image; } else { $image_loc = '../../images/default/image.png'; } $thumb_url = './lib/minigalnano/createthumb.php?filename=' . urlencode($image_loc) . '&width=120'; $image_cover = '<img src="' . $thumb_url . '" class="img-thumbnail" itemprop="image" alt="' . $title . '" />'; } // $alt_list = ($n%2 == 0)?'alterList':'alterList2'; $output .= '<div class="slims-row">'; $output .= '<div class="item slims-12 biblioRecord" itemscope itemtype="http://schema.org/Book" vocab="http://schema.org/" typeof="Book"><div class="cover-list">' . $image_cover . '</div>'; $output .= '<div class="detail-list"><h4>' . $title_link . '</h4>'; // concat author data $_authors = isset($biblio_detail['author']) ? $biblio_detail['author'] : biblio_list_model::getAuthors($dbs, $biblio_id, true); $output .= '<div class="author" itemprop="author" property="author" itemscope itemtype="http://schema.org/Person">'; if ($_authors) { $_authors_string = ''; if (is_array($_authors)) { foreach ($_authors as $author) { $_authors_string .= '<span class="author-name" itemprop="name" property="name">' . $author . '</span> - '; } } else { $_authors_string .= '<span class="author-name" itemprop="name" property="name">' . $_authors . '</span> - '; } $_authors_string = substr_replace($_authors_string, '', -2); $output .= $_authors_string; // $output .= '<div class="author" itemprop="author"><b>'.__('Author(s)').'</b> : '.$_authors.'</div>'; } $output .= '</div>'; // checking custom frontpage file if ($settings['enable_custom_frontpage'] and $settings['custom_fields']) { foreach ($settings['custom_fields'] as $field => $field_opts) { if ($field_opts[0] == 1) { if ($field == 'edition') { $output .= '<div class="customField editionField" itemprop="bookEdition" property="bookEdition"><b>' . $field_opts[1] . '</b> : ' . $biblio_detail['edition'] . '</div>'; } else { if ($field == 'isbn_issn') { $output .= '<div class="customField isbnField" itemprop="isbn" property="isbn"><b>' . $field_opts[1] . '</b> : ' . $biblio_detail['isbn_issn'] . '</div>'; } else { if ($field == 'collation') { $output .= '<div class="customField collationField" itemprop="numberOfPages" property="numberOfPages"><b>' . $field_opts[1] . '</b> : ' . $biblio_detail['collation'] . '</div>'; } else { if ($field == 'series_title') { $output .= '<div class="customField seriesTitleField" itemprop="alternativeHeadline" property="alternativeHeadline"><b>' . $field_opts[1] . '</b> : ' . $biblio_detail['series_title'] . '</div>'; } else { if ($field == 'call_number') { $output .= '<div class="customField callNumberField"><b>' . $field_opts[1] . '</b> : ' . $biblio_detail['call_number'] . '</div>'; } else { if ($field == 'availability' && !$settings['disable_item_data']) { // get total number of this biblio items/copies $_item_q = $dbs->query('SELECT COUNT(*) FROM item WHERE biblio_id=' . $biblio_id); $_item_c = $_item_q->fetch_row(); // get total number of currently borrowed copies $_borrowed_q = $dbs->query('SELECT COUNT(*) FROM loan AS l INNER JOIN item AS i' . ' ON l.item_code=i.item_code WHERE l.is_lent=1 AND l.is_return=0 AND i.biblio_id=' . $biblio_id); $_borrowed_c = $_borrowed_q->fetch_row(); // total available $_total_avail = $_item_c[0] - $_borrowed_c[0]; if ($_total_avail < 1) { $output .= '<div class="customField availabilityField"><b>' . $field_opts[1] . '</b> : <strong style="color: #f00;">' . __('none copy available') . '</strong></div>'; } else { $item_availability_message = $_total_avail . ' copies available for loan'; $output .= '<div class="customField availabilityField"><b>' . $field_opts[1] . '</b> : ' . $item_availability_message . '</div>'; } } else { if ($field == 'node_id' && $settings['disable_item_data']) { $output .= '<div class="customField locationField"><b>' . $field_opts[1] . '</b> : ' . $sysconf['node'][$biblio_detail['node_id']]['name'] . '</div>'; } } } } } } } } } } // social buttons if ($sysconf['social_shares']) { // share buttons $detail_url_encoded = urlencode('http://' . $_SERVER['SERVER_NAME'] . $detail_url); $_share_btns = "\n" . '<ul class="share-buttons">' . '<li>' . __('Share to') . ': </li>' . '<li><a href="http://www.facebook.com/sharer.php?u=' . $detail_url_encoded . '" title="Facebook" target="_blank"><img src="./images/default/fb.gif" alt="Share this title to Facebook" /></a></li>' . '<li><a href="http://twitter.com/share?url=' . $detail_url_encoded . '&text=' . urlencode($title) . '" title="Twitter" target="_blank"><img src="./images/default/tw.gif" alt="Share this title to Twitter" /></a></li>' . '<li><a href="https://plus.google.com/share?url=' . $detail_url_encoded . '" title="Google Plus" target="_blank"><img src="./images/default/gplus.gif" alt="Share this title to Google Plus" /></a></li>' . '<li><a href="http://www.digg.com/submit?url=' . $detail_url_encoded . '" title="Digg It" target="_blank"><img src="./images/default/digg.gif" alt="Share this title to Digg It" /></a></li>' . '<li><a href="http://reddit.com/submit?url=' . $detail_url_encoded . '&title=' . urlencode($title) . '" title="Reddit" target="_blank"><img src="./images/default/rdit.gif" alt="Share this title to Reddit" /></a></li>' . '<li><a href="http://www.linkedin.com/shareArticle?mini=true&url=' . $detail_url_encoded . '" title="LinkedIn" target="_blank"><img src="./images/default/lin.gif" alt="Share this title to LinkedIn" /></a></li>' . '<li><a href="http://www.stumbleupon.com/submit?url=' . $detail_url_encoded . '&title=' . urlencode($title) . '" title="Stumbleupon" target="_blank"><img src="./images/default/su.gif" alt="Share this title to StumbleUpon" /></a></li>' . '</ul>' . "\n"; // $output .= $_share_btns; } // checkbox for marking collection $_i = rand(); // Add By Eddy Subratha $_check_mark = utility::isMemberLogin() && $settings['enable_mark'] ? ' <input type="checkbox" id="biblioCheck' . $_i . '" name="biblio[]" class="biblioCheck" value="' . $biblio_id . '" /> <label for="biblioCheck' . $_i . '">' . __('mark this') . '</label>' : ''; $output .= '<div class="subItem">' . $_check_mark . '</div></div>'; // share menu $menu = '<div class="slims-card--menu">'; $menu .= $cite_button; $menu .= '<button class="slims-button slims-button--circle slims-button--flat slims-button--default"><i class="material-icons">favorite_border</i></button>'; $menu .= '<button class="slims-button slims-button--circle slims-button--flat slims-button--default"><i class="material-icons">file_download</i></button>'; $menu .= '<button class="slims-button slims-button--circle slims-button--flat slims-button--default"><i class="material-icons">share</i></button>'; $menu .= '</div>'; $output .= $menu; $output .= "</div></div>\n"; return $output; }
/** * Method to make an output of document records * * @return string */ protected function makeOutput() { global $sysconf; // init the result buffer $_buffer = ''; // keywords from last search $_keywords = ''; // loop data $_i = 0; if (!$this->resultset) { return '<div class="errorBox">Query error : ' . $this->query_error . '</div>'; } if (isset($_GET['keywords'])) { $_keywords = urlencode(trim(urldecode($_GET['keywords']))); } while ($_biblio_d = $this->resultset->fetch_assoc()) { $_detail_link = SWB . 'index.php?p=show_detail&id=' . $_biblio_d['biblio_id'] . '&keywords=' . $_keywords; $_title_plain = $_biblio_d['title']; $_biblio_d['title'] = '<a href="' . $_detail_link . '" class="titleField" itemprop="name" property="name" title="' . __('View record detail description for this title') . '">' . $_biblio_d['title'] . '</a>'; // label if ($this->show_labels and !empty($_biblio_d['labels'])) { $arr_labels = @unserialize($_biblio_d['labels']); if ($arr_labels !== false) { foreach ($arr_labels as $label) { if (!isset($this->label_cache[$label[0]]['name'])) { $_label_q = $this->obj_db->query('SELECT label_name, label_desc, label_image FROM mst_label AS lb WHERE lb.label_name=\'' . $label[0] . '\''); $_label_d = $_label_q->fetch_row(); $this->label_cache[$label[0]] = array('name' => $_label_d[0], 'desc' => $_label_d[1], 'image' => $_label_d[2]); } if (isset($label[1]) && $label[1]) { $_biblio_d['title'] .= ' <a href="' . $label[1] . '" target="_blank"><img src="' . SWB . IMAGES_DIR . '/labels/' . $this->label_cache[$label[0]]['image'] . '" title="' . $this->label_cache[$label[0]]['desc'] . '" alt="' . $this->label_cache[$label[0]]['desc'] . '" align="middle" class="labels" border="0" /></a>'; } else { $_biblio_d['title'] .= ' <img src="' . SWB . IMG . '/labels/' . $this->label_cache[$label[0]]['image'] . '" title="' . $this->label_cache[$label[0]]['desc'] . '" alt="' . $this->label_cache[$label[0]]['desc'] . '" align="middle" class="labels" />'; } } } } // button $_biblio_d['detail_button'] = '<a href="' . $_detail_link . '" class="detailLink" title="' . __('View record detail description for this title') . '">' . __('Record Detail') . '</a>'; if ($this->xml_detail) { $_biblio_d['xml_button'] = '<a href="' . $_detail_link . '&inXML=true" class="xmlDetailLink" title="View record detail description in XML Format" target="_blank">XML Detail</a>'; } else { $_biblio_d['xml_button'] = ''; } // cover images var $_image_cover = ''; if (!empty($_biblio_d['image']) && !defined('LIGHTWEIGHT_MODE')) { $_biblio_d['image'] = urlencode($_biblio_d['image']); $images_loc = '../../images/docs/' . $_biblio_d['image']; if ($sysconf['tg']['type'] == 'minigalnano') { $thumb_url = './lib/minigalnano/createthumb.php?filename=' . urlencode($images_loc) . '&width=90'; $_image_cover = '<img src="' . $thumb_url . '" class="img-thumbnail" itemprop="image" />'; } } $_alt_list = $_i % 2 == 0 ? 'alterList' : 'alterList2'; $_buffer .= '<div class="item biblioRecord" itemscope itemtype="http://schema.org/Book" vocab="http://schema.org/" typeof="Book"><div class="cover-list">' . $_image_cover . '</div>'; $_buffer .= '<div class="detail-list"><h4>' . $_biblio_d['title'] . '</h4>'; // concat author data $_authors = isset($_biblio_d['author']) ? $_biblio_d['author'] : self::getAuthors($this->obj_db, $_biblio_d['biblio_id'], true); $_buffer .= '<div class="author" itemprop="author" property="author" itemscope itemtype="http://schema.org/Person">'; if ($_authors) { $_authors_string = ''; foreach ($_authors as $author) { $_authors_string .= '<span class="author-name" itemprop="name" property="name">' . $author . '</span> - '; } $_authors_string = substr_replace($_authors_string, '', -2); $_buffer .= $_authors_string; // $_buffer .= '<div class="author" itemprop="author"><b>'.__('Author(s)').'</b> : '.$_authors.'</div>'; } $_buffer .= '</div>'; # checking custom file if ($this->enable_custom_frontpage and $this->custom_fields) { foreach ($this->custom_fields as $_field => $_field_opts) { if ($_field_opts[0] == 1) { if ($_field == 'edition') { $_buffer .= '<div class="customField editionField" itemprop="bookEdition" property="bookEdition"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['edition'] . '</div>'; } else { if ($_field == 'isbn_issn') { $_buffer .= '<div class="customField isbnField" itemprop="isbn" property="isbn"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['isbn_issn'] . '</div>'; } else { if ($_field == 'collation') { $_buffer .= '<div class="customField collationField" itemprop="numberOfPages" property="numberOfPages"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['collation'] . '</div>'; } else { if ($_field == 'series_title') { $_buffer .= '<div class="customField seriesTitleField" itemprop="alternativeHeadline" property="alternativeHeadline"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['series_title'] . '</div>'; } else { if ($_field == 'call_number') { $_buffer .= '<div class="customField callNumberField"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['call_number'] . '</div>'; } else { if ($_field == 'availability' && !$this->disable_item_data) { // get total number of this biblio items/copies $_item_q = $this->obj_db->query('SELECT COUNT(*) FROM item WHERE biblio_id=' . $_biblio_d['biblio_id']); $_item_c = $_item_q->fetch_row(); // get total number of currently borrowed copies $_borrowed_q = $this->obj_db->query('SELECT COUNT(*) FROM loan AS l INNER JOIN item AS i' . ' ON l.item_code=i.item_code WHERE l.is_lent=1 AND l.is_return=0 AND i.biblio_id=' . $_biblio_d['biblio_id']); $_borrowed_c = $_borrowed_q->fetch_row(); // total available $_total_avail = $_item_c[0] - $_borrowed_c[0]; if ($_total_avail < 1) { $_buffer .= '<div class="customField availabilityField"><b>' . $_field_opts[1] . '</b> : <strong style="color: #f00;">' . __('none copy available') . '</strong></div>'; } else { $this->item_availability_message = $_total_avail . ' copies available for loan'; $_buffer .= '<div class="customField availabilityField"><b>' . $_field_opts[1] . '</b> : ' . $this->item_availability_message . '</div>'; } } else { if ($_field == 'node_id' && $this->disable_item_data) { $_buffer .= '<div class="customField locationField"><b>' . $_field_opts[1] . '</b> : ' . $sysconf['node'][$_biblio_d['node_id']]['name'] . '</div>'; } } } } } } } } } } // checkbox for marking collection $_check_mark = utility::isMemberLogin() && $this->enable_mark ? ' <input type="checkbox" id="biblioCheck' . $_i . '" name="biblio[]" class="biblioCheck" value="' . $_biblio_d['biblio_id'] . '" /> <label for="biblioCheck' . $_i . '">' . __('mark this') . '</label>' : ''; $_buffer .= '<div class="subItem">' . $_biblio_d['detail_button'] . ' ' . $_biblio_d['xml_button'] . $_check_mark . '</div>'; if ($sysconf['social_shares']) { // share buttons $_detail_link_encoded = urlencode('http://' . $_SERVER['SERVER_NAME'] . $_detail_link); $_share_btns = "\n" . '<ul class="share-buttons">' . '<li>' . __('Share to') . ': </li>' . '<li><a href="http://www.facebook.com/sharer.php?u=' . $_detail_link_encoded . '" title="Facebook" target="_blank"><img src="./images/default/fb.gif" alt="Share this title to Facebook" /></a></li>' . '<li><a href="http://twitter.com/share?url=' . $_detail_link_encoded . '&text=' . urlencode($_title_plain) . '" title="Twitter" target="_blank"><img src="./images/default/tw.gif" alt="Share this title to Twitter" /></a></li>' . '<li><a href="https://plus.google.com/share?url=' . $_detail_link_encoded . '" title="Google Plus" target="_blank"><img src="./images/default/gplus.gif" alt="Share this title to Google Plus" /></a></li>' . '<li><a href="http://www.digg.com/submit?url=' . $_detail_link_encoded . '" title="Digg It" target="_blank"><img src="./images/default/digg.gif" alt="Share this title to Digg It" /></a></li>' . '<li><a href="http://reddit.com/submit?url=' . $_detail_link_encoded . '&title=' . urlencode($_title_plain) . '" title="Reddit" target="_blank"><img src="./images/default/rdit.gif" alt="Share this title to Reddit" /></a></li>' . '<li><a href="http://www.linkedin.com/shareArticle?mini=true&url=' . $_detail_link_encoded . '" title="LinkedIn" target="_blank"><img src="./images/default/lin.gif" alt="Share this title to LinkedIn" /></a></li>' . '<li><a href="http://www.stumbleupon.com/submit?url=' . $_detail_link_encoded . '&title=' . urlencode($_title_plain) . '" title="Stumbleupon" target="_blank"><img src="./images/default/su.gif" alt="Share this title to StumbleUpon" /></a></li>' . '</ul>' . "\n"; $_buffer .= $_share_btns; } $_buffer .= "</div></div>\n"; $_i++; } // free resultset memory $this->resultset->free_result(); // paging if ($this->num_rows > $this->num2show) { $_paging = '<div class="biblioPaging">' . simbio_paging::paging($this->num_rows, $this->num2show, 5) . '</div>'; } else { $_paging = ''; } $_biblio_list = ''; $_is_member_logged_in = utility::isMemberLogin() && $this->enable_mark; if ($_paging) { $_biblio_list .= $_paging; } if ($_is_member_logged_in) { $_submit = '<div class="biblioMarkFormAction"><input type="submit" name="markBiblio" value="' . __('Put marked selection into basket') . '" /></div>'; $_biblio_list .= '<form class="biblioMarkForm" method="post" action="index.php?p=member#biblioBasket">'; $_biblio_list .= $_submit; } $_biblio_list .= $_buffer; if ($_is_member_logged_in) { $_biblio_list .= $_submit; $_biblio_list .= '</form>'; } if ($_paging) { $_biblio_list .= $_paging; } return $_biblio_list; }
/** * Method to get file attachments information of biblio * * @param boolean $bool_return_raw * * @return mix */ public function getAttachments($bool_return_raw = false) { $items = array(); $_output = ''; $attachment_q = $this->obj_db->query(sprintf('SELECT att.*, f.* FROM biblio_attachment AS att LEFT JOIN files AS f ON att.file_id=f.file_id WHERE att.biblio_id=%d AND att.access_type=\'public\' LIMIT 20', $this->detail_id)); if ($attachment_q->num_rows < 1) { $_output = '<div class="alert alert-error no-attachment">' . __('No Attachment') . '</div>'; if (!$bool_return_raw) { return $_output; } return false; } else { $_output .= '<ul class="attachList">'; while ($attachment_d = $attachment_q->fetch_assoc()) { // check member type privileges if ($attachment_d['access_limit']) { if (utility::isMemberLogin()) { $allowed_mem_types = @unserialize($attachment_d['access_limit']); if (!in_array($_SESSION['m_member_type_id'], $allowed_mem_types)) { continue; } } else { continue; } } #if (preg_match('@(video|audio|image)/.+@i', $attachment_d['mime_type'])) { if ($attachment_d['mime_type'] == 'application/pdf') { $_output .= '<li class="attachment-pdf" style="list-style-image: url(images/labels/ebooks.png)" itemscope itemtype="http://schema.org/MediaObject"><a itemprop="name" property="name" class="openPopUp" title="' . $attachment_d['file_title'] . '" href="./index.php?p=fstream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '&fname=' . $attachment_d['file_name'] . '" width="780" height="520">' . $attachment_d['file_title'] . '</a>'; $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div>'; if (trim($attachment_d['file_url']) != '') { $_output .= '<div><a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource related to this book" target="_blank">Other Resource Link</a></div>'; } $_output .= '</li>'; } else { if (preg_match('@(video)/.+@i', $attachment_d['mime_type'])) { $_output .= '<li class="attachment-audio-video" itemprop="video" property="video" itemscope itemtype="http://schema.org/VideoObject" style="list-style-image: url(images/labels/auvi.png)">' . '<a itemprop="name" property="name" class="openPopUp" title="' . $attachment_d['file_title'] . '" href="./index.php?p=multimediastream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '" width="640" height="480">' . $attachment_d['file_title'] . '</a>'; $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div>'; if (trim($attachment_d['file_url']) != '') { $_output .= '<div><a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource Link" target="_blank">Other Resource Link</a></div>'; } $_output .= '</li>'; } else { if (preg_match('@(audio)/.+@i', $attachment_d['mime_type'])) { $_output .= '<li class="attachment-audio-audio" itemprop="audio" property="audio" itemscope itemtype="http://schema.org/AudioObject" style="list-style-image: url(images/labels/auvi.png)">' . '<a itemprop="name" property="name" class="openPopUp" title="' . $attachment_d['file_title'] . '" href="./index.php?p=multimediastream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '" width="640" height="480">' . $attachment_d['file_title'] . '</a>'; $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div>'; if (trim($attachment_d['file_url']) != '') { $_output .= '<div><a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource Link" target="_blank">Other Resource Link</a></div>'; } $_output .= '</li>'; } else { if ($attachment_d['mime_type'] == 'text/uri-list') { $_output .= '<li class="attachment-url-list" style="list-style-image: url(images/labels/url.png)" itemscope itemtype="http://schema.org/MediaObject"><a itemprop="name" property="name" href="' . trim($attachment_d['file_url']) . '" title="Click to open link" target="_blank">' . $attachment_d['file_title'] . '</a><div class="attachment-desc">' . $attachment_d['file_desc'] . '</div></li>'; } else { if (preg_match('@(image)/.+@i', $attachment_d['mime_type'])) { $file_loc = REPOBS . '/' . $attachment_d['file_dir'] . '/' . $attachment_d['file_name']; $imgsize = GetImageSize($file_loc); $imgwidth = $imgsize[0] + 16; if ($imgwidth > 600) { $imgwidth = 600; } $imgheight = $imgsize[1] + 16; if ($imgheight > 400) { $imgheight = 400; } $_output .= '<li class="attachment-image" style="list-style-image: url(images/labels/ebooks.png)" itemprop="image" itemscope itemtype="http://schema.org/ImageObject"><a itemprop="name" property="name" class="openPopUp" title="' . $attachment_d['file_title'] . '" href="index.php?p=fstream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '" width="' . $imgwidth . '" height="' . $imgheight . '">' . $attachment_d['file_title'] . '</a>'; if (trim($attachment_d['file_url']) != '') { $_output .= ' [<a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource related to this file" target="_blank" style="font-size: 90%;">Other Resource Link</a>]'; } $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div></li>'; } else { $_output .= '<li class="attachment-image" style="list-style-image: url(images/labels/ebooks.png)" itemscope itemtype="http://schema.org/MediaObject"><a itemprop="name" property="name" title="Click To View File" href="index.php?p=fstream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '" target="_blank">' . $attachment_d['file_title'] . '</a>'; if (trim($attachment_d['file_url']) != '') { $_output .= ' [<a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource related to this file" target="_blank" style="font-size: 90%;">Other Resource Link</a>]'; } $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div></li>'; } } } } } } $_output .= '</ul>'; if (!$bool_return_raw) { return $bool_return_raw; } return $items; } }
/** * Method to make an output of document records * * @return string */ protected function makeOutput() { global $sysconf; // init the result buffer $_buffer = ''; // loop data $_i = 0; if (!$this->resultset) { return '<div style="border: 1px dotted #f00; color: #f00; padding: 5px; margin: 5px;">Query error : ' . $this->query_error . '</div>'; } while ($_biblio_d = $this->resultset->fetch_assoc()) { $_biblio_d['title'] = '<a href="' . $sysconf['baseurl'] . 'index.php?p=show_detail&id=' . $_biblio_d['biblio_id'] . '" class="titleField" title="' . __('Record Detail') . '">' . $_biblio_d['title'] . '</a>'; // label if ($this->show_labels and !empty($_biblio_d['labels'])) { $arr_labels = @unserialize($_biblio_d['labels']); if ($arr_labels !== false) { foreach ($arr_labels as $label) { if (!isset($this->label_cache[$label[0]]['name'])) { $_label_q = $this->obj_db->query('SELECT label_name, label_desc, label_image FROM mst_label AS lb WHERE lb.label_name=\'' . $label[0] . '\''); $_label_d = $_label_q->fetch_row(); $this->label_cache[$label[0]] = array('name' => $_label_d[0], 'desc' => $_label_d[1], 'image' => $_label_d[2]); } if (isset($label[1]) && $label[1]) { $_biblio_d['title'] .= ' <a href="' . $label[1] . '" target="_blank"><img src="' . SENAYAN_WEB_ROOT_DIR . IMAGES_DIR . '/labels/' . $this->label_cache[$label[0]]['image'] . '" title="' . $this->label_cache[$label[0]]['desc'] . '" align="middle" class="labels" border="0" /></a>'; } else { $_biblio_d['title'] .= ' <img src="' . SENAYAN_WEB_ROOT_DIR . IMAGES_DIR . '/labels/' . $this->label_cache[$label[0]]['image'] . '" title="' . $this->label_cache[$label[0]]['desc'] . '" align="middle" class="labels" />'; } } } } // button $_biblio_d['detail_button'] = '<a href="' . $sysconf['baseurl'] . 'index.php?p=show_detail&id=' . $_biblio_d['biblio_id'] . '" class="detailLink" title="' . __('Record Detail') . '">' . __('Record Detail') . '</a>'; if ($this->xml_detail) { $_biblio_d['xml_button'] = '<a href="' . $sysconf['baseurl'] . 'index.php?p=show_detail&inXML=true&id=' . $_biblio_d['biblio_id'] . '" class="xmlDetailLink" title="View Detail in XML Format" target="_blank">XML Detail</a>'; } else { $_biblio_d['xml_button'] = ''; } // cover images var $_image_cover = ''; if (!empty($_biblio_d['image']) && !defined('LIGHTWEIGHT_MODE')) { $_biblio_d['image'] = urlencode($_biblio_d['image']); $images_loc = 'images/docs/' . $_biblio_d['image']; #$cache_images_loc = 'images/cache/'.$_biblio_d['image']; if ($sysconf['tg']['type'] == 'phpthumb') { $_image_cover = 'style="background-image: url(./lib/phpthumb/phpThumb.php?src=' . $sysconf['tg']['relative_url'] . '' . $images_loc . '&w=42); background-repeat: no-repeat;"'; } elseif ($sysconf['tg']['type'] == 'minigalnano') { $_image_cover = 'style="background-image: url(./lib/minigalnano/createthumb.php?filename=' . $sysconf['tg']['relative_url'] . '' . $images_loc . '&width=42); background-repeat: no-repeat;"'; } else { $_image_cover = 'style="background-image: url(./lib/phpthumb/phpThumb.php?src=' . $sysconf['tg']['relative_url'] . '' . $images_loc . '&w=42); background-repeat: no-repeat;"'; } } $_alt_list = $_i % 2 == 0 ? 'alterList' : 'alterList2'; $_buffer .= '<div class="item ' . $_alt_list . '" ' . $_image_cover . '>' . $_biblio_d['title'] . '<br />'; // concat author data $_authors = isset($_biblio_d['author']) ? $_biblio_d['author'] : self::getAuthors($this->obj_db, $_biblio_d['biblio_id']); if ($_authors) { $_buffer .= '<div class="subItem authorField"><b>' . __('Author(s)') . '</b> : ' . $_authors . '</div>'; } # checking custom file if ($this->enable_custom_frontpage and $this->custom_fields) { foreach ($this->custom_fields as $_field => $_field_opts) { if ($_field_opts[0] == 1) { if ($_field == 'edition') { $_buffer .= '<div class="customField editionField"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['edition'] . '</div>'; } else { if ($_field == 'isbn_issn') { $_buffer .= '<div class="customField isbnField"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['isbn_issn'] . '</div>'; } else { if ($_field == 'collation') { $_buffer .= '<div class="customField collationField"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['collation'] . '</div>'; } else { if ($_field == 'series_title') { $_buffer .= '<div class="customField seriesTitleField"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['series_title'] . '</div>'; } else { if ($_field == 'call_number') { $_buffer .= '<div class="customField callNumberField"><b>' . $_field_opts[1] . '</b> : ' . $_biblio_d['call_number'] . '</div>'; } else { if ($_field == 'availability' && !$this->disable_item_data) { // get total number of this biblio items/copies $_item_q = $this->obj_db->query('SELECT COUNT(*) FROM item WHERE biblio_id=' . $_biblio_d['biblio_id']); $_item_c = $_item_q->fetch_row(); // get total number of currently borrowed copies $_borrowed_q = $this->obj_db->query('SELECT COUNT(*) FROM loan AS l INNER JOIN item AS i' . ' ON l.item_code=i.item_code WHERE l.is_lent=1 AND l.is_return=0 AND i.biblio_id=' . $_biblio_d['biblio_id']); $_borrowed_c = $_borrowed_q->fetch_row(); // total available $_total_avail = $_item_c[0] - $_borrowed_c[0]; if ($_total_avail < 1) { $_buffer .= '<div class="customField availabilityField"><b>' . $_field_opts[1] . '</b> : <strong style="color: #f00;">' . __('none copy available') . '</strong></div>'; } else { $this->item_availability_message = $_total_avail . ' copies available for loan'; $_buffer .= '<div class="customField availabilityField"><b>' . $_field_opts[1] . '</b> : ' . $this->item_availability_message . '</div>'; } } else { if ($_field == 'node_id' && $this->disable_item_data) { $_buffer .= '<div class="customField locationField"><b>' . $_field_opts[1] . '</b> : ' . $sysconf['node'][$_biblio_d['node_id']]['name'] . '</div>'; } } } } } } } } } } // checkbox for marking collection $_check_mark = utility::isMemberLogin() && $this->enable_mark ? ' <input type="checkbox" id="biblioCheck' . $_i . '" name="biblio[]" class="biblioCheck" value="' . $_biblio_d['biblio_id'] . '" /> <label for="biblioCheck' . $_i . '">' . __('mark this') . '</label>' : ''; $_buffer .= '<div class="subItem">' . $_biblio_d['detail_button'] . ' ' . $_biblio_d['xml_button'] . $_check_mark . '</div>'; $_buffer .= "</div>\n"; $_i++; } // free resultset memory $this->resultset->free_result(); // paging if ($this->num_rows > $this->num2show) { $_paging = '<div class="biblioPaging">' . simbio_paging::paging($this->num_rows, $this->num2show, 5) . '</div>'; } else { $_paging = ''; } $_biblio_list = ''; $_is_member_logged_in = utility::isMemberLogin() && $this->enable_mark; if ($_paging) { $_biblio_list .= $_paging; $_biblio_list .= '<hr width="98%" size="1" />'; } if ($_is_member_logged_in) { $_submit = '<div class="biblioMarkFormAction"><input type="submit" class="button markBiblio" name="markBiblio" value="' . __('Put marked selection into basket') . '" /></div>'; $_biblio_list .= '<form class="biblioMarkForm" method="post" action="index.php?p=member#biblioBasket">'; $_biblio_list .= $_submit; } $_biblio_list .= $_buffer; if ($_is_member_logged_in) { $_biblio_list .= $_submit; $_biblio_list .= '</form>'; } if ($_paging) { $_biblio_list .= '<hr width="98%" size="1" />'; $_biblio_list .= $_paging; } return $_biblio_list; }
/** * Method to get file attachments information of biblio * * @param boolean $bool_return_raw * * @return mix */ public function getAttachments() { $_output = ''; $_output .= '<ul class="attachList">'; if (!$this->record_detail['attachments']) { return false; } foreach ($this->record_detail['attachments'] as $attachment_d) { // check member type privileges if ($attachment_d['access_limit']) { if (utility::isMemberLogin()) { $allowed_mem_types = @unserialize($attachment_d['access_limit']); if (!in_array($_SESSION['m_member_type_id'], $allowed_mem_types)) { continue; } } else { continue; } } #if (preg_match('@(video|audio|image)/.+@i', $attachment_d['mime_type'])) { if ($attachment_d['mime_type'] == 'application/pdf') { $_output .= '<li class="attachment-pdf" style="list-style-image: url(images/labels/ebooks.png)" itemscope itemtype="http://schema.org/MediaObject"><a itemprop="name" property="name" class="openPopUp" title="' . $attachment_d['file_title'] . '" href="./index.php?p=fstream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '" width="780" height="520">' . $attachment_d['file_title'] . '</a>'; $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div>'; if (trim($attachment_d['file_url']) != '') { $_output .= '<div><a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource related to this book" target="_blank">Other Resource Link</a></div>'; } $_output .= '</li>'; } else { if (preg_match('@(video)/.+@i', $attachment_d['mime_type'])) { $_output .= '<li class="attachment-audio-video" itemprop="video" property="video" itemscope itemtype="http://schema.org/VideoObject" style="list-style-image: url(images/labels/auvi.png)">' . '<a itemprop="name" property="name" class="openPopUp" title="' . $attachment_d['file_title'] . '" href="./index.php?p=multimediastream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '" width="640" height="480">' . $attachment_d['file_title'] . '</a>'; $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div>'; if (trim($attachment_d['file_url']) != '') { $_output .= '<div><a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource Link" target="_blank">Other Resource Link</a></div>'; } $_output .= '</li>'; } else { if (preg_match('@(audio)/.+@i', $attachment_d['mime_type'])) { $_output .= '<li class="attachment-audio-audio" itemprop="audio" property="audio" itemscope itemtype="http://schema.org/AudioObject" style="list-style-image: url(images/labels/auvi.png)">' . '<a itemprop="name" property="name" class="openPopUp" title="' . $attachment_d['file_title'] . '" href="./index.php?p=multimediastream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '" width="640" height="480">' . $attachment_d['file_title'] . '</a>'; $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div>'; if (trim($attachment_d['file_url']) != '') { $_output .= '<div><a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource Link" target="_blank">Other Resource Link</a></div>'; } $_output .= '</li>'; } else { if ($attachment_d['mime_type'] == 'text/uri-list') { $_output .= '<li class="attachment-url-list" style="list-style-image: url(images/labels/url.png)" itemscope itemtype="http://schema.org/MediaObject"><a itemprop="name" property="name" href="' . trim($attachment_d['file_url']) . '" title="Click to open link" target="_blank">' . $attachment_d['file_title'] . '</a><div class="attachment-desc">' . $attachment_d['file_desc'] . '</div></li>'; } else { if (preg_match('@(image)/.+@i', $attachment_d['mime_type'])) { $file_loc = REPOBS . '/' . $attachment_d['file_dir'] . '/' . $attachment_d['file_name']; $imgsize = GetImageSize($file_loc); $imgwidth = $imgsize[0] + 16; if ($imgwidth > 600) { $imgwidth = 600; } $imgheight = $imgsize[1] + 16; if ($imgheight > 400) { $imgheight = 400; } $_output .= '<li class="attachment-image" style="list-style-image: url(images/labels/ebooks.png)" itemprop="image" itemscope itemtype="http://schema.org/ImageObject"><a itemprop="name" property="name" class="openPopUp" title="' . $attachment_d['file_title'] . '" href="index.php?p=fstream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '" width="' . $imgwidth . '" height="' . $imgheight . '">' . $attachment_d['file_title'] . '</a>'; if (trim($attachment_d['file_url']) != '') { $_output .= ' [<a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource related to this file" target="_blank" style="font-size: 90%;">Other Resource Link</a>]'; } $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div></li>'; } else { $_output .= '<li class="attachment-image" style="list-style-image: url(images/labels/ebooks.png)" itemscope itemtype="http://schema.org/MediaObject"><a itemprop="name" property="name" title="Click To View File" href="index.php?p=fstream&fid=' . $attachment_d['file_id'] . '&bid=' . $attachment_d['biblio_id'] . '" target="_blank">' . $attachment_d['file_title'] . '</a>'; if (trim($attachment_d['file_url']) != '') { $_output .= ' [<a href="' . trim($attachment_d['file_url']) . '" itemprop="url" property="url" title="Other Resource related to this file" target="_blank" style="font-size: 90%;">Other Resource Link</a>]'; } $_output .= '<div class="attachment-desc" itemprop="description" property="description">' . $attachment_d['file_desc'] . '</div></li>'; } } } } } } $_output .= '</ul>'; return $_output; }