Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejection reasons widget does not appear on rejection #494

Merged
merged 4 commits into from
Dec 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ Changelog

**Fixed**

- #494 Rejection reasons widget does not appear on rejection
- #492 Fix AR Add Form: CC Contacts not set on Contact Change
- #489 Worksheet Templates selection list is empty in Worksheets view
- #490 Fix AR Add Form: No specifications found if a sample type was set
22 changes: 10 additions & 12 deletions bika/lims/browser/js/bika.lims.rejection.js
Original file line number Diff line number Diff line change
@@ -5,16 +5,6 @@

var that = this;
that.load = function() {
// I don't know why samples don't have the reject state button, so I'll
// have to insert a handmade one.
if ($('body').hasClass('portaltype-sample') &&
$('#plone-contentmenu-workflow .state-reject').length < 1) {
var url = window.location.href.replace('/base_view','');
var autentification = $('input[name="_authenticator"]').val();
// we have to insert the state button
var dom_e = '<li><a id="workflow-transition-reject" class="" title="" href="' + url + '/doActionForSample?workflow_action=reject&_authenticator=' + autentification + '">Reject</li>"';
$(dom_e).prependTo($('#plone-contentmenu-workflow dd.actionMenuContent ul')[0]);
}
// If rejection workflow is disabled, hide the state link
var request_data = {
catalog_name: "portal_catalog",
@@ -59,7 +49,16 @@
var td = $('#archetypes-fieldname-RejectionWidget').parent('td');
var label = "<div class='semioverlay-head'>"+$(td).prev('td').html().trim()+"</div>";
// Creating the div element
$('#content').prepend("<div id='semioverlay'><div class='semioverlay-back'></div><div class='semioverlay-panel'><div class='semioverlay-content'></div><div class='semioverlay-buttons'><input type='button' name='semioverlay.reject' value='reject'/><input type='button' name='semioverlay.cancel' value='cancel'/></div></div></div>");
$('#content').prepend(
"<div id='semioverlay' style='display:none'>" +
" <div class='semioverlay-back'> </div>" +
" <div class='semioverlay-panel'>" +
" <div class='semioverlay-content'></div>" +
" <div class='semioverlay-buttons'>" +
" <input type='button'" +
" name='semioverlay.reject' value='reject'/>" +
" <input type='button' name='semioverlay.cancel'" +
" value='cancel'/></div></div></div>");
// Moving the widget there
$('#archetypes-fieldname-RejectionWidget').detach().prependTo('#semioverlay .semioverlay-content');
// hidding the widget's td and moving the label
@@ -83,7 +82,6 @@
$('div#semioverlay .semioverlay-panel').fadeOut();
reject_ar_sample();
});
$('div#semioverlay .semioverlay-panel').hide();
}
}