- Internationalized a bunch of stuff that was previously uninternationalized.

- Fixed a bug in the survey that caused users to not be able to submit
   survey's.
- added context menu to nav toolbar
- added a switch to disable content locking on alternate criteria shortcuts.
This commit is contained in:
JT Smith 2005-05-03 22:01:07 +00:00
parent d8a6eb332c
commit b631cbb2f4
9 changed files with 147 additions and 25 deletions

View file

@ -57,6 +57,10 @@ sub definition {
fieldType=>"yesNo",
defaultValue=>0,
},
disableContentLock=>{
fieldType=>"yesNo",
defaultValue=>0
},
resolveMultiples=>{
fieldType=>"selectList",
defaultValue=>"mostRecent",
@ -137,6 +141,11 @@ sub getEditForm {
this.form.proxyCriteria.disabled=true;
}"|
);
$tabform->getTab("properties")->yesNo(
-name=>"disableContentLock",
-value=>$self->getValue("disableContentLock"),
-label=>WebGUI::International::get("disable content lock","Asset_Shortcut")
);
if ($self->getValue("shortcutByCriteria") == 0) {
$self->{_disabled} = 'disabled=true';
}
@ -229,7 +238,7 @@ sub getShortcutByCriteria {
my $scratchId;
if ($assetId) {
$scratchId = "Shortcut_" . $assetId;
if($session{scratch}{$scratchId}) {
if($session{scratch}{$scratchId} && !$self->getValue("disableContentLock")) {
return $session{scratch}{$scratchId} unless ($session{var}{adminOn});
}
}

View file

@ -286,7 +286,14 @@ sub getToolbar {
$returnUrl = "&proceed=goBackToPage&returnUrl=".WebGUI::URL::escape($session{asset}->getUrl);
}
my $toolbar = editIcon('func=edit'.$returnUrl,$self->get("url"));
return '<img src="'.$self->getIcon(1).'" border="0" title="'.$self->getName.'" alt="'.$self->getName.'" align="absmiddle">'.$toolbar;
my $i18n = WebGUI::International->new("Asset");
return '<script type="text/javascript">
var contextMenu = new contextMenu_create("'.$self->getIcon(1).'","'.$self->getId.'","'.$self->getName.'");
contextMenu.addLink("'.$self->getUrl("func=copy").'","'.$i18n->get("copy").'");
contextMenu.addLink("'.$self->getUrl("func=manageAssets").'","'.$i18n->get("manage").'");
contextMenu.addLink("'.$self->getUrl.'","'.$i18n->get("view").'");
contextMenu.draw();
</script>'.$toolbar;
}
return $self->SUPER::getToolbar();
}

View file

@ -589,7 +589,7 @@ sub view {
$var->{question_loop} = $self->getQuestionsLoop($var->{'response.Id'});
}
}
$var->{'form.header'} = WebGUI::Form::formHeader({-action=>$self->getUrl})
$var->{'form.header'} = WebGUI::Form::formHeader({action=>$self->getUrl})
.WebGUI::Form::hidden({
name=>'func',
value=>'respond'
@ -990,7 +990,7 @@ sub www_viewGradebook {
$var->{title} = WebGUI::International::get(71,'Asset_Survey');
my $p = WebGUI::Paginator->new($self->getUrl('func=viewGradebook'));
$p->setDataByQuery("select userId,username,ipAddress,Survey_responseId,startDate,endDate from Survey_response
where isComplete=1 and Survey_id=".quote($self->get("Survey_id"))." order by username,ipAddress,startDate");
where Survey_id=".quote($self->get("Survey_id"))." order by username,ipAddress,startDate");
my $users = $p->getPageData;
($var->{'question.count'}) = WebGUI::SQL->quickArray("select count(*) from Survey_question where Survey_id=".quote($self->get("Survey_id")));
if ($var->{'question.count'} > $self->get("questionsPerResponse")) {