More Matrix bugfixes
This commit is contained in:
parent
931b502666
commit
8ba4f6ef70
6 changed files with 54 additions and 22 deletions
Binary file not shown.
BIN
docs/upgrades/packages-7.6.5/matrix-default-view-template.wgpkg
Normal file
BIN
docs/upgrades/packages-7.6.5/matrix-default-view-template.wgpkg
Normal file
Binary file not shown.
|
|
@ -361,7 +361,8 @@ sub getCompareForm {
|
|||
$maxComparisons = $self->get('maxComparisonsPrivileged');
|
||||
}
|
||||
$form .= "\n<script type='text/javascript'>\n".
|
||||
'var maxComparisons = '.$maxComparisons.';'.
|
||||
'var maxComparisons = '.$maxComparisons.";\n".
|
||||
"var matrixUrl = '".$self->getUrl."';\n".
|
||||
"\n</script>\n";
|
||||
return $form;
|
||||
}
|
||||
|
|
@ -449,7 +450,7 @@ sub view {
|
|||
'text/javascript'});
|
||||
$self->session->style->setScript($self->session->url->extras('wobject/Matrix/matrix.js'), {type =>
|
||||
'text/javascript'});
|
||||
|
||||
|
||||
my $var = $self->get;
|
||||
$var->{isLoggedIn} = ($self->session->user->userId ne "1");
|
||||
$var->{addMatrixListing_url} = $self->getUrl('func=add;class=WebGUI::Asset::MatrixListing');
|
||||
|
|
@ -457,7 +458,7 @@ sub view {
|
|||
$var->{exportAttributes_url} = $self->getUrl('func=exportAttributes');
|
||||
$var->{listAttributes_url} = $self->getUrl('func=listAttributes');
|
||||
$var->{search_url} = $self->getUrl('func=search');
|
||||
|
||||
|
||||
# Get the MatrixListing with the most views as an object using getLineage.
|
||||
my ($bestViews_listing) = @{ $self->getLineage(['descendants'], {
|
||||
includeOnlyClasses => ['WebGUI::Asset::MatrixListing'],
|
||||
|
|
@ -674,6 +675,7 @@ sub www_compare {
|
|||
'var listingIds = new Array('.join(", ",map {'"'.$_.'"'} @listingIds).");\n".
|
||||
'var responseFields = new Array("attributeId", "name", "fieldType", "checked", '.join(", ",map {'"'.$_.'"'} @responseFields).");\n".
|
||||
"var maxComparisons = ".$maxComparisons.";\n".
|
||||
"var matrixUrl = '".$self->getUrl."';\n".
|
||||
"</script>";
|
||||
|
||||
return $self->processStyle($self->processTemplate($var,$self->get("compareTemplateId")));
|
||||
|
|
@ -903,12 +905,12 @@ sub www_getCompareFormData {
|
|||
my $session = $self->session;
|
||||
my $form = $session->form;
|
||||
my $sort = shift || $session->scratch->get('matrixSort') || $self->get('defaultSort');
|
||||
my $sortDirection = ' asc';
|
||||
|
||||
my $sortDirection = ' desc';
|
||||
=cut
|
||||
if ( WebGUI::Utility::isIn($sort, qw(revisionDate score)) ) {
|
||||
$sortDirection = " desc";
|
||||
}
|
||||
|
||||
=cut
|
||||
my @results;
|
||||
my @listingIds = $self->session->form->checkList("listingId");
|
||||
|
||||
|
|
@ -983,7 +985,7 @@ assetData.revisionDate
|
|||
}
|
||||
}
|
||||
$result->{assetId} =~ s/-/_____/g;
|
||||
$result->{url} = "/".$result->{url};
|
||||
$result->{url} = $session->url->gateway($result->{url});
|
||||
}
|
||||
|
||||
my $jsonOutput;
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
];
|
||||
|
||||
var uri = "func=getCompareFormData";
|
||||
if(typeof(listingIds) != 'undefined'){
|
||||
for (var i = 0; i < listingIds.length; i++) {
|
||||
uri = uri+';listingId='+listingIds[i];
|
||||
}
|
||||
if(typeof(listingIds) != 'undefined'){
|
||||
for (var i = 0; i < listingIds.length; i++) {
|
||||
uri = uri+';listingId='+listingIds[i];
|
||||
}
|
||||
}
|
||||
|
||||
this.myDataSource = new YAHOO.util.DataSource("?");
|
||||
this.myDataSource = new YAHOO.util.DataSource(matrixUrl + "?");
|
||||
this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
|
||||
this.myDataSource.connXhrMode = "queueRequests";
|
||||
this.myDataSource.responseSchema = {
|
||||
|
|
@ -47,25 +47,25 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
var btnSortByViews = new YAHOO.widget.Button("sortByViews");
|
||||
btnSortByViews.on("click", function(e) {
|
||||
this.myDataTable.sortColumn(this.myDataTable.getColumn(2));
|
||||
var request = YAHOO.util.Connect.asyncRequest('POST', "?func=setSort;sort=views");
|
||||
var request = YAHOO.util.Connect.asyncRequest('POST', matrixUrl + "?func=setSort;sort=views");
|
||||
},this,true);
|
||||
|
||||
var btnSortByClicks = new YAHOO.widget.Button("sortByClicks");
|
||||
btnSortByClicks.on("click", function(e) {
|
||||
this.myDataTable.sortColumn(this.myDataTable.getColumn(3));
|
||||
var request = YAHOO.util.Connect.asyncRequest('POST', "?func=setSort;sort=clicks");
|
||||
var request = YAHOO.util.Connect.asyncRequest('POST', matrixUrl + "?func=setSort;sort=clicks");
|
||||
},this,true);
|
||||
|
||||
var btnSortByCompares = new YAHOO.widget.Button("sortByCompares");
|
||||
btnSortByCompares.on("click", function(e) {
|
||||
this.myDataTable.sortColumn(this.myDataTable.getColumn(4));
|
||||
var request = YAHOO.util.Connect.asyncRequest('POST', "?func=setSort;sort=compares");
|
||||
var request = YAHOO.util.Connect.asyncRequest('POST', matrixUrl + "?func=setSort;sort=compares");
|
||||
},this,true);
|
||||
|
||||
var btnSortByUpdated = new YAHOO.widget.Button("sortByUpdated");
|
||||
btnSortByUpdated.on("click", function(e) {
|
||||
this.myDataTable.sortColumn(this.myDataTable.getColumn(5));
|
||||
var request = YAHOO.util.Connect.asyncRequest('POST', "?func=setSort;sort=lastUpdated");
|
||||
var request = YAHOO.util.Connect.asyncRequest('POST', matrixUrl + "?func=setSort;sort=lastUpdated");
|
||||
},this,true);
|
||||
|
||||
var myCallback = function() {
|
||||
|
|
@ -77,6 +77,15 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
btnCompare.on("click", function(e) {
|
||||
window.document.forms['doCompare'].submit();
|
||||
},this,true);
|
||||
var btnCompare2 = new YAHOO.widget.Button("compare2",{disabled:true,id:"compareButton2"});
|
||||
btnCompare2.on("click", function(e) {
|
||||
window.document.forms['doCompare'].submit();
|
||||
},this,true);
|
||||
|
||||
var btnSearch = new YAHOO.widget.Button("search");
|
||||
btnSearch.on("click", function(e) {
|
||||
window.location.href = matrixUrl + '?func=search';
|
||||
},this,true);
|
||||
|
||||
window.compareDataTable = this.myDataTable;
|
||||
|
||||
|
|
@ -92,8 +101,10 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
}
|
||||
if (checked > 1 && checked < maxComparisons){
|
||||
btnCompare.set("disabled",false);
|
||||
btnCompare2.set("disabled",false);
|
||||
}else{
|
||||
btnCompare.set("disabled",true);
|
||||
btnCompare2.set("disabled",true);
|
||||
}
|
||||
var elements = window.compareDataTable.getRecordSet().getRecords();
|
||||
for(j=0; j<elements.length; j++){
|
||||
|
|
|
|||
|
|
@ -89,10 +89,13 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
scope : myDataTable
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
var btnCompare = new YAHOO.widget.Button("compare",{disabled:true,id:"compareButton"});
|
||||
btnCompare.on("click", function(e) {
|
||||
var uri = "func=getCompareListData";
|
||||
var compareCheckBoxes = YAHOO.util.Dom.getElementsByClassName('compareCheckBox','input');
|
||||
var uri = "func=getCompareListData";
|
||||
for (var i = compareCheckBoxes.length; i--; ) {
|
||||
if(compareCheckBoxes[i].checked == true){
|
||||
uri = uri+';listingId='+compareCheckBoxes[i].value;
|
||||
|
|
@ -101,6 +104,23 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
this.myDataSource.sendRequest(uri,callback2);
|
||||
},this,true);
|
||||
|
||||
var btnCompare2 = new YAHOO.widget.Button("compare2",{disabled:true,id:"compareButton2"});
|
||||
btnCompare2.on("click", function(e) {
|
||||
var compareCheckBoxes = YAHOO.util.Dom.getElementsByClassName('compareCheckBox','input');
|
||||
var uri = "func=getCompareListData";
|
||||
for (var i = compareCheckBoxes.length; i--; ) {
|
||||
if(compareCheckBoxes[i].checked == true){
|
||||
uri = uri+';listingId='+compareCheckBoxes[i].value;
|
||||
}
|
||||
}
|
||||
this.myDataSource.sendRequest(uri,callback2);
|
||||
},this,true);
|
||||
|
||||
var btnSearch = new YAHOO.widget.Button("search");
|
||||
btnSearch.on("click", function(e) {
|
||||
window.location.href = matrixUrl + '?func=search';
|
||||
},this,true);
|
||||
|
||||
window.compareFormButton = function() {
|
||||
var compareCheckBoxes = YAHOO.util.Dom.getElementsByClassName('compareCheckBox','input');
|
||||
var checked = 0;
|
||||
|
|
@ -111,8 +131,10 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
}
|
||||
if (checked > 1 && checked < maxComparisons){
|
||||
btnCompare.set("disabled",false);
|
||||
btnCompare2.set("disabled",false);
|
||||
}else{
|
||||
btnCompare.set("disabled",true);
|
||||
btnCompare2.set("disabled",true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
|
||||
var myColumnDefs = [
|
||||
{key:"assetId",label:"",sortable:false, formatter:this.formatCheckBox},
|
||||
{key:"title", label:"Name", sortable:true, formatter:this.formatUrl},
|
||||
{key:"views", sortable:true},
|
||||
{key:"clicks", sortable:true},
|
||||
{key:"compares", sortable:true}
|
||||
{key:"title", label:"Name", sortable:true, formatter:this.formatUrl}
|
||||
];
|
||||
|
||||
var uri = "func=getCompareFormData";
|
||||
|
|
@ -34,7 +31,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
this.myDataSource.connXhrMode = "queueRequests";
|
||||
this.myDataSource.responseSchema = {
|
||||
resultsList: "ResultSet.Result",
|
||||
fields: ["title","views","clicks","compares","checked","url","assetId"]
|
||||
fields: ["title","checked","url","assetId"]
|
||||
};
|
||||
|
||||
var myDataTable = new YAHOO.widget.DataTable("compareForm", myColumnDefs,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue