Skip to content
This repository has been archived by the owner on Feb 26, 2025. It is now read-only.

Commit

Permalink
Merge pull request coral-erm#621 from biblibre/Issue_601_Keep_Search_…
Browse files Browse the repository at this point in the history
…in_Resource_Module

Issue 601: Keep search parameters in resource module
  • Loading branch information
veggiematts authored Jan 30, 2020
2 parents 961a1e2 + c700df8 commit 6cc256b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 12 additions & 5 deletions resources/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

include_once 'directory.php';

$currentPage = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentPage);
$currentPage = $parts[count($parts) - 1];

//used for creating a "sticky form" for back buttons
//except we don't want it to retain if they press the 'index' button
Expand Down Expand Up @@ -131,8 +134,12 @@
$fundCodeLength = strlen($fund['fundCode']) + 3;
$combinedLength = strlen($fund['shortName']) + $fundCodeLength;
$fundName = ($combinedLength <=50) ? $fund['shortName'] : substr($fund['shortName'],0,49-$fundCodeLength) . "&hellip;";
$fundName .= " [" . $fund['fundCode'] . "]</option>";
echo "<option value='" . $fund['fundID'] . "'>" . $fundName . "</option>";
$fundName .= " [" . $fund['fundCode'] . "]";
if (isset($search['fund']) && $search['fund'] == $fund['fundID']) {
echo "<option value='" . $fund['fundID'] . "' selected='selected'>" . $fundName . "</option>";
} else {
echo "<option value='" . $fund['fundID'] . "'>" . $fundName . "</option>";
}
}

?>
Expand Down Expand Up @@ -612,9 +619,9 @@
<td class='searchRow'><label for='searchParents'><b>Relationship</b></label>
<select name='search[parent]' id='searchParents' style='width:150px'>
<option value=''><?php echo _("All");?></option>
<option value='RRC'><?php echo _("Parent");?></option>
<option value='RRP'><?php echo _("Child");?></option>
<option value='None'><?php echo _("None");?></option>
<option value='RRC'<?php if (isset($search['parent']) && $search['parent'] == 'RRC') { echo " selected='selected'"; }; echo ">" ._("Parent");?></option>
<option value='RRP'<?php if (isset($search['parent']) && $search['parent'] == 'RRP') { echo " selected='selected'"; }; echo ">" . _("Child");?></option>
<option value='None'<?php if (isset($search['parent']) && $search['parent'] == 'None') { echo " selected='selected'"; }; echo ">" . _("None");?></option>
</select>
</td>
</tr>
Expand Down
6 changes: 5 additions & 1 deletion resources/resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
$status = new Status(new NamedArguments(array('primaryKey' => $resource->statusID)));
$resourceAcquisitions = $resource->getResourceAcquisitions();

$currentPage = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentPage);
$currentPage = $parts[count($parts) - 1];


//used to get default email address for feedback link in the right side panel
$config = new Configuration();
Expand All @@ -34,7 +38,7 @@
if ((isset($_GET['ref'])) && ($_GET['ref'] == 'new')){
CoralSession::set('ref_script', 'new');
}else{
CoralSession::set('ref_script', $currentPage = '');
CoralSession::set('ref_script', $currentPage);
}

//set this to turn off displaying the title header in header.php
Expand Down

0 comments on commit 6cc256b

Please sign in to comment.