Updated 'core' + renamed 'main' -> 'classes'.
authorRoland Haeder <roland@mxchange.org>
Tue, 25 Aug 2015 16:50:54 +0000 (18:50 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 25 Aug 2015 16:50:54 +0000 (18:50 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
309 files changed:
application/shipsimu/classes/.htaccess [new file with mode: 0644]
application/shipsimu/classes/actions/.htaccess [new file with mode: 0644]
application/shipsimu/classes/actions/class_ [new file with mode: 0644]
application/shipsimu/classes/actions/class_BaseShipSimuAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/ship-simu/.htaccess [new file with mode: 0644]
application/shipsimu/classes/actions/ship-simu/class_ShipSimuLoginAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/ship-simu/class_ShipSimuProfileAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/web/.htaccess [new file with mode: 0644]
application/shipsimu/classes/actions/web/class_WebShipSimuLogin [new file with mode: 0644]
application/shipsimu/classes/actions/web/class_WebShipSimuLoginCompanyAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/web/class_WebShipSimuLoginLogoutAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/web/class_WebShipSimuLoginProfileAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/web/class_WebShipSimuLoginRefillAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/web/class_WebShipSimuLoginStatusProblemAction.php [new file with mode: 0644]
application/shipsimu/classes/actions/web/class_WebShipSimuLoginWelcomeAction.php [new file with mode: 0644]
application/shipsimu/classes/bank/.htaccess [new file with mode: 0644]
application/shipsimu/classes/bank/class_BaseBank.php [new file with mode: 0644]
application/shipsimu/classes/bank/money/class_MoneyBank.php [new file with mode: 0644]
application/shipsimu/classes/class_ [new file with mode: 0644]
application/shipsimu/classes/class_BasePersonell.php [new file with mode: 0644]
application/shipsimu/classes/class_BaseSimulator.php [new file with mode: 0644]
application/shipsimu/classes/class_Merchant.php [new file with mode: 0644]
application/shipsimu/classes/class_WorksContract.php [new file with mode: 0644]
application/shipsimu/classes/commands/.htaccess [new file with mode: 0644]
application/shipsimu/classes/commands/web/.htaccess [new file with mode: 0644]
application/shipsimu/classes/commands/web/class_WebShipsimuGuestLoginCommand.php [new file with mode: 0644]
application/shipsimu/classes/commands/web/class_WebShipsimuProfileCommand.php [new file with mode: 0644]
application/shipsimu/classes/commands/web/class_WebShipsimuRefillCommand.php [new file with mode: 0644]
application/shipsimu/classes/commands/web/class_WebShipsimuRegisterCommand.php [new file with mode: 0644]
application/shipsimu/classes/commands/web/class_WebShipsimuUserLoginCommand.php [new file with mode: 0644]
application/shipsimu/classes/commands/web/company/.htaccess [new file with mode: 0644]
application/shipsimu/classes/commands/web/company/class_WebShipSimuCompanyCommand.php [new file with mode: 0644]
application/shipsimu/classes/commands/web/government/.htaccess [new file with mode: 0644]
application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedStartupCommand.php [new file with mode: 0644]
application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedTrainingCommand.php [new file with mode: 0644]
application/shipsimu/classes/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php [new file with mode: 0644]
application/shipsimu/classes/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php [new file with mode: 0644]
application/shipsimu/classes/companies/.htaccess [new file with mode: 0644]
application/shipsimu/classes/companies/class_ShippingCompany.php [new file with mode: 0644]
application/shipsimu/classes/constructions/.htaccess [new file with mode: 0644]
application/shipsimu/classes/constructions/berths/.htaccess [new file with mode: 0644]
application/shipsimu/classes/constructions/berths/class_Berth.php [new file with mode: 0644]
application/shipsimu/classes/constructions/class_BaseConstruction.php [new file with mode: 0644]
application/shipsimu/classes/constructions/docks/.htaccess [new file with mode: 0644]
application/shipsimu/classes/constructions/docks/class_DryDock.php [new file with mode: 0644]
application/shipsimu/classes/constructions/harbors/.htaccess [new file with mode: 0644]
application/shipsimu/classes/constructions/harbors/class_Harbor.php [new file with mode: 0644]
application/shipsimu/classes/constructions/terminals/.htaccess [new file with mode: 0644]
application/shipsimu/classes/constructions/terminals/class_Terminal.php [new file with mode: 0644]
application/shipsimu/classes/constructions/yards/.htaccess [new file with mode: 0644]
application/shipsimu/classes/constructions/yards/class_Shipyard.php [new file with mode: 0644]
application/shipsimu/classes/controller/.htaccess [new file with mode: 0644]
application/shipsimu/classes/controller/html/.htaccess [new file with mode: 0644]
application/shipsimu/classes/controller/html/class_HtmlCompanyController.php [new file with mode: 0644]
application/shipsimu/classes/controller/html/class_HtmlGovernmentFailedController.php [new file with mode: 0644]
application/shipsimu/classes/drives/.htaccess [new file with mode: 0644]
application/shipsimu/classes/drives/class_BaseDrive.php [new file with mode: 0644]
application/shipsimu/classes/drives/motor/.htaccess [new file with mode: 0644]
application/shipsimu/classes/drives/motor/class_Motor.php [new file with mode: 0644]
application/shipsimu/classes/factories/.htaccess [new file with mode: 0644]
application/shipsimu/classes/factories/class_ShipSimuWebNewsFactory.php [new file with mode: 0644]
application/shipsimu/classes/filter/.htaccess [new file with mode: 0644]
application/shipsimu/classes/filter/book/.htaccess [new file with mode: 0644]
application/shipsimu/classes/filter/book/refill/.htaccess [new file with mode: 0644]
application/shipsimu/classes/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php [new file with mode: 0644]
application/shipsimu/classes/filter/class_ [new file with mode: 0644]
application/shipsimu/classes/filter/class_BaseShipSimuFilter.php [new file with mode: 0644]
application/shipsimu/classes/filter/government/.htaccess [new file with mode: 0644]
application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php [new file with mode: 0644]
application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php [new file with mode: 0644]
application/shipsimu/classes/filter/page/.htaccess [new file with mode: 0644]
application/shipsimu/classes/filter/page/class_RefillPageFilter.php [new file with mode: 0644]
application/shipsimu/classes/filter/validator/.htaccess [new file with mode: 0644]
application/shipsimu/classes/filter/validator/class_RefillRequestValidatorFilter.php [new file with mode: 0644]
application/shipsimu/classes/filter/validator/class_ShipSimuUserStatusGuestFilter.php [new file with mode: 0644]
application/shipsimu/classes/government/.htaccess [new file with mode: 0644]
application/shipsimu/classes/government/class_SimplifiedGovernment.php [new file with mode: 0644]
application/shipsimu/classes/login/.htaccess [new file with mode: 0644]
application/shipsimu/classes/login/class_ShipSimuGuestLogin.php [new file with mode: 0644]
application/shipsimu/classes/login/class_ShipSimuUserLogin.php [new file with mode: 0644]
application/shipsimu/classes/login/helper/.htaccess [new file with mode: 0644]
application/shipsimu/classes/login/helper/class_ShipSimuLoginHelper.php [new file with mode: 0644]
application/shipsimu/classes/menu/.htaccess [new file with mode: 0644]
application/shipsimu/classes/menu/class_ShipSimu [new file with mode: 0644]
application/shipsimu/classes/menu/class_ShipSimuConfirmMenu.php [new file with mode: 0644]
application/shipsimu/classes/menu/class_ShipSimuHomeMenu.php [new file with mode: 0644]
application/shipsimu/classes/menu/class_ShipSimuLoginAreaMenu.php [new file with mode: 0644]
application/shipsimu/classes/menu/class_ShipSimuLoginFailedMenu.php [new file with mode: 0644]
application/shipsimu/classes/menu/class_ShipSimuLoginMenu.php [new file with mode: 0644]
application/shipsimu/classes/menu/class_ShipSimuLogoutMenu.php [new file with mode: 0644]
application/shipsimu/classes/menu/class_ShipSimuRegisterMenu.php [new file with mode: 0644]
application/shipsimu/classes/menu/class_ShipSimuStatusMenu.php [new file with mode: 0644]
application/shipsimu/classes/menu/government/.htaccess [new file with mode: 0644]
application/shipsimu/classes/menu/government/class_ShipSimuGovernmentFailedAreaMenu.php [new file with mode: 0644]
application/shipsimu/classes/opening/.htaccess [new file with mode: 0644]
application/shipsimu/classes/opening/bank/.htaccess [new file with mode: 0644]
application/shipsimu/classes/opening/bank/class_MoneyBankRealtimeOpening.php [new file with mode: 0644]
application/shipsimu/classes/opening/class_ [new file with mode: 0644]
application/shipsimu/classes/opening/class_BaseOpening.php [new file with mode: 0644]
application/shipsimu/classes/parts/.htaccess [new file with mode: 0644]
application/shipsimu/classes/parts/class_BaseShipPart.php [new file with mode: 0644]
application/shipsimu/classes/parts/maschineroom/.htaccess [new file with mode: 0644]
application/shipsimu/classes/parts/maschineroom/class_MaschineRoom.php [new file with mode: 0644]
application/shipsimu/classes/personell/.htaccess [new file with mode: 0644]
application/shipsimu/classes/personell/class_SimulatorPersonell.php [new file with mode: 0644]
application/shipsimu/classes/personell/company/.htaccess [new file with mode: 0644]
application/shipsimu/classes/personell/company/class_CompanyEmployee.php [new file with mode: 0644]
application/shipsimu/classes/registration/.htaccess [new file with mode: 0644]
application/shipsimu/classes/registration/class_ShipSimuRegistration.php [new file with mode: 0644]
application/shipsimu/classes/resolver/.htaccess [new file with mode: 0644]
application/shipsimu/classes/resolver/command/.htaccess [new file with mode: 0644]
application/shipsimu/classes/resolver/command/html/.htaccess [new file with mode: 0644]
application/shipsimu/classes/resolver/command/html/class_HtmlCompanyCommandResolver.php [new file with mode: 0644]
application/shipsimu/classes/resolver/command/html/class_HtmlGovernmentFailedCommandResolver.php [new file with mode: 0644]
application/shipsimu/classes/resolver/controller/.htaccess [new file with mode: 0644]
application/shipsimu/classes/resolver/controller/html/.htaccess [new file with mode: 0644]
application/shipsimu/classes/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php [new file with mode: 0644]
application/shipsimu/classes/ships/.htaccess [new file with mode: 0644]
application/shipsimu/classes/ships/class_BaseShip.php [new file with mode: 0644]
application/shipsimu/classes/ships/passenger/.htaccess [new file with mode: 0644]
application/shipsimu/classes/ships/passenger/class_PassengerShip.php [new file with mode: 0644]
application/shipsimu/classes/structures/.htaccess [new file with mode: 0644]
application/shipsimu/classes/structures/class_BaseStructure.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/.htaccess [new file with mode: 0644]
application/shipsimu/classes/structures/extended/cabines/.htaccess [new file with mode: 0644]
application/shipsimu/classes/structures/extended/cabines/class_BaseCabin.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/cabines/ship/.htaccess [new file with mode: 0644]
application/shipsimu/classes/structures/extended/cabines/ship/class_EconomyCabin.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/cabines/ship/class_LowCabin.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/cabines/ship/class_LuxuryCabin.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/cabines/ship/class_PremierCabin.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/class_ [new file with mode: 0644]
application/shipsimu/classes/structures/extended/class_BaseCabinStructure.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/class_BaseDeckStructure.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/class_BaseUpperStructure.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/decks/.htaccess [new file with mode: 0644]
application/shipsimu/classes/structures/extended/decks/cargo/.htaccess [new file with mode: 0644]
application/shipsimu/classes/structures/extended/decks/cargo/class_CarDeck.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/decks/cargo/class_TrainDeck.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/decks/cargo/class_TruckDeck.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/decks/class_BaseDeck.php [new file with mode: 0644]
application/shipsimu/classes/structures/extended/lower/.htaccess [new file with mode: 0644]
application/shipsimu/classes/structures/extended/upper/.htaccess [new file with mode: 0644]
application/shipsimu/classes/structures/extended/upper/class_Bridge.php [new file with mode: 0644]
application/shipsimu/classes/user/.htaccess [new file with mode: 0644]
application/shipsimu/classes/user/class_ShipSimuBaseUser.php [new file with mode: 0644]
application/shipsimu/classes/user/extended/.htaccess [new file with mode: 0644]
application/shipsimu/classes/user/extended/class_ShipSimuGuest.php [new file with mode: 0644]
application/shipsimu/classes/user/extended/class_ShipSimuMember.php [new file with mode: 0644]
application/shipsimu/classes/wrapper/.htaccess [new file with mode: 0644]
application/shipsimu/classes/wrapper/class_CompanyDatabaseWrapper.php [new file with mode: 0644]
application/shipsimu/classes/wrapper/class_UserGovernmentDatabaseWrapper.php [new file with mode: 0644]
application/shipsimu/main/.htaccess [deleted file]
application/shipsimu/main/actions/.htaccess [deleted file]
application/shipsimu/main/actions/class_ [deleted file]
application/shipsimu/main/actions/class_BaseShipSimuAction.php [deleted file]
application/shipsimu/main/actions/ship-simu/.htaccess [deleted file]
application/shipsimu/main/actions/ship-simu/class_ShipSimuLoginAction.php [deleted file]
application/shipsimu/main/actions/ship-simu/class_ShipSimuProfileAction.php [deleted file]
application/shipsimu/main/actions/web/.htaccess [deleted file]
application/shipsimu/main/actions/web/class_WebShipSimuLogin [deleted file]
application/shipsimu/main/actions/web/class_WebShipSimuLoginCompanyAction.php [deleted file]
application/shipsimu/main/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php [deleted file]
application/shipsimu/main/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php [deleted file]
application/shipsimu/main/actions/web/class_WebShipSimuLoginLogoutAction.php [deleted file]
application/shipsimu/main/actions/web/class_WebShipSimuLoginProfileAction.php [deleted file]
application/shipsimu/main/actions/web/class_WebShipSimuLoginRefillAction.php [deleted file]
application/shipsimu/main/actions/web/class_WebShipSimuLoginStatusProblemAction.php [deleted file]
application/shipsimu/main/actions/web/class_WebShipSimuLoginWelcomeAction.php [deleted file]
application/shipsimu/main/bank/.htaccess [deleted file]
application/shipsimu/main/bank/class_BaseBank.php [deleted file]
application/shipsimu/main/bank/money/class_MoneyBank.php [deleted file]
application/shipsimu/main/class_ [deleted file]
application/shipsimu/main/class_BasePersonell.php [deleted file]
application/shipsimu/main/class_BaseSimulator.php [deleted file]
application/shipsimu/main/class_Merchant.php [deleted file]
application/shipsimu/main/class_WorksContract.php [deleted file]
application/shipsimu/main/commands/.htaccess [deleted file]
application/shipsimu/main/commands/web/.htaccess [deleted file]
application/shipsimu/main/commands/web/class_WebShipsimuGuestLoginCommand.php [deleted file]
application/shipsimu/main/commands/web/class_WebShipsimuProfileCommand.php [deleted file]
application/shipsimu/main/commands/web/class_WebShipsimuRefillCommand.php [deleted file]
application/shipsimu/main/commands/web/class_WebShipsimuRegisterCommand.php [deleted file]
application/shipsimu/main/commands/web/class_WebShipsimuUserLoginCommand.php [deleted file]
application/shipsimu/main/commands/web/company/.htaccess [deleted file]
application/shipsimu/main/commands/web/company/class_WebShipSimuCompanyCommand.php [deleted file]
application/shipsimu/main/commands/web/government/.htaccess [deleted file]
application/shipsimu/main/commands/web/government/class_WebGovernmentFailedStartupCommand.php [deleted file]
application/shipsimu/main/commands/web/government/class_WebGovernmentFailedTrainingCommand.php [deleted file]
application/shipsimu/main/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php [deleted file]
application/shipsimu/main/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php [deleted file]
application/shipsimu/main/companies/.htaccess [deleted file]
application/shipsimu/main/companies/class_ShippingCompany.php [deleted file]
application/shipsimu/main/constructions/.htaccess [deleted file]
application/shipsimu/main/constructions/berths/.htaccess [deleted file]
application/shipsimu/main/constructions/berths/class_Berth.php [deleted file]
application/shipsimu/main/constructions/class_BaseConstruction.php [deleted file]
application/shipsimu/main/constructions/docks/.htaccess [deleted file]
application/shipsimu/main/constructions/docks/class_DryDock.php [deleted file]
application/shipsimu/main/constructions/harbors/.htaccess [deleted file]
application/shipsimu/main/constructions/harbors/class_Harbor.php [deleted file]
application/shipsimu/main/constructions/terminals/.htaccess [deleted file]
application/shipsimu/main/constructions/terminals/class_Terminal.php [deleted file]
application/shipsimu/main/constructions/yards/.htaccess [deleted file]
application/shipsimu/main/constructions/yards/class_Shipyard.php [deleted file]
application/shipsimu/main/controller/.htaccess [deleted file]
application/shipsimu/main/controller/html/.htaccess [deleted file]
application/shipsimu/main/controller/html/class_HtmlCompanyController.php [deleted file]
application/shipsimu/main/controller/html/class_HtmlGovernmentFailedController.php [deleted file]
application/shipsimu/main/drives/.htaccess [deleted file]
application/shipsimu/main/drives/class_BaseDrive.php [deleted file]
application/shipsimu/main/drives/motor/.htaccess [deleted file]
application/shipsimu/main/drives/motor/class_Motor.php [deleted file]
application/shipsimu/main/factories/.htaccess [deleted file]
application/shipsimu/main/factories/class_ShipSimuWebNewsFactory.php [deleted file]
application/shipsimu/main/filter/.htaccess [deleted file]
application/shipsimu/main/filter/book/.htaccess [deleted file]
application/shipsimu/main/filter/book/refill/.htaccess [deleted file]
application/shipsimu/main/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php [deleted file]
application/shipsimu/main/filter/class_ [deleted file]
application/shipsimu/main/filter/class_BaseShipSimuFilter.php [deleted file]
application/shipsimu/main/filter/government/.htaccess [deleted file]
application/shipsimu/main/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php [deleted file]
application/shipsimu/main/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php [deleted file]
application/shipsimu/main/filter/page/.htaccess [deleted file]
application/shipsimu/main/filter/page/class_RefillPageFilter.php [deleted file]
application/shipsimu/main/filter/validator/.htaccess [deleted file]
application/shipsimu/main/filter/validator/class_RefillRequestValidatorFilter.php [deleted file]
application/shipsimu/main/filter/validator/class_ShipSimuUserStatusGuestFilter.php [deleted file]
application/shipsimu/main/government/.htaccess [deleted file]
application/shipsimu/main/government/class_SimplifiedGovernment.php [deleted file]
application/shipsimu/main/login/.htaccess [deleted file]
application/shipsimu/main/login/class_ShipSimuGuestLogin.php [deleted file]
application/shipsimu/main/login/class_ShipSimuUserLogin.php [deleted file]
application/shipsimu/main/login/helper/.htaccess [deleted file]
application/shipsimu/main/login/helper/class_ShipSimuLoginHelper.php [deleted file]
application/shipsimu/main/menu/.htaccess [deleted file]
application/shipsimu/main/menu/class_ShipSimu [deleted file]
application/shipsimu/main/menu/class_ShipSimuConfirmMenu.php [deleted file]
application/shipsimu/main/menu/class_ShipSimuHomeMenu.php [deleted file]
application/shipsimu/main/menu/class_ShipSimuLoginAreaMenu.php [deleted file]
application/shipsimu/main/menu/class_ShipSimuLoginFailedMenu.php [deleted file]
application/shipsimu/main/menu/class_ShipSimuLoginMenu.php [deleted file]
application/shipsimu/main/menu/class_ShipSimuLogoutMenu.php [deleted file]
application/shipsimu/main/menu/class_ShipSimuRegisterMenu.php [deleted file]
application/shipsimu/main/menu/class_ShipSimuStatusMenu.php [deleted file]
application/shipsimu/main/menu/government/.htaccess [deleted file]
application/shipsimu/main/menu/government/class_ShipSimuGovernmentFailedAreaMenu.php [deleted file]
application/shipsimu/main/opening/.htaccess [deleted file]
application/shipsimu/main/opening/bank/.htaccess [deleted file]
application/shipsimu/main/opening/bank/class_MoneyBankRealtimeOpening.php [deleted file]
application/shipsimu/main/opening/class_ [deleted file]
application/shipsimu/main/opening/class_BaseOpening.php [deleted file]
application/shipsimu/main/parts/.htaccess [deleted file]
application/shipsimu/main/parts/class_BaseShipPart.php [deleted file]
application/shipsimu/main/parts/maschineroom/.htaccess [deleted file]
application/shipsimu/main/parts/maschineroom/class_MaschineRoom.php [deleted file]
application/shipsimu/main/personell/.htaccess [deleted file]
application/shipsimu/main/personell/class_SimulatorPersonell.php [deleted file]
application/shipsimu/main/personell/company/.htaccess [deleted file]
application/shipsimu/main/personell/company/class_CompanyEmployee.php [deleted file]
application/shipsimu/main/registration/.htaccess [deleted file]
application/shipsimu/main/registration/class_ShipSimuRegistration.php [deleted file]
application/shipsimu/main/resolver/.htaccess [deleted file]
application/shipsimu/main/resolver/command/.htaccess [deleted file]
application/shipsimu/main/resolver/command/html/.htaccess [deleted file]
application/shipsimu/main/resolver/command/html/class_HtmlCompanyCommandResolver.php [deleted file]
application/shipsimu/main/resolver/command/html/class_HtmlGovernmentFailedCommandResolver.php [deleted file]
application/shipsimu/main/resolver/controller/.htaccess [deleted file]
application/shipsimu/main/resolver/controller/html/.htaccess [deleted file]
application/shipsimu/main/resolver/controller/html/class_ShipSimuHtmlControllerResolver.php [deleted file]
application/shipsimu/main/ships/.htaccess [deleted file]
application/shipsimu/main/ships/class_BaseShip.php [deleted file]
application/shipsimu/main/ships/passenger/.htaccess [deleted file]
application/shipsimu/main/ships/passenger/class_PassengerShip.php [deleted file]
application/shipsimu/main/structures/.htaccess [deleted file]
application/shipsimu/main/structures/class_BaseStructure.php [deleted file]
application/shipsimu/main/structures/extended/.htaccess [deleted file]
application/shipsimu/main/structures/extended/cabines/.htaccess [deleted file]
application/shipsimu/main/structures/extended/cabines/class_BaseCabin.php [deleted file]
application/shipsimu/main/structures/extended/cabines/ship/.htaccess [deleted file]
application/shipsimu/main/structures/extended/cabines/ship/class_EconomyCabin.php [deleted file]
application/shipsimu/main/structures/extended/cabines/ship/class_LowCabin.php [deleted file]
application/shipsimu/main/structures/extended/cabines/ship/class_LuxuryCabin.php [deleted file]
application/shipsimu/main/structures/extended/cabines/ship/class_PremierCabin.php [deleted file]
application/shipsimu/main/structures/extended/class_ [deleted file]
application/shipsimu/main/structures/extended/class_BaseCabinStructure.php [deleted file]
application/shipsimu/main/structures/extended/class_BaseDeckStructure.php [deleted file]
application/shipsimu/main/structures/extended/class_BaseUpperStructure.php [deleted file]
application/shipsimu/main/structures/extended/decks/.htaccess [deleted file]
application/shipsimu/main/structures/extended/decks/cargo/.htaccess [deleted file]
application/shipsimu/main/structures/extended/decks/cargo/class_CarDeck.php [deleted file]
application/shipsimu/main/structures/extended/decks/cargo/class_TrainDeck.php [deleted file]
application/shipsimu/main/structures/extended/decks/cargo/class_TruckDeck.php [deleted file]
application/shipsimu/main/structures/extended/decks/class_BaseDeck.php [deleted file]
application/shipsimu/main/structures/extended/lower/.htaccess [deleted file]
application/shipsimu/main/structures/extended/upper/.htaccess [deleted file]
application/shipsimu/main/structures/extended/upper/class_Bridge.php [deleted file]
application/shipsimu/main/user/.htaccess [deleted file]
application/shipsimu/main/user/class_ShipSimuBaseUser.php [deleted file]
application/shipsimu/main/user/extended/.htaccess [deleted file]
application/shipsimu/main/user/extended/class_ShipSimuGuest.php [deleted file]
application/shipsimu/main/user/extended/class_ShipSimuMember.php [deleted file]
application/shipsimu/main/wrapper/.htaccess [deleted file]
application/shipsimu/main/wrapper/class_CompanyDatabaseWrapper.php [deleted file]
application/shipsimu/main/wrapper/class_UserGovernmentDatabaseWrapper.php [deleted file]
core

diff --git a/application/shipsimu/classes/.htaccess b/application/shipsimu/classes/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/actions/.htaccess b/application/shipsimu/classes/actions/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/actions/class_ b/application/shipsimu/classes/actions/class_
new file mode 100644 (file)
index 0000000..d84fab7
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Action extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public final static function create???Action (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new ???Action();
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here
+               $this->partialStub("You have to implement me.");
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some filters here
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Call parent addExtraFilters method
+               parent::addExtraFilters($controllerInstance, $requestInstance);
+
+               // Unfinished method
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/class_BaseShipSimuAction.php b/application/shipsimu/classes/actions/class_BaseShipSimuAction.php
new file mode 100644 (file)
index 0000000..41dcce0
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/**
+ * A general action class for blog
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseShipSimuAction extends BaseAction {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       protected function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Add code here executed with every action
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some filters here
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Unfinished method
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/ship-simu/.htaccess b/application/shipsimu/classes/actions/ship-simu/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/actions/ship-simu/class_ShipSimuLoginAction.php b/application/shipsimu/classes/actions/ship-simu/class_ShipSimuLoginAction.php
new file mode 100644 (file)
index 0000000..2fbee37
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/**
+ * An action class for the login welcome page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ShipSimuLoginAction extends BaseShipSimuAction implements PerformableAction {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createShipSimuLoginAction () {
+               // Get a new instance
+               $actionInstance = new ShipSimuLoginAction();
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        Maybe we need to do something later here
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/ship-simu/class_ShipSimuProfileAction.php b/application/shipsimu/classes/actions/ship-simu/class_ShipSimuProfileAction.php
new file mode 100644 (file)
index 0000000..56090bf
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/**
+ * An action class for the profile page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ShipSimuProfileAction extends BaseShipSimuAction implements PerformableAction {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createShipSimuProfileAction () {
+               // Get a new instance
+               $actionInstance = new ShipSimuProfileAction();
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        Maybe we need to do something later here
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here...
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/web/.htaccess b/application/shipsimu/classes/actions/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/actions/web/class_WebShipSimuLogin b/application/shipsimu/classes/actions/web/class_WebShipSimuLogin
new file mode 100644 (file)
index 0000000..d60f442
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * An action for 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLogin???Action extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public final static function createWebShipSimuLogin???Action (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebShipSimuLogin???Action();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute parent method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some filters here
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Check for user status by default
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/web/class_WebShipSimuLoginCompanyAction.php b/application/shipsimu/classes/actions/web/class_WebShipSimuLoginCompanyAction.php
new file mode 100644 (file)
index 0000000..842d6cb
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * An action for shipping company page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLoginCompanyAction extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createWebShipSimuLoginCompanyAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebShipSimuLoginCompanyAction();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        Maybe add fetching company list of current user here?
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here...
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some more filters here
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Check for user status by default
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php b/application/shipsimu/classes/actions/web/class_WebShipSimuLoginGovernmentStartupHelpAction.php
new file mode 100644 (file)
index 0000000..fa62481
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/**
+ * An action for government startup help form
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLoginGovernmentStartupHelpAction extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createWebShipSimuLoginGovernmentStartupHelpAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebShipSimuLoginGovernmentStartupHelpAction();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here...
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some filters here
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Check for user status by default
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+
+               // Check if government can pay startup help
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_startup_help_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php b/application/shipsimu/classes/actions/web/class_WebShipSimuLoginGovernmentTrainingAction.php
new file mode 100644 (file)
index 0000000..fcbc711
--- /dev/null
@@ -0,0 +1,85 @@
+<?php
+/**
+ * An action for trainings payed by government
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLoginGovernmentTrainingAction extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createWebShipSimuLoginGovernmentTrainingAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebShipSimuLoginGovernmentTrainingAction();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here...
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some more filters here
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Check for user status by default
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+
+               // Check if government can pay a training
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_training_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/web/class_WebShipSimuLoginLogoutAction.php b/application/shipsimu/classes/actions/web/class_WebShipSimuLoginLogoutAction.php
new file mode 100644 (file)
index 0000000..9b066a9
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+/**
+ * An action for logout
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLoginLogoutAction extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createWebShipSimuLoginLogoutAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebShipSimuLoginLogoutAction();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Check for user status by default
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/web/class_WebShipSimuLoginProfileAction.php b/application/shipsimu/classes/actions/web/class_WebShipSimuLoginProfileAction.php
new file mode 100644 (file)
index 0000000..58d6745
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * An action for profile (editing) page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLoginProfileAction extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createWebShipSimuLoginProfileAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebShipSimuLoginProfileAction();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here...
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some filters here
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Check for user status by default
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/web/class_WebShipSimuLoginRefillAction.php b/application/shipsimu/classes/actions/web/class_WebShipSimuLoginRefillAction.php
new file mode 100644 (file)
index 0000000..31c7337
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * An action for money refill page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLoginRefillAction extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createWebShipSimuLoginRefillAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebShipSimuLoginRefillAction();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here...
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Check for user status by default
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+
+               // Is the refill page active?
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter'));
+
+               // Add payment discovery filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('payment_discovery_filter', array($this)));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/web/class_WebShipSimuLoginStatusProblemAction.php b/application/shipsimu/classes/actions/web/class_WebShipSimuLoginStatusProblemAction.php
new file mode 100644 (file)
index 0000000..8b26b8f
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * An action for 
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLoginStatusProblemAction extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createWebShipSimuLoginStatusProblemAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebShipSimuLoginStatusProblemAction();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some filters here
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Check for user status by default
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/actions/web/class_WebShipSimuLoginWelcomeAction.php b/application/shipsimu/classes/actions/web/class_WebShipSimuLoginWelcomeAction.php
new file mode 100644 (file)
index 0000000..d839bd1
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+/**
+ * An action for the welcome page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuLoginWelcomeAction extends BaseShipSimuAction implements Commandable, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this action
+        *
+        * @param       $resolverInstance       An instance of an action resolver
+        * @return      $actionInstance         An instance of this action class
+        */
+       public static final function createWebShipSimuLoginWelcomeAction (ActionResolver $resolverInstance) {
+               // Get a new instance
+               $actionInstance = new WebShipSimuLoginWelcomeAction();
+
+               // Set the resolver instance
+               $actionInstance->setResolverInstance($resolverInstance);
+
+               // Return the instance
+               return $actionInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Call parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Add your code here...
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some filters here
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Unfinished method
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/bank/.htaccess b/application/shipsimu/classes/bank/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/bank/class_BaseBank.php b/application/shipsimu/classes/bank/class_BaseBank.php
new file mode 100644 (file)
index 0000000..21ae0d5
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/**
+ * A general bank class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ * @todo               Find an instance for all banks and move the abstract functions there
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+abstract class BaseBank extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      The class' real name
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Checks wether the bank lends more money to the current user
+        *
+        * @return      $lendsMoreMoney         Wether this bank lends more money to the user
+        */
+       public abstract function ifBankLendsMoreMoney ();
+
+       /**
+        * Checks wethert the current user has maximum allowed credits with this bank
+        *
+        * @return      $hasMaximumCredits      Wether the user has maximum allowed credits
+        */
+       public abstract function ifUserHasMaxCredits ();
+
+       /**
+        * Checks wether this money bank has opened
+        *
+        * @return      $hasOpened      Wether this money bank has opened
+        */
+       public abstract function ifMoneyBankHasOpened ();
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/bank/money/class_MoneyBank.php b/application/shipsimu/classes/bank/money/class_MoneyBank.php
new file mode 100644 (file)
index 0000000..11d4d9e
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ * A money bank which may lend points to the user
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class MoneyBank extends BaseBank implements Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this money bank class
+        *
+        * @param       $userInstance   A class instance of a user object
+        * @return      $bankInstance   An instance of this class
+        */
+       public static final function createMoneyBank (ManageableAccount $userInstance) {
+               // Get a new instance
+               $moneyInstance = new MoneyBank();
+
+               // Set the user instance
+               $moneyInstance->setUserInstance($userInstance);
+
+               // Return the prepared instance
+               return $moneyInstance;
+       }
+
+       /**
+        * Checks wether the bank lends more money to the current user
+        *
+        * @return      $lendsMoreMoney         Wether this bank lends more money to the user
+        */
+       public function ifBankLendsMoreMoney () {
+               $this->partialStub();
+       }
+
+       /**
+        * Checks wethert the current user has maximum allowed credits with this bank
+        *
+        * @return      $hasMaximumCredits      Wether the user has maximum allowed credits
+        */
+       public function ifUserHasMaxCredits () {
+               $this->partialStub();
+       }
+
+       /**
+        * Checks wether this money bank has opened
+        *
+        * @return      $hasOpened      Wether this money bank has opened
+        */
+       public function ifMoneyBankHasOpened () {
+               // Has not opened by default
+               $hasOpened = false;
+
+               // Is the money bank activated in config?
+               if ($this->getConfigInstance()->getConfigEntry('moneybank_activated')) {
+                       // Okay, does the user ask within the opening times? To find this out we need a OpeningTimes class
+                       $openingInstance = ObjectFactory::createObjectByConfiguredName('moneybank_opening_class', array($this));
+
+                       // Then we simply "ask" the opening time instance if the user asks within the opening time
+                       $hasOpened = $openingInstance->ifWithinOpeningTimes();
+               } // END - if
+
+               // Return status
+               return $hasOpened;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/class_ b/application/shipsimu/classes/class_
new file mode 100644 (file)
index 0000000..956f6c5
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * 
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ??? extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this money bank class
+        *
+        * @return      $???Instance    An instance of this class
+        */
+       public final static function create??? () {
+               // Get a new instance
+               $???Instance = new ???();
+
+               // Return the prepared instance
+               return $???Instance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/class_BasePersonell.php b/application/shipsimu/classes/class_BasePersonell.php
new file mode 100644 (file)
index 0000000..8e08ec3
--- /dev/null
@@ -0,0 +1,246 @@
+<?php
+/**
+ * A general class for personell
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BasePersonell extends BaseFrameworkSystem implements Personellizer {
+       // Maximum/minimum age
+       private $MIN_AGE = 21;
+       private $MAX_AGE = 40;
+
+       // Male/female
+       private $gender     = ""; // M=Male, F=Female, empty=uninitialized
+
+       // Year/month/day of birth
+       private $yearBirth  = 0;
+       private $monthBirth = 0;
+       private $dayBirth   = 0;
+
+       // Surname/family name
+       private $surname    = "";
+       private $family     = "";
+
+       // Employed?
+       private $employed   = false;
+
+       // Married?
+       private $married    = false;
+
+       // Her/his salary
+       private $salary     = 0.00;
+
+       // Constructor
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       // Remove min/max ages
+       public final function removeMinMaxAge () {
+               unset($this->MIN_AGE);
+               unset($this->MAX_AGE);
+       }
+
+       // Generates a birthday based on MAX_AGE/MIN_AGE and the current date
+       public final function createBirthday () {
+               // Is the birthday already set?
+               if ($this->isDateValid($this->yearBirth, $this->monthBirth, $this->dayBirth)) return false;
+
+               // Get current year
+               $currYear = date("Y", time());
+
+               // Generate random year/month/day
+               $year = mt_rand(($currYear - $this->MIN_AGE), ($currYear - $this->MAX_AGE));
+               $month = 0;
+               $day = 0;
+               while ($this->isDateValid($year, $month, $day) === false) {
+                       $month = mt_rand(1, 12);
+                       switch ($month) {
+                       case 1:
+                       case 3:
+                       case 5:
+                       case 7:
+                       case 8:
+                       case 10:
+                       case 12:
+                               $day   = mt_rand(1, 31);
+                               break;
+
+                       case 4:
+                       case 6:
+                       case 9:
+                       case 11:
+                               $day   = mt_rand(1, 30);
+                               break;
+
+                       case 2: // February
+                               if ($year % 4 == 0) {
+                                       // Is a "Schaltjahr"
+                                       $day = mt_rand(1, 29);
+                               } else {
+                                       // Regular year
+                                       $day = mt_rand(1, 28);
+                               }
+                               break;
+                       } // END - switch
+               } // END - while
+
+               // Set the new birthday
+               $this->setBirthday($year, $month, $day);
+       }
+
+       // Is the current day valid?
+       public final function isDateValid ($year, $month, $day) {
+               // Create timestamp
+               $stamp = mktime(0, 0, 0, $month, $day, $year);
+
+               // Get year/month/day back
+               $y = date("Y", $stamp);
+               $m = date("m", $stamp);
+               $d = date("d", $stamp);
+
+               // Compare all
+               return (($y == $year) && ($m == $month) && ($d == $day));
+       }
+
+       // Employed?
+       public final function isEmployed () {
+               return $this->employed;
+       }
+
+       // Married?
+       public final function isMarried () {
+               return $this->married;
+       }
+
+       // Male?
+       public final function isMale () {
+               return ($this->gender == "M");
+       }
+
+       // Female
+       public final function isFemale () {
+               return ($this->gender == "F");
+       }
+
+       // Setter for surname
+       public final function setSurname ($surname) {
+               $this->surname = (string) $surname;
+       }
+
+       // Getter for surname
+       public function getSurname () {
+               return $this->surname;
+       }
+
+       // Setter for family name
+       public final function setFamily ($family) {
+               $this->family = (string) $family;
+       }
+
+       // Getter for family name
+       public final function getFamily () {
+               return $this->family;
+       }
+
+       // Setter for gender
+       public final function setGender ($gender) {
+               // Set random gender here
+               if (($gender == "M") || ($gender == "F") || ((empty($gender)) && ($this->getSurname() == ""))) {
+                       $this->gender = $gender;
+               } else {
+                       throw new WrongGenderSpecifiedException($gender, self::EXCEPTION_GENDER_IS_WRONG);
+               }
+       }
+
+       // Getter for gender
+       public final function getGender () {
+               return $this->gender;
+       }
+
+       // Setter for employment status
+       public final function setEmployed ($employed) {
+               $this->employed = (boolean) $employed;
+       }
+
+       // Setter for marriage status
+       public final function setMarried ($married) {
+               $this->married = (boolean) $married;
+       }
+
+       // Getter for salary
+       public final function getSalary () {
+               return $this->salary;
+       }
+
+       // Increase salary
+       public final function increaseSalary ($add) {
+               $this->salary += (float) abs($add);
+       }
+
+       // Decrease salary
+       public final function decreaseSalary ($sub) {
+               $this->salary -= (float) abs($sub);
+       }
+
+       // Setter for birthday
+       public final function setBirthday ($year, $month, $day) {
+               $this->yearBirth  = (int) abs($year);
+               $this->monthBirth = (int) abs($month);
+               $this->dayBirth   = (int) abs($day);
+       }
+
+       // Remove gender
+       public final function removeGender () {
+               unset($this->gender);
+       }
+
+       // Remove both names
+       public final function removeNames () {
+               unset($this->surname);
+               unset($this->family);
+       }
+
+       // Remove complete birthday
+       public final function removeBirthday () {
+               unset($this->yearBirth);
+               unset($this->monthBirth);
+               unset($this->dayBirth);
+       }
+
+       // Remove salary
+       public final function removeSalary () {
+               unset($this->salary);
+       }
+
+       // Remove employment status
+       public final function removeEmployed () {
+               unset($this->employed);
+       }
+
+       // Remove marrital status
+       public final function removeMarried () {
+               unset($this->married);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/class_BaseSimulator.php b/application/shipsimu/classes/class_BaseSimulator.php
new file mode 100644 (file)
index 0000000..e460013
--- /dev/null
@@ -0,0 +1,302 @@
+<?php
+/**
+ * The general simulator class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseSimulator extends BaseFrameworkSystem {
+       // Schiffsteilinstanz
+       private $partInstance = null;
+
+       // Abmasse (Breite/Hoehe/Laenge)
+       private $width  = 0;
+       private $height = 0;
+       private $length = 0;
+
+       // Aktuelles Schiff und Schiffsteil
+       private $currShip = null;
+       private $currPart = null;
+
+       // Faktoren zur Erweiterung der Masse. Beispielsweise soll der Maschinenraum groesser wie der Motor sein
+       private $resizeFactorArray = array(
+               'width'  => 1,
+               'height' => 1,
+               'length' => 1
+       );
+
+       // Konstruktor
+       protected function __construct ($className) {
+               // Call highest constructor
+               parent::__construct($className);
+
+               // Clean up a little, dies sollte ganz zum Schluss erfolgen!
+               $this->removeResizeFactorArray();
+               $this->removeCurrPart();
+               $this->removeCurrShip();
+       }
+
+       // Setter-Methode fuer Laenge
+       public final function setLength ($length) {
+               $this->length = (float) $length;
+       }
+
+       // Setter-Methode fuer Breite
+       public final function setWidth ($width) {
+               $this->width = (float) $width;
+       }
+
+       // Setter-Methode fuer Hoehe
+       public final function setHeight ($height) {
+               $this->height = (float) $height;
+       }
+
+       // Getter-Methode fuer Laenge
+       public final function getLength () {
+               return $this->length;
+       }
+
+       // Getter-Methode fuer Breite
+       public final function getWidth () {
+               return $this->width;
+       }
+
+       // Getter-Methode fuer Hoehe
+       public final function getHeight () {
+               return $this->height;
+       }
+
+       // Setter-Methode fuer Teil-Instanz
+       public final function setPartInstance (ConstructableShipPart $partInstance) {
+               $this->partInstance = $partInstance;
+       }
+
+       // Getter-Methode fuer Teil-Instanz
+       public final function getPartInstance () {
+               if (!isset($this->partInstance)) {
+                       return null;
+               }
+               return $this->partInstance;
+       }
+
+       // Remover-Methode fuer die Teil-Instanz
+       public final function removePartInstance () {
+               unset($this->partInstance);
+       }
+
+       // Prueft ob all Umberechnungsfaktoren gesetzt sind
+       private function isResizeFactorValid () {
+               return (($this->getResizeFactorElement('width')  > 1)
+                       || ($this->getResizeFactorElement('height') > 1)
+                       || ($this->getResizeFactorElement('length') > 1)
+               );
+       }
+
+       // Baut einen Motor in das Schiff ein
+       public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $partInstance) {
+               // Schiff/-steil merken
+               $this->currShip = $shipInstance;
+               $this->currPart = $partInstance;
+
+               // Passt ueberhaupt das Schiffsteil in's Schiff?
+               if ($this->isShipPartSizeValid()) {
+                       // Muessen die Masse angepasst werden?
+                       if ($this->isResizeFactorValid()) {
+                               // Neue Angaben berechnen (wir lassen etwas Lust fuer Kabelbaeume, Roehren, Maschinisten, etc.)
+                               $this->newWidth  = (float) $this->getCurrPart()->getWidth()  * $this->resizeFactorArray['width'];
+                               $this->newHeight = (float) $this->getCurrPart()->getHeight() * $this->resizeFactorArray['height'];
+                               $this->newLength = (float) $this->getCurrPart()->getLength() * $this->resizeFactorArray['length'];
+
+                               // Passt dies nun immer noch?
+                               if ($this->isNewSizeValid()) {
+                                       // Das passt auch, dann Werte setzen und Motor-Instanz merken
+                                       $this->setWidth($this->newWidth);
+                                       $this->setHeight($this->newHeight);
+                                       $this->setLength($this->newLength);
+
+                                       // Einige Dinge entfernen...
+                                       $this->removeAllNewAttr();
+                               } else {
+                                       // Passt nicht! Also wieder Exception werfen...
+                                       throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil <strong>%s</strong> vom Typ <strong>%s</strong> ist zu gross f&uuml;r das Schiff!",
+                                               $this->getCurrPart()->__toString(),
+                                               $this->getCurrPart()->getObjectDescription(),
+                                               $this->getCurrPart()->__toString()
+                                       ), 2);
+                               }
+                       } elseif ($this->currPart != null) {
+                               // Aktuelle Masse setzen
+                               $this->setWidth($this->getCurrPart()->getWidth());
+                               $this->setHeight($this->getCurrPart()->getHeight());
+                               $this->setLength($this->getCurrPart()->getLength());
+                       }
+
+                       // Existiert ein Schiffsteil?
+                       if (!is_null($this->currPart)) {
+                               // Schiffsteil-Instanz setzen
+                               $this->setPartInstance($this->currPart);
+
+                               // Instanzen entfernen
+                               $this->getCurrPart()->removeCurrShip();
+                               $this->getCurrPart()->removeCurrPart();
+                               $this->getCurrPart()->removePartInstance();
+                               $this->getCurrPart()->removeResizeFactorArray();
+                       }
+               } else {
+                       // Exception werfen!
+                       throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil <u>%s</u> vom Typ <u>%s</u> passt nicht in das Schiff!",
+                               $this->getCurrPart()->realClass,
+                               $this->getCurrPart()->getObjectDescription(),
+                               $this->getCurrPart()->__toString()
+                       ), 1);
+               }
+
+               // Nochmals Clean up a little
+               $this->removeResizeFactorArray();
+               $this->removeCurrShip();
+               $this->removeCurrPart();
+       }
+
+       // Array fuer Umrechnungstabelle entfernen
+       public final function removeResizeFactorArray () {
+               unset($this->resizeFactorArray);
+       }
+
+       /**
+        * Remove all new*** attributes
+        *
+        * @return      void
+        */
+       public final function removeAllNewAttr () {
+               unset($this->newWidth);
+               unset($this->newHeight);
+               unset($this->newLength);
+       }
+
+       /**
+        * Remove current ship instance
+        *
+        * @return      void
+        */
+       public final function removeCurrShip () {
+               unset($this->currShip);
+       }
+
+       // Aktuelle Schiffsteil-Instanz entfernen
+       public final function removeCurrPart () {
+               unset($this->currPart);
+       }
+
+       // Breite entfernen
+       public final function removeWidth () {
+               unset($this->width);
+       }
+
+       // Hoehe entfernen
+       public final function removeHeight () {
+               unset($this->height);
+       }
+
+       // Laenge entfernen
+       public final function removeLength () {
+               unset($this->length);
+       }
+
+       // Tiefgang entfernen
+       public final function removeDraught () {
+               unset($this->draught);
+       }
+
+       // Getter-Methode fuer Element aus resizeFactor
+       public final function getResizeFactorElement ($el) {
+               if (isset($this->resizeFactorArray[$el])) {
+                       // Element gefunden
+                       return $this->resizeFactorArray[$el];
+               } else {
+                       // Element nicht gefunden!
+                       return null;
+               }
+       }
+
+       // Setter-Methode fuer Element in resizeFactor
+       public final function setResizeFactorElement ($el, $value) {
+               $this->resizeFactorArray[$el] = (float) $value;
+       }
+
+       // Kontrolliert, ob die Abmasse Schiffsteil->Schiff stimmen
+       public function isShipPartSizeValid () {
+               return (
+                       (
+                               ( // Already defined ship messurings
+                                                ($this->getCurrPart()->getWidth()  < $this->currShip->getWidth())
+                                       && ($this->getCurrPart()->getHeight() < $this->currShip->getDraught())
+                                       && ($this->getCurrPart()->getLength() < $this->currShip->getLength())
+                               ) || ( // Ship messurings shall be calculated
+                                                ($this->currShip->getWidth()  == 0)
+                                       && ($this->currShip->getHeight() == 0)
+                                       && ($this->currShip->getLength() == 0)
+                               )
+                       // The inserted part must be messured!
+                       ) && ($this->getCurrPart()->getWidth()  > 0)
+                               && ($this->getCurrPart()->getHeight() > 0)
+                               && ($this->getCurrPart()->getLength() > 0)
+               );
+       }
+
+       // Kontrolliert, ob die Abmasse Maschinenraum->Schiff stimmen
+       public function isNewSizeValid () {
+               return (
+                       ( // Already defined ship messurings
+                                        ($this->newWidth  < $this->currShip->getWidth())
+                               && ($this->newHeight < $this->currShip->getDraught())
+                               && ($this->newLength < $this->currShip->getLength())
+                       ) || ( // Ship messurings shall be calculated
+                                        ($this->currShip->getWidth()  == 0)
+                               && ($this->currShip->getHeight() == 0)
+                               && ($this->currShip->getLength() == 0)
+                       )
+               );
+       }
+
+       // Masse extrahieren
+       public function extractDimensions ($dim) {
+               // Abmasse setzen
+               if ((isset($dim)) && (is_array($dim)) && (count($dim) == 3)) {
+                       // Abmasse aus Array holen
+                       $this->setWidth($dim[0]);
+                       $this->setHeight($dim[1]);
+                       $this->setLength($dim[2]);
+               } else {
+                       // Nicht gefundene Abmasse!
+                       throw new DimNotFoundInArrayException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID);
+               }
+       }
+
+       /**
+        * Getter for current part instance
+        *
+        * @return              $currPart       Instance of the current ship part object
+        */
+       public final function getCurrPart () {
+               return $this->currPart;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/class_Merchant.php b/application/shipsimu/classes/class_Merchant.php
new file mode 100644 (file)
index 0000000..648e299
--- /dev/null
@@ -0,0 +1,109 @@
+<?php
+/**
+ * A class for merchants which can trade items
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Merchant extends BaseFrameworkSystem {
+       // Name des Haendlers
+       private $merchantName   = "Namenloser H&auml;ndler";
+
+       // Preislite (Objekte wiedermal!)
+       private $priceList      = null;
+
+       // Zugewiesener Hafen
+       private $harborInstance = null;
+
+       // Konstruktor
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       // Haendler mit Namen erzeugen
+       public static final function createMerchant ($merchantName, Harbor $harborInstance) {
+               // String absichern
+               $merchantName = (string) $merchantName;
+
+               // Get new instance
+               $merchantInstance = new Merchant();
+
+               // Debug message
+               if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) {
+                       $merchantInstance->debugOutput(sprintf("[%s:%d] Ein H&auml;ndler <strong>%s</strong> wird angelegt und soll sich am <strong>%s</strong> niederlassen.",
+                               __CLASS__,
+                               __LINE__,
+                               $merchantName,
+                               $harborInstance->getHarborName()
+                       ));
+               }
+
+               // Haendlernamen setzen
+               $merchantInstance->setMerchantName($merchantName);
+
+               // In dem angegebenen Hafen den Haendler ansiedeln
+               $merchantInstance->setHarborInstance($harborInstance);
+
+               // Preisliste initialisieren
+               $merchantInstance->createPriceList();
+
+               // Instanz zurueckliefern
+               return $merchantInstance;
+       }
+
+       // Initialize pricing list
+       private function createPriceList () {
+               $this->priceList = new FrameworkArrayObject("FakedPriceList");
+       }
+
+       // Setter for merchant name
+       public final function setMerchantName ($merchantName) {
+               // Debug message
+               $this->merchantName = (string) $merchantName;
+       }
+
+       // Getter for merchant name
+       public final function getMerchantName () {
+               return $this->merchantName;
+       }
+
+       // Setter for harbor instance
+       public final function setHarborInstance (Harbor $harborInstance) {
+               $this->harborInstance = $harborInstance;
+       }
+
+       // Getter for harbor instance
+       public final function getHarborInstance () {
+               return $this->harborInstance;
+       }
+
+       // Add new item to merchant's price list
+       public function addItemToPriceList (TradeableItem $itemInstance, $price) {
+               $this->makeDeprecated();
+       }
+
+       // Get a price from the merchant's list
+       public final function getPriceFromList (TradeableItem $itemInstance) {
+               $this->makeDeprecated();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/class_WorksContract.php b/application/shipsimu/classes/class_WorksContract.php
new file mode 100644 (file)
index 0000000..bbe2f35
--- /dev/null
@@ -0,0 +1,329 @@
+<?php
+/**
+ * The work constract class which can be used for contract parties
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WorksContract extends BaseFrameworkSystem implements SignableContract {
+       // Zukuenftiger Schiffsname
+       private $shipName         = "";
+
+       // Instanz zum Schiffstypen
+       private $shipInstance     = null;
+
+       // Contract partner
+       private $contractPartner  = null;
+
+       // Other contract partner
+       private $contractParty    = null;
+
+       // Is the contract signed?
+       private $signed           = false;
+
+       // Merchant instance
+       private $merchantInstance = null;
+
+       // Konstruktor
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       // Neuen Bauvertrag generieren
+       public static final function createWorksContract ($shipType, $shipName, ContractPartner $partnerInstance) {
+               // Strings absichern
+               $shipType = (string) $shipType;
+               $shipName = (string) $shipName;
+
+               // Get new instance
+               $contractInstance = new WorksContract();
+
+               // Schiffsnamen setzen
+               $contractInstance->setShipName($shipName);
+
+               // Existiert die Klasse ueberhaupt?
+               if (!class_exists($shipType)) {
+                       // Klasse nicht gefunden
+                       throw new NoClassException ($shipType, self::EXCEPTION_CLASS_NOT_FOUND);
+               }
+
+               // Schiff-Instanz temporaer erzeugen und in den Bauvertrag einfuegen
+               $shipInstance = ObjectFactory::createObjectByName($shipType, array($shipName));
+               $contractInstance->setShipInstance($shipInstance);
+
+               // Remove the ship instance
+               unset($shipInstance);
+
+               // Set itself as contract partner
+               $contractInstance->setContractPartner($partnerInstance);
+
+               // Instanz zurueckgeben
+               return $contractInstance;
+       }
+
+       // Setter for ship instance
+       private final function setShipInstance (ConstructableShip $shipInstance) {
+               $this->shipInstance = $shipInstance;
+       }
+
+       // Setter for ship name
+       private final function setShipName ($shipName) {
+               $this->shipName = (string) $shipName;
+       }
+
+       // Getter for ship name
+       public final function getShipName () {
+               return $this->shipName;
+       }
+
+       // Getter for ship instance
+       public final function getShipInstance () {
+               return $this->shipInstance;
+       }
+
+       // Add detail to the contract
+       public function addContractDetails ($shipPart, $parentPart, array $dataArray) {
+               // Secure strings
+               $shipPart   = (string) $shipPart;
+               $parentPart = (string) $parentPart;
+
+               // Debug message
+               if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiffsteil <strong>%s</strong> wird zusammen mit dem Konstruktionsteil <strong>%s</strong> in den Bauvertrag aufgenommen.",
+                       __CLASS__,
+                       __LINE__,
+                       $shipPart,
+                       $parentPart
+               ));
+
+               // Initialize the instance (shall not be done within dynamic part)
+               $partInstance = null;
+
+               // Try to get an instance for this ship part
+               try {
+                       $partInstance = ObjectFactory::createObjectByName($shipPart, $dataArray);
+               } catch (DimNotFoundInArrayException $e) {
+                       $this->debugOutput(sprintf("[main:] Die <strong>%s</strong> konnte nicht vervollst&auml;ndigt werden. Grund: <strong>%s</strong><br />",
+                               $this->getShipInstance()->getShipName(),
+                               $e->getMessage()
+                       ));
+
+                       // Debug message
+                       if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Versuche ein Schiffsteil in den Bauvertrag aufzunehmen.",
+                               __CLASS__,
+                               __LINE__
+                       ));
+
+                       // Is this ship part constructable?
+                       if (!$partInstance instanceof ConstructableShipPart) {
+                               // Ship part not constructable!
+                               throw new ShipPartNotConstructableException(array($shipPart), self::EXCEPTION_NOT_CONSTRUCTABLE);
+                       } elseif ($this->getShipInstance()->createShipPart($partInstance, $parentPart) === false) {
+                               // Schiff konnte nicht gebaut werden!
+                               throw new ShipNotConstructedException(sprintf("Das Schiff <strong>%s</strong> konnte wegen eines Fehlers nicht gebaut werden. Siehe obere Meldungen.",
+                                       $this->getShipInstance()->getShipName()
+                               ));
+                       }
+               } catch (NoClassException $e) {
+                       // Throw it again...
+                       throw new NoClassException($e->getMessage(), $e->getCode());
+               }
+
+               // Get price for this item
+               $price = $this->getMerchantInstance()->getPriceFromList($partInstance);
+
+               // Add price
+               $partInstance->setPrice($price);
+       }
+
+       // Setter for contract partner
+       public final function setContractPartner (ContractPartner $partnerInstance) {
+               $this->contractPartner = $partnerInstance;
+       }
+
+       // Getter for contract partner
+       public final function getContractPartner () {
+               return $this->contractPartner;
+       }
+
+       // Setter for contract party
+       public final function setContractParty (ContractPartner $partyInstance) {
+               $this->contractParty = $partyInstance;
+       }
+
+       // Getter for contract party
+       public final function getContractParty () {
+               return $this->contractParty;
+       }
+
+       // Setter for signature
+       public final function setSigned ($signed) {
+               $this->signed = (boolean) $signed;
+       }
+
+       // Getter for signature
+       public function isSigned () {
+               return $this->signed;
+       }
+
+       // Sign the contract
+       public function signContract (ContractPartner $partnerInstance, ContractPartner $partyInstance) {
+               // Is this contract already signed?
+               if ($this->isSigned()) {
+                       // Throw an exception
+                       throw new ContractAllreadySignedException(array($this, $this->getContractPartner(), $this->getContractParty()), self::EXCEPTION_CONTRACT_ALREADY_SIGNED);
+               }
+
+               // Is the first contract partner still the same?
+               if ($partnerInstance->equals($this->getContractPartner())) {
+                       // Set contract party (other partner is already set)
+                       $this->setContractParty($partyInstance);
+
+                       // Finally sign it
+                       $this->setSigned(true);
+               } else {
+                       // Throw an exception
+                       throw new ContractPartnerMismatchException(array($this, $this->getContractPartner(), $partyInstance), self::EXCEPTION_CONTRACT_PARTNER_MISMATCH);
+               }
+
+               // Debug message
+               if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) {
+                       if ($partnerInstance->equals($partyInstance)) {
+                               // With itself
+                               $this->debugOutput(sprintf("[%s:%d] Die <strong>%s</strong> <em><strong>%s</strong></em> stimmt einem Bauvertrag &uuml;ber das <strong>%s</strong> <em><strong>%s</strong></em> zu.",
+                                       __CLASS__,
+                                       __LINE__,
+                                       $partnerInstance->getObjectDescription(),
+                                       $partnerInstance->getCompanyName(),
+                                       $this->getShipInstance()->getObjectDescription(),
+                                       $this->getShipInstance()->getShipName()
+                               ));
+                       } else {
+                               // Other contract party
+                               $this->debugOutput(sprintf("[%s:%d] Die <strong>%s</strong> <em><strong>%s</strong></em> geht mit der <strong>%s</strong> <em><strong>%s</strong></em> einen Bauvertrag &uuml;ber das <strong>%s</strong> <em><strong>%s</strong></em> ein.",
+                                       __CLASS__,
+                                       __LINE__,
+                                       $partnerInstance->getObjectDescription(),
+                                       $partnerInstance->getCompanyName(),
+                                       $partyInstance->getObjectDescription(),
+                                       $partyInstance->getCompanyName(),
+                                       $this->getShipInstance()->getObjectDescription(),
+                                       $this->getShipInstance()->getShipName()
+                               ));
+                       }
+               }
+       }
+
+       // Setter for merchant instance
+       public final function setMerchantInstance (Merchant $merchantInstance) {
+               $this->merchantInstance = $merchantInstance;
+       }
+
+       // Getter for merchant instance
+       public final function getMerchantInstance () {
+               return $this->merchantInstance;
+       }
+
+       // Getter for total price
+       public final function getTotalPrice () {
+               // Get ship instance
+               $shipInstance = $this->getShipInstance();
+
+               // Is this a ship?
+               if (is_null($shipInstance)) {
+                       // Opps! Empty partner instance?
+                       throw new NullPointerException($shipInstance, self::EXCEPTION_IS_NULL_POINTER);
+               } elseif (!is_object($shipInstance)) {
+                       // Not an object! ;-(
+                       throw new InvalidObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT);
+               } elseif (!$shipInstance instanceof ConstructableShip) {
+                       // Does not have the required feature (method)
+                       throw new ShipIsInvalidException(array($shipInstance), self::EXCEPTION_INVALID_SHIP_INSTANCE);
+               }
+
+               // Get the structure array
+               $struct = $shipInstance->getStructuresArray();
+
+               // Is this a ship?
+               if (is_null($struct)) {
+                       // Opps! Empty partner instance?
+                       throw new EmptyStructuresListException($this, self::EXCEPTION_EMPTY_STRUCTURES_ARRAY);
+               }
+
+               // Init total price
+               $totalPrice = 0;
+
+               // Iterate through the list
+               for ($iter = $struct->getIterator(); $iter->valid(); $iter->next()) {
+                       // Get item
+                       $item = $iter->current();
+
+                       // Is this a ship?
+                       if (is_null($item)) {
+                               // Opps! Empty partner instance?
+                               throw new NullPointerException($item, self::EXCEPTION_IS_NULL_POINTER);
+                       } elseif (!is_object($item)) {
+                               // Not an object! ;-(
+                               throw new InvalidObjectException($item, self::EXCEPTION_IS_NO_OBJECT);
+                       } elseif (!$item instanceof BaseSimulator) {
+                               // Does not have the required feature (method)
+                               throw new MissingMethodException(array($item, 'getPartInstance'), self::EXCEPTION_MISSING_METHOD);
+                       }
+
+                       // Get part instance
+                       $part = $item->getPartInstance();
+
+                       // Is this a ship?
+                       if (is_null($part)) {
+                               // Opps! Empty partner instance?
+                               throw new NullPointerException($part, self::EXCEPTION_IS_NULL_POINTER);
+                       } elseif (!is_object($part)) {
+                               // Not an object! ;-(
+                               throw new InvalidObjectException($part, self::EXCEPTION_IS_NO_OBJECT);
+                       } elseif (!method_exists($part, 'getPrice')) {
+                               // Does not have the required feature (method)
+                               throw new MissingMethodException(array($part, 'getPrice'), self::EXCEPTION_MISSING_METHOD);
+                       }
+
+                       // Get price for one item
+                       $price = $part->getPrice();
+
+                       // Is there numCabin() available?
+                       if (method_exists($item, 'getNumCabin')) {
+                               // Get total cabin and multiply it with the price
+                               $price = $price * $item->getNumCabin();
+                       }
+
+                       // Add price to total price
+                       $totalPrice += $price;
+               }
+
+               // Total price calculated?
+               if ($totalPrice === 0) {
+                       // Throw exception
+                       throw new TotalPriceNotCalculatedException($this, self::EXCEPTION_TOTAL_PRICE_NOT_CALCULATED);
+               }
+
+               // Return total price
+               return $totalPrice;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/.htaccess b/application/shipsimu/classes/commands/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/commands/web/.htaccess b/application/shipsimu/classes/commands/web/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/commands/web/class_WebShipsimuGuestLoginCommand.php b/application/shipsimu/classes/commands/web/class_WebShipsimuGuestLoginCommand.php
new file mode 100644 (file)
index 0000000..14015a3
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+/**
+ * A command for guest logins
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this command and sets the resolver instance
+        *
+        * @param       $resolverInstance       An instance of a command resolver
+        * @return      $commandInstance        The created command instance
+        */
+       public static final function createWebShipsimuGuestLoginCommand (CommandResolver $resolverInstance) {
+               // Get a new instance
+               $commandInstance = new WebShipsimuGuestLoginCommand();
+
+               // Set the resolver instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // First get a GuestLogin instance
+               $loginInstance = ObjectFactory::createObjectByConfiguredName('guest_login_class');
+
+               // First set request and response instance
+               $loginInstance->setRequestInstance($requestInstance);
+
+               // Encrypt the password
+               $loginInstance->encryptPassword('passwd');
+
+               // Do the login here
+               $loginInstance->doLogin($requestInstance, $responseInstance);
+
+               // Was the login fine? Then redirect here
+               if ($loginInstance->ifLoginWasSuccessfull()) {
+                       // Try to redirect here
+                       try {
+                               // Redirect...
+                               $responseInstance->redirectToConfiguredUrl('app_login');
+
+                               // Exit here
+                               exit();
+                       } catch (FrameworkException $e) {
+                               // Something went wrong here!
+                               $responseInstance->addFatalMessage($e->getMessage());
+                       }
+               } else {
+                       // Attach error message to the response
+                       $responseInstance->addFatalMessage('failed_user_login');
+               }
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add more filters
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add username verifier filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_filter'));
+
+               // Add password verifier filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_filter'));
+
+               // Add CAPTCHA verifier code
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_guest_verifier_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/web/class_WebShipsimuProfileCommand.php b/application/shipsimu/classes/commands/web/class_WebShipsimuProfileCommand.php
new file mode 100644 (file)
index 0000000..a266f26
--- /dev/null
@@ -0,0 +1,153 @@
+<?php
+/**
+ * A command for profile-update handling
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipsimuProfileCommand extends BaseCommand implements Commandable {
+       /**
+        * Filtered request data
+        */
+       private $requestData = array();
+
+       /**
+        * Allowed profile data to pass through
+        */
+       private $allowedData = array(
+               'pass'  => 'pass1',
+               'email' => 'email1',
+               'surname',
+               'family',
+               'street',
+               'city',
+               'zip',
+               'icq',
+               'jabber',
+               'yahoo',
+               'aol',
+               'msn',
+               'rules',
+               'birth_day',
+               'birth_month',
+               'birth_year'
+       );
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this command and sets the resolver instance
+        *
+        * @param       $resolverInstance       An instance of a command resolver
+        * @return      $commandInstance        The created command instance
+        */
+       public static final function createWebShipsimuProfileCommand (CommandResolver $resolverInstance) {
+               // Get a new instance
+               $commandInstance = new WebShipsimuProfileCommand();
+
+               // Set the resolver instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        Add functionality here
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Make sure only allowed values are comming through
+               foreach ($this->allowedData as $alias => $element) {
+                       // Get data
+                       $data = $requestInstance->getRequestElement($element);
+
+                       // Silently skip empty fields
+                       if (empty($data)) continue;
+
+                       // Do we have an alias?
+                       if (is_string($alias)) {
+                               // Yes, so use it
+                               $this->requestData[$alias]   = $data;
+                       } else {
+                               // No, default entry
+                               $this->requestData[$element] = $data;
+                       }
+               } // END - foreach
+
+               // Remove the array, we don't need it anymore
+               unset($this->allowedData);
+
+               // Unfinished!
+               $this->partialStub("Unfinished work.");
+               $this->debugBackTrace();
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some more pre/post filters to the controller
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add user auth filter (we don't need an update of the user here because it will be redirected)
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+               // User status filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+
+               // User status if not 'guest' filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_guest_filter'));
+
+               // Updated rules accepted
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter'));
+
+               // Account password validation
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
+
+               // Validate CAPTCHA input
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter'));
+
+               // Validate birthday input
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_profile_verifier_filter'));
+
+               // Email changed
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter'));
+
+               // Password changed
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/web/class_WebShipsimuRefillCommand.php b/application/shipsimu/classes/commands/web/class_WebShipsimuRefillCommand.php
new file mode 100644 (file)
index 0000000..1c9bd8e
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+/**
+ * A command for the money refill page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipsimuRefillCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this command and sets the resolver instance
+        *
+        * @param       $resolverInstance       An instance of a command resolver
+        * @return      $commandInstance        The created command instance
+        */
+       public static final function createWebShipsimuRefillCommand (CommandResolver $resolverInstance) {
+               // Get a new instance
+               $commandInstance = new WebShipsimuRefillCommand();
+
+               // Set the resolver instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get template instance
+               $templateInstance = $responseInstance->getTemplateInstance();
+
+               // Set amount and type as variables
+               $templateInstance->assignVariable('refill_done', $requestInstance->getRequestElement('type'));
+               $templateInstance->assignVariable('amount'     , $requestInstance->getRequestElement('amount'));
+
+               // This method does currently redirect if all goes right. Booking is done in filters
+               $responseInstance->redirectToConfiguredUrl('refill_page_done');
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add user auth filter (we don't need an update of the user here because it will be redirected)
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+               // Add user status filter here
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+
+               // Is the refill page active?
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter'));
+
+               // Verify password
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
+
+               // Verify CAPTCHA code
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter'));
+
+               // Verify refill request
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter'));
+
+               // Construct config entry for wether automatic payment from API or waiting for approval
+               $paymentTypeConfig = sprintf("refill_request_%s_payment_type", $requestInstance->getRequestElement('type'));
+
+               // Prepare a filter based on the requested type we shall refill
+               $filterName = sprintf("refill_request_%s_%s_book_filter",
+                       $requestInstance->getRequestElement('type'),
+                       $this->getConfigInstance()->getConfigEntry($paymentTypeConfig)
+               );
+
+               // Now, try to load that filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName($filterName));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/web/class_WebShipsimuRegisterCommand.php b/application/shipsimu/classes/commands/web/class_WebShipsimuRegisterCommand.php
new file mode 100644 (file)
index 0000000..181ce2f
--- /dev/null
@@ -0,0 +1,117 @@
+<?php
+/**
+ * A command for registration handling
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipsimuRegisterCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this command and sets the resolver instance
+        *
+        * @param       $resolverInstance       An instance of a command resolver
+        * @return      $commandInstance        The created command instance
+        */
+       public static final function createWebShipsimuRegisterCommand (CommandResolver $resolverInstance) {
+               // Get a new instance
+               $commandInstance = new WebShipsimuRegisterCommand();
+
+               // Set the resolver instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // First get a UserRegistration instance
+               $registerInstance = ObjectFactory::createObjectByConfiguredName('user_registration_class');
+
+               // First set request and response instance
+               $registerInstance->setRequestInstance($requestInstance);
+               $registerInstance->setResponseInstance($responseInstance);
+
+               // Encrypt the password
+               $registerInstance->encryptPassword('pass1');
+
+               // Do things before registration
+               $registerInstance->doPreRegistration();
+
+               // Register the new user
+               $registerInstance->registerNewUser();
+
+               // Do things after registration like notifying partner pages or queueing
+               // them for notification
+               $registerInstance->doPostRegistration();
+
+               // Redirect or login after registration
+               $registerInstance->doPostAction();
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add some more pre/post filters to the controller
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Validate email address (if configured: check on double email addresses)
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_filter'));
+
+               // Validate username and check if it does not exist
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_filter'));
+
+               // Validate if username is "guest" and not taken
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_filter'));
+
+               // Validate if password is set
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_filter'));
+
+               // Check if rules where accepted
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter'));
+
+               // Validate CAPTCHA input
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_register_verifier_filter'));
+
+               // Validate birthday
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_register_verifier_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/web/class_WebShipsimuUserLoginCommand.php b/application/shipsimu/classes/commands/web/class_WebShipsimuUserLoginCommand.php
new file mode 100644 (file)
index 0000000..2a33a8f
--- /dev/null
@@ -0,0 +1,124 @@
+<?php
+/**
+ * A command for user login
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipsimuUserLoginCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this command and sets the resolver instance
+        *
+        * @param       $resolverInstance       An instance of a command resolver
+        * @return      $commandInstance        The created command instance
+        */
+       public static final function createWebShipsimuUserLoginCommand (CommandResolver $resolverInstance) {
+               // Get a new instance
+               $commandInstance = new WebShipsimuUserLoginCommand();
+
+               // Set the resolver instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // First get a UserLogin instance
+               $loginInstance = ObjectFactory::createObjectByConfiguredName('user_login_class');
+
+               // First set request and response instance
+               $loginInstance->setRequestInstance($requestInstance);
+
+               // Encrypt the password
+               $loginInstance->encryptPassword('pass');
+
+               // Do the login here
+               $loginInstance->doLogin($requestInstance, $responseInstance);
+
+               // Was the login fine? Then redirect here
+               if ($loginInstance->ifLoginWasSuccessfull()) {
+                       // Try to redirect here
+                       try {
+                               // Redirect...
+                               $responseInstance->redirectToConfiguredUrl('app_login');
+
+                               // Exit here
+                               exit();
+                       } catch (FrameworkException $e) {
+                               // Something went wrong here!
+                               $responseInstance->addFatalMessage($e->getMessage());
+                       }
+               } else {
+                       // Attach error message to the response
+                       $responseInstance->addFatalMessage('failed_user_login');
+               }
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Add more filters
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Which login type do we have?
+               switch ($this->getConfigInstance()->getConfigEntry('login_type')) {
+                       case 'username': // Login via username
+                               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter'));
+                               break;
+
+                       case 'email': // Login via email
+                               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter'));
+                               break;
+
+                       default: // Wether username or email is set
+                               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter'));
+                               break;
+               }
+
+               // Password verifier filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter'));
+
+               // Add filter for CAPTCHA
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/web/company/.htaccess b/application/shipsimu/classes/commands/web/company/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/commands/web/company/class_WebShipSimuCompanyCommand.php b/application/shipsimu/classes/commands/web/company/class_WebShipSimuCompanyCommand.php
new file mode 100644 (file)
index 0000000..7fed46f
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/**
+ * A command for the money refill page
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipSimuCompanyCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this command and sets the resolver instance
+        *
+        * @param       $resolverInstance       An instance of a command resolver
+        * @return      $commandInstance        The created command instance
+        */
+       public static final function createWebShipSimuCompanyCommand (CommandResolver $resolverInstance) {
+               // Get a new instance
+               $commandInstance = new WebShipSimuCompanyCommand();
+
+               // Set the resolver instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get template instance
+               $templateInstance = $responseInstance->getTemplateInstance();
+
+               // Set amount and type as variables
+               $templateInstance->assignVariable('refill_done', $requestInstance->getRequestElement('type'));
+               $templateInstance->assignVariable('amount'     , $requestInstance->getRequestElement('amount'));
+
+               // This method does currently redirect if all goes right
+               $responseInstance->redirectToConfiguredUrl('refill_page_done');
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add user auth filter (we don't need an update of the user here because it will be redirected)
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+               // Add user status filter here
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/web/government/.htaccess b/application/shipsimu/classes/commands/web/government/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedStartupCommand.php b/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedStartupCommand.php
new file mode 100644 (file)
index 0000000..54ddb05
--- /dev/null
@@ -0,0 +1,146 @@
+<?php
+/**
+ * A command for a failed startup request. This may happen when the user
+ * "knows" the correct URL but government refuses to pay.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebGovernmentFailedStartupCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance       An instance of a command resolver class
+        * @return      $commandInstance        An instance a prepared command class
+        */
+       public static final function createWebGovernmentFailedStartupCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebGovernmentFailedStartupCommand();
+
+               // Set the application instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the given command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get the action instance from registry
+               $actionInstance = Registry::getRegistry()->getInstance('action');
+
+               // Do we have an action here?
+               if ($actionInstance instanceof PerformableAction) {
+                       // Execute the action (shall not output anything, see below why)
+                       $actionInstance->execute($requestInstance, $responseInstance);
+               } // END - if
+
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign base URL
+               $templateInstance->assignConfigVariable('base_url');
+
+               // Assign all the application's data with template variables
+               $templateInstance->assignApplicationData($appInstance);
+
+               // Load the master template
+               $masterTemplate = $appInstance->buildMasterTemplateName();
+
+               // Load header template
+               $templateInstance->loadCodeTemplate('header');
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable('header', 'header');
+
+               // Load footer template
+               $templateInstance->loadCodeTemplate('footer');
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable('footer', 'footer');
+
+               // Load main template
+               $templateInstance->loadCodeTemplate('government_failed_main');
+
+               // Assign the main template with the master template as a content ... ;)
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable('government_failed_main', 'main_content');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($requestInstance->getRequestElement('page') . '_' . $requestInstance->getRequestElement('failed') . '_title'));
+
+               // Construct the menu in every command. We could do this in BaseCommand class. But this means
+               // *every* command has a navigation system and that is want we don't want.
+               $menuInstance = ObjectFactory::createObjectByConfiguredName('government_failed_area_menu_class', array($appInstance));
+
+               // Render the menu
+               $menuInstance->renderMenu();
+
+               // Transfer it to the template engine instance
+               $menuInstance->transferContentToTemplateEngine();
+
+               // ... and all variables. This should be merged together in a pattern
+               // to make things easier. A cache mechanism should be added between
+               // these two calls to cache compiled templates.
+               $templateInstance->compileVariables();
+
+               // Get the content back from the template engine and put it in response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Maybe we need some filters here?
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedTrainingCommand.php b/application/shipsimu/classes/commands/web/government/class_WebGovernmentFailedTrainingCommand.php
new file mode 100644 (file)
index 0000000..7119196
--- /dev/null
@@ -0,0 +1,146 @@
+<?php
+/**
+ * A command for a failed training request. This may happen when the user
+ * "knows" the correct URL but government refuses to pay.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebGovernmentFailedTrainingCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance       An instance of a command resolver class
+        * @return      $commandInstance        An instance a prepared command class
+        */
+       public static final function createWebGovernmentFailedTrainingCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebGovernmentFailedTrainingCommand();
+
+               // Set the application instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the given command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get the action instance from registry
+               $actionInstance = Registry::getRegistry()->getInstance('action');
+
+               // Do we have an action here?
+               if ($actionInstance instanceof PerformableAction) {
+                       // Execute the action (shall not output anything, see below why)
+                       $actionInstance->execute($requestInstance, $responseInstance);
+               } // END - if
+
+               // Get the application instance
+               $appInstance = $this->getResolverInstance()->getApplicationInstance();
+
+               // Prepare a template instance
+               $templateInstance = $this->prepareTemplateInstance($appInstance);
+
+               // Assign base URL
+               $templateInstance->assignConfigVariable('base_url');
+
+               // Assign all the application's data with template variables
+               $templateInstance->assignApplicationData($appInstance);
+
+               // Load the master template
+               $masterTemplate = $appInstance->buildMasterTemplateName();
+
+               // Load header template
+               $templateInstance->loadCodeTemplate('header');
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable('header', 'header');
+
+               // Load footer template
+               $templateInstance->loadCodeTemplate('footer');
+
+               // Compile and assign it with a variable
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable('footer', 'footer');
+
+               // Load main template
+               $templateInstance->loadCodeTemplate('government_failed_main');
+
+               // Assign the main template with the master template as a content ... ;)
+               $templateInstance->compileTemplate();
+               $templateInstance->assignTemplateWithVariable('government_failed_main', 'main_content');
+
+               // Load the master template
+               $templateInstance->loadCodeTemplate($masterTemplate);
+
+               // Set title
+               $templateInstance->assignVariable('title', $this->getLanguageInstance()->getMessage($requestInstance->getRequestElement('command') . '_' . $requestInstance->getRequestElement('failed') . '_title'));
+
+               // Construct the menu in every command. We could do this in BaseCommand class. But this means
+               // *every* command has a navigation system and that is want we don't want.
+               $menuInstance = ObjectFactory::createObjectByConfiguredName('government_failed_area_menu_class', array($appInstance));
+
+               // Render the menu
+               $menuInstance->renderMenu();
+
+               // Transfer it to the template engine instance
+               $menuInstance->transferContentToTemplateEngine();
+
+               // ... and all variables. This should be merged together in a pattern
+               // to make things easier. A cache mechanism should be added between
+               // these two calls to cache compiled templates.
+               $templateInstance->compileVariables();
+
+               // Get the content back from the template engine and put it in response class
+               $templateInstance->transferToResponse($responseInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Maybe we need some filters here?
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Empty for now
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php b/application/shipsimu/classes/commands/web/government/class_WebShipsimuGovernmentStartupCommand.php
new file mode 100644 (file)
index 0000000..3153962
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+/**
+ * A command for a failed startup request. This may happen when the user
+ * "knows" the correct URL but government refuses to pay.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipsimuGovernmentStartupCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance       An instance of a command resolver class
+        * @return      $commandInstance        An instance a prepared command class
+        */
+       public static final function createWebShipsimuGovernmentStartupCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebShipsimuGovernmentStartupCommand();
+
+               // Set the application instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the given command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get a wrapper instance
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class');
+
+               // Register the startup help
+               $wrapperInstance->registerStartupHelpByRequest($requestInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Maybe we need some filters here?
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add user auth filter (we don't need an update of the user here because it will be redirected)
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+               // Add user status filter here
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+
+               // Check if government can pay startup help
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_startup_help_filter'));
+
+               // Verify password
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
+
+               // Verify CAPTCHA code
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_government_verifier_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php b/application/shipsimu/classes/commands/web/government/class_WebShipsimuGovernmentTrainingCommand.php
new file mode 100644 (file)
index 0000000..035e5e8
--- /dev/null
@@ -0,0 +1,94 @@
+<?php
+/**
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class WebShipsimuGovernmentTrainingCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance       An instance of a command resolver class
+        * @return      $commandInstance        An instance a prepared command class
+        */
+       public static final function createWebShipsimuGovernmentTrainingCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new WebShipsimuGovernmentTrainingCommand();
+
+               // Set the application instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the given command with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get a wrapper instance
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_gov_wrapper_class');
+
+               // Register the training
+               $wrapperInstance->registerTrainingByRequest($requestInstance);
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Maybe we need some filters here?
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add user auth filter (we don't need an update of the user here because it will be redirected)
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+               // Add user status filter here
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter'));
+
+               // Check if government can pay training help
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('government_pays_training_filter'));
+
+               // Verify password
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter'));
+
+               // Verify CAPTCHA code
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter'));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/companies/.htaccess b/application/shipsimu/classes/companies/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/companies/class_ShippingCompany.php b/application/shipsimu/classes/companies/class_ShippingCompany.php
new file mode 100644 (file)
index 0000000..cee5ccc
--- /dev/null
@@ -0,0 +1,666 @@
+<?php
+/**
+ * A shipping company may be founded with this class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ShippingCompany extends BaseSimulator implements Customer, ContractPartner {
+       /**
+        * Full name of this company
+        */
+       private $companyName     = "Namenlose Reederei";
+
+       /**
+        * Shorted name of this company
+        */
+       private $shortName       = "";
+
+       /**
+        * Instance of the founder
+        */
+       private $founderInstance = null;
+
+       /**
+        * Headquarter harbor instance
+        */
+       private $hqInstance      = null;
+
+       /**
+        * Employed people by this company
+        */
+       private $employeeList    = null;
+
+       /**
+        * List of all assigned shipyards
+        */
+       private $shipyardList   = null;
+
+       /**
+        * List of owned ships
+        */
+       private $ownedShips      = null;
+
+       /**
+        * Work constracts this company is currently working on
+        */
+       private $contractList    = null;
+
+       // Exception constants
+       const EXCEPTION_USER_OWNS_NO_COMPANY = 0x200;
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this company class or throws an exception if the
+        * given user owns no company.
+        *
+        * @param       $userInstance           A user class
+        * @return      $companyInstance        Prepared company instance
+        * @todo        Add functionality if user participates in a company
+        */
+       public static final function createShippingCompany (ManageableAccount $userInstance) {
+               // Get new instance
+               $companyInstance = new ShippingCompany();
+
+               // Does the given user owns a company?
+               if ($companyInstance->ifUserParticipatesInCompany($userInstance)) {
+                       // Then do some nasty caching here but don't throw an exception
+                       // because then you will hurt our web helpers... :/
+                       $companyInstance->partialStub("Don&#39;t throw exceptions here.");
+               } // END - if
+
+               // Init all lists
+               $companyInstance->initCompanyLists();
+
+               // Return instance
+               return $companyInstance;
+       }
+
+       /**
+        * Checks wether the given user participates in a company
+        *
+        * @param       $userInstance   An instance of a user class
+        * @return      $participates   Wether the user participates at lease in one company
+        */
+       protected function ifUserParticipatesInCompany (ManageableAccount $userInstance)  {
+               // By default no user owns any company... ;)
+               $participates = false;
+
+               // Get a company database wrapper class
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('company_db_wrapper_class', array($this));
+
+               // Ask the wrapper if this user participates
+               $participates = $wrapperInstance->ifUserParticipatesInCompany($userInstance);
+
+               // Get the result instance
+               $resultInstance = $wrapperInstance->getResultInstance();
+
+               // Caches the result instance here, if set (we don't the wrapper anymore!)
+               if ($resultInstance instanceof SearchableResult) {
+                       // Set the result instance
+                       $this->setResultInstance($resultInstance);
+               } // END - if
+
+               // Return result
+               return $participates;
+       }
+
+       /**
+        * Checks wether the current user in registry is the company founder
+        *
+        * @return      $isFounder      Wether the current user is the company founder
+        * @todo        Check if user is company founder
+        */
+       public function ifUserIsFounder () {
+               // Default is not the founder
+               $isFounder = false;
+
+               // Get result instance
+               $resultInstance = $this->getResultInstance();
+
+               // Is it set?
+               if ($resultInstance instanceof SearchableResult) {
+                       // Result found so analyse it
+                       $this->partialStub("Check if user is company founder.");
+               } // END - if
+
+               // Return result
+               return $isFounder;
+       }
+
+       /**
+        * Checks wether the current user in registry is the company owner
+        *
+        * @return      $isOwner        Wether the current user is the company owner
+        * @todo        Check if user is company owner
+        */
+       public function ifUserIsOwner () {
+               // Default is not the owner
+               $isOwner = false;
+
+               // Get result instance
+               $resultInstance = $this->getResultInstance();
+
+               // Is it set?
+               if ($resultInstance instanceof SearchableResult) {
+                       // Result found so analyse it
+                       $this->partialStub("Check if user is company owner.");
+               } // END - if
+
+               // Return result
+               return $isOwner;
+       }
+
+       /**
+        * Checks wether the current user in registry is an employee in this company
+        *
+        * @return      $isOwner        Wether the current user is an employee in this company
+        */
+       public function ifUserIsEmployee () {
+               // Default is no employee
+               $isEmployee = false;
+
+               // Get result instance
+               $resultInstance = $this->getResultInstance();
+
+               // Is it set?
+               if ($resultInstance instanceof SearchableResult) {
+                       // Result found so he is employee
+                       $isEmployee = true;
+               } // END - if
+
+               // Return result
+               return $isEmployee;
+       }
+
+       //------------------------------------------------------------------------------\
+       // Below here is very old code which needs to be translated and changed heavily |
+       //------------------------------------------------------------------------------/
+
+       /**
+        * Intialize all lists
+        *
+        * @return      void
+        * @todo        Maybe we don't need these big lists anymore?! So we can deprecate/remove it
+        */
+       protected function initCompanyLists () {
+               // Employees
+               $this->employeeList = new FrameworkArrayObject("FakedEmployeeList");
+
+               // Ship yards
+               $this->shipyardList = new FrameworkArrayObject("FakedShipyardList");
+
+               // Contracts
+               $this->contractList = new FrameworkArrayObject("FakedContractList");
+       }
+
+       // Setter-Methode fuer Firmennamen
+       public final function setCompanyName ($companyName) {
+               $this->companyName = (string) $companyName;
+       }
+
+       // Getter-Methode fuer Firmennamen
+       public final function getCompanyName () {
+               return $this->companyName;
+       }
+
+       // Setter-Methode fuer Firmensitz
+       public final function setHQInstance (Harbor $hqInstance) {
+               $this->hqInstance = $hqInstance;
+       }
+
+       // Kuerzel setzen
+       private function initShortName () {
+               // Mindestens eine Leerstelle?
+               $dummy = explode(" ", $this->getCompanyName());
+               foreach ($dummy as $part) {
+                       $this->shortName .= substr($part, 0, 1);
+               } // END - if
+       }
+
+       // Reedereien Werften bauen lassen
+       public function createShipyardInHarbor($shipyardName, Harbor $harborInstance) {
+               if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> baut im <strong>%s</strong> eine Werft <strong>%s</strong>.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getCompanyName(),
+                       $harborInstance->getHarborName(),
+                       $shipyardName
+               ));
+
+               // Wird im HQ gebaut?
+               if ($this->hqInstance->equals($harborInstance)) {
+                       // Die neue Werft wird im HQ gebaut!
+                       $this->hqInstance->addNewShipyardNotify($shipyardName, $this);
+                       // Die Werft drueber in Kenntnis setzen, welcher Reederei sie angehoert
+               } else {
+                       // Ausserhalb des Heimathafens soll eine Werft gebaut werden
+                       $harborInstance->addNewShipyardNotify($shipyardName, $this);
+               }
+       }
+
+       // Setter fuer Reederei-Gruender
+       public final function setCompanyFounder(CompanyEmployee $founderInstance) {
+               $this->founderInstance = $founderInstance;
+       }
+
+       // Getter for founder instance
+       public final function getFounderInstance () {
+               return $this->founderInstance;
+       }
+
+       // Neue(n) Angestellte(n) in Angestellten-Liste aufnehmen
+       public function addNewEmployee (SimulatorPersonell $employeeInstance) {
+               $this->employeeList->append($employeeInstance);
+       }
+
+       // Neue Werft in Liste aufnehmen
+       public function addNewShipyard (Shipyard $shipyardInstance) {
+               $this->shipyardList->append($shipyardInstance);
+       }
+
+       // Neue Mitarbeiter per Zufall einstellen/rekrutieren
+       public function recruitRandomEmployees($amount, SimulatorPersonell $personellInstance) {
+               // Anzahl Mitarbeiter absichern
+               $amount = (int) $amount;
+
+               // Debug-Meldung ausgeben
+               if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> stellt per Zufall <strong>%d</strong> neue Mitarbeiter ein.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getCompanyName(),
+                       $amount
+               ));
+
+               // Gesamtanzahl verfuegbarer Erwerbsloser holen
+               $totalUnemployed = $personellInstance->getAllUnemployed();
+
+               // Existiert die gewuenschte Anzahl freier Arbeiter? (doppelt geht derzeit nicht)
+               if ($totalUnemployed < $amount) {
+                       // Reichte nicht aus!
+                       throw new ToMuchEmployeesException(array($amount, $personellInstance->getAllUnemployed()), self::EXCEPTION_NOT_ENOUGTH_UNEMPLOYEES);
+               } // END - if
+
+               // Get list for all unemployed people
+               $list = $personellInstance->getSpecialPersonellList(false); // Should be cached
+
+               // Get iterator of the list
+               $iterator = $list->getIterator();
+
+               // Get the requested amount of personell
+               for ($idx = 0; $idx < $amount; $idx++) {
+                       $employee = null;
+                       // Is this personl unemployed?
+                       while (is_null($employee) || $employee->isEmployed()) {
+                               // Generate random number
+                               $pos = mt_rand(0, ($totalUnemployed - 1)); // Don't remove the -1 here:
+                               // E.g. 100 entries means latest position is 99...
+
+                               // Seek for the position
+                               $iterator->seek($pos);
+
+                               // Is the current position valid?
+                               if ($iterator->valid() === false) {
+                                       // Should normally not happen... :(
+                                       throw new StructuresOutOfBoundsException($idx, self::EXCEPTION_INDEX_OUT_OF_BOUNDS);
+                               } // END - if
+
+                               // Get current element
+                               $employee = $iterator->current();
+                       } // END - while
+
+                       // A dummy just for the description and real class
+                       $dummy = CompanyEmployee::createCompanyEmployee("", "", "M", 1970, 1, 1, $employee->isMarried(), 0);
+
+                       // Make this person employed and give him some money to work
+                       $employee->setEmployed(true);
+                       $employee->setRealClass($dummy->__toString());
+                       $employee->increaseSalary((mt_rand(7, 14) * 100)); // Are 700 to 1400 EUR for the begin okay?
+
+                       // Debug message
+                       if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> stellt den/die Angestellte(n) <strong>%s %s</strong> ein.",
+                               __CLASS__,
+                               __LINE__,
+                               $this->getCompanyName(),
+                               $employee->getSurname(),
+                               $employee->getFamily()
+                       ));
+
+                       // Add this employee
+                       $this->addNewEmployee($employee);
+               } // End - for
+
+               // Cache resetten
+               $personellInstance->resetCache();
+
+               // Debug-Meldung ausgeben
+               if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat per Zufall <strong>%d</strong> neue Mitarbeiter eingestellt.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getCompanyName(),
+                       $amount
+               ));
+       } // End - method
+
+       // Distribute all personells on all shipyards
+       public function distributeAllPersonellOnShipyards () {
+               if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> verteilt alle ihre <strong>%d</strong> Mitarbeiter auf alle <strong>%d</strong> Werft(en).",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getCompanyName(),
+                       $this->getTotalEmployee(),
+                       $this->getTotalShipyards()
+               ));
+
+               // Do we have some shipyards?
+               if (is_null($this->shipyardList)) {
+                       // No shipyards created
+                       throw new NoShipyardsConstructedException($this, self::EXCEPTION_HARBOR_HAS_NO_SHIPYARDS);
+               }
+
+               // Get iterator for shipyards
+               $shipyardIter = $this->shipyardList->getIterator();
+
+               // Iterate through all employees
+               for ($idx = $this->employeeList->getIterator(); $idx->valid(); $idx->next()) {
+                       // Is the shipyard iterator still okay?
+                       if ($shipyardIter->valid() === false) {
+                               // Rewind to first position
+                               $shipyardIter->seek(0);
+                       } // END - if
+
+                       // Get Shipyard object
+                       $shipyard = $shipyardIter->current();
+
+                       // Is this a Shipyard object?
+                       if (is_null($shipyard)) {
+                               // No class returned
+                               throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       } elseif (!is_object($shipyard)) {
+                               // Not an object! ;-(
+                               throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT);
+                       } elseif ($shipyard->isClass("Shipyard") === false) {
+                               // Nope, so throw exception
+                               throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING);
+                       }
+
+                       // Add employee to the shipyard
+                       $shipyard->addNewPersonell($idx->current());
+
+                       // Continue to next shipyard
+                       $shipyardIter->next();
+               }
+       }
+
+       // Getter for total employees
+       public final function getTotalEmployee () {
+               // Count all...
+               $total = $this->employeeList->count();
+
+               // Debug message
+               if ((defined('DEBUG_COMPANY_EMPLOYEE')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat <strong>%d</strong> Mitarbeiter.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getCompanyName(),
+                       $total
+               ));
+
+               // Return amount
+               return $total;
+       }
+
+       // Getter for total shipyards
+       public final function getTotalShipyards () {
+               if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] F&uuml;r die Reederei <strong>%s</strong> werden die Anzahl der Werften in allen H&auml;fen ermittelt.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getCompanyName()
+               ));
+
+               // Do we have some shipyards?
+               if (is_null($this->shipyardList)) {
+                       // No shipyards created
+                       throw new NoShipyardsConstructedException($this, self::EXCEPTION_HARBOR_HAS_NO_SHIPYARDS);
+               }
+
+               // Get iterator
+               $total = $this->shipyardList->count();
+
+               // Debug message
+               if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat <strong>%d</strong> Werft(en).",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getCompanyName(),
+                       $total
+               ));
+
+               // Return amount
+               return $total;
+       }
+
+       // Add a ship type (class) to all shipyards
+       public function addShipTypeToAllShipyards ($shipType) {
+               // Secure strings
+               $shipType = (string) $shipType;
+
+               // Is the class there?
+               if (!class_exists($shipType)) {
+                       // Throw exception
+                       throw new NoClassException($shipType, self::EXCEPTION_CLASS_NOT_FOUND);
+               }
+
+               // Create dummy ship
+               eval(sprintf("\$shipInstance = %s::create%s(\"M/S Dummy\");",
+                       $shipType,
+                       $shipType
+               ));
+
+               // Iterate shipyard list
+               for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) {
+                       // Get current element
+                       $shipyard = $idx->current();
+
+                       // Is this a shipyard?
+                       if (is_null($shipyard)) {
+                               // Opps! Empty list?
+                               throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       } elseif (!is_object($shipyard)) {
+                               // Not an object! ;-(
+                               throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT);
+                       } elseif ($shipyard->isClass("Shipyard") === false) {
+                               // Class is not a shipyard
+                               throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING);
+                       }
+
+                       // Add the new ship type to the shipyard
+                       $shipyard->addNewConstructableShipType($shipType);
+               } // END - for
+       }
+
+       // Validate the requested ship type with the company if they can construct it
+       public function validateWorksContractShipType (SignableContract $contractInstance) {
+               // First get the ship type
+               $shipInstance = $contractInstance->getShipInstance();
+
+               // Ist there a ship instance?
+               if (is_null($shipInstance)) {
+                       // Opps! Empty entry?
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } elseif (!is_object($shipInstance)) {
+                       // Not an object! ;-(
+                       throw new InvalidObjectException($shipInstance, self::EXCEPTION_IS_NO_OBJECT);
+               }
+
+               // Get it's real class name
+               $shipType = $shipInstance->__toString();
+
+               // Now check if ship type is in any list and return the result
+               return ($this->isShipTypeConstructable($shipType));
+       }
+
+       // Is the ship type constructable?
+       public function isShipTypeConstructable ($shipType) {
+               // The type must be a string!
+               $shipType = (string) $shipType;
+
+               // Debug message
+               if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> fragt alle Werften ab, ob diese Schiffe vom Typ <strong>%s</strong> bauen k&ouml;nnen.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getCompanyName(),
+                       $shipType
+               ));
+
+               // First everthing is failed...
+               $result = false;
+
+               // Iterate through all shipyards
+               for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) {
+                       // Get current Shipyard instance
+                       $shipyard = $idx->current();
+
+                       // Is this a shipyard?
+                       if (is_null($shipyard)) {
+                               // Opps! Empty list?
+                               throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+                       } elseif (!is_object($shipyard)) {
+                               // Not an object! ;-(
+                               throw new InvalidObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT);
+                       } elseif ($shipyard->isClass("Shipyard") === false) {
+                               // Class is not a shipyard
+                               throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING);
+                       }
+
+                       // Validate if first found shipyard can construct the requested type
+                       $result = $shipyard->isShipTypeConstructable($shipType);
+
+                       // Does this shipyard construct the requested ship type?
+                       if ($result) break; // Then abort the search!
+               } // END - for
+
+               // Debug message
+               if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat die Suche nach einer Werft beendet, die Schiffe vom Typ <strong>%s</strong> bauen kann.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getCompanyName(),
+                       $shipType
+               ));
+
+               // Return result
+               return $result;
+       }
+
+       // As a customer the shipping company can add new contracts
+       public function addNewWorksContract (SignableContract $contractInstance) {
+               $this->contractList->append($contractInstance);
+       }
+
+       // As a customer the shippng company can withdraw from a contract
+       public function withdrawFromContract (SignableContract $contractInstance) {
+               ApplicationEntryPoint::app_exit("WITHDRAW:<pre>".print_r($contractInstance, true)."</pre>");
+       }
+
+       // Get latest added contract instance
+       public final function getLastContractInstance () {
+               // Get iterator
+               $iter = $this->contractList->getIterator();
+
+               // Get latest entry (total - 1)
+               $iter->seek($iter->count() - 1);
+
+               // Return entry
+               return $iter->current();
+       }
+
+       // Sign a contract with an other party which must also implement Customer
+       public function signContract (SignableContract $contractInstance, ContractPartner $partnerInstance) {
+               // Check wether the other party is our contract partner
+               if ($partnerInstance->isContractPartner($contractInstance) === false) {
+                       // Invalid contract partner!
+                       throw new InvalidContractPartnerException($partnerInstance, self::EXCEPTION_CONTRACT_PARTNER_INVALID);
+               } // END - if
+
+               // Determine if company "signs" own contract (must be done) or with an other party
+               if ($this->equals($partnerInstance)) {
+                       // With itself
+                       if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erteilt an sich selbst einen Bauauftrag f&uuml;r das <strong>%s</strong> &quot;<strong>%s</strong>&quot;.",
+                               __CLASS__,
+                               __LINE__,
+                               $this->getCompanyName(),
+                               $contractInstance->getShipInstance()->getObjectDescription(),
+                               $contractInstance->getShipInstance()->getShipName()
+                       ));
+               } else {
+                       // Other external company
+                       if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> unterzeichnet einen Bauauftrag f&uuml;r das <strong>%s</strong> &quot;<strong>%s</strong>&quot; mit der <strong>%s</strong>.",
+                               __CLASS__,
+                               __LINE__,
+                               $this->getCompanyName(),
+                               $contractInstance->getShipInstance()->getObjectDescription(),
+                               $contractInstance->getShipInstance()->getShipName(),
+                               $partnerInstance->getCompanyName()
+                       ));
+               }
+
+               // Sign the contract
+               $contractInstance->signContract($this, $partnerInstance);
+
+               /**
+                * @todo        Maybe do something more here...
+                */
+       }
+
+       // Is this the right contract partner?
+       public function isContractPartner (SignableContract $contractInstance) {
+               // Get contract partner instance and compare it with $this contract partner
+               return ($this->equals($contractInstance->getContractPartner()));
+       }
+
+       // Setter for merchant instance
+       public final function setMerchantInstance (Merchant $merchantInstance) {
+               // Get contract
+               $contractInstance = $this->getLastContractInstance();
+
+               if (is_null($contractInstance)) {
+                       // Opps! Empty contract instance?
+                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
+               } elseif (!is_object($contractInstance)) {
+                       // Not an object! ;-(
+                       throw new InvalidObjectException($contractInstance, self::EXCEPTION_IS_NO_OBJECT);
+               } elseif ($contractInstance->isClass("WorksContract") === false) {
+                       // Is not a merchant
+                       throw new ClassMismatchException(array($contractInstance->__toString(), "WorksContract"), self::EXCEPTION_CLASSES_NOT_MATCHING);
+               }
+
+               // Set the merchant in the contract (for getting prices)
+               $contractInstance->setMerchantInstance($merchantInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/constructions/.htaccess b/application/shipsimu/classes/constructions/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/constructions/berths/.htaccess b/application/shipsimu/classes/constructions/berths/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/constructions/berths/class_Berth.php b/application/shipsimu/classes/constructions/berths/class_Berth.php
new file mode 100644 (file)
index 0000000..c96ba10
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+/**
+ * A berth is a place where ships can wait for their next assignment
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Berth extends BaseConstruction {
+       // Durchlaufende Nummer der Liegeplaetze
+       private $berthIndex = 0;
+
+       // Zugewiesener Hafen
+       private $harborInstance = null;
+
+       // Konstruktor
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/constructions/class_BaseConstruction.php b/application/shipsimu/classes/constructions/class_BaseConstruction.php
new file mode 100644 (file)
index 0000000..af08a39
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * A general construction (land) class
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseConstruction extends BaseSimulator {
+       // Tiefgang fuer z.B. Trockdocks
+       private $draught = 0;
+
+       // Konstruktor
+       protected function __construct ($className) {
+               // Eltern-Konstrutor aufrufen
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/constructions/docks/.htaccess b/application/shipsimu/classes/constructions/docks/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/constructions/docks/class_DryDock.php b/application/shipsimu/classes/constructions/docks/class_DryDock.php
new file mode 100644 (file)
index 0000000..c9d6f8e
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * A dry dock where ships can be repaired, repainted or modified in.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DryDock extends BaseConstruction {
+       // Zugewiesener Hafen
+       private $harborInstance = null;
+
+       // Konstruktor
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/constructions/harbors/.htaccess b/application/shipsimu/classes/constructions/harbors/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/constructions/harbors/class_Harbor.php b/application/shipsimu/classes/constructions/harbors/class_Harbor.php
new file mode 100644 (file)
index 0000000..cf350ce
--- /dev/null
@@ -0,0 +1,87 @@
+<?php
+/**
+ * A harbor class suitable for all kind of harbors
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Harbor extends BaseConstruction {
+       // Namen des Hafens (z.B. Hamburger Hafen)
+       private $harborName = "Unbekannter Hafen";
+
+       // Schiffsliste aller gebauten Schiffe
+       private $constructedShips = null;
+
+       // Liegeplatz-Liste
+       private $berthList = null;
+
+       // List of all assigned shipyards
+       private $shipyardList = null;
+
+       // Constructor
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       // Creates a harbor
+       public static final function createHarbor ($harborName) {
+               // Hafen-Instanz holen
+               $harborInstance = new Harbor();
+
+               // Hafenname setzen
+               $harborInstance->setHarborName($harborName);
+
+               // Werftliste initialisieren
+               $harborInstance->createshipyardList();
+
+               // Instanz zurueckliefern
+               return $harborInstance;
+       }
+
+       // Werft-Liste generieren
+       public function createshipyardList () {
+               $this->shipyardList = new FrameworkArrayObject("FakedShipyardList");
+       }
+
+       // Setter fuer Hafennamen
+       public final function setHarborName ($harborName) {
+               $this->harborName = (string) $harborName;
+       }
+
+       // Getter fuer Hafennamen
+       public final function getHarborName () {
+               return $this->harborName;
+       }
+
+       // Werft in den Hafen einbauen und Werft->Reederei zuweisen
+       public function addNewShipyardNotify ($shipyardName, ShippingCompany $companyInstance) {
+               // Werft generieren und in die Werftliste aufnehmen
+               $this->shipyardList->append(Shipyard::createShipyardNotify($this, $shipyardName, $companyInstance));
+       }
+
+       // Werft in den Hafen einbauen ohne Zuweisung einer Reederei (gehoert der "Stadt" dann)
+       public function addNewShipyard ($shipyardName) {
+               // Werft generieren und in die Werftliste aufnehmen
+               $this->shipyardList->append(Shipyard::createShipyard($this, $shipyardName));
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/constructions/terminals/.htaccess b/application/shipsimu/classes/constructions/terminals/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/constructions/terminals/class_Terminal.php b/application/shipsimu/classes/constructions/terminals/class_Terminal.php
new file mode 100644 (file)
index 0000000..9ae9985
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * A terminal class where ships can land and passengers can board the ship
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Terminal extends BaseConstruction {
+       // Zugewiesener Hafen
+       private $harborInstance = null;
+
+       // Konstruktor
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/constructions/yards/.htaccess b/application/shipsimu/classes/constructions/yards/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/constructions/yards/class_Shipyard.php b/application/shipsimu/classes/constructions/yards/class_Shipyard.php
new file mode 100644 (file)
index 0000000..1959f83
--- /dev/null
@@ -0,0 +1,215 @@
+<?php
+/**
+ * A shipyard construction class which can be used for constructing all kinds of
+ * ships.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Shipyard extends BaseConstruction {
+       // Werft-Name
+       private $shipyardName    = "Namenlose Werft";
+
+       // Arbeiter-Liste
+       private $staffList = null;
+
+       // Queue-Liste fuer zu bauende Schiffe
+       private $queueList = null;
+
+       // Aktuell im Bau befindliches Schiff
+       private $currShipInConst = null;
+
+       // Liste konstruierbarer Schiffstypen
+       private $shipTypeList = null;
+
+       // Zugewiesener Hafen
+       private $harborInstance = null;
+
+       // Zugewiesene Reederei
+       private $shippingCompany = null;
+
+       // Constructor
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Staff-Liste/Schiffstyp-Liste erzeugen
+               $this->createStaffList();
+               $this->createShipTypeList();
+       }
+
+       // Create a shipyard and notify it about it's owner
+       public static final function createShipyardNotify (Harbor $harborInstance, $shipyardName, ShippingCompany $companyInstance) {
+               // Werft-Instanz holen
+               $shipyardInstance = self::createShipyard($harborInstance, $shipyardName);
+
+               // Reederei der Werft zuweisen
+               $shipyardInstance->setCompanyInstance($companyInstance);
+
+               // Die Reederei ueber ihre Werft informieren
+               $companyInstance->addNewShipyard($shipyardInstance);
+
+               // Instanz zurueckgeben
+               return $shipyardInstance;
+       }
+
+       // Create a shipyard, first we need to create a harbor
+       public static final function createShipyard (Harbor $harborInstance, $shipyardName) {
+               // Instanz temporaer holen
+               $shipyardInstance = new Shipyard();
+
+               // Debug message
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Eine Werft mit dem Namen <strong>%s</strong> wird im Hafen <strong>%s</strong> konstruiert.",
+                       __CLASS__,
+                       __LINE__,
+                       $shipyardName,
+                       $harborInstance->getHarborName()
+               ));
+
+               // Werft-Name setzen
+               $shipyardInstance->setShipyardName($shipyardName);
+
+               // Hafen-Instanz setzen
+               $shipyardInstance->setHarborInstance($harborInstance);
+
+               // Abmasse setzen in Meter
+               $shipyardInstance->setWidth(30);
+               $shipyardInstance->setHeight(30);
+               $shipyardInstance->setLength(100);
+
+               // Clean up a little
+               $shipyardInstance->removeDraught();
+
+               // Debug-Meldung
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Die Werft <strong>%s</strong> wurde gebaut.",
+                       __CLASS__,
+                       __LINE__,
+                       $shipyardName
+               ));
+
+               // Instanz zurueckliefern
+               return $shipyardInstance;
+       }
+
+       // Create staff list
+       private function createStaffList () {
+               $this->staffList = new FrameworkArrayObject("FakedStaffList");
+       }
+
+       // Create ship type list
+       private function createShipTypeList () {
+               $this->shipTypeList = new FrameworkArrayObject("FakedShipTypeList");
+       }
+
+       // Setter-Methode fuer Werft-Name
+       public final function setShipyardName ($shipyardName) {
+               $this->shipyardName = (string) $shipyardName;
+       }
+
+       // Getter-Methode fuer Werft-Name
+       public final function getShipyardName () {
+               return $this->shipyardName;
+       }
+
+       // Setter-Methode fuer Hafen-Instanz
+       public final function setHarborInstance (Harbor $harborInstance) {
+               $this->harborInstance = $harborInstance;
+       }
+
+       // Getter-Methode fuer Hafen-Instanz
+       public final function getHarborInstance () {
+               return $this->harborInstance;
+       }
+
+       // Setter fuer Reederei-Instanz
+       public final function setCompanyInstance (ShippingCompany $companyInstance) {
+               $this->shippingCompany = $companyInstance;
+       }
+
+       // Getter fuer Reederei-Instanz
+       public final function getCompanyInstance () {
+               return $this->shippingCompany;
+       }
+
+       // Add new personell
+       public function addNewPersonell ($personell) {
+               // Add to list
+               $this->staffList->append($personell);
+       }
+
+       // Add a new ship type to our list
+       public function addNewConstructableShipType ($shipType) {
+               // This must be a string!
+               $shipType = (string) $shipType;
+
+               // Debug message
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft <strong>%s</strong> kann bald Schiffe vom Typ <strong>%s</strong> bauen.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getShipyardName(),
+                       $shipType
+               ));
+
+               // Add to list
+               $this->shipTypeList->append($shipType);
+       }
+
+       // Is the specified ship type in our list?
+       public function isShipTypeConstructable ($shipType) {
+               // First we can't build this ship
+               $result = false;
+
+               // This must be a string!
+               $shipType = (string) $shipType;
+
+               // Debug message
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft <strong>%s</strong> pr&uuml;ft, ob Schiffe vom Typ <strong>%s</strong> baubar sind.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getShipyardName(),
+                       $shipType
+               ));
+
+               // Iterate through all types
+               for ($idx = $this->shipTypeList->getIterator(); $idx->valid(); $idx->next()) {
+                       // Get current ship type
+                       $type = (string) $idx->current();
+
+                       // Is both the same?
+                       $result = ($type == $shipType);
+
+                       // Type is found?
+                       if ($result) break; // Then abort the search!
+               }
+
+               // Debug message
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft <strong>%s</strong> hat die Suche nach dem Schiffstyp <strong>%s</strong> abgeschlossen.",
+                       __CLASS__,
+                       __LINE__,
+                       $this->getShipyardName(),
+                       $shipType
+               ));
+
+               // Return result
+               return $result;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/controller/.htaccess b/application/shipsimu/classes/controller/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/controller/html/.htaccess b/application/shipsimu/classes/controller/html/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/controller/html/class_HtmlCompanyController.php b/application/shipsimu/classes/controller/html/class_HtmlCompanyController.php
new file mode 100644 (file)
index 0000000..741cc5a
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Controller for company requests
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HtmlCompanyController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some filters to this controller
+        */
+       public static final function createHtmlCompanyController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new HtmlCompanyController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // User auth filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+               // User update filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter'));
+
+               // News fetcher filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
+
+               // News proccess/display-preparation
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
+
+               // Return the prepared instance
+               return $controllerInstance;
+       }
+
+       /**
+        * Handles the given request and response
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Try to run the pre filters, if auth exceptions come through redirect here
+               try {
+                       // Run the pre filters
+                       $this->executePreFilters($requestInstance, $responseInstance);
+               } catch (UserAuthorizationException $e) {
+                       // Redirect to main page
+                       $responseInstance->redirectToConfiguredUrl('login_failed');
+
+                       // Exit here
+                       exit();
+               }
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Run the pre filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/controller/html/class_HtmlGovernmentFailedController.php b/application/shipsimu/classes/controller/html/class_HtmlGovernmentFailedController.php
new file mode 100644 (file)
index 0000000..217b6b5
--- /dev/null
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Controller for failed government requests
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class HtmlGovernmentFailedController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        * @todo        Add some filters to this controller
+        */
+       public static final function createHtmlGovernmentFailedController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new HtmlGovernmentFailedController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // User auth filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter'));
+
+               // User update filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter'));
+
+               // News fetcher filter
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter'));
+
+               // News proccess/display-preparation
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter'));
+
+               // Return the prepared instance
+               return $controllerInstance;
+       }
+
+       /**
+        * Handles the given request and response
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Try to run the pre filters, if auth exceptions come through redirect here
+               try {
+                       // Run the pre filters
+                       $this->executePreFilters($requestInstance, $responseInstance);
+               } catch (UserAuthorizationException $e) {
+                       // Redirect to main page
+                       $responseInstance->redirectToConfiguredUrl('login_failed');
+
+                       // Exit here
+                       exit();
+               }
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Run the pre filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/drives/.htaccess b/application/shipsimu/classes/drives/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/drives/class_BaseDrive.php b/application/shipsimu/classes/drives/class_BaseDrive.php
new file mode 100644 (file)
index 0000000..56f9802
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+/**
+ * A general drive class for all kind of "drives".
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseDrive extends BaseSimulator {
+       // Price of this drive
+       private $price      = 0.00;
+       // PS-Zahl
+       private $horsePower = 0;
+       // Anzahl Nocken
+       private $numCams    = 0;
+
+       // Konstruktor
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       // Setter-Methode fuert PS-Zahl
+       public final function setHorsePower ($hp) {
+               $this->horsePower = (int) $hp;
+       }
+
+       // Setter-Methode fuer Nockenanzahl
+       public final function setNumCams ($cams) {
+               $this->numCams = (int) $cams;
+       }
+
+       // Setter for price
+       public final function setPrice ($price) {
+               $this->price = (float) $price;
+       }
+
+       // Getter for price
+       public final function getPrice () {
+               return $this->price;
+       }
+
+       public final function removePrice () {
+               unset($this->price);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/drives/motor/.htaccess b/application/shipsimu/classes/drives/motor/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/drives/motor/class_Motor.php b/application/shipsimu/classes/drives/motor/class_Motor.php
new file mode 100644 (file)
index 0000000..2f3479e
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/**
+ * A motorized drive for bigger ships
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class Motor extends BaseDrive implements TradeableItem, ConstructableShipPart {
+       // Constructor
+       protected function __construct() {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       // Einen Motor erstellen
+       public static final function createMotor ($descr, $hp, $cams, $w, $h, $l) {
+               // Get new instance
+               $motorInstance = new Motor();
+
+               // Beschreibung und Abmasse setzen
+               $motorInstance->setWidth($w);
+               $motorInstance->setHeight($h);
+               $motorInstance->setLength($l);
+
+               // Weitere Daten setzen
+               $motorInstance->setHorsePower($hp);
+               $motorInstance->setNumCams($cams);
+
+               // Instanz zurueckgeben
+               return $motorInstance;
+       }
+
+       // Overwritten method for tradeable items
+       public function isTradeable () {
+               return true;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/factories/.htaccess b/application/shipsimu/classes/factories/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/factories/class_ShipSimuWebNewsFactory.php b/application/shipsimu/classes/factories/class_ShipSimuWebNewsFactory.php
new file mode 100644 (file)
index 0000000..e42b021
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/**
+ * A class for the special news object factory
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ShipSimuWebNewsFactory extends BaseFrameworkSystem {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return              $factoryInstance        An instance of this class
+        */
+       public static final function createShipSimuWebNewsFactory () {
+               // Get a new instance
+               $factoryInstance = new ShipSimuWebNewsFactory();
+
+               // Return the prepared instance
+               return $factoryInstance;
+       }
+
+       /**
+        * Create the news object itself here depending on the request
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @return      $newsInstance           An instance of a news class
+        */
+       public function createNewObject (Requestable $requestInstance) {
+               // Do some stuff here
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/filter/.htaccess b/application/shipsimu/classes/filter/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/filter/book/.htaccess b/application/shipsimu/classes/filter/book/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/filter/book/refill/.htaccess b/application/shipsimu/classes/filter/book/refill/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php b/application/shipsimu/classes/filter/book/refill/class_RefillRequestCurrencyTestBookFilter.php
new file mode 100644 (file)
index 0000000..b7ff113
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/**
+ * A filter for currency booking in refill requests. This filter shall "book" the
+ * requested amount of points directly on the users account. This filter is for
+ * testing/developing only and was needed for the first developement stage of the
+ * game. You should not really use this filter on your "live-system".
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class RefillRequestCurrencyTestBookFilter extends BaseShipSimuFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public static final function createRefillRequestCurrencyTestBookFilter () {
+               // Get a new instance
+               $filterInstance = new RefillRequestCurrencyTestBookFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        Add code being executed in this filter
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute the parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Get the user instance from registry
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Run the update
+               $userInstance->bookAmountDirectly($requestInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/filter/class_ b/application/shipsimu/classes/filter/class_
new file mode 100644 (file)
index 0000000..20653ff
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/**
+ * A filter for money refill page
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Filter extends BaseShipSimuFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function create???Filter () {
+               // Get a new instance
+               $filterInstance = new ???Filter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        Add code being executed in this filter
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute the parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               $this->partialStub("Add code here for your specific filter.");
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/filter/class_BaseShipSimuFilter.php b/application/shipsimu/classes/filter/class_BaseShipSimuFilter.php
new file mode 100644 (file)
index 0000000..7a80cf2
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A general filter class for Ship-Simu
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseShipSimuFilter extends BaseFilter {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the filter class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        Add something to do on every filter
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Add something to do on every filter
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/filter/government/.htaccess b/application/shipsimu/classes/filter/government/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php b/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysStartupHelpFilter.php
new file mode 100644 (file)
index 0000000..7becf12
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A filter for checking if government can pay startup helps
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ShipSimuGovernmentPaysStartupHelpFilter extends BaseShipSimuFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public static final function createShipSimuGovernmentPaysStartupHelpFilter () {
+               // Get a new instance
+               $filterInstance = new ShipSimuGovernmentPaysStartupHelpFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute the parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Get the user instance from registry
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Now simply check for it
+               if ((!$userInstance instanceof ManageableMember) || ($userInstance->ifGovernmentPaysStartupHelp() === false)) {
+                       // Request is invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Redirect to configured URL
+                       $responseInstance->redirectToConfiguredUrl('login_government_startup_failed');
+
+                       // Stop processing here
+                       exit();
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php b/application/shipsimu/classes/filter/government/class_ShipSimuGovernmentPaysTrainingFilter.php
new file mode 100644 (file)
index 0000000..75eb1cc
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A filter for checking if government can pay a training for current user
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ShipSimuGovernmentPaysTrainingFilter extends BaseShipSimuFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance                 An instance of this filter class
+        */
+       public static final function createShipSimuGovernmentPaysTrainingFilter () {
+               // Get a new instance
+               $filterInstance = new ShipSimuGovernmentPaysTrainingFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Execute the parent execute method
+               parent::execute($requestInstance, $responseInstance);
+
+               // Get the user instance from registry
+               $userInstance = Registry::getRegistry()->getInstance('user');
+
+               // Now simply check for it
+               if ((!$userInstance instanceof ManageableMember) || ($userInstance->ifGovernmentPaysTraining() === false)) {
+                       // Request is invalid
+                       $requestInstance->requestIsValid(false);
+
+                       // Redirect to configured URL
+                       $responseInstance->redirectToConfiguredUrl('login_government_training_failed');
+
+                       // Stop processing here
+                       exit();
+