Added the interval method in the forms package and updated those packages that should use it.

This commit is contained in:
JT Smith 2002-08-04 21:31:43 +00:00
parent 5dad94ef4d
commit 12fd555889
8 changed files with 170 additions and 16 deletions

View file

@ -80,7 +80,8 @@ sub www_editGroup {
$f->readOnly($session{form}{gid},WebGUI::International::get(379));
$f->text("groupName",WebGUI::International::get(84),$group{groupName});
$f->textarea("description",WebGUI::International::get(85),$group{description});
$f->integer("expireAfter",WebGUI::International::get(367),$group{expireAfter});
$f->interval("expireAfter",WebGUI::International::get(367),
WebGUI::DateTime::secondsToInterval($group{expireAfter}));
if ($session{setting}{useKarma}) {
$f->integer("karmaThreshold",WebGUI::International::get(538),$group{karmaThreshold});
} else {
@ -122,7 +123,9 @@ sub www_editGroupSave {
WebGUI::SQL->write("insert into groups (groupId) values ($session{form}{gid})");
}
WebGUI::SQL->write("update groups set groupName=".quote($session{form}{groupName}).",
description=".quote($session{form}{description}).", expireAfter='$session{form}{expireAfter}',
description=".quote($session{form}{description}).",
expireAfter='".WebGUI::DateTime::intervalToSeconds($session{form}{expireAfter_interval},
$session{form}{expireAfter_units})."',
karmaThreshold='$session{form}{karmaThreshold}'
where groupId=".$session{form}{gid});
return www_listGroups();

View file

@ -12,6 +12,7 @@ package WebGUI::Operation::Settings;
use Exporter;
use strict;
use WebGUI::DateTime;
use WebGUI::HTMLForm;
use WebGUI::Icon;
use WebGUI::International;
@ -45,7 +46,7 @@ sub www_editUserSettings {
$f->group("onNewUserAlertGroup",WebGUI::International::get(535),[$session{setting}{onNewUserAlertGroup}]);
$f->yesNo("useKarma",WebGUI::International::get(539),$session{setting}{useKarma});
$f->integer("karmaPerLogin",WebGUI::International::get(540),$session{setting}{karmaPerLogin});
$f->integer("sessionTimeout",WebGUI::International::get(142),$session{setting}{sessionTimeout});
$f->interval("sessionTimeout",WebGUI::International::get(142),WebGUI::DateTime::secondsToInterval($session{setting}{sessionTimeout}));
$f->select("authMethod",\%authMethod,WebGUI::International::get(119),[$session{setting}{authMethod}]);
$f->yesNo("usernameBinding",WebGUI::International::get(306),$session{setting}{usernameBinding});
$f->url("ldapURL",WebGUI::International::get(120),$session{setting}{ldapURL});
@ -63,6 +64,8 @@ sub www_editUserSettings {
#-------------------------------------------------------------------
sub www_editUserSettingsSave {
if (WebGUI::Privilege::isInGroup(3)) {
$session{form}{sessionTimeout} = WebGUI::DateTime::intervalToSeconds($session{form}{sessionTimeout_interval},
$session{form}{sessionTimeout_units});
_saveSetting("sessionTimeout");
_saveSetting("onNewUserAlertGroup");
_saveSetting("alertOnNewUser");