<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright (C) 2016 Roland Häder
+Copyright (C) 2016, 2017 Roland Häder
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.beans.financial;
+
+import org.mxchange.jfinancials.FinancialSessionBeanRemote;
+import java.text.MessageFormat;
+import java.util.Arrays;
+import java.util.List;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.RequestScoped;
+import javax.faces.view.facelets.FaceletException;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jfinancials.beans.BaseFinancialsController;
+import org.mxchange.jfinancials.beans.login.user.FinancialsUserLoginWebSessionController;
+import org.mxchange.jfinancials.model.income.BillableIncome;
+import org.mxchange.jfinancials.model.income.FinancialIncome;
+import org.mxchange.jfinancials.model.income.interval.FinancialInterval;
+
+/**
+ * An administrative user bean (controller)
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Named ("financialController")
+@RequestScoped
+public class FinancialsAdminFinancialWebRequestBean extends BaseFinancialsController implements FinancialsAdminFinancialWebRequestController {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 56_189_028_928_371L;
+
+ /**
+ * Remote contact bean
+ */
+ private FinancialSessionBeanRemote financialBean;
+
+ /**
+ * Income interval
+ */
+ private FinancialInterval incomeInterval;
+
+ /**
+ * Income single amount
+ */
+ private Float incomeSingleAmount;
+
+ /**
+ * Income (type) title
+ */
+ private String incomeTitle;
+
+ /**
+ * User instance
+ */
+ @Inject
+ private FinancialsUserLoginWebSessionController userLoginController;
+
+ /**
+ * Constructor
+ */
+ public FinancialsAdminFinancialWebRequestBean () {
+ // Call super constructor
+ super();
+ }
+
+ public String addFinancialIncome () {
+ // Is all data valid?
+ if (null == this.getIncomeInterval()) {
+ // Throw NPE
+ throw new NullPointerException("incomeInterval is null"); //NOI18N
+ } else if (null == this.getIncomeSingleAmount()) {
+ // Throw again
+ throw new NullPointerException("incomeSingleAmount is null"); //NOI18N
+ } else if (this.getIncomeSingleAmount() < 0) {
+ // Not allowed value
+ throw new IllegalArgumentException(MessageFormat.format("incomeSingleAmount={0} is not valid.", this.getIncomeSingleAmount())); //NOI18N
+ } else if (null == this.getIncomeTitle()) {
+ // Throw again
+ throw new NullPointerException("incomeTitle is null"); //NOI18N
+ } else if (this.getIncomeTitle().isEmpty()) {
+ // Should not be empty
+ throw new IllegalArgumentException("incomeTitle is empty"); //NOI18N
+ }
+
+ // Now that all required data has been entered, prepare new income instance
+ BillableIncome income = new FinancialIncome(this.getIncomeTitle(), this.getIncomeSingleAmount(), this.getIncomeInterval(), this.userLoginController.getLoggedInUser());
+
+ // Handle it over to the EJB
+ // @TODO Use updated income instance, e.g. fire event
+ BillableIncome updatedIncome = this.financialBean.addIncome(income);
+
+ // All fine
+ return "add_user_fiancial_income"; //NOI18N
+ }
+
+ @Override
+ public List<FinancialInterval> getAllIncomeIntervals () {
+ // Init array
+ List<FinancialInterval> incomeIntervals = Arrays.asList(FinancialInterval.values());
+
+ // Return it
+ return incomeIntervals;
+ }
+
+ @Override
+ public FinancialInterval getIncomeInterval () {
+ return this.incomeInterval;
+ }
+
+ @Override
+ public void setIncomeInterval (final FinancialInterval incomeInterval) {
+ this.incomeInterval = incomeInterval;
+ }
+
+ @Override
+ public Float getIncomeSingleAmount () {
+ return this.incomeSingleAmount;
+ }
+
+ @Override
+ public void setIncomeSingleAmount (final Float incomeSingleAmount) {
+ this.incomeSingleAmount = incomeSingleAmount;
+ }
+
+ @Override
+ public String getIncomeTitle () {
+ return this.incomeTitle;
+ }
+
+ @Override
+ public void setIncomeTitle (final String incomeTitle) {
+ this.incomeTitle = incomeTitle;
+ }
+
+ /**
+ * Post-initialization of this class
+ */
+ @PostConstruct
+ public void init () {
+ // Try it
+ try {
+ // Get initial context
+ Context context = new InitialContext();
+
+ // Try to lookup
+ this.financialBean = (FinancialSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/financial!org.mxchange.jfinancials.FinancialSessionBeanRemote"); //NOI18N
+ } catch (final NamingException e) {
+ // Throw again
+ throw new FaceletException(e);
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.beans.financial;
+
+import java.io.Serializable;
+import java.util.List;
+import org.mxchange.jfinancials.model.income.interval.FinancialInterval;
+
+/**
+ * An administrative interface for user beans
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+public interface FinancialsAdminFinancialWebRequestController extends Serializable {
+
+ /**
+ * Getter for income single amount
+ * <p>
+ * @return Income single amount
+ */
+ Float getIncomeSingleAmount ();
+
+ /**
+ * Setter for income single amount
+ * <p>
+ * @param incomeSingleAmount Income single amount
+ */
+ void setIncomeSingleAmount (final Float incomeSingleAmount);
+
+ /**
+ * Getter for income (type) title
+ * <p>
+ * @return Income title
+ */
+ String getIncomeTitle ();
+
+ /**
+ * Setter for income (type) title
+ * <p>
+ * @param incomeTitle Income title
+ */
+ void setIncomeTitle (final String incomeTitle);
+
+ /**
+ * Getter for income interval
+ * <p>
+ * @return Income interval
+ */
+ FinancialInterval getIncomeInterval ();
+
+ /**
+ * Setter for income (type) interval
+ * <p>
+ * @param incomeInterval Income interval
+ */
+ void setIncomeInterval (final FinancialInterval incomeInterval);
+
+ /**
+ * Returns a list of all all income intervals
+ * <p>
+ * @return Income intervals
+ */
+ List<FinancialInterval> getAllIncomeIntervals ();
+
+}
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder GmbH
+ * Copyright (C) 2016, 2017 Roland Häder GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder GmbH
+ * Copyright (C) 2016, 2017 Roland Häder GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
*/
package org.mxchange.jfinancials.beans.resendlink;
-import java.text.MessageFormat;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Any;
import javax.faces.view.facelets.FaceletException;
import javax.inject.Inject;
import javax.inject.Named;
import org.mxchange.jfinancials.beans.BaseFinancialsController;
import org.mxchange.jfinancials.beans.localization.FinancialsLocalizationSessionController;
import org.mxchange.jfinancials.beans.user.FinancialsUserWebSessionController;
+import org.mxchange.jusercore.events.resendlink.ObservableUserResendLinkAccountEvent;
+import org.mxchange.jusercore.events.resendlink.UserResendLinkAccountEvent;
import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
+import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
import org.mxchange.jusercore.exceptions.UserStatusLockedException;
+import org.mxchange.jusercore.model.resendlink.ResendLinkSessionBeanRemote;
import org.mxchange.jusercore.model.user.User;
import org.mxchange.jusercore.model.user.status.UserAccountStatus;
@Inject
private FinancialsUserWebSessionController userController;
+ /**
+ * Event being fired after confirmation link is being sent
+ */
+ @Inject
+ @Any
+ private Event<ObservableUserResendLinkAccountEvent> userResendLinkEvent;
+
/**
* Default constructor
*/
this.clear();
// Not found, should not happen as the registered validator should find it
- throw new FaceletException(MessageFormat.format("this.emailAddress={0} should be resolveable into User instance.", this.getEmailAddress()), ex); //NOI18N
+ this.showFacesMessage("form_resend_link:", "ERROR_USER_EMAIL_ADDRESS_NOT_FOUND"); //NOI18N
+ return ""; //NOI18N
}
// Is the user account already confirmed?
this.clear();
// Then abort here
- this.showFacesMessage("form_resend_link:resendEmailAddress", new UserStatusConfirmedException(user)); //NOI18N
+ this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_STATUS_ALREADY_CONFIRMED"); //NOI18N
return ""; //NOI18N
} else if (user.getUserAccountStatus() == UserAccountStatus.LOCKED) {
// Always clear bean
this.clear();
// User account is locked
- this.showFacesMessage("form_resend_link:resendEmailAddress", new UserStatusLockedException(user)); //NOI18N
+ this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_STATUS_LOCKED"); //NOI18N
return ""; //NOI18N
} else if (user.getUserConfirmKey() == null) {
// Status is UNCONFIRMED but confirmation key is NULL
throw new NullPointerException("user.userConfirmKey is null"); //NOI18N
}
- // Get base URL
- String baseUrl = FacesUtils.generateBaseUrl();
+ try {
+ // Get base URL
+ String baseUrl = FacesUtils.generateBaseUrl();
+
+ // Call EJB and return redirect target
+ this.resendLinkBean.resendConfirmationLink(user, this.localizationController.getLocale(), baseUrl);
+ } catch (final UserNotFoundException ex) {
+ // User not found
+ this.showFacesMessage("form_resend_link:resendEmailAddress", "ERROR_USER_NOT_FOUND"); //NOI18N
+ return ""; //NOI18N
+ } catch (final UserStatusLockedException | UserStatusConfirmedException ex) {
+ // Output message, this should not happen as the confirmation key is being removed
+ this.showFacesMessage("form_resend_link:resendEmailAddress", ex); //NOI18N
+ return ""; //NOI18N
+ }
- // Call EJB and return redirect target
- this.resendLinkBean.resendConfirmationLink(user, this.localizationController.getLocale(), baseUrl);
+ // Fire event
+ this.userResendLinkEvent.fire(new UserResendLinkAccountEvent(user));
// Clear this bean
this.clear();
// Return redirect target
- return "resend_done"; //NOI18N
+ return "user_resend_done"; //NOI18N
}
@Override
Context context = new InitialContext();
// Try to lookup
- this.resendLinkBean = (ResendLinkSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/resendLink!org.mxchange.jfinancials.beans.resendlink.ResendLinkSessionBeanRemote"); //NOI18N
+ this.resendLinkBean = (ResendLinkSessionBeanRemote) context.lookup("java:global/jfinancials-ejb/resendLink!org.mxchange.jusercore.model.resendlink.ResendLinkSessionBeanRemote"); //NOI18N
} catch (final NamingException e) {
// Throw again
throw new FaceletException(e);
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
- * Copyright (C) 2016 Roland Häder
+ * Copyright (C) 2016, 2017 Roland Häder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
-# Copyright (C) 2016 Roland H\u00e4der
+# Copyright (C) 2016, 2017 Roland H\u00e4der
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
ERROR_USER_PASSWORD_TO_WEAK=Das eingegebene Passwort ist zu schwach. Bitte geben Sie Bustaben, Zahlen und Sonderzeichen ein, um ein sicheres Passwort zu erstellen.
#@TODO Please fix German umlauts!
GUEST_REGISTRATION_USER_NAME_NOT_ENTERED=Bitte geben Sie einen Benutzernamen ein. Dieser wird auf Verfuegbarkeit hin getestet.
+#@TODO Please fix German umlauts!
+PAGE_TITLE_LOGIN_FINANCIAL_OVERVIEW=Finanzen-Uebersicht
+#@TODO Please fix German umlauts!
+SUB_TITLE_LOGIN_FINANCIAL_OVERVIEW=Uebersicht Ihrer Finanzen:
+#@TODO Please fix German umlauts!
+PAGE_TITLE_LOGIN_FINANCIAL_ADD_RECEIPT=Rechnung hinzufuegen/erfassen
+SUB_TITLE_LOGIN_FINANCIAL_ADD_RECEIPT=Weitere Rechnung erfassen:
+#@TODO Please fix German umlauts!
+PAGE_TITLE_LOGIN_FINANCIAL_ADD_INCOME=Neue Einkommensart hinzufuegen
+#@TODO Please fix German umlauts!
+SUB_TITLE_LOGIN_FINANCIAL_ADD_INCOME=Weitere Einkommensart hinzufuegen:
+LOGIN_FINANCIAL_ADD_INCOME_FORM_TITLE=Daten einer Einkommensart erfassen:
+LOGIN_FINANCIAL_INCOME_INTERVAL=Einkommensinterval:
+#@TODO Please fix German umlauts!
+FIELD_FINANCIAL_INCOME_REQUIRED=Feld "Einkommensinterval" muss ausgewaehlt werden.
+#@TODO Please fix German umlauts!
+BUTTON_LOGIN_FINCIAL_ADD_INCOME=Einkommensart hinzufuegen
+LOGIN_FINANCIAL_INCOME_SINGLE_VALUE=Einkommensbetrag:
+#@TODO Please fix German umlauts!
+FIELD_FINANCIAL_INCOME_SINGLE_VALUE_REQUIRED=Feld "Einkommensbetrag" bitte ausfuellen.
+LOGIN_FINANCIAL_INCOME_TITLE=Bezeichnung der Einkommensart:
+#@TODO Please fix German umlauts!
+FIELD_FINANCIAL_INCOME_TITLE_REQUIRED=Feld "Title" muss ausgefuellt werden.
-# Copyright (C) 2016 Roland H\u00e4der
+# Copyright (C) 2016, 2017 Roland H\u00e4der
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
SELECTION_NOTICE_USER_PROFILE_MODE_MEMBERS=If you choose "Only members", other users can start sharing address books with you.
SELECTION_NOTICE_USER_PROFILE_MODE_PUBLIC=If you choose "All" the whole Internet can view your profile, including bots.
LOGIN_ENTER_CURRENT_PASSWORD_CONFIRMATION_LEGEND=Your current password for confirmation:
-LINK_LOGIN_USER_CHANGE_EMAIL_ADDRESS=Change your email address
LOGIN_USER_CHANGE_PERSONAL_DATA_TITLE=Change personal data:
LINK_TITLE_GUEST_LOGIN_LOST_PASSWORD=Restore your password
PAGE_TITLE_INDEX_CONFIRM_ACCOUNT=Confirm registration
ADMIN_LINK_SHOW_CONTACT_DATA=Show contact data
ERROR_USER_PASSWORD_TO_WEAK=Your entered password is to weak. Please enter letters, numbers and special characters to create a secure password.
GUEST_REGISTRATION_USER_NAME_NOT_ENTERED=Please enter a user name. The entered name is being checked for availability.
+PAGE_TITLE_LOGIN_FINANCIAL_OVERVIEW=Financials Overview
+SUB_TITLE_LOGIN_FINANCIAL_OVERVIEW=Overview of your financials:
+PAGE_TITLE_LOGIN_FINANCIAL_ADD_RECEIPT=Add receipt
+SUB_TITLE_LOGIN_FINANCIAL_ADD_RECEIPT=Add new receipt:
+PAGE_TITLE_LOGIN_FINANCIAL_ADD_INCOME=Add new income type
+SUB_TITLE_LOGIN_FINANCIAL_ADD_INCOME=Add new income type:
+LOGIN_FINANCIAL_ADD_INCOME_FORM_TITLE=Enter all data of one income type:
+LOGIN_FINANCIAL_INCOME_INTERVAL=Income interval:
+FIELD_FINANCIAL_INCOME_REQUIRED=Field "Income interval" must be selected.
+BUTTON_LOGIN_FINCIAL_ADD_INCOME=Add income type
+LOGIN_FINANCIAL_INCOME_SINGLE_VALUE=Income value:
+FIELD_FINANCIAL_INCOME_SINGLE_VALUE_REQUIRED=Field "Income value" must be filled out.
+LOGIN_FINANCIAL_INCOME_TITLE=Title of income type:
+FIELD_FINANCIAL_INCOME_TITLE_REQUIRED=Field "Title" must be filled out.
</li>
</ui:fragment>
- <li class="footer_copyright">Copyright (c) 2017 Roland Häder</li>
+ <li class="footer_copyright">Copyright (c) 2016, 2017 Roland Häder</li>
</ul>
</footer>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
+
+ <ui:composition template="/WEB-INF/templates/login/user/user_base.tpl">
+ <ui:define name="login_title">
+ <h:outputText value="#{msg.PAGE_TITLE_LOGIN_FINANCIAL_ADD_INCOME}" />
+ </ui:define>
+
+ <ui:define name="content_header">
+ <h:outputText value="#{msg.SUB_TITLE_LOGIN_FINANCIAL_ADD_INCOME}" />
+ </ui:define>
+
+ <ui:define name="content">
+ <h:form id="form_add_financials_income">
+ <h:panelGroup styleClass="table_medium" layout="block">
+ <div class="table_header">
+ <h:outputText value="#{msg.LOGIN_FINANCIAL_ADD_INCOME_FORM_TITLE}" />
+ </div>
+
+ <div class="table_row">
+ <div class="table_left_medium">
+ <h:outputLabel for="incomeTitle" value="#{msg.LOGIN_FINANCIAL_INCOME_TITLE}" />
+ </div>
+
+ <div class="table_right_medium">
+ <h:inputText styleClass="input" id="incomeTitle" size="2" maxlength="10" value="#{financialController.incomeTitle}" required="true" requiredMessage="#{msg.FIELD_FINANCIAL_INCOME_TITLE_REQUIRED}">
+ <f:validator validatorId="IncomeTitleValidator" />
+ </h:inputText>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left_medium">
+ <h:outputLabel for="incomeInterval" value="#{msg.LOGIN_FINANCIAL_INCOME_INTERVAL}" />
+ </div>
+
+ <div class="table_right_medium">
+ <h:selectOneMenu styleClass="select" id="incomeInterval" value="#{financialController.incomeInterval}" required="true" requiredMessage="#{msg.FIELD_FINANCIAL_INCOME_REQUIRED}">
+ <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" />
+ <f:selectItems value="#{financialController.allIncomeIntervals}" var="incomeInterval" itemValue="#{incomeInterval}" itemLabel="#{msg[incomeInterval.concat('_INTERVAL')]}" />
+ </h:selectOneMenu>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left_medium">
+ <h:outputLabel for="incomeSingleValue" value="#{msg.LOGIN_FINANCIAL_INCOME_SINGLE_VALUE}" />
+ </div>
+
+ <div class="table_right_medium">
+ <h:inputText styleClass="input" id="incomeSingleValue" size="5" maxlength="20" value="#{financialController.incomeSingleAmount}" required="true" requiredMessage="#{msg.FIELD_FINANCIAL_INCOME_SINGLE_VALUE_REQUIRED}">
+ <f:validator validatorId="CurrencyAmountValidator" />
+ </h:inputText>
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_footer">
+ <h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+
+ <h:commandButton styleClass="submit" id="submit_add_income" type="submit" action="#{financialController.addFinancialIncome()}" value="#{msg.BUTTON_LOGIN_FINCIAL_ADD_INCOME}" />
+ </div>
+ </h:panelGroup>
+ </h:form>
+ </ui:define>
+ </ui:composition>
+</html>
<h:column>
<h:outputLabel for="totalReceipts" styleClass="data_label" value="#{msg.USER_FINANCIALS_TOTAL_RECEIPTS}" />
- <h:outputLink id="totalReceipts" target="list_user_financial_receipts" value="#{financialController.receipts.size()}" />
+ <h:outputLink id="totalReceipts" styleClass="data_field" target="list_user_financial_receipts" value="#{financialController.receipts.size()}" />
+ </h:column>
+
+ <h:column>
+ <h:outputLabel for="totalReceipts" styleClass="data_label" value="#{msg.USER_FINANCIALS_TOTAL_OTHER_EXPENSES}" />
+
+ <h:outputLink id="totalReceipts" styleClass="data_field" target="list_user_financial_other_expenses" value="#{financialController.income.size()}" />
+ </h:column>
+
+ <h:column>
+ <h:outputLabel for="totalReceipts" styleClass="data_label" value="#{msg.USER_FINANCIALS_TOTAL_INCOME}" />
+
+ <h:outputLink id="totalReceipts" styleClass="data_field" target="list_user_financial_income" value="#{financialController.income.size()}" />
</h:column>
</h:panelGrid>
</h:panelGroup>
<h:panelGroup layout="block" styleClass="para">
- <h:outputText value="#{msg.USER_FINANCIALS_NEXT_ACTIONS}"
+ <h:outputText value="#{msg.USER_FINANCIALS_NEXT_ACTIONS}" />
+
<ul>
<li>
- <h:link title="#{msg.LINK_USER_ADD_FINANCIAL_RECEIPT_TITLE}" outcome="add_user_fiancial_receipt" value="#{msg.LINK_USER_ADD_FINANCIAL_RECEIPT}" />
+ <h:link title="#{msg.LINK_USER_FINANCIAL_ADD_RECEIPT_TITLE}" outcome="add_user_fiancial_receipt" value="#{msg.LINK_USER_FINANCIAL_ADD_RECEIPT}" />
+ </li>
+
+ <li>
+ <h:link title="#{msg.LINK_USER_FINANCIAL_ADD_OTHER_EXPENSES_TITLE}" outcome="add_user_fiancial_other_expenses" value="#{msg.LINK_USER_FINANCIAL_ADD_OTHER_EXPENSES}" />
+ </li>
+
+ <li>
+ <h:link title="#{msg.LINK_USER_FINANCIAL_ADD_INCOME_TITLE}" outcome="add_user_fiancial_income" value="#{msg.LINK_USER_FINANCIAL_ADD_INCOME}" />
</li>
</ul>
</h:panelGroup>