forked from jverein/jverein
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Neue View zum drucken von freien Formularen (#277)
* Neue View zum drucken von freien Formularen * Freies Formular Fehler behoben * Prüfen ob Mailadresse vorhanden * Mail laden Fehler beohben * Formular und Ausgebe getauscht
- Loading branch information
Showing
7 changed files
with
414 additions
and
3 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/de/jost_net/JVerein/gui/action/FreieFormulareAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.jost_net.JVerein.gui.action; | ||
|
||
import de.jost_net.JVerein.gui.view.FreieFormulareView; | ||
import de.willuhn.jameica.gui.Action; | ||
import de.willuhn.jameica.gui.GUI; | ||
|
||
public class FreieFormulareAction implements Action { | ||
|
||
@Override | ||
public void handleAction(Object context) | ||
{ | ||
GUI.startView(FreieFormulareView.class.getName(), null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
src/de/jost_net/JVerein/gui/control/FreieFormulareControl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
package de.jost_net.JVerein.gui.control; | ||
|
||
import java.io.IOException; | ||
import java.rmi.RemoteException; | ||
import de.jost_net.JVerein.gui.input.FormularInput; | ||
import de.jost_net.JVerein.io.FreiesFormularAusgabe; | ||
import de.jost_net.JVerein.keys.Ausgabeart; | ||
import de.jost_net.JVerein.keys.FormularArt; | ||
import de.willuhn.jameica.gui.AbstractView; | ||
import de.willuhn.jameica.gui.Action; | ||
import de.willuhn.jameica.gui.GUI; | ||
import de.willuhn.jameica.gui.input.Input; | ||
import de.willuhn.jameica.gui.input.SelectInput; | ||
import de.willuhn.jameica.gui.input.TextAreaInput; | ||
import de.willuhn.jameica.gui.input.TextInput; | ||
import de.willuhn.jameica.gui.parts.Button; | ||
import de.willuhn.logging.Logger; | ||
|
||
public class FreieFormulareControl extends FilterControl | ||
{ | ||
|
||
private FormularInput formular = null; | ||
|
||
private TextInput betreff = null; | ||
|
||
private TextAreaInput txt = null; | ||
|
||
private SelectInput ausgabeart = null; | ||
|
||
public FreieFormulareControl(AbstractView view) | ||
{ | ||
super(view); | ||
settings = new de.willuhn.jameica.system.Settings(this.getClass()); | ||
settings.setStoreWhenRead(true); | ||
} | ||
|
||
public FormularInput getFormular(FormularArt frei) throws RemoteException | ||
{ | ||
if (formular != null) | ||
{ | ||
return formular; | ||
} | ||
formular = new FormularInput(frei); | ||
return formular; | ||
} | ||
|
||
public Input getAusgabeart() | ||
{ | ||
if (ausgabeart != null) | ||
{ | ||
return ausgabeart; | ||
} | ||
ausgabeart = new SelectInput(Ausgabeart.values(), Ausgabeart | ||
.valueOf(settings.getString(settingsprefix + "ausgabeart", "DRUCK"))); | ||
ausgabeart.setName("Ausgabe"); | ||
return ausgabeart; | ||
} | ||
|
||
public TextInput getBetreff() | ||
{ | ||
if (betreff != null) | ||
{ | ||
return betreff; | ||
} | ||
betreff = new TextInput( | ||
settings.getString(settingsprefix + "mail.betreff", ""), 100); | ||
betreff.setName("Betreff"); | ||
return betreff; | ||
} | ||
|
||
public TextAreaInput getTxt() | ||
{ | ||
if (txt != null) | ||
{ | ||
return txt; | ||
} | ||
txt = new TextAreaInput( | ||
settings.getString(settingsprefix + "mail.text", ""), 10000); | ||
txt.setName("Text"); | ||
return txt; | ||
} | ||
|
||
private void saveSettings() throws RemoteException | ||
{ | ||
if (ausgabeart != null ) | ||
{ | ||
Ausgabeart aa = (Ausgabeart) getAusgabeart().getValue(); | ||
settings.setAttribute(settingsprefix + "ausgabeart", aa.toString()); | ||
} | ||
if (betreff != null) | ||
{ | ||
settings.setAttribute(settingsprefix + "mail.betreff", | ||
(String) getBetreff().getValue()); | ||
} | ||
if (txt != null) | ||
{ | ||
settings.setAttribute(settingsprefix + "mail.text", | ||
(String) getTxt().getValue()); | ||
} | ||
} | ||
|
||
public Button getStartFreieFormulareButton(Object currentObject, | ||
FreieFormulareControl control) | ||
{ | ||
Button button = new Button("Starten", new Action() | ||
{ | ||
|
||
@Override | ||
public void handleAction(Object context) | ||
{ | ||
try | ||
{ | ||
generiereFreieFormulare(context); | ||
} | ||
catch (Exception e) | ||
{ | ||
Logger.error("", e); | ||
GUI.getStatusBar().setErrorText(e.getMessage()); | ||
} | ||
} | ||
}, null, true, "walking.png"); | ||
return button; | ||
} | ||
|
||
private void generiereFreieFormulare(Object currentObject) throws IOException | ||
{ | ||
saveFilterSettings(); | ||
saveSettings(); | ||
new FreiesFormularAusgabe(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package de.jost_net.JVerein.gui.view; | ||
|
||
import de.jost_net.JVerein.Einstellungen; | ||
import de.jost_net.JVerein.gui.action.DokumentationAction; | ||
import de.jost_net.JVerein.gui.action.MailVorlageZuweisenAction; | ||
import de.jost_net.JVerein.gui.control.FreieFormulareControl; | ||
import de.jost_net.JVerein.keys.FormularArt; | ||
import de.jost_net.JVerein.gui.control.FilterControl.Mitgliedstyp; | ||
import de.willuhn.jameica.gui.AbstractView; | ||
import de.willuhn.jameica.gui.GUI; | ||
import de.willuhn.jameica.gui.parts.Button; | ||
import de.willuhn.jameica.gui.parts.ButtonArea; | ||
import de.willuhn.jameica.gui.util.ColumnLayout; | ||
import de.willuhn.jameica.gui.util.LabelGroup; | ||
import de.willuhn.jameica.gui.util.SimpleContainer; | ||
|
||
public class FreieFormulareView extends AbstractView | ||
{ | ||
|
||
@Override | ||
public void bind() throws Exception | ||
{ | ||
GUI.getView().setTitle("Freie Formulare"); | ||
|
||
final FreieFormulareControl control = new FreieFormulareControl(this); | ||
control.init("freieformulare.","zusatzfeld.", "zusatzfelder."); | ||
|
||
LabelGroup group = new LabelGroup(getParent(), "Filter"); | ||
|
||
ColumnLayout cl = new ColumnLayout(group.getComposite(), 3); | ||
SimpleContainer left = new SimpleContainer(cl.getComposite()); | ||
left.addInput(control.getSuchAdresstyp(Mitgliedstyp.ALLE)); | ||
left.addInput(control.getMitgliedStatus()); | ||
left.addInput(control.getBeitragsgruppeAusw()); | ||
left.addInput(control.getMailauswahl()); | ||
|
||
SimpleContainer mid = new SimpleContainer(cl.getComposite()); | ||
mid.addInput(control.getSuchname()); | ||
mid.addInput(control.getGeburtsdatumvon()); | ||
mid.addInput(control.getGeburtsdatumbis()); | ||
mid.addInput(control.getSuchGeschlecht()); | ||
|
||
SimpleContainer right = new SimpleContainer(cl.getComposite()); | ||
right.addInput(control.getEigenschaftenAuswahl()); | ||
right.addInput(control.getStichtag()); | ||
if (Einstellungen.getEinstellung().hasZusatzfelder()) | ||
right.addInput(control.getZusatzfelderAuswahl()); | ||
|
||
SimpleContainer cont = new SimpleContainer(getParent(), true); | ||
cont.addHeadline("Parameter"); | ||
cont.addLabelPair("Formular", | ||
control.getFormular(FormularArt.FREIESFORMULAR)); | ||
cont.addInput(control.getAusgabeart()); | ||
|
||
cont.addHeadline("Mail"); | ||
cont.addInput(control.getBetreff()); | ||
cont.addLabelPair("Text", control.getTxt()); | ||
|
||
ButtonArea fbuttons = new ButtonArea(); | ||
fbuttons.addButton(control.getResetButton()); | ||
fbuttons.addButton(control.getSpeichernButton()); | ||
group.addButtonArea(fbuttons); | ||
|
||
ButtonArea buttons = new ButtonArea(); | ||
buttons.addButton("Hilfe", new DokumentationAction(), | ||
DokumentationUtil.FREIESFORMULAR, false, "question-circle.png"); | ||
buttons.addButton(new Button("Mail-Vorlage", | ||
new MailVorlageZuweisenAction(), control, false, "view-refresh.png")); | ||
buttons.addButton( | ||
control.getStartFreieFormulareButton(this.getCurrentObject(), control)); | ||
buttons.paint(this.getParent()); | ||
} | ||
} |
Oops, something went wrong.