adding Shortcut/Dashlet reload icon.

This commit is contained in:
Matthew Wilson 2005-12-08 03:46:36 +00:00
parent 2e0c3dc48c
commit a421e5297a
5 changed files with 55 additions and 7 deletions

View file

@ -69,6 +69,7 @@ sub convertDashboardPrefs {
WebGUI::SQL->write("ALTER TABLE `Dashboard` ADD COLUMN `assetsToHide` TEXT");
WebGUI::SQL->write("ALTER TABLE `Shortcut` ADD COLUMN `prefFieldsToShow` TEXT");
WebGUI::SQL->write("ALTER TABLE `Shortcut` ADD COLUMN `prefFieldsToImport` TEXT");
WebGUI::SQL->write("ALTER TABLE `Shortcut` ADD COLUMN `showReloadIcon` TINYINT UNSIGNED NOT NULL DEFAULT 0");
}
#-------------------------------------------------

View file

@ -200,6 +200,10 @@ sub definition {
prefFieldsToImport=>{
fieldType=>"checkList",
defaultValue=>undef
},
showReloadIcon=>{
fieldType=>"yesNo",
defaultValue=>1
}
}
});
@ -264,18 +268,23 @@ sub getEditForm {
},
-extras=>$self->{_disabled}
);
$tabform->getTab("properties")->readOnly(
-value=>$self->_drawQueryBuilder(),
-label=>WebGUI::International::get("Criteria","Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get("Criteria description","Asset_Shortcut")
);
$tabform->getTab("properties")->readOnly(
-value=>$self->_drawQueryBuilder(),
-label=>WebGUI::International::get("Criteria","Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get("Criteria description","Asset_Shortcut")
);
}
$tabform->addTab('overrides',$i18n->get('Overrides'));
$tabform->getTab('overrides')->raw($self->getOverridesList);
if ($self->isDashlet) {
$tabform->addTab('preferences',$i18n->get('Preferences'));
$tabform->getTab('preferences')->raw($self->getFieldsList);
$tabform->getTab("properties")->yesNo(
-value=>$self->getValue("showReloadIcon"),
-name=>"showReloadIcon",
-label=>WebGUI::International::get("show reload icon","Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get("show reload icon description","Asset_Shortcut")
);
}
return $tabform;
}
@ -425,6 +434,7 @@ sub getShortcut {
foreach my $override (keys %overrides) {
$self->{_shortcut}{_properties}{$override} = $overrides{$override}{parsedValue};
}
$self->{_shortcut}{_properties}{showReloadIcon} = $self->get("showReloadIcon");
}
return $self->{_shortcut};
}

View file

@ -220,6 +220,7 @@ sub view {
dashletTitle=>$child->{_properties}{title},
shortcutUrl=>$child->getUrl,
canPersonalize=>$self->canPersonalize,
showReloadIcon=>$child->{_properties}{showReloadIcon},
canEditUserPrefs=>(($session{user}{userId} ne '1') && (ref $child eq 'WebGUI::Asset::Shortcut') && (scalar($child->getPrefFieldsToShow) > 0))
});
$newStuff .= 'available_dashlets["'.$child->getId.'"]=\''.$child->getUrl.'\';';
@ -231,6 +232,7 @@ sub view {
dashletTitle=>$child->{_properties}{title},
shortcutUrl=>$child->getUrl,
canPersonalize=>$self->canPersonalize,
showReloadIcon=>$child->{_properties}{showReloadIcon},
canEditUserPrefs=>(($session{user}{userId} ne '1') && (ref $child eq 'WebGUI::Asset::Shortcut') && (scalar($child->getPrefFieldsToShow) > 0))
});
$newStuff .= 'available_dashlets["'.$child->getId.'"]=\''.$child->getUrl.'\';';
@ -252,6 +254,7 @@ sub view {
content=>'',
dashletTitle=>$child->getTitle,
shortcutUrl=>$child->getUrl,
showReloadIcon=>$child->{_properties}{showReloadIcon},
canPersonalize=>$self->canPersonalize,
canEditUserPrefs=>(($session{user}{userId} ne '1') && (ref $child eq 'WebGUI::Asset::Shortcut') && (scalar($child->getPrefFieldsToShow) > 0))
});

View file

@ -395,6 +395,16 @@ The word "Shortcut".</p>
lastUpdated => 1133619940,
},
'show reload icon' => {
message => q|Show Reload Icon?|,
lastUpdated => 1133619940,
},
'show reload icon description' => {
message => q|Whether or not to show the yellow reload dashlet icon on this Shortcut/Dashlet.|,
lastUpdated => 1133619940,
},

View file

@ -532,4 +532,28 @@ function dashboard_toggleEditForm(event,shortcutId,shortcutUrl) {
}
}
);
}
}
function dashboard_reloadDashlet(event,shortcutId,shortcutUrl) {
//discover if form is there.
var existingForm = document.getElementById("form" + shortcutId + "_div");
if (existingForm) {
var throwAway = existingForm.parentNode.removeChild(existingForm);
return;
}
// Reload the content div.
contentDiv = document.getElementById("ct" + shortcutId + "_div");
var hooha = AjaxRequest.get(
{
'url':shortcutUrl
,'parameters':{
'func':"ajaxInlineView"
}
,'onSuccess':function(req){
var myArr558 = req.responseText.split(/beginDebug/mg,1);
contentDiv.innerHTML = myArr558[0];
}
}
);
}