added button for refreshing list of recipients, since date picker panel can't be updated with on change behavior
This commit is contained in:
parent
29cd1286c0
commit
039d72ed41
src/main/java/se/su/dsv/scipro/admin/panels
@ -32,6 +32,7 @@
|
||||
</div>
|
||||
</wicket:enclosure>
|
||||
</div>
|
||||
<button wicket:id="refreshRecipients">Refresh recipient list</button><br /><br />
|
||||
<a wicket:id="showList">Show/Hide recipients</a><br />
|
||||
<select multiple wicket:id="emailList" size="15" class="span-8">
|
||||
<option>Adam Adamsson (aaa@email)</option>
|
||||
|
@ -38,6 +38,7 @@ import se.su.dsv.scipro.components.ProjectIdeaMailChoice;
|
||||
import se.su.dsv.scipro.components.ProjectMailChoice;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.GeneralSystemSettingsDao;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.MailEventDao;
|
||||
import se.su.dsv.scipro.data.dao.interfaces.UserDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.GeneralSystemSettings;
|
||||
import se.su.dsv.scipro.data.dataobjects.MailEvent;
|
||||
import se.su.dsv.scipro.data.dataobjects.ProjectClass;
|
||||
@ -175,6 +176,16 @@ public class AdminMailPanel extends Panel {
|
||||
showList.setOutputMarkupId(true);
|
||||
showList.setOutputMarkupPlaceholderTag(true);
|
||||
add(showList);
|
||||
|
||||
AjaxLink<String> refreshList = new AjaxLink<String>("refreshRecipients"){
|
||||
private static final long serialVersionUID = -5312361960170366432L;
|
||||
|
||||
@Override
|
||||
public void onClick(AjaxRequestTarget target) {
|
||||
updateUserSet(target);
|
||||
}
|
||||
};
|
||||
add(refreshList);
|
||||
}
|
||||
|
||||
|
||||
@ -325,8 +336,11 @@ public class AdminMailPanel extends Panel {
|
||||
|
||||
@Override
|
||||
protected void onSubmit() {
|
||||
userSet = getRecipients(selectedRecipientSet, projectClassModel);
|
||||
try {
|
||||
if(userSet != null && !userSet.isEmpty()) {
|
||||
//Always add thesis support to mail list
|
||||
//userSet.add( THESIS SUPPORT USER )
|
||||
MailEvent me = new MailEvent(mailSubjectField.getInput(), mailBodyField.getInput(), userSet, fromName, fromEmail);
|
||||
me = mailEventDao.save(me);
|
||||
info("E-mail sent successfully to the selected recipients");
|
||||
|
Loading…
x
Reference in New Issue
Block a user