Index: web/interface/themes/classic/Search/list.tpl
===================================================================
--- web/interface/themes/classic/Search/list.tpl (revision 1959)
+++ web/interface/themes/classic/Search/list.tpl (working copy)
@@ -1,3 +1,4 @@
+
{* Main Listing *}
Index: web/interface/themes/default/Record/view.tpl
===================================================================
--- web/interface/themes/default/Record/view.tpl (revision 1959)
+++ web/interface/themes/default/Record/view.tpl (working copy)
@@ -1,3 +1,4 @@
+
Index: web/interface/themes/default/Search/list.tpl
===================================================================
--- web/interface/themes/default/Search/list.tpl (revision 1959)
+++ web/interface/themes/default/Search/list.tpl (working copy)
@@ -1,4 +1,5 @@
-
+
+
{* Main Listing *}
Index: web/js/ajax_common.js
===================================================================
--- web/js/ajax_common.js (revision 0)
+++ web/js/ajax_common.js (revision 0)
@@ -0,0 +1,45 @@
+/* This file contains AJAX routines that are shared by multiple VuFind modules.
+ */
+
+/* Create a new list for storing favorites:
+ */
+function addList(form)
+{
+ for (var i = 0; i < form.public.length; i++) {
+ if (form.public[i].checked) {
+ var isPublic = form.public[i].value;
+ }
+ }
+
+ var url = path + "/MyResearch/AJAX";
+ var params = "method=AddList&" +
+ "title=" + encodeURIComponent(form.title.value) + "&" +
+ "public=" + isPublic + "&" +
+ "desc=" + encodeURIComponent(form.desc.value) + "&" +
+ "followupModule=" + form.followupModule.value + "&" +
+ "followupAction=" + form.followupAction.value + "&" +
+ "followupId=" + form.followupId.value;
+
+ var callback =
+ {
+ success: function(transaction) {
+ var response = transaction.responseXML.documentElement;
+ if (response.getElementsByTagName('result')) {
+ var value = response.getElementsByTagName('result').item(0).firstChild.nodeValue;
+ if (value == "Done") {
+ getLightbox(form.followupModule.value, form.followupAction.value, form.followupId.value, null, form.followupText.value);
+ } else {
+ alert(value.length > 0 ? value : 'Error: List not created');
+ }
+ } else {
+ document.getElementById('popupbox').innerHTML = 'Error: List not created';
+ setTimeout("hideLightbox();", 3000);
+ }
+ },
+ failure: function(transaction) {
+ document.getElementById('popupbox').innerHTML = 'Error: List not created';
+ setTimeout("hideLightbox();", 3000);
+ }
+ }
+ var transaction = YAHOO.util.Connect.asyncRequest('GET', url+'?'+params, callback, null);
+}
Index: web/lang/en.ini
===================================================================
--- web/lang/en.ini (revision 1959)
+++ web/lang/en.ini (working copy)
@@ -166,3 +166,5 @@
top_facet_additional_prefix = "Additional "
wiki_link = "Provided by Wikipedia"
+
+list_edit_name_required = "List name is required."
\ No newline at end of file
Index: web/services/MyResearch/AJAX.php
===================================================================
--- web/services/MyResearch/AJAX.php (revision 1959)
+++ web/services/MyResearch/AJAX.php (working copy)
@@ -55,7 +55,11 @@
$xml = "Done";
$xml .= "$result";
} else {
- $xml = "Error";
+ $error = $result->getMessage();
+ if (empty($error)) {
+ $error = 'Error';
+ }
+ $xml = "" . htmlspecialchars(translate($error)) . "";
}
} else {
$xml = "Unauthorized";
Index: web/services/MyResearch/ListEdit.php
===================================================================
--- web/services/MyResearch/ListEdit.php (revision 1959)
+++ web/services/MyResearch/ListEdit.php (working copy)
@@ -72,6 +72,9 @@
function addList()
{
if ($this->user) {
+ if (strlen(trim($_GET['title'])) == 0) {
+ return new PEAR_Error('list_edit_name_required');
+ }
$list = new User_list();
$list->title = $_GET['title'];
$list->description = $_GET['desc'];
Index: web/services/Record/ajax.js
===================================================================
--- web/services/Record/ajax.js (revision 1959)
+++ web/services/Record/ajax.js (working copy)
@@ -70,48 +70,6 @@
var transaction = YAHOO.util.Connect.asyncRequest('GET', url+'?'+params, callback, null);
}
-function addList(form)
-{
- for (var i = 0; i < form.public.length; i++) {
- if (form.public[i].checked) {
- var isPublic = form.public[i].value;
- }
- }
-
- var url = path + "/MyResearch/AJAX";
- var params = "method=AddList&" +
- "title=" + encodeURIComponent(form.title.value) + "&" +
- "public=" + isPublic + "&" +
- "desc=" + encodeURIComponent(form.desc.value) + "&" +
- "followupModule=" + form.followupModule.value + "&" +
- "followupAction=" + form.followupAction.value + "&" +
- "followupId=" + form.followupId.value;
-
- var callback =
- {
- success: function(transaction) {
- var response = transaction.responseXML.documentElement;
- if (response.getElementsByTagName('result')) {
- var value = response.getElementsByTagName('result').item(0).firstChild.nodeValue;
- if (value == "Done") {
- getLightbox(form.followupModule.value, form.followupAction.value, form.followupId.value, null, form.followupText.value);
- } else {
- document.getElementById('popupbox').innerHTML = 'Error: List not created';
- setTimeout("hideLightbox();", 3000);
- }
- } else {
- document.getElementById('popupbox').innerHTML = 'Error: List not created';
- setTimeout("hideLightbox();", 3000);
- }
- },
- failure: function(transaction) {
- document.getElementById('popupbox').innerHTML = 'Error: List not created';
- setTimeout("hideLightbox();", 3000);
- }
- }
- var transaction = YAHOO.util.Connect.asyncRequest('GET', url+'?'+params, callback, null);
-}
-
function SendEmail(id, to, from, message)
{
document.getElementById('popupbox').innerHTML = '
Sending Message ...
';
Index: web/services/Search/ajax.js
===================================================================
--- web/services/Search/ajax.js (revision 1959)
+++ web/services/Search/ajax.js (working copy)
@@ -225,48 +225,6 @@
var transaction = YAHOO.util.Connect.asyncRequest('GET', url+'?'+params, callback, null);
}
-function addList(form)
-{
- for (var i = 0; i < form.public.length; i++) {
- if (form.public[i].checked) {
- var isPublic = form.public[i].value;
- }
- }
-
- var url = path + "/MyResearch/AJAX";
- var params = "method=AddList&" +
- "title=" + encodeURIComponent(form.title.value) + "&" +
- "public=" + isPublic + "&" +
- "desc=" + encodeURIComponent(form.desc.value) + "&" +
- "followupModule=" + form.followupModule.value + "&" +
- "followupAction=" + form.followupAction.value + "&" +
- "followupId=" + form.followupId.value;
-
- var callback =
- {
- success: function(transaction) {
- var response = transaction.responseXML.documentElement;
- if (response.getElementsByTagName('result')) {
- var value = response.getElementsByTagName('result').item(0).firstChild.nodeValue;
- if (value == "Done") {
- getLightbox(form.followupModule.value, form.followupAction.value, form.followupId.value, null, form.followupText.value);
- } else {
- document.getElementById('popupbox').innerHTML = 'Error: List not created';
- setTimeout("hideLightbox();", 3000);
- }
- } else {
- document.getElementById('popupbox').innerHTML = 'Error: List not created';
- setTimeout("hideLightbox();", 3000);
- }
- },
- failure: function(transaction) {
- document.getElementById('popupbox').innerHTML = 'Error: List not created';
- setTimeout("hideLightbox();", 3000);
- }
- }
- var transaction = YAHOO.util.Connect.asyncRequest('GET', url+'?'+params, callback, null);
-}
-
function getSaveStatuses(id)
{
GetSaveStatusList[GetSaveStatusList.length] = id;