<event code='2004' textcode='ACTOR_USER_DELETE_OPEN_XACTS'>
<desc xml:lang="en-US">The user you have attempted to delete cannot be deleted because it has open circulations and/or unpaid bills.</desc>
</event>
+ <event code='2005' textcode='OBJECT_UNIQUE_IDENTIFIER_USED'>
+ <desc xml:lang="en-US">You are trying to create an object with a unique identifier (such as a 'name' field) that is already in use.</desc>
+ </event>
<!-- CREDIT EVENTS -->
<event code='4001' textcode='CREDIT_PROCESSOR_NOT_ENABLED'>
$owning_lib ||= $e->requestor->ws_ou;
return $e->die_event unless $e->allowed("URL_VERIFY", $owning_lib);
+ $name .= "";
+ my $name_test = $e->search_url_verify_session({name => $name});
+ return $e->die_event unless $name_test; # db error
+ return $e->die_event(
+ new OpenILS::Event("OBJECT_UNIQUE_IDENTIFIER_USED", note => "name"),
+ ) if @$name_test; # already existing sessions with that name
+
my $session = Fieldmapper::url_verify::session->new;
$session->name($name);
$session->owning_lib($owning_lib);
CREATE OR REPLACE FUNCTION url_verify.extract_urls ( session_id INT, item_id INT ) RETURNS INT AS $$
DECLARE
+ last_seen_tag TEXT;
current_tag TEXT;
current_sf TEXT;
current_url TEXT;
JOIN container.biblio_record_entry_bucket_item c ON (c.target_biblio_record_entry = b.id)
WHERE c.id = item_id;
+ IF current_tag IS NULL THEN
+ current_tag := last_seen_tag;
+ ELSE
+ last_seen_tag := current_tag;
+ END IF;
+
SELECT (XPATH(current_selector.xpath || '/@code', b.marc::XML))[current_url_pos]::TEXT INTO current_sf
FROM biblio.record_entry b
JOIN container.biblio_record_entry_bucket_item c ON (c.target_biblio_record_entry = b.id)
CREATE OR REPLACE FUNCTION url_verify.extract_urls ( session_id INT, item_id INT ) RETURNS INT AS $$
DECLARE
+ last_seen_tag TEXT;
current_tag TEXT;
current_sf TEXT;
current_url TEXT;
JOIN container.biblio_record_entry_bucket_item c ON (c.target_biblio_record_entry = b.id)
WHERE c.id = item_id;
+ IF current_tag IS NULL THEN
+ current_tag := last_seen_tag;
+ ELSE
+ last_seen_tag := current_tag;
+ END IF;
+
SELECT (XPATH(current_selector.xpath || '/@code', b.marc::XML))[current_url_pos]::TEXT INTO current_sf
FROM biblio.record_entry b
JOIN container.biblio_record_entry_bucket_item c ON (c.target_biblio_record_entry = b.id)
<tr>
<th>
- <label for="no-url-selection">[% l('Process immediately?') %]</label>
- </th>
- <td>
- <input dojoType="dijit.form.CheckBox" id="no-url-selection"
- jsId="no_url_selection" />
- </td>
- <td class="note">
- </td>
- </tr>
-
- <tr>
- <th>
[% l('Tags and subfields to search for URLs:') %]
</th>
<td>
<td class="note">
</td>
</tr>
+
+ <tr>
+ <th>
+ <label for="no-url-selection">[% l('Process immediately?') %]</label>
+ </th>
+ <td>
+ <input dojoType="dijit.form.CheckBox" id="no-url-selection"
+ jsId="no_url_selection" />
+ </td>
+ <td class="note">
+ </td>
+ </tr>
+
</table>
<div>
/* I think we're modal enough to get away with this. */
module.session_id = r;
module.save_tags();
+ } else {
+ module.progress_dialog.hide();
}
}
}