OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 152 → Rev 153

/trunk/Modules/Module Badge/src/org/openconcerto/modules/badge/BadgeListener.java
44,7 → 44,6
import org.openconcerto.sql.preferences.SQLPreferences;
import org.openconcerto.sql.preferences.UserProps;
import org.openconcerto.sql.sqlobject.IComboSelectionItem;
import org.openconcerto.sql.users.UserManager;
import org.openconcerto.utils.ExceptionHandler;
import org.openconcerto.utils.i18n.TranslationManager;
 
60,7 → 59,7
}
 
public void init(String id) {
 
// TODO use HeadlessGestion
TranslationManager.getInstance().addTranslationStreamFromClass(BadgeListener.class);
TranslationManager.getInstance().setLocale(Locale.FRANCE);
final ComptaPropsConfiguration conf = ComptaPropsConfiguration.create(true);
70,7 → 69,7
}
 
Configuration.setInstance(conf);
UserManager.getInstance().setCurrentUser(2);
conf.getUserManager().setCurrentUserID(2);
 
try {
conf.getBase();
276,6 → 275,7
public boolean isBadgeAllowed(String cardNumber) {
SQLBase base = Configuration.getInstance().getBase();
SQLSelect sel = new SQLSelect(base);
// FIXME use SQLElement
SQLTable tableAdh = Configuration.getInstance().getRoot().findTable("ADHERENT");
sel.addSelectStar(tableAdh);
sel.setWhere(new Where(tableAdh.getField("NUMERO_CARTE"), "=", cardNumber));
282,6 → 282,7
List<SQLRow> list = (List<SQLRow>) base.getDataSource().execute(sel.asString(), SQLRowListRSH.createFromSelect(sel));
 
String motif = "";
// FIXME use actual module installed in the DB (MAYBE init() the ModuleManager)
Boolean onlyAdmin = ModuleManager.getInstance().getFactories().get("org.openconcerto.modules.badge").get(new ModuleVersion(1, 0)).getSQLPreferences(tableAdh.getDBRoot())
.getBoolean(Module.ENTREE_PREF, false);
boolean allow = false;