From 9c058c454fa243555f534799624cc2b420fd6138 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Wed, 19 Jul 2017 15:09:23 -0400
Subject: [PATCH] Add COinS to MyResearch pages. - Includes additional Missing
 record driver smarts so that ILS details can be used to set COinS title.

---
 module/VuFind/src/VuFind/RecordDriver/Missing.php           | 6 ++++++
 themes/bootstrap3/templates/myresearch/checkedout.phtml     | 1 +
 themes/bootstrap3/templates/myresearch/holds.phtml          | 1 +
 themes/bootstrap3/templates/myresearch/illrequests.phtml    | 1 +
 .../templates/myresearch/storageretrievalrequests.phtml     | 1 +
 5 files changed, 10 insertions(+)

diff --git a/module/VuFind/src/VuFind/RecordDriver/Missing.php b/module/VuFind/src/VuFind/RecordDriver/Missing.php
index fb45356f478..dc4477e207a 100644
--- a/module/VuFind/src/VuFind/RecordDriver/Missing.php
+++ b/module/VuFind/src/VuFind/RecordDriver/Missing.php
@@ -61,6 +61,12 @@ class Missing extends SolrDefault
      */
     public function determineMissingTitle()
     {
+        // If available, use details from ILS:
+        $ilsDetails = $this->getExtraDetail('ils_details');
+        if (isset($ilsDetails['title'])) {
+            return $ilsDetails['title'];
+        }
+
         // If available, load title from database:
         $id = $this->getUniqueId();
         if ($id) {
diff --git a/themes/bootstrap3/templates/myresearch/checkedout.phtml b/themes/bootstrap3/templates/myresearch/checkedout.phtml
index 3ff144feab0..87f4bdf714d 100644
--- a/themes/bootstrap3/templates/myresearch/checkedout.phtml
+++ b/themes/bootstrap3/templates/myresearch/checkedout.phtml
@@ -177,6 +177,7 @@
             <?=$thumbnail ?>
           <? endif ?>
         </div>
+        <?=$resource->tryMethod('supportsCoinsOpenUrl')?'<span class="Z3988" title="'.$this->escapeHtmlAttr($resource->getCoinsOpenUrl()).'"></span>':''?>
       </div>
     <? endforeach; ?>
     <? if ($this->renewForm): ?></form><? endif; ?>
diff --git a/themes/bootstrap3/templates/myresearch/holds.phtml b/themes/bootstrap3/templates/myresearch/holds.phtml
index 8d398115075..4dee22f685f 100644
--- a/themes/bootstrap3/templates/myresearch/holds.phtml
+++ b/themes/bootstrap3/templates/myresearch/holds.phtml
@@ -163,6 +163,7 @@
             <?=$thumbnail ?>
           <? endif ?>
         </div>
+        <?=$resource->tryMethod('supportsCoinsOpenUrl')?'<span class="Z3988" title="'.$this->escapeHtmlAttr($resource->getCoinsOpenUrl()).'"></span>':''?>
       </div>
     <? endforeach; ?>
     <? if ($this->cancelForm): ?></form><? endif; ?>
diff --git a/themes/bootstrap3/templates/myresearch/illrequests.phtml b/themes/bootstrap3/templates/myresearch/illrequests.phtml
index 56ee96b4811..c8190718840 100644
--- a/themes/bootstrap3/templates/myresearch/illrequests.phtml
+++ b/themes/bootstrap3/templates/myresearch/illrequests.phtml
@@ -163,6 +163,7 @@
             <?=$thumbnail ?>
           <? endif ?>
         </div>
+        <?=$resource->tryMethod('supportsCoinsOpenUrl')?'<span class="Z3988" title="'.$this->escapeHtmlAttr($resource->getCoinsOpenUrl()).'"></span>':''?>
       </div>
     <? endforeach; ?>
     <? if ($this->cancelForm): ?></form><? endif; ?>
diff --git a/themes/bootstrap3/templates/myresearch/storageretrievalrequests.phtml b/themes/bootstrap3/templates/myresearch/storageretrievalrequests.phtml
index a64345a449b..e4bea0ca675 100644
--- a/themes/bootstrap3/templates/myresearch/storageretrievalrequests.phtml
+++ b/themes/bootstrap3/templates/myresearch/storageretrievalrequests.phtml
@@ -160,6 +160,7 @@
             <?=$thumbnail ?>
           <? endif ?>
         </div>
+        <?=$resource->tryMethod('supportsCoinsOpenUrl')?'<span class="Z3988" title="'.$this->escapeHtmlAttr($resource->getCoinsOpenUrl()).'"></span>':''?>
       </div>
     <? endforeach; ?>
     <? if ($this->cancelForm): ?></form><? endif; ?>
-- 
GitLab