some bug fixes

This commit is contained in:
JT Smith 2006-05-25 00:20:39 +00:00
parent e1fee84dc5
commit 15bb672c3c
8 changed files with 147 additions and 32 deletions

View file

@ -1,4 +1,5 @@
6.99.2
- Added UI Levels to asset toolbar icons, as discussed in Community IRC.
- Data Forms now send email as HTML.
- Added full drag bar to the top of each asset as discussed in Community IRC.
- fixed a bug in the project management app that was causing a no privilege error when trying to display the view.
@ -24,7 +25,7 @@
page.
- Added a context menu to the last item in the crumb trail in the asset
manager as discussed in Community IRC.
- Login boxes are now Section 508 compliant.
- Login boxes are now Section 508 compliant as discussed in Community IRC.
6.99.1
- Bugfixes on dashboard to fix template errors.

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,57 @@
#PBtmpl0000000000000207
#create
#namespace:Article
#url:article-with-files
#title:Article with Files
#menuTitle:Article with Files
<a name="id<tmpl_var assetId>" id="id<tmpl_var assetId>"></a>
<tmpl_if session.var.adminOn>
<p><tmpl_var controls></p>
</tmpl_if>
<tmpl_if displayTitle>
<h2><tmpl_var title></h2>
</tmpl_if>
<tmpl_if pagination.isFirstPage>
</tmpl_if>
<tmpl_if description>
<tmpl_var description>
</tmpl_if>
<tmpl_if pagination.isLastPage>
<tmpl_if linkUrl>
<tmpl_if linkTitle>
<p />
<a href="<tmpl_var linkUrl>"><tmpl_var linkTitle></a>
</tmpl_if>
</tmpl_if>
<tmpl_loop attachment_loop>
<p style="display:inline;vertical-align:middle;"><a href="<tmpl_var url>"><img src="<tmpl_var icon>" style="vertical-align:middle;border: 0px;" alt="<tmpl_var filename>" /> <tmpl_var filename></a></p><br />
</tmpl_loop>
</tmpl_if>
<tmpl_if pagination.pageCount.isMultiple>
<tmpl_var pagination.previousPage>
&#183;
<tmpl_var pagination.pageList.upTo20>
&#183;
<tmpl_var pagination.nextPage>
</tmpl_if>
<tmpl_if pagination.isFirstPage>
</tmpl_if>
<tmpl_if pagination.isLastPage>
<tmpl_if allowDiscussion>
<p>
<table width="100%" cellspacing="2" cellpadding="1" border="0">
<tr>
<td align="center" width="50%" class="tableMenu"><a href="<tmpl_var replies.URL>"><tmpl_var replies.label> (<tmpl_var replies.count>)</a></td>
<td align="center" width="50%" class="tableMenu"><a href="<tmpl_var post.url>"><tmpl_var post.label></a></td>
</tr>
</table>
</tmpl_if>
</tmpl_if>

View file

@ -22,12 +22,35 @@ my $session = start(); # this line required
# upgrade functions go here
updateTT();
addToolbarUiLevels();
finish($session); # this line required
#-------------------------------------------------
sub addToolbarUiLevels {
print "\tAdding asset toolbar UI levels.\n" unless ($quiet);
$session->config->set("assetToolbarUiLevel", {
"edit" => 1,
"delete" => 1,
"cut" => 1,
"copy" => 1,
"shortcut" => 5,
"editBranch" => 9,
"lock" => 5,
"export" => 9,
"changeUrl" => 9,
"promote" => 3,
"demote" => 3,
"manage" => 5,
"revisions" => 5,
"view" => 1
});
}
#-------------------------------------------------
sub updateTT {
print "\tUpdating the Time Tracking System.\n" unless ($quiet);
my $tableList = [
"create table TT_projectTasks (
taskId varchar(22) binary not null,
@ -60,7 +83,6 @@ sub updateTT {
"alter table TT_timeEntry drop column lastUpdateDate"
];
print "\tUpdating the Time Tracking System.\n" unless ($quiet);
foreach (@{$tableList}) {
$session->db->write($_);
}

View file

@ -218,6 +218,25 @@
# "WebGUI::Asset::RichEdit" : 4
# },
# Configure the UI Levels of the asset toolbar links.
"assetToolbarUiLevel" : {
"edit" : 1,
"delete" : 1,
"cut" : 1,
"copy" : 1,
"shortcut" : 5,
"editBranch" : 9,
"lock" : 5,
"export" : 9,
"changeUrl" : 9,
"promote" : 3,
"demote" : 3,
"manage" : 5,
"revisions" : 5,
"view" : 1
},
# You can override the UI Levels of any field in the edit form of
# any asset using the following variables. Basically just take the
# class name of the asset separated by underscores, and append

View file

@ -897,43 +897,56 @@ sub getToolbar {
my $self = shift;
return undef unless $self->canEdit;
return $self->{_toolbar} if (exists $self->{_toolbar});
my $userUiLevel = $self->session->user->profileField("uiLevel");
my $uiLevels = $self->session->config->get("assetToolbarUiLevel");
my $i18n = WebGUI::International->new($self->session, "Asset");
my $toolbar = "";
my $commit;
if ($self->canEditIfLocked) {
$toolbar .= $self->session->icon->delete('func=delete',$self->get("url"),$i18n->get(43));
$toolbar .= $self->session->icon->edit('func=edit',$self->get("url"));
$toolbar .= $self->session->icon->delete('func=delete',$self->get("url"),$i18n->get(43)) if ($userUiLevel >= $uiLevels->{"delete"});
$toolbar .= $self->session->icon->edit('func=edit',$self->get("url")) if ($userUiLevel >= $uiLevels->{"edit"});
} else {
$toolbar .= $self->session->icon->locked('func=manageRevisions',$self->get("url"));
$toolbar .= $self->session->icon->locked('func=manageRevisions',$self->get("url")) if ($userUiLevel >= $uiLevels->{"revisions"});
}
$toolbar .= $self->session->icon->cut('func=cut',$self->get("url"))
.$self->session->icon->copy('func=copy',$self->get("url"));
$toolbar .= $self->session->icon->shortcut('func=createShortcut',$self->get("url")) unless ($self->get("className") =~ /Shortcut/);
$toolbar .= $self->session->icon->cut('func=cut',$self->get("url")) if ($userUiLevel >= $uiLevels->{"cut"});
$toolbar .= $self->session->icon->copy('func=copy',$self->get("url")) if ($userUiLevel >= $uiLevels->{"copy"});
$toolbar .= $self->session->icon->shortcut('func=createShortcut',$self->get("url")) if ($userUiLevel >= $uiLevels->{"shortcut"} && !($self->get("className") =~ /Shortcut/));
$self->session->style->setLink($self->session->url->extras('contextMenu/contextMenu.css'), {rel=>"stylesheet",type=>"text/css"});
$self->session->style->setScript($self->session->url->extras('contextMenu/contextMenu.js'), {type=>"text/javascript"});
my $lock = "";
if (!$self->isLocked) {
$lock = 'contextMenu.addLink("'.$self->getUrl("func=lock").'","'.$i18n->get("lock").'");';
my $output = '<script type="text/javascript">
//<![CDATA[
var contextMenu = new contextMenu_createWithImage("'.$self->getIcon(1).'","'.$self->getId.'","'.$self->getName.'");';
if ($userUiLevel >= $uiLevels->{"lock"} && !$self->isLocked) {
$output .= 'contextMenu.addLink("'.$self->getUrl("func=lock").'","'.$i18n->get("lock").'");';
}
my $export = "";
if (defined $self->session->config->get("exportPath")) {
$export = 'contextMenu.addLink("'.$self->getUrl("func=export").'","'.$i18n->get("Export","Icon").'");';
if ($userUiLevel >= $uiLevels->{"changeUrl"}) {
$output .= 'contextMenu.addLink("'.$self->getUrl("func=changeUrl").'","'.$i18n->get("change url").'");';
}
return '<script type="text/javascript">
//<![CDATA[
var contextMenu = new contextMenu_createWithImage("'.$self->getIcon(1).'","'.$self->getId.'","'.$self->getName.'");
'.$lock.'
contextMenu.addLink("'.$self->getUrl("func=changeUrl").'","'.$i18n->get("change url").'");
'.$export.'
contextMenu.addLink("'.$self->getUrl("func=editBranch").'","'.$i18n->get("edit branch").'");
contextMenu.addLink("'.$self->getUrl("func=promote").'","'.$i18n->get("promote").'");
contextMenu.addLink("'.$self->getUrl("func=demote").'","'.$i18n->get("demote").'");
contextMenu.addLink("'.$self->getUrl("func=manageAssets").'","'.$i18n->get("manage").'");
contextMenu.addLink("'.$self->getUrl("func=manageRevisions").'","'.$i18n->get("revisions").'");
contextMenu.addLink("'.$self->getUrl.'","'.$i18n->get("view").'");
contextMenu.print();
//]]>
</script>'.$toolbar;
if ($userUiLevel >= $uiLevels->{"export"} && defined $self->session->config->get("exportPath")) {
$output .= 'contextMenu.addLink("'.$self->getUrl("func=export").'","'.$i18n->get("Export","Icon").'");';
}
if ($userUiLevel >= $uiLevels->{"editBranch"}) {
$output .= 'contextMenu.addLink("'.$self->getUrl("func=editBranch").'","'.$i18n->get("edit branch").'");';
}
if ($userUiLevel >= $uiLevels->{"promote"}) {
$output .= 'contextMenu.addLink("'.$self->getUrl("func=promote").'","'.$i18n->get("promote").'");';
}
if ($userUiLevel >= $uiLevels->{"demote"}) {
$output .= 'contextMenu.addLink("'.$self->getUrl("func=demote").'","'.$i18n->get("demote").'");';
}
if ($userUiLevel >= $uiLevels->{"manage"}) {
$output .= 'contextMenu.addLink("'.$self->getUrl("func=manageAssets").'","'.$i18n->get("manage").'");';
}
if ($userUiLevel >= $uiLevels->{"revisions"}) {
$output .= 'contextMenu.addLink("'.$self->getUrl("func=manageRevisions").'","'.$i18n->get("revisions").'");';
}
if ($userUiLevel >= $uiLevels->{"view"}) {
$output .= 'contextMenu.addLink("'.$self->getUrl.'","'.$i18n->get("view").'");';
}
$output .= 'contextMenu.print();
//]]>
</script>'.$toolbar;
return $output;
}
#-------------------------------------------------------------------
@ -1268,7 +1281,7 @@ sub manageAssetsSearch {
$output .= WebGUI::Form::formFooter($self->session);
$self->session->output->print($output);
$output = '';
return undef unless ($self->session->form->get("doit"));
return undef unless ($self->session->form->get("doit") && $self->session->form->get("keywords") ne "");
my $class = $self->session->form->process("class","className") eq "any" ? undef : $self->session->form->process("class","className");
my $assets = WebGUI::Search->new($self->session,0)->search({
keywords=>$self->session->form->get("keywords"),

View file

@ -83,6 +83,10 @@ sub getAssets {
my @assets = ();
while (my ($id, $class, $version) = $rs->array) {
my $asset = WebGUI::Asset->new($self->session, $id, $class, $version);
unless (defined $asset) {
$self->session->errorHandler->warn("Search index contains assetId $id even though it no longer exists.");
next;
}
push(@assets, $asset);
}
return \@assets;

View file

@ -82,7 +82,6 @@ function contextMenu_draw(){
output += '<img src="' + this.imagePath + '" id="contextMenu_' + this.id + '" onclick="return contextMenu_renderLeftClick(\'contextMenu_' + this.id + '_menu\',event)" alt="' + this.name + '" title="' + this.name + '" align="absmiddle" />';
} else {
output += '<a href="#" id="contextMenu_' + this.id + '" onclick="return contextMenu_renderLeftClick(\'contextMenu_' + this.id + '_menu\',event)">' + this.name + '</a>';
//output += '<a href="javascript:contextMenu_renderLeftClick(\'contextMenu_' + this.id + '_menu\',event)" id="contextMenu_' + this.id + '">' + this.name + '</a>';
}
return output;
}