Lines 168-221
function PopupZ3950() {
Link Here
|
168 |
} |
168 |
} |
169 |
} |
169 |
} |
170 |
|
170 |
|
171 |
function addCreateAuthorityButton(tag_subfield_line, tag, index) { |
171 |
/** |
|
|
172 |
* this function append button for create new authority if not found |
173 |
*/ |
174 |
|
175 |
function addCreateAuthorityButton(tag_subfield_line, auth_type) { |
172 |
var title = _("Create authority"); |
176 |
var title = _("Create authority"); |
173 |
var elem = $('<a class="subfield_status" href="#"><img src="[% interface %]/[% theme %]/img/edit-tag.png" title="' + title + '" /></a>'); |
177 |
var elem = $('<a class="subfield_status" href="#"><img src="[% interface %]/[% theme %]/img/edit-tag.png" title="' + title + '" /></a>'); |
|
|
178 |
elem.attr("onclick","window.open('../authorities/authorities.pl?authtypecode=" + auth_type + "','','fullscreen','scrollbars')"); |
174 |
tag_subfield_line.append(elem); |
179 |
tag_subfield_line.append(elem); |
175 |
|
|
|
176 |
elem.click(function() { |
177 |
var biblioindex = $(this).parents('.subfield_line').find('input').eq(1).attr('id'); |
178 |
var popup = window.open("", "new_auth_popup",'width=700,height=550,toolbar=false,scrollbars=yes'); |
179 |
|
180 |
if(popup !== null) { |
181 |
// Create a new form that will be POSTed in the new window |
182 |
var form = $('<form>').attr({ |
183 |
method: 'post', |
184 |
action: "../authorities/authorities.pl", |
185 |
target: "new_auth_popup" |
186 |
}); |
187 |
|
188 |
// Add the biblioindex |
189 |
form.append($('<input>').attr({ |
190 |
type: 'hidden', |
191 |
name: 'biblioindex', |
192 |
value: biblioindex |
193 |
})); |
194 |
//add the authtypecode |
195 |
form.append($('<input>').attr({ |
196 |
type: 'hidden', |
197 |
name: 'authtypecode', |
198 |
value: $("#authtypecode").val() |
199 |
})); |
200 |
|
201 |
|
202 |
// Get all form datas for the current heading field |
203 |
$('.tag[id^=tag_' + tag + '_]').eq(index).find(':input').each(function(){ |
204 |
form.append($('<input>').attr({ |
205 |
type: 'hidden', |
206 |
name: this.name, |
207 |
value: $(this).val() |
208 |
})); |
209 |
}); |
210 |
|
211 |
// We need to add the temporary form to the body so we can submit it |
212 |
$('body').append(form); |
213 |
form.submit(); |
214 |
form.remove(); |
215 |
} |
216 |
|
217 |
return false; |
218 |
}); |
219 |
} |
180 |
} |
220 |
|
181 |
|
221 |
/** |
182 |
/** |
Lines 292-298
function updateHeadingLinks(links) {
Link Here
|
292 |
|
253 |
|
293 |
// Add a link to create a new authority if none was found |
254 |
// Add a link to create a new authority if none was found |
294 |
if(heading.status == 'NONE_FOUND') { |
255 |
if(heading.status == 'NONE_FOUND') { |
295 |
addCreateAuthorityButton(tag_subfield_line, heading.tag, tag_index); |
256 |
addCreateAuthorityButton(tag_subfield_line, heading.auth_type); |
296 |
} |
257 |
} |
297 |
}); |
258 |
}); |
298 |
|
259 |
|
299 |
- |
|
|