09-05-2012 01:00 AM
Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/components/dashlets/showRTTickets.get.js': 08050000 TypeError: Cannot find function sort. (jar:file:/opt/alfresco-4.0.d/tomcat/shared/lib/showRTTickets.jar!/alfresco/site-webscripts/org/alfresco/components/dashlets/showRTTickets.get.js#7)
function ticketSort(tickets, sortBy, sortType)
{
var result={};
switch(sortBy)
{
case "id": //integer sort
result = tickets.sort(function(a, b){return a.id-b.id;});
break;
case "queue": //string sort
result = tickets.sort(function(a, b){
var stringA=a.queue.toLowerCase(), stringB=b.queue.toLowerCase();
if (stringA < stringB)
return -1;
if (stringA > stringB)
return 1;
return 0;
});
break;
case "owner": //string sort
result = tickets.sort(function(a, b){
var stringA=a.owner.toLowerCase(), stringB=b.owner.toLowerCase();
if (stringA < stringB)
return -1;
if (stringA > stringB)
return 1;
return 0;
});
break;
case "creator": //string sort
result = tickets.sort(function(a, b){
var stringA=a.creator.toLowerCase(), stringB=b.creator.toLowerCase();
if (stringA < stringB)
return -1;
if (stringA > stringB)
return 1;
return 0;
});
break;
case "subject": //string sort
result = tickets.sort(function(a, b){
var stringA=a.subject.toLowerCase(), stringB=b.subject.toLowerCase();
if (stringA < stringB)
return -1;
if (stringA > stringB)
return 1;
return 0;
});
break;
case "status": //string sort
result = tickets.sort(function(a, b){
var stringA=a.status.toLowerCase(), stringB=b.status.toLowerCase();
if (stringA < stringB)
return -1;
if (stringA > stringB)
return 1;
return 0;
});
break;
case "priority": //integer sort
result = tickets.sort(function(a, b){return a.priority-b.priority});
break;
case "created": //date sort
result = tickets.sort(function(a,b) {
var dateA=new Date(a.created), dateB=new Date(b.created);
return dateA-dateB;
});
break;
case "due": //date sort
result = tickets.sort(function(a,b) {
var dateA=new Date(a.due), dateB=new Date(b.due);
return dateA-dateB;
});
break;
case "lastupdated": //date sort
result = tickets.sort(function(a,b) {
var dateA=new Date(a.lastUpdated), dateB=new Date(b.lastUpdated);
return dateA-dateB;
});
break;
}
if (sortType == "desc")
return results.reverse();
else
return results;
}
09-05-2012 05:20 AM
09-05-2012 07:02 PM
09-06-2012 02:14 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.