Changeset 28128f83d33445165a2ae24ddd4c32fb9047a675
- Timestamp:
- 10/21/07 22:22:44
(1 year ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1192998164 +0200
- git-parent:
[8806ccd37ab181d04f0d5aa7db1d42e09871d3cd]
- git-author:
- Christopher Jung <bktheg@web.de> 1192998164 +0200
- Message:
Flotten: Alarmstufe setzen eingebaut
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r37c103c |
r28128f8 |
|
| 934 | 934 | } |
|---|
| 935 | 935 | |
|---|
| | 936 | /** |
|---|
| | 937 | * Aendert die Alarmstufe der Schiffe |
|---|
| | 938 | * @urlparam Integer alarm Die neue Alarmstufe |
|---|
| | 939 | * |
|---|
| | 940 | */ |
|---|
| | 941 | @Action(ActionType.DEFAULT) |
|---|
| | 942 | public void alarmAction() { |
|---|
| | 943 | org.hibernate.Session db = getDB(); |
|---|
| | 944 | TemplateEngine t = getTemplateEngine(); |
|---|
| | 945 | |
|---|
| | 946 | parameterNumber("alarm"); |
|---|
| | 947 | final int alarm = getInteger("alarm"); |
|---|
| | 948 | |
|---|
| | 949 | List ships = db.createQuery("from Ship where id>0 and fleet=? and battle is null" ) |
|---|
| | 950 | .setEntity(0, this.fleet) |
|---|
| | 951 | .list(); |
|---|
| | 952 | |
|---|
| | 953 | for( Iterator iter=ships.iterator(); iter.hasNext(); ) { |
|---|
| | 954 | Ship ship = (Ship)iter.next(); |
|---|
| | 955 | |
|---|
| | 956 | if( (ship.getTypeData().getShipClass() == ShipClasses.GESCHUETZ.ordinal()) || !ship.getTypeData().isMilitary() ) { |
|---|
| | 957 | continue; |
|---|
| | 958 | } |
|---|
| | 959 | |
|---|
| | 960 | ship.setAlarm(alarm); |
|---|
| | 961 | } |
|---|
| | 962 | |
|---|
| | 963 | t.setVar( "fleetmgnt.message", "Die Alarmstufe wurde geändert", |
|---|
| | 964 | "jscript.reloadmain", 1 ); |
|---|
| | 965 | |
|---|
| | 966 | this.redirect(); |
|---|
| | 967 | } |
|---|
| | 968 | |
|---|
| 936 | 969 | @Override |
|---|
| 937 | 970 | @Action(ActionType.DEFAULT) |
|---|
| r1b56016 |
r28128f8 |
|
| 179 | 179 | } |
|---|
| 180 | 180 | {/endif} |
|---|
| | 181 | if( action == "alarm" ) { |
|---|
| | 182 | document.getElementById("alarm").style.display = 'inline'; |
|---|
| | 183 | } |
|---|
| | 184 | else { |
|---|
| | 185 | document.getElementById("alarm").style.display = 'none'; |
|---|
| | 186 | } |
|---|
| 181 | 187 | } |
|---|
| 182 | 188 | --> |
|---|
| … | … | |
| 192 | 198 | <option value="chargeBatteries">Batterien aufladen</option> |
|---|
| 193 | 199 | <option value="dischargeBatteries">Batterien entladen</option> |
|---|
| | 200 | <option value="alarm">Alarmstufe ändern</option> |
|---|
| 194 | 201 | <option value="show">---------</option> |
|---|
| 195 | 202 | <option value="jstart">Jäger starten</option> |
|---|
| … | … | |
| 224 | 231 | </select> |
|---|
| 225 | 232 | {/endif} |
|---|
| | 233 | <select id="alarm" name="alarm" size="1" style="display:none"> |
|---|
| | 234 | <option value="0">gelb</option> |
|---|
| | 235 | <option value="1">rot</option> |
|---|
| | 236 | </select> |
|---|
| 226 | 237 | <input type="submit" value="ok" /> |
|---|
| 227 | 238 | </form> |
|---|