<!ENTITY staff.cat.marcedit.phys_char_wizard.accesskey "W">
<!ENTITY staff.cat.marcedit.catalogdate.caption "Cataloging Date:">
<!ENTITY staff.cat.marcedit.catalogdate.submit.label "Update date">
+<!ENTITY staff.cat.marcedit.catalogdate.clear.label "Clear date">
<!ENTITY staff.cat.marcedit.catalogdate.submit.accesskey "U">
<!ENTITY staff.cat.marc_new.load.label "Load">
<!ENTITY staff.cat.marc_new.load.accesskey "L">
//If cataloging_date is already set use the incoming date, else use the current system time
if(bib.cataloging_date() != null) {
catDate = new Date(bib.cataloging_date());
+ dojo.byId('clear-cat-date-button').disabled = false;
} else {
- catDate = new Date();
+ catDate = new Date();
+ dojo.byId('clear-cat-date-button').disabled = true;
}
// Show the current value of the bib source for this record
dojo.byId('cat-date-value').hidden = false;
dojo.byId('cat-date-button').disabled = false;
dojo.byId('cat-date-button').hidden = false;
+ dojo.byId('clear-cat-date-button').hidden = false;
}
current_bib.ischanged = true;
pcrud.update(current_bib);
dojo.byId('cat-date-button').disabled = true;
+ dojo.byId('clear-cat-date-button').disabled = false;
}
}
}
}
+// Fired when the "Clear date" button is clicked
+// Sets the bib record catatalog_date to null.
+function clearCatDate() {
+
+ dojo.byId('clear-cat-date-button').disabled = true;
+ var pcrud = new openils.PermaCrud({authtoken : ses()});
+
+ if (!current_bib) {
+ current_bib = pcrud.retrieve('bre', xulG.record.id);
+ }
+
+ // already clear.. nothing to do. We should never get here.
+ if (current_bib.cataloging_date() === null) return;
+
+ current_bib.cataloging_date(null);
+ pcrud.update(current_bib);
+
+ // set the UI back to the today
+ catDate = new Date();
+ var catDateField = dojo.byId('cat-date-value');
+ catDateField.date = catDate.getDate();
+ catDateField.month = catDate.getMonth()
+ catDateField.year = catDate.getFullYear();
+
+ // re-enable the set-cat-date button
+ dojo.byId('cat-date-button').disabled = false;
+}
+
+
function addNewAuthorityID(authority, sf, target) {
var id_sf = <subfield code="0" xmlns="http://www.loc.gov/MARC21/slim">({xulG.marc_control_number_identifier}){authority.id()}</subfield>;
sf.parent().appendChild(id_sf);
<caption id="cat-date-caption" hidden="true" align="center">&staff.cat.marcedit.catalogdate.caption;</caption>
<datepicker id="cat-date-value" hidden="true" type="popup" onselect='onCatDateSelect();' oncommand='onCatDateSelect();' onchange='onCatDateSelect();' onblur='onCatDateSelect();'/>
<button id="cat-date-button" label="&staff.cat.marcedit.catalogdate.submit.label;" accesskey="&staff.cat.marcedit.catalogdate.submit.accesskey;" disabled="true" oncommand="updateCatDate();" hidden="true"/>
+ <button id="clear-cat-date-button" label="&staff.cat.marcedit.catalogdate.clear.label;" accesskey="&staff.cat.marcedit.catalogdate.clear.accesskey;" oncommand="clearCatDate();" hidden="true"/>
</hbox>
<hbox id="fastItemAdd_textboxes">
<label control="fastItemAdd_callnumber" accesskey="&staff.cat.marcedit.fastItemAdd_callnumber.accesskey;" value="&staff.cat.marcedit.fastItemAdd_callnumber.label;" />