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