Mailinglist Archive: yast-commit (883 mails)
| < Previous | Next > |
[yast-commit] <web-client> master : fixed changing time zone region
- From: Jiří Šrain <jsrain@xxxxxxx>
- Date: Fri, 24 Jul 2009 14:54:33 +0200
- Message-id: <E1MUKHw-0005yW-V6@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 2361e77a782134d3351bfe5599f8b31ee8401da2
Author: JiÅÃ Å rain <jsrain@xxxxxxx>
Date: Fri Jul 24 14:54:33 2009 +0200
fixed changing time zone region
---
.../app/controllers/system_time_controller.rb | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/plugins/systemtime/app/controllers/system_time_controller.rb
b/plugins/systemtime/app/controllers/system_time_controller.rb
index 094c573..d2f215f 100644
--- a/plugins/systemtime/app/controllers/system_time_controller.rb
+++ b/plugins/systemtime/app/controllers/system_time_controller.rb
@@ -140,12 +140,26 @@ class SystemTimeController < ApplicationController
#AJAX function that renders new timezones for selected region. Expected
# initialized values from index call.
def timezones_for_region
- region = ""
+ # since while calling this function there is different instance of the
class
+ # than when calling index, @timezones were empty; reinitialize them
+ # possible FIXME: how does it increase the amount of data transferred?
+ systemtime = load_proxy 'org.opensuse.yast.modules.yapi.time'
+
+ unless systemtime
+ return false #possible FIXME: is returnign false for AJAX correct?
+ end
+
+ @timezones = systemtime.timezones
+
+ region = "" #possible FIXME later it gets class, not a string
@timezones.each do |r|
if r.name == params[:value]
region = r
end
end
+ if region == ""
+ return false; #possible FIXME: is returnign false for AJAX correct?
+ end
render(:partial => 'timezones',
:locals => {:region => region, :default => region.central,
:disabled => ! params[:disabled]=="true"})
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
commit 2361e77a782134d3351bfe5599f8b31ee8401da2
Author: JiÅÃ Å rain <jsrain@xxxxxxx>
Date: Fri Jul 24 14:54:33 2009 +0200
fixed changing time zone region
---
.../app/controllers/system_time_controller.rb | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/plugins/systemtime/app/controllers/system_time_controller.rb
b/plugins/systemtime/app/controllers/system_time_controller.rb
index 094c573..d2f215f 100644
--- a/plugins/systemtime/app/controllers/system_time_controller.rb
+++ b/plugins/systemtime/app/controllers/system_time_controller.rb
@@ -140,12 +140,26 @@ class SystemTimeController < ApplicationController
#AJAX function that renders new timezones for selected region. Expected
# initialized values from index call.
def timezones_for_region
- region = ""
+ # since while calling this function there is different instance of the
class
+ # than when calling index, @timezones were empty; reinitialize them
+ # possible FIXME: how does it increase the amount of data transferred?
+ systemtime = load_proxy 'org.opensuse.yast.modules.yapi.time'
+
+ unless systemtime
+ return false #possible FIXME: is returnign false for AJAX correct?
+ end
+
+ @timezones = systemtime.timezones
+
+ region = "" #possible FIXME later it gets class, not a string
@timezones.each do |r|
if r.name == params[:value]
region = r
end
end
+ if region == ""
+ return false; #possible FIXME: is returnign false for AJAX correct?
+ end
render(:partial => 'timezones',
:locals => {:region => region, :default => region.central,
:disabled => ! params[:disabled]=="true"})
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |