Esempio n. 1
0
  static Object responsibleField(final String responsible, boolean mutable) throws SQLException {
    if (!mutable) return user_link(responsible);

    final Listbox list = new Listbox("f_company.responsible", responsible);
    list.add("", "{niko}");
    for (final User user : User.filterAndOrderBy(null, User.Field.id, true))
      if (user.status != User.Status.Admin) {
        final int count = Company.countWithMember(user.id);
        list.add(user.id, user.id + " (" + count + ") " + iso(user.status.out));
      }
    return list;
  }
Esempio n. 2
0
  static Object statusField(final int status, final boolean mutable) {
    if (!mutable) return bold(escape(iso(Company.statusToString(status))));

    final Listbox list = new Listbox("f_company.status", String.valueOf(status));
    for (int s = 0; s < Company.statusCount(); s++)
      list.add(String.valueOf(s), iso(Company.statusToString(s)));
    return list;
  }
Esempio n. 3
0
  static Object industryField(final String industry, boolean mutable) {
    if (!mutable) return bold(escape(industry));

    switch (Variant.current) {
      case Fund_Raising:
        return new Textbox("f_company.industry", industry);
      case Public_Relations:
        final Listbox list = new Listbox("f_company.industry", industry);
        for (final String a : Company.industryPR) list.add(a, iso(a));
        return list;
      default:
        throw new RuntimeException();
    }
  }