Changeset 28128f83d33445165a2ae24ddd4c32fb9047a675

Show
Ignore:
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
  • src/net/driftingsouls/ds2/server/modules/FleetMgntController.java

    r37c103c r28128f8  
    934934        } 
    935935         
     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&auml;ndert", 
     964                                        "jscript.reloadmain",   1 ); 
     965                 
     966                this.redirect(); 
     967        } 
     968         
    936969        @Override 
    937970        @Action(ActionType.DEFAULT) 
  • templates/fleetmgnt.html

    r1b56016 r28128f8  
    179179                                                } 
    180180                                        {/endif} 
     181                                        if( action == "alarm" ) { 
     182                                                document.getElementById("alarm").style.display = 'inline'; 
     183                                        } 
     184                                        else { 
     185                                                document.getElementById("alarm").style.display = 'none'; 
     186                                        } 
    181187                                } 
    182188                        --> 
     
    192198                                        <option value="chargeBatteries">Batterien aufladen</option> 
    193199                                        <option value="dischargeBatteries">Batterien entladen</option> 
     200                                        <option value="alarm">Alarmstufe &auml;ndern</option> 
    194201                                        <option value="show">---------</option> 
    195202                                        <option value="jstart">J&auml;ger starten</option> 
     
    224231                                        </select> 
    225232                                {/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> 
    226237                                <input type="submit" value="ok" /> 
    227238                        </form>