From 542f6850140ccab9621a49066f520522718040a6 Mon Sep 17 00:00:00 2001 From: Matthew Wilson Date: Fri, 18 Nov 2005 17:10:26 +0000 Subject: [PATCH] fixing several misc. bugs. draggable, backToPage, tooLateDates --- lib/WebGUI/Asset.pm | 2 +- lib/WebGUI/Asset/Wobject/Article.pm | 11 ----------- lib/WebGUI/Asset/Wobject/Folder.pm | 2 +- lib/WebGUI/Asset/Wobject/Layout.pm | 12 ++---------- lib/WebGUI/Asset/Wobject/Survey.pm | 13 ++----------- www/extras/draggable.css | 3 +++ www/extras/draggable.js | 15 ++++++++++----- 7 files changed, 19 insertions(+), 39 deletions(-) diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index f707fd227..4c3c0c401 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -202,7 +202,7 @@ sub definition { }, endDate=>{ fieldType=>'dateTime', - defaultValue=>32472169200 + defaultValue=>2082783600 }, status=>{ noFormPost=>1, diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index be99f2e3a..3b72b3089 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -173,16 +173,5 @@ sub view { return $self->processTemplate(\%var, $templateId); } - -#------------------------------------------------------------------- -#sub www_edit { -# my $self = shift; -# return WebGUI::Privilege::insufficient() unless $self->canEdit; -# $self->getAdminConsole->setHelp("article add/edit","Asset_Article"); -# return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get("12","Asset_Article")); -#} - - - 1; diff --git a/lib/WebGUI/Asset/Wobject/Folder.pm b/lib/WebGUI/Asset/Wobject/Folder.pm index 39d3ecb21..82c0fd8d6 100644 --- a/lib/WebGUI/Asset/Wobject/Folder.pm +++ b/lib/WebGUI/Asset/Wobject/Folder.pm @@ -97,7 +97,7 @@ sub getEditForm { $tabform->getTab("properties")->whatNext( -options=>{ view=>WebGUI::International::get(823, "Asset_Folder"), - ""=>WebGUI::International::get(847, "Asset_Folder") + "viewParent"=>WebGUI::International::get(847, "Asset_Folder") }, -value=>"view" ); diff --git a/lib/WebGUI/Asset/Wobject/Layout.pm b/lib/WebGUI/Asset/Wobject/Layout.pm index 985cd881b..ac1681250 100644 --- a/lib/WebGUI/Asset/Wobject/Layout.pm +++ b/lib/WebGUI/Asset/Wobject/Layout.pm @@ -106,7 +106,7 @@ sub getEditForm { $tabform->getTab("properties")->whatNext( -options=>{ view=>WebGUI::International::get(823, 'Asset_Layout'), - ""=>WebGUI::International::get(847, 'Asset_Layout') + viewParent=>WebGUI::International::get(847, 'Asset_Layout') }, -value=>"view" ); @@ -138,7 +138,7 @@ sub getEditForm { #------------------------------------------------------------------- sub view { my $self = shift; - my $children = $self->getLineage( ["children"], { returnObjects=>1, excludeClasses=>["WebGUI::Asset::Wobject::Layout"] }); + my $children = $self->getLineage( ["children"], { returnObjects=>1, excludeClasses=>["WebGUI::Asset::Wobject::Layout","WebGUI::Asset::Wobject::Dashboard"] }); my %vars; # I'm sure there's a more efficient way to do this. We'll figure it out someday. my @positions = split(/\./,$self->get("contentPositions")); @@ -218,14 +218,6 @@ sub view { return $self->processTemplate(\%vars,$self->get("templateId")); } - -#sub www_edit { -# my $self = shift; -# return WebGUI::Privilege::insufficient() unless $self->canEdit; -# $self->getAdminConsole->setHelp("layout add/edit", "Asset_Layout"); -# return $self->getAdminConsole->render($self->getEditForm->print,"Edit Layout"); -#} - sub www_setContentPositions { my $self = shift; return WebGUI::Privilege::insufficient() unless ($self->canEdit); diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index be1c5f1a9..8988dc561 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -158,7 +158,7 @@ sub duplicate { $qdata->{Survey_sectionId} = $sdata->{Survey_sectionId}; $qdata->{Survey_questionId} = $newAsset->setCollateral("Survey_question","Survey_questionId",$qdata,1,0,"Survey_id"); while ($adata = $answers->hashRef) { - $responses = WebGUI::SQL->read("select * from Survey_questionResponse where Survey_answerId=".quote($adata->{Survey_answerId})); + my $responses = WebGUI::SQL->read("select * from Survey_questionResponse where Survey_answerId=".quote($adata->{Survey_answerId})); $adata->{Survey_answerId} = "new"; $adata->{Survey_questionId} = $qdata->{Survey_questionId}; $adata->{Survey_id} = $newSurveyId; @@ -308,7 +308,7 @@ sub getEditForm { $tabform->getTab('properties')->whatNext( -options=>{ editQuestion=>WebGUI::International::get(28,'Asset_Survey'), - backToPage=>WebGUI::International::get(745,'Asset_Survey') + viewParent=>WebGUI::International::get(745,'Asset_Survey') }, -value=>"editQuestion", -hoverHelp => WebGUI::International::get('what next','Asset_Survey'), @@ -795,14 +795,6 @@ sub www_deleteAllResponsesConfirm { return ""; } -#------------------------------------------------------------------- -#sub www_edit { -# my $self = shift; -# return WebGUI::Privilege::insufficient() unless $self->canEdit; -# $self->getAdminConsole->setHelp("survey add/edit","Asset_Survey"); -# return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get(2,'Asset_Survey')); -#} - #------------------------------------------------------------------- sub www_editSave { return WebGUI::Privilege::insufficient() unless ($_[0]->canEdit); @@ -811,7 +803,6 @@ sub www_editSave { $session{form}{qid} = "new"; return $_[0]->www_editQuestion; } - return $output; } diff --git a/www/extras/draggable.css b/www/extras/draggable.css index fba7174dc..e3417afe7 100644 --- a/www/extras/draggable.css +++ b/www/extras/draggable.css @@ -13,6 +13,9 @@ div.dragable:hover { } .dragging{ position: relative; + opacity:0.6; + -moz-opacity:0.6; + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=60); cursor: hand; z-index: 2000; } diff --git a/www/extras/draggable.js b/www/extras/draggable.js index 5e126a497..c255dd095 100644 --- a/www/extras/draggable.js +++ b/www/extras/draggable.js @@ -181,9 +181,9 @@ function dragable_move(e){ } dragable_adjustScrollBars(e); - - z.style.left=temp1+e.clientX-x; - z.style.top=temp2+e.clientY-y; + // alert('x is: '+ (temp1+e.clientX-x)); + z.style.left=(temp1+e.clientX-x)+"px"; + z.style.top=(temp2+e.clientY-y)+"px"; return false }else { @@ -221,8 +221,13 @@ function dragable_dragStart(e){ dragging=true z=fObj; - temp1=parseInt(z.style.left+0) - temp2=parseInt(z.style.top+0) + temp1=z.style.left; + temp1=temp1.replace(/px/g,'')+0; + temp1=parseInt(temp1); + temp2=z.style.top; + temp2=temp2.replace(/px/g,'')+0; + temp2=parseInt(temp2); +// alert(temp1,temp2); x=e.clientX; y=e.clientY; return false