Skip to content

Commit

Permalink
Merge pull request coral-erm#516 from biblibre/RF74288_library_number
Browse files Browse the repository at this point in the history
Add library number to orders and dashboards
  • Loading branch information
veggiematts authored Jan 21, 2019
2 parents ceeea90 + c5fe086 commit 5d49426
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 3 deletions.
4 changes: 3 additions & 1 deletion resources/admin/classes/common/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public function getQuery($resourceTypeID, $year, $acquisitionTypeID, $orderTypeI
CD.shortName AS costDetails,
GS.shortName AS generalSubject,
DS.shortName AS detailedSubject,
RA.libraryNumber AS libraryNumber,
SUM(ROUND(COALESCE(RP.paymentAmount, 0) / 100, 2)) as paymentAmount
";

Expand Down Expand Up @@ -55,7 +56,8 @@ public function getQueryYearlyCosts($resourceTypeID, $startYear, $endYear, $acqu
AT.shortName AS acquisitionType,
CD.shortName AS costDetails,
GS.shortName AS generalSubject,
DS.shortName AS detailedSubject
DS.shortName AS detailedSubject,
RA.libraryNumber AS libraryNumber
";

$costDetails = new CostDetails();
Expand Down
5 changes: 5 additions & 0 deletions resources/ajax_forms/getOrderForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
<td><input type='text' id='systemNumber' name='systemNumber' value = '<?php echo $resourceAcquisition->systemNumber; ?>' style='width:95px;' class='changeInput' /></td>
</tr>

<tr>
<td style='vertical-align:top;text-align:left;font-weight:bold'><label for='libraryNumber'><?php echo _("Library Number:");?></label></td>
<td><input type='text' id='libraryNumber' name='libraryNumber' value = '<?php echo $resourceAcquisition->libraryNumber; ?>' style='width:95px;' class='changeInput' /></td>
</tr>

<tr>
<td style='vertical-align:top;text-align:left;font-weight:bold'><label for='currentStartDate'><?php echo _("Sub Start:");?></label></td>
<td><input class='date-pick' id='currentStartDate' name='currentStartDate' value = '<?php echo $startDate; ?>' placeholder='mm/dd/yyyy' style='width:75px;' /></td>
Expand Down
4 changes: 3 additions & 1 deletion resources/ajax_htmldata/getDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
echo "<th>" . _("Subject") . "</th>";
echo "<th>" . _("Acquisition Type") . "</th>";
echo "<th>" . _("Payment amount") . "</th>";
echo "<th>" . _("Library number") . "</th>";
echo "</tr></thead>";
echo "<tbody>";
$count = sizeof($results);
Expand All @@ -38,9 +39,10 @@
echo "<td>" . $subject . "</td>";
echo "<td>" . $result['acquisitionType'] . "</td>";
echo "<td>" . $result['paymentAmount'] . "</td>";
echo "<td>" . $result['libraryNumber'] . "</td>";
echo "</tr>";
} else {
echo "<tr><td colspan='4'><b>";
echo "<tr><td colspan='5'><b>";
if ($i == $count) { echo _("Total"); } else { echo _("Sub-Total:") . " " . $result[$groupBy]; }
echo "</b></td>";
echo "<td><b>" . $result['paymentAmount'] . "</b></td>";
Expand Down
4 changes: 3 additions & 1 deletion resources/ajax_htmldata/getDashboardYearlyCosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
echo "<th>" . _("Resource Type") . "</th>";
echo "<th>" . _("Subject") . "</th>";
echo "<th>" . _("Acquisition Type") . "</th>";
echo "<th>" . _("Library Number") . "</th>";
for ($i = $startYear; $i <= $endYear; $i++) {
foreach ($costDetailsArray as $costDetail) {
if ($costDetailsID && $costDetail['costDetailsID'] != $costDetailsID) continue;
Expand All @@ -49,6 +50,7 @@
$result['generalSubject'] . $result['detailedSubject'];
echo "<td>" . $subject . "</td>";
echo "<td>" . $result['acquisitionType'] . "</td>";
echo "<td>" . $result['libraryNumber'] . "</td>";
for ($i = $startYear; $i <= $endYear; $i++) {
foreach ($costDetailsArray as $costDetail) {
if ($costDetailsID && $costDetail['costDetailsID'] != $costDetailsID) continue;
Expand All @@ -57,7 +59,7 @@
}
echo "</tr>";
} else {
echo "<tr><td colspan='4'><b>";
echo "<tr><td colspan='5'><b>";
if ($currentCount == $count) { echo _("Total"); } else { echo _("Sub-Total:") . " " . $result[$groupBy]; }
echo "</b></td>";
for ($i = $startYear; $i <= $endYear; $i++) {
Expand Down
7 changes: 7 additions & 0 deletions resources/ajax_htmldata/getOrdersDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ class='removeOrder'
</tr>
<?php } ?>

<?php if ($resourceAcquisition->libraryNumber) { ?>
<tr>
<td style='vertical-align:top;width:110px;'><?php echo _("Library Number:");?></td>
<td style='width:350px;'><?php echo $resourceAcquisition->libraryNumber; ?></td>
</tr>
<?php } ?>

<?php if (count($purchaseSiteArray) > 0) { ?>
<tr>
<td style='vertical-align:top;width:110px;'><?php echo _("Purchasing Sites:");?></td>
Expand Down
1 change: 1 addition & 0 deletions resources/ajax_processing/submitAcquisitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
$resourceAcquisition->acquisitionTypeID = $_POST['acquisitionTypeID'];
$resourceAcquisition->orderNumber = $_POST['orderNumber'];
$resourceAcquisition->systemNumber = $_POST['systemNumber'];
$resourceAcquisition->libraryNumber = $_POST['libraryNumber'];
$resourceAcquisition->subscriptionAlertEnabledInd = isset($_POST['subscriptionAlertEnabledInd']) ? $_POST['subscriptionAlertEnabledInd'] : 0;
$resourceAcquisition->resourceID = $_POST['resourceID'];
$resourceAcquisition->organizationID = $_POST['organizationID'];
Expand Down
1 change: 1 addition & 0 deletions resources/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<option value="resourceType"><?php echo _("Resource Type"); ?></option>
<option value="GS.shortName"><?php echo _("Subject"); ?></option>
<option value="acquisitionType"><?php echo _("Acquisition Type"); ?></option>
<option value="libraryNumber"><?php echo _("Library Number"); ?></option>
</select>
</td>
</tr>
Expand Down
1 change: 1 addition & 0 deletions resources/dashboard_yearly_costs.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
<option value="resourceType"><?php echo _("Resource Type"); ?></option>
<option value="GS.shortName"><?php echo _("Subject"); ?></option>
<option value="acquisitionType"><?php echo _("Acquisition Type"); ?></option>
<option value="libraryNumber"><?php echo _("Library Number"); ?></option>
</select>
</td>
</tr>
Expand Down
1 change: 1 addition & 0 deletions resources/install/protected/3.0.1/003-516.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE ResourceAcquisition ADD libraryNumber VARCHAR(45) NULL DEFAULT NULL;
1 change: 1 addition & 0 deletions resources/js/forms/acquisitionsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ function submitOrderForm(){
acquisitionTypeID: $("#acquisitionTypeID").val(),
orderNumber: $("#orderNumber").val(),
systemNumber: $("#systemNumber").val(),
libraryNumber: $("#libraryNumber").val(),
currentStartDate: $("#currentStartDate").val(),
currentEndDate: $("#currentEndDate").val(),
organizationID: $("#organizationID").val(),
Expand Down

0 comments on commit 5d49426

Please sign in to comment.