Skip to content

Commit

Permalink
Merge pull request #85 from Aspen-Discovery/24.08.00
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
AlexanderBlanchardAC authored Jul 17, 2024
2 parents 8262dc3 + 70362dc commit 7fc0454
Show file tree
Hide file tree
Showing 24 changed files with 379 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,10 @@ public void getFormatFromLeader(AbstractGroupedWorkSolr groupedWork, Set<String>
result.add("PhysicalObject");
break;
}
} else {
if (groupedWork != null && groupedWork.isDebugEnabled()) {groupedWork.addDebugMessage("Adding bib level format PhysicalObject based on Leader and no 008 field", 2);}
result.add("PhysicalObject");
break;
}
break;
case 'T':
Expand Down
34 changes: 28 additions & 6 deletions code/web/Drivers/Koha.php
Original file line number Diff line number Diff line change
Expand Up @@ -3596,14 +3596,36 @@ function processEmailResetPinForm() {
];

$catalogUrl = $this->accountProfile->vendorOpacUrl;

$kohaVersion = $this->getKohaVersion();
$csrfToken = '';
if ($kohaVersion >= 24.05) {
//First get the page to get the csrf token
$getResults = $this->getKohaPage($catalogUrl . '/cgi-bin/koha/opac-password-recovery.pl');
if (preg_match('/<input type="hidden" name="csrf_token" value="(.*?)" \/>/', $getResults, $matches)) {
$csrfToken = $matches[1];
}
}


$username = isset($_REQUEST['username']) ? strip_tags($_REQUEST['username']) : '';
$email = isset($_REQUEST['email']) ? strip_tags($_REQUEST['email']) : '';
$postVariables = [
'koha_login_context' => 'opac',
'username' => $username,
'email' => $email,
'sendEmail' => 'Submit',
];
if ($kohaVersion >= 24.05) {
$postVariables = [
'koha_login_context' => 'opac',
'username' => $username,
'email' => $email,
'op' => 'cud-sendEmail',
'csrf_token' => $csrfToken
];
}else{
$postVariables = [
'koha_login_context' => 'opac',
'username' => $username,
'email' => $email,
'sendEmail' => 'Submit',
];
}
if (isset($_REQUEST['resendEmail'])) {
$postVariables['resendEmail'] = strip_tags($_REQUEST['resendEmail']);
}
Expand Down
68 changes: 55 additions & 13 deletions code/web/Drivers/Nashville.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ public function getCollectionReportData($location, $date): array {
public function getHoldsReportData($location): array {
$this->initDatabaseConnection();
$sql = <<<EOT
-- getHoldsReportData, combining bib level and item level holds 2024 07 09
with holds_vs_items as (
select
t.bid
Expand All @@ -485,7 +486,7 @@ public function getHoldsReportData($location): array {
left join patron_v2 p on t.patronid = p.patronid
left join bbibmap_v2 b on t.bid = b.bid
left join bty_v2 bb on p.bty = bb.btynumber
left join branch_v2 ob on t.holdingbranch = ob.branchnumber -- Origin Branch
left join branch_v2 ob on t.holdingbranch = ob.branchnumber -- Origin/Owning Branch
left join item_v2 i on ( t.bid = i.bid and t.holdingbranch = i.branch)
left join location_v2 l on i.location = l.locnumber
left join branch_v2 pb on t.pickupbranch = pb.branchnumber -- Pickup Branch
Expand All @@ -507,18 +508,59 @@ public function getHoldsReportData($location): array {
, h.CALL_NUMBER
, h.TITLE
, h.occur_dense_rank
)
select
PATRON_NAME
, PICKUP_BRANCH
, HOME_ROOM
, GRD_LVL
, P_BARCODE
, SHELF_LOCATION
, TITLE
, CALL_NUMBER
, ITEM_ID
from fillable
),
bib_level_holds as (
select
PATRON_NAME
, PICKUP_BRANCH
, HOME_ROOM
, GRD_LVL
, P_BARCODE
, SHELF_LOCATION
, TITLE
, CALL_NUMBER
, ITEM_ID
from fillable
),
item_level_holds as (
select
pb.branchname as PICKUP_BRANCH
, p.name as PATRON_NAME
, p.sponsor as HOME_ROOM
, bb.btyname as GRD_LVL
, p.patronid as P_BARCODE
, l.locname as SHELF_LOCATION
, b.title as TITLE
, i.cn as CALL_NUMBER
, i.item as ITEM_ID
from transitem_v2 t
left join item_v2 i on t.item = i.item
left join patron_v2 p on t.patronid = p.patronid
left join bbibmap_v2 b on i.bid = b.bid
left join bty_v2 bb on p.bty = bb.btynumber
left join branch_v2 ob on t.holdingbranch = ob.branchnumber -- Origin Branch
left join location_v2 l on i.location = l.locnumber
left join branch_v2 pb on t.pickupbranch = pb.branchnumber -- Pickup Branch
where ob.branchcode = '$location'
and t.transcode = 'R*'
order by
i.bid
)
, holds as (
select
bib_level_holds.*
from bib_level_holds
union
select
item_level_holds.*
from item_level_holds
)
select * from holds
order by
SHELF_LOCATION
, CALL_NUMBER
, TITLE
;
EOT;
$stid = oci_parse($this->dbConnection, $sql);
// consider using oci_set_prefetch to improve performance
Expand Down
11 changes: 9 additions & 2 deletions code/web/cron/createSiteTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

//Create a template for $serverName
$templateName = "$serverName.ini";
if (!file_exists($configArray['Site']['local'] . "/../../install/templates/")){
mkdir($configArray['Site']['local'] . "/../../install/templates/");
}
$fhnd = fopen($configArray['Site']['local'] . "/../../install/templates/$templateName", 'w');
$dbHost = empty($configArray['Database']['database_aspen_host']) ? 'localhost' : $configArray['Database']['database_aspen_host'];
$dbPort = empty($configArray['Database']['database_aspen_dbport']) ? '3306' : $configArray['Database']['database_aspen_dbport'];
Expand All @@ -27,9 +30,13 @@
fwrite($fhnd, ";Which host should Solr run on (typically localhost)\n");
fwrite($fhnd, "solrHost = {$configArray['Index']['solrHost']}\n");
fwrite($fhnd, "; Which port should Solr run on (typically 8080)\n");
fwrite($fhnd, "solrPort = {$configArray['Index']['solrPort']}\n");
if (array_key_exists('solrPort', $configArray['Index'])) {
fwrite($fhnd, "solrPort = {$configArray['Index']['solrPort']}\n");
}else{
fwrite($fhnd, "solrPort = 8080\n");
}
fwrite($fhnd, "; Which ILS does the library use?\n");
fwrite($fhnd, "ils = {$configArray['Index']['solrHost']}\n");
fwrite($fhnd, "ils = {$configArray['Catalog']['driver']}\n");
fwrite($fhnd, "; timezone of the library (e.g. America/Los_Angeles, check http://www.php.net/manual/en/timezones.php)\n");
fwrite($fhnd, "timezone = {$configArray['Site']['timezone']}\n");
fwrite($fhnd, "\n");
Expand Down
8 changes: 8 additions & 0 deletions code/web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1173,13 +1173,15 @@ function loadModuleActionId() {
$basicPageLibrary = new LibraryBasicPage();
$basicPageLibrary->libraryId = $library->libraryId;
$basicPage->joinAdd($basicPageLibrary, 'INNER', 'libraryFilter', 'id', 'basicPageId');
$pageExists = false;
if ($basicPage->find(true)) {
$_GET['module'] = 'WebBuilder';
$_GET['action'] = 'BasicPage';
$_GET['id'] = $basicPage->id;
$_REQUEST['module'] = 'WebBuilder';
$_REQUEST['action'] = 'BasicPage';
$_REQUEST['id'] = $basicPage->id;
$pageExists = true;
} else {
require_once ROOT_DIR . '/sys/WebBuilder/PortalPage.php';
$portalPage = new PortalPage();
Expand All @@ -1194,6 +1196,7 @@ function loadModuleActionId() {
$_REQUEST['module'] = 'WebBuilder';
$_REQUEST['action'] = 'PortalPage';
$_REQUEST['id'] = $portalPage->id;
$pageExists = true;
} else {
require_once ROOT_DIR . '/sys/WebBuilder/CustomForm.php';
$form = new CustomForm();
Expand All @@ -1208,6 +1211,7 @@ function loadModuleActionId() {
$_REQUEST['module'] = 'WebBuilder';
$_REQUEST['action'] = 'Form';
$_REQUEST['id'] = $form->id;
$pageExists = true;
} else {
require_once ROOT_DIR . '/sys/WebBuilder/QuickPoll.php';
$quickPoll = new QuickPoll();
Expand All @@ -1222,10 +1226,14 @@ function loadModuleActionId() {
$_REQUEST['module'] = 'WebBuilder';
$_REQUEST['action'] = 'QuickPoll';
$_REQUEST['id'] = $quickPoll->id;
$pageExists = true;
}
}
}
}
if ($pageExists && $_SERVER['REDIRECT_STATUS'] == '404') {
http_response_code('200');
}
}
} catch (Exception $e) {
//This happens if web builder is not fully installed, ignore the error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
{if !empty($showCardExpirationDate) && !empty($expirationDate)}
{translate text="Expires %1%" 1=$expirationDate|date_format:"%b %d, %Y" isPublicFacing=true}
{/if}
{if $showRenewalLink}
<div class="text-center">
<a class="btn btn-info btn-sm" href="{$cardRenewalLink}">{translate text="Renew your card" isPublicFacing=true}</a>
</div>
{/if}
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<img src="{$exploreMoreCategory.image}" alt="{translate text="Explore more on" inAttribute=true isPublicFacing=true} {$exploreMoreCategory.label|escapeCSS}">
</a>
<figcaption class="explore-more-category-title">
<a href='{$exploreMoreCategory.link}' {if !empty($exploreMoreCategory.onclick)}onclick="{$exploreMoreCategory.onclick}"{/if} {if !empty($exploreMoreCategory.openInNewWindow)}target="_blank" aria-label="{$exporeMoreCategory.label|escape|truncate:30} ({translate text='opens in new window' isPublicFacing=true})" {/if}>
<a href='{$exploreMoreCategory.link}' {if !empty($exploreMoreCategory.onclick)}onclick="{$exploreMoreCategory.onclick}"{/if} {if !empty($exploreMoreCategory.openInNewWindow)}target="_blank" aria-label="{$exploreMoreCategory.label|escape|truncate:30} ({translate text='opens in new window' isPublicFacing=true})" {/if}>
<strong>{$exploreMoreCategory.label|truncate:30}</strong>
</a>
</figcaption>
Expand Down
1 change: 1 addition & 0 deletions code/web/release_notes/24.06.01.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Aspen Discovery Updates
### Koha Updates
- Fix issues related to loading ILL requests and holds for Koha version 24.05. (*MDN*)
- Update Aspen so emailing PIN reset information works properly with Koha version 24.05. (*MDN*)

### OverDrive Updates
- Error message when returning Kindle books is now translatable. (Tickets 133671, 133815, 133663, 133982) (*KP*)
Expand Down
6 changes: 6 additions & 0 deletions code/web/release_notes/24.07.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
- Correct loading Days Since Added Facet for item items at libraries where the display status is not "On Order". (Tickets 134372, 134501, 134543, 134618) (*MDN*)
- Check the fallback format if the only format detected with earlier rules is "Book" as well as checking fallback format if no formats are found. (Ticket 134503) (*MDN*)
- Check for null formats when determining inclusion of records. (*MDN*)
- Add logic for assigning the format 'Physical Object' if position 6 of the Leader is 'R' and the record has no 008 field (Ticket 134996) (*KL*)

### Koha Updates
- Add control over whether holidays and hours are automatically loaded from Koha for each library and location. (Tickets 130879, 132358) (*MDN*)
Expand Down Expand Up @@ -93,6 +94,10 @@
- Delete old tables in the database while initializing the database for unit test. (*MDN*)
- Add a utility to generate a site template to aid in migrating servers. (*MDN*)
- Update updateSitePermissions scripts to include all directories. (*MDN*)
- Increase column length for format in user_hold table to accommodate concatenated OverDrive/Libby formats (Ticket 134832) (*KL*)
- Correct the number of requests made on the success screen after submitting a request. (Ticket 128760) (*MDN*)
- Set limits for Aspen user within Debian. (*MDN*)
- Add the ability to change the supporting company name on site creation. (*CZ*)

## This release includes code contributions from
- ByWater Solutions
Expand All @@ -107,6 +112,7 @@
- PTFS-Europe
- Pedro Amorim (PA)
- Alexander Blanchard (AB)
- Chloe Zermatten (CZ)

- Theke Solutions
- Lucas Montoya (LM)
50 changes: 50 additions & 0 deletions code/web/release_notes/24.08.00.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
## Aspen LiDA Updates
-

## Aspen Discovery Updates
// mark
### Account Updates
- Show account renewal links on the Library Card page when applicable. (Ticket 134192) (*MDN*)

### Search Updates
- Add a new option within Show Hold and Copy Counts to always show hold and copy counts. (Ticket 128625) (*MDN*)

// kirstien

// kodi

// katherine
### Other Updates
- Fixed bug with unexpected 404 errors on Web Builder pages. (Ticket 123122) (*KP*)

// alexander

// jacob

// pedro

// lucas

// James Staub
### Reports
- Nashville-specific: Circulation Holds Report now includes item-level holds (*JStaub*)

// other

## This release includes code contributions from
- ByWater Solutions
- Mark Noble (MDN)
- Kirstien Kroeger (KK)
- Kodi Lein (KL)
- Katherine Perdue (KP)

- Nashville Public Library
- James Staub (JStaub)

- PTFS-Europe
- Pedro Amorim (PA)
- Alexander Blanchard (AB)
- Jacob O'Mara (JOM)

- Theke Solutions
- Lucas Montoya (LM)
21 changes: 21 additions & 0 deletions code/web/services/MyAccount/LibraryCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ function launch() {
$interface->assign('showCardExpirationDate', $library->showCardExpirationDate);
$interface->assign('expirationDate', $user->getAccountSummary()->expirationDate);

$interface->assign('showRenewalLink', false);
if ($user->hasIlsConnection()) {
$ilsSummary = $user->getCatalogDriver()->getAccountSummary($user);
$showRenewalLink = $user->showRenewalLink($ilsSummary);
$interface->assign('showRenewalLink', $showRenewalLink);
if ($showRenewalLink) {
$userLibrary = $user->getHomeLibrary();
if ($userLibrary->enableCardRenewal == 2) {
if (!empty($userLibrary->cardRenewalUrl)) {
$interface->assign('cardRenewalLink', $userLibrary->cardRenewalUrl);
}
} elseif ($userLibrary->enableCardRenewal == 3) {
require_once ROOT_DIR . '/sys/Enrichment/QuipuECardSetting.php';
$quipuECardSettings = new QuipuECardSetting();
if ($quipuECardSettings->find(true) && $quipuECardSettings->hasERenew) {
$interface->assign('cardRenewalLink', "/MyAccount/eRENEW");
}
}
}
}

$linkedUsers = $user->getLinkedUsers();
$linkedCards = [];
foreach ($linkedUsers as $tmpUser) {
Expand Down
8 changes: 8 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.07.00.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ function getUpdates24_07_00(): array {
) ENGINE INNODB',
],
], // self_registration_form_carlx
'overdrive_format_length' => [
'title' => 'Format Length',
'description' => 'Increase column length for format in user_hold table to accomodate concatenated OverDrive/Libby formats',
'sql' => [
'ALTER TABLE user_hold CHANGE COLUMN format format VARCHAR(150)',
],
],//overdrive_format_length

//katherine - ByWater
//greenhouseMonitoring
'greenhouseSlackIntegration2' => [
Expand Down
30 changes: 30 additions & 0 deletions code/web/sys/DBMaintenance/version_updates/24.08.00.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

function getUpdates24_08_00(): array {
$curTime = time();
return [
/*'name' => [
'title' => '',
'description' => '',
'continueOnError' => false,
'sql' => [
''
]
], //name*/

//mark - ByWater

//kirstien - ByWater

//kodi - ByWater

//katherine - ByWater

//alexander - PTFS-Europe

//pedro - PTFS-Europe

//other

];
}
Loading

0 comments on commit 7fc0454

Please sign in to comment.