use of org.projectforge.web.wicket.flowlayout.DivPanel in project projectforge by micromata.
the class EmployeeBillingImportForm method init.
@SuppressWarnings("serial")
@Override
protected void init() {
super.init();
gridBuilder.newGridPanel();
// Date DropDowns
final FieldsetPanel fsMonthYear = gridBuilder.newFieldset(I18nHelper.getLocalizedMessage("plugins.eed.listcare.yearmonth"));
dropDownMonth = new DropDownChoicePanel<>(fsMonthYear.newChildId(), new DropDownChoice<>(DropDownChoicePanel.WICKET_ID, new PropertyModel<>(this, "selectedMonth"), EEDHelper.MONTH_INTEGERS));
fsMonthYear.add(dropDownMonth);
dropDownYear = new DropDownChoicePanel<>(fsMonthYear.newChildId(), new DropDownChoice<>(DropDownChoicePanel.WICKET_ID, new PropertyModel<>(this, "selectedYear"), eedHelper.getDropDownYears()));
fsMonthYear.add(dropDownYear);
// upload buttons
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("file"), "*.xls");
fileUploadField = new FileUploadField(FileUploadPanel.WICKET_ID);
fs.add(new FileUploadPanel(fs.newChildId(), fileUploadField));
fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID) {
@Override
public final void onSubmit() {
final Date dateToSelectAttrRow = new GregorianCalendar(selectedYear, selectedMonth - 1, 1, 0, 0).getTime();
storagePanel.setDateToSelectAttrRow(dateToSelectAttrRow);
final boolean success = parentPage.doImport(dateToSelectAttrRow);
if (success) {
setDateDropDownsEnabled(false);
}
}
}, getString("upload"), SingleButtonPanel.NORMAL).setTooltip(getString("common.import.upload.tooltip")));
addClearButton(fs);
}
addImportFilterRadio(gridBuilder);
// preview of the imported data
gridBuilder.newGridPanel();
final DivPanel panel = gridBuilder.getPanel();
storagePanel = new EmployeeBillingImportStoragePanel(panel.newChildId(), parentPage, importFilter);
final Date dateToSelectAttrRow = new GregorianCalendar(selectedYear, selectedMonth - 1, 1, 0, 0).getTime();
storagePanel.setDateToSelectAttrRow(dateToSelectAttrRow);
panel.add(storagePanel);
}
use of org.projectforge.web.wicket.flowlayout.DivPanel in project projectforge by micromata.
the class EmployeeConfigurationForm method init.
@Override
protected void init() {
super.init();
// AttrPanels
// set hasSubSplitPanel to true to remove borders from this split panel
gridBuilder.newSplitPanel(GridSize.COL100, true);
final DivPanel divPanel = gridBuilder.getPanel();
final Function<AttrGroup, EmployeeConfigurationTimedDO> addNewEntryFunction = group -> employeeConfigurationService.addNewTimeAttributeRow(data, group.getName());
attrSchemaService.createAttrPanels(divPanel, data, parentPage, addNewEntryFunction);
}
use of org.projectforge.web.wicket.flowlayout.DivPanel in project projectforge by micromata.
the class DatevImportForm method init.
@SuppressWarnings("serial")
@Override
protected void init() {
super.init();
this.setOutputMarkupId(true);
Bytes maxSize = Bytes.valueOf(configurationService.getMaxFileSizeDatev());
this.setMaxSize(maxSize);
gridBuilder.newGridPanel();
String hint = I18nHelper.getLocalizedMessage("finance.datev.upload.hint", NumberHelper.formatBytes(maxSize.bytes()));
final FieldsetPanel fs = gridBuilder.newFieldset(getString("file"), hint);
fileUploadField = new FileUploadField(FileUploadPanel.WICKET_ID);
fs.add(new FileUploadPanel(fs.newChildId(), fileUploadField));
fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("uploadAccounts")) {
@Override
public final void onSubmit() {
parentPage.importAccountList();
}
}, getString("finance.datev.uploadAccountList"), SingleButtonPanel.NORMAL).setTooltip(getString("common.import.upload.tooltip")));
fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("uploadRecords")) {
@Override
public final void onSubmit() {
parentPage.importAccountRecords();
}
}, getString("finance.datev.uploadAccountingRecords"), SingleButtonPanel.NORMAL).setTooltip(getString("common.import.upload.tooltip")));
addClearButton(fs);
addImportFilterRadio(gridBuilder);
// Statistics
new BusinessAssessment4Fieldset(gridBuilder) {
/**
* @see org.projectforge.web.fibu.BusinessAssessment4Fieldset#getBusinessAssessment()
*/
@Override
protected BusinessAssessment getBusinessAssessment() {
return storagePanel.businessAssessment;
}
@Override
public boolean isVisible() {
return storagePanel.businessAssessment != null;
}
};
gridBuilder.newGridPanel();
final DivPanel panel = gridBuilder.getPanel();
storagePanel = new DatevImportStoragePanel(panel.newChildId(), parentPage, importFilter);
panel.add(storagePanel);
this.fileUploadField.add(new FileFieldSizeCheckBehavior() {
@Override
protected void onSubmit(final AjaxRequestTarget target, final FileList fileList) {
// return form to remove errors
target.add(DatevImportForm.this.feedbackPanel);
}
@Override
protected void addErrorMsg(AjaxRequestTarget target, FileList fileList) {
DatevImportForm.this.addError("common.uploadpanel.filetolarge", NumberHelper.formatBytes(maxSize.bytes()));
}
@Override
protected void onError(final AjaxRequestTarget target, final FileList fileList) {
// clear input field to avoid uploading the image
DatevImportForm.this.fileUploadField.clearInput();
// return form
target.add(DatevImportForm.this);
}
});
}
use of org.projectforge.web.wicket.flowlayout.DivPanel in project projectforge by micromata.
the class PluginListForm method init.
@Override
protected void init() {
super.init();
List<AbstractPlugin> availables = pluginAdminService.getAvailablePlugins();
List<String> activatedPlugins = pluginAdminService.getActivatedPluginsFromConfiguration();
gridBuilder.newFormHeading("Please note: (de)activation of plugins will take effect only after restart!");
for (AbstractPlugin plugin : availables) {
gridBuilder.newGridPanel();
gridBuilder.newSplitPanel(GridSize.SPAN2);
DivPanel section = gridBuilder.getPanel();
DivTextPanel pluginId = new DivTextPanel(section.newChildId(), new Model<String>() {
@Override
public String getObject() {
return plugin.getInfo().getId();
}
});
section.add(pluginId);
gridBuilder.newSplitPanel(GridSize.SPAN8);
section = gridBuilder.getPanel();
pluginId = new DivTextPanel(section.newChildId(), new Model<String>() {
@Override
public String getObject() {
return plugin.getInfo().getDescription();
}
});
section.add(pluginId);
gridBuilder.newSplitPanel(GridSize.SPAN2);
section = gridBuilder.getPanel();
final Button button = new Button(SingleButtonPanel.WICKET_ID, new Model<String>()) {
@Override
public final void onSubmit() {
pluginAdminService.storePluginToBeActivated(plugin.getInfo().getId(), !isActivated(activatedPlugins, plugin));
setResponsePage(new PluginListPage(getPage().getPageParameters()));
}
};
final SingleButtonPanel buttonPanel = new SingleButtonPanel(section.newChildId(), button, isActivated(activatedPlugins, plugin) ? getString("system.pluginAdmin.button.deactivate") : getString("system.pluginAdmin.button.activate"), SingleButtonPanel.DANGER);
if (isActivated(activatedPlugins, plugin)) {
buttonPanel.setClassnames(SingleButtonPanel.SUCCESS);
}
section.add(buttonPanel);
}
}
use of org.projectforge.web.wicket.flowlayout.DivPanel in project projectforge by micromata.
the class AbstractImportForm method addImportFilterRadio.
/**
* @return this for chaining.
*/
@SuppressWarnings("serial")
protected AbstractImportForm<F, P, S> addImportFilterRadio(final GridBuilder gridBuilder) {
final FieldsetPanel fs = new FieldsetPanel(gridBuilder.getPanel(), getString("filter")) {
/**
* @see org.apache.wicket.Component#isVisible()
*/
@Override
public boolean isVisible() {
return storagePanel.isVisible();
}
};
final DivPanel radioGroupPanel = fs.addNewRadioBoxButtonDiv();
final RadioGroupPanel<String> radioGroup = new RadioGroupPanel<String>(radioGroupPanel.newChildId(), "filterType", new PropertyModel<String>(importFilter, "listType")) {
/**
* @see org.projectforge.web.wicket.flowlayout.RadioGroupPanel#wantOnSelectionChangedNotifications()
*/
@Override
protected boolean wantOnSelectionChangedNotifications() {
return true;
}
};
radioGroupPanel.add(radioGroup);
fs.setLabelFor(radioGroup.getRadioGroup());
radioGroup.add(new Model<String>("all"), getString("filter.all"));
radioGroup.add(new Model<String>("modified"), getString("modified"));
radioGroup.add(new Model<String>("faulty"), getString("filter.faulty"));
return this;
}
Aggregations