From 003eb483d65dbdd8ce58f965d934d33d68be19a0 Mon Sep 17 00:00:00 2001 From: Mike Hatfield Date: Fri, 14 Sep 2007 12:34:50 +0000 Subject: [PATCH] Some minor Office add-in usability updates (actions available for search results and workflow resources) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6787 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/office/myAlfresco.get.html.ftl | 2 +- .../org/alfresco/office/myTasks.get.html.ftl | 5 ++-- .../office/myTasksDetail.get.html.ftl | 23 +++++++++++++++---- .../org/alfresco/office/search.get.html.ftl | 2 +- .../office/searchResults.get.html.ftl | 19 ++++++++++++++- source/web/css/office.css | 1 + source/web/scripts/office/my_tasks.js | 15 ++++++++++++ source/web/scripts/office/office_addin.js | 3 ++- 8 files changed, 58 insertions(+), 12 deletions(-) diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl index e6770938bf..beadc381ac 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myAlfresco.get.html.ftl @@ -26,7 +26,7 @@ diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.html.ftl index afb8a23eb1..f40826b18b 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasks.get.html.ftl @@ -120,9 +120,8 @@
 
- - Submit - + Submit + Cancel
diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.html.ftl index 92317254ee..7eeddbd1a5 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/myTasksDetail.get.html.ftl @@ -1,3 +1,4 @@ +<#assign doc_actions="${url.serviceContext}/office/docActions"> <#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"><#assign extnx=extn+"x"> <#if args.t?exists> <#assign taskid = args.t> @@ -45,18 +46,30 @@ <#list task.packageResources as res> <#if res.isDocument> + <#assign relativePath = (res.displayPath?substring(companyhome.name?length+1) + '/' + res.name)?url?replace('%2F', '/')?replace('\'', '\\\'') /> <#if res.name?ends_with(extn) || res.name?ends_with(extnx)> - <#assign relativePath = (res.displayPath?substring(companyhome.name?length+1) + '/' + res.name)?url?replace('%2F', '/')?replace('\'', '\\\'') /> - ${res.name} + ${res.name} ${res.name} - <#else> - ${res.name} + ${res.name} ${res.name} - +
+ Modified: ${res.properties.modified?datetime} (${(res.size / 1024)?int}Kb)
+ <#if res.isLocked > + Locked + <#elseif hasAspect(res, "cm:workingcopy") == 1> + Check In + <#else> + Check Out + + Insert File into Current Document + <#if !res.name?ends_with(".pdf")> + Make PDF... + + <#else> ${res.name} diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl index acd3b73068..aa6ed8e857 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/search.get.html.ftl @@ -2,7 +2,7 @@ <#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome> <#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"><#assign extnx=extn+"x"> <#if args.n?exists><#assign nav=args.n><#else><#assign nav=""> -<#assign searchCommand="OfficeSearch.runSearch('${url.serviceContext}/office/searchResults', '${path}&e=${extn}')" > +<#assign searchCommand="OfficeSearch.runSearch('${url.serviceContext}/office/searchResults', '${path?url}&e=${extn}')" > <#if (args.searchagain?exists)><#assign searchText=args.searchagain><#else><#assign searchText=""> <#if (args.maxresults?exists)><#assign maxResults=args.maxresults><#else><#assign maxResults="5"> diff --git a/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.html.ftl index 890bfc9201..3d564382c3 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/office/searchResults.get.html.ftl @@ -1,3 +1,5 @@ +<#assign doc_actions="${url.serviceContext}/office/docActions"> +<#if args.p?exists><#assign path=args.p><#else><#assign path=""> <#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"><#assign extnx=extn+"x"> <#if args.search?exists> <#assign searchString = args.search> @@ -28,8 +30,8 @@ <#list results as child> <#assign resCount=resCount + 1> <#if child.isDocument> + <#assign relativePath = (child.displayPath?substring(companyhome.name?length+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') /> <#if child.name?ends_with(extn) || child.name?ends_with(extnx)> - <#assign relativePath = (child.displayPath?substring(companyhome.name?length+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') /> <#assign openURL = "#"> <#assign hrefExtra = " onClick=\"window.external.openDocument('${relativePath}')\""> <#else> @@ -53,6 +55,21 @@ <#if child.isDocument> Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)
+ <#if child.isLocked > + Locked + <#elseif hasAspect(child, "cm:workingcopy") == 1> + Check In + <#else> + Check Out + + Create Workflow... + Insert File into Current Document + <#if !child.name?ends_with(".pdf")> + Make PDF... + + <#if !child.isLocked> + Delete... + diff --git a/source/web/css/office.css b/source/web/css/office.css index ab494340fb..88aeda11df 100644 --- a/source/web/css/office.css +++ b/source/web/css/office.css @@ -27,6 +27,7 @@ body { a { color: #0073e6; text-decoration: none; + outline: none; } a img { diff --git a/source/web/scripts/office/my_tasks.js b/source/web/scripts/office/my_tasks.js index 52dc74b916..b11f4159fe 100644 --- a/source/web/scripts/office/my_tasks.js +++ b/source/web/scripts/office/my_tasks.js @@ -228,6 +228,21 @@ var OfficeMyTasks = myAjax.request(); }, + /* AJAX call to perform server-side actions */ + runAction: function(useTemplate, Action, Doc, Msg) + { + // Re-select a selected task after reload + var taskSel = $E('#taskList .taskItemSelected'); + var extraParams = ""; + if (taskSel != null) + { + var taskId = taskSel.id; + extraParams = "t=" + encodeURI(taskId); + } + + OfficeAddin.runAction(useTemplate, Action, Doc, Msg, extraParams); + }, + refreshPage: function() { // Remove any trailing hash diff --git a/source/web/scripts/office/office_addin.js b/source/web/scripts/office/office_addin.js index 0d53d50407..afa5a5d0f3 100644 --- a/source/web/scripts/office/office_addin.js +++ b/source/web/scripts/office/office_addin.js @@ -91,7 +91,7 @@ var OfficeAddin = }, /* AJAX call to perform server-side actions */ - runAction: function(useTemplate, Action, Doc, Msg) + runAction: function(useTemplate, Action, Doc, Msg, extraParams) { if (Msg != "" && !confirm(Msg)) { @@ -114,6 +114,7 @@ var OfficeAddin = { href += (href.indexOf("?") == -1) ? "?" : "&"; href += "st=" + encodeURI(textResponse); + href += "&" + extraParams; } window.location.href = href; }