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
This commit is contained in:
Mike Hatfield
2007-09-14 12:34:50 +00:00
parent 4c3222257e
commit 003eb483d6
8 changed files with 58 additions and 12 deletions

View File

@@ -26,7 +26,7 @@
<ul> <ul>
<li id="current"><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li> <li id="current"><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li> <li><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li> <li><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}&amp;e=${extn}&amp;n=${nav}&amp;ticket=${session.ticket}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
<li><a title="View Details" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li> <li><a title="View Details" href="${url.serviceContext}/office/documentDetails?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
<li><a title="My Tasks" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li> <li><a title="My Tasks" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
</ul> </ul>

View File

@@ -120,9 +120,8 @@
<div class="taskValue"><textarea id="wrkDescription" rows="4" style="height:54px;"></textarea></div> <div class="taskValue"><textarea id="wrkDescription" rows="4" style="height:54px;"></textarea></div>
<div class="taskParam">&nbsp;</div> <div class="taskParam">&nbsp;</div>
<div class="taskValue"> <div class="taskValue">
<a class="taskAction" href="#" onclick="OfficeMyTasks.startWorkflow('${url.serviceContext}/office/docActions', '${d.id}');"> <a class="taskAction" href="#" onclick="OfficeMyTasks.startWorkflow('${url.serviceContext}/office/docActions', '${d.id}');">Submit</a>
Submit <a class="taskAction" href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;e=${extn}&amp;n=${nav}">Cancel</a>
</a>
</div> </div>
</div> </div>

View File

@@ -1,3 +1,4 @@
<#assign doc_actions="${url.serviceContext}/office/docActions">
<#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"></#if><#assign extnx=extn+"x"> <#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"></#if><#assign extnx=extn+"x">
<#if args.t?exists> <#if args.t?exists>
<#assign taskid = args.t> <#assign taskid = args.t>
@@ -45,18 +46,30 @@
<#list task.packageResources as res> <#list task.packageResources as res>
<tr> <tr>
<#if res.isDocument> <#if res.isDocument>
<#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('\'', '\\\'') /> <#assign relativePath = (res.displayPath?substring(companyhome.name?length+1) + '/' + res.name)?url?replace('%2F', '/')?replace('\'', '\\\'') />
<td width="16"><a href="${url.context}${res.url}" target="new"><img src="${url.context}${res.icon16}" alt="${res.name}"></a></td> <#if res.name?ends_with(extn) || res.name?ends_with(extnx)>
<td width="16" valign="top"><a href="${url.context}${res.url}" target="new"><img src="${url.context}${res.icon16}" alt="${res.name}"></a></td>
<td> <td>
<a href="#" onclick="window.external.openDocument('${relativePath}')" title="Open ${res.name}">${res.name}</a> <a href="#" onclick="window.external.openDocument('${relativePath}')" title="Open ${res.name}">${res.name}</a>
</td>
<#else> <#else>
<td width="16"><a href="${url.context}${res.url}?ticket=${session.ticket}" target="_blank" title="Open ${res.name}"><img src="${url.context}${res.icon16}" alt="${res.name}"></a></td> <td width="16" valign="top"><a href="${url.context}${res.url}?ticket=${session.ticket}" target="_blank" title="Open ${res.name}"><img src="${url.context}${res.icon16}" alt="${res.name}"></a></td>
<td> <td>
<a href="${url.context}${res.url}?ticket=${session.ticket}" target="_blank">${res.name}</a> <a href="${url.context}${res.url}?ticket=${session.ticket}" target="_blank">${res.name}</a>
</td>
</#if> </#if>
<br />
Modified: ${res.properties.modified?datetime} (${(res.size / 1024)?int}Kb)<br />
<#if res.isLocked >
<img src="${url.context}/images/office/lock.gif" style="padding:3px 6px 2px 0px;" alt="Locked" />
<#elseif hasAspect(res, "cm:workingcopy") == 1>
<a href="#" onclick="OfficeMyTasks.runAction('${doc_actions}','checkin','${res.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<#else>
<a href="#" onclick="OfficeMyTasks.runAction('${doc_actions}','checkout','${res.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out" /></a>
</#if>
<a href="#" onclick="window.external.insertDocument('${relativePath}')"><img src="${url.context}/images/office/insert_document.gif" style="padding:3px 6px 2px 0px;" alt="Insert File into Current Document" title="Insert File into Current Document" /></a>
<#if !res.name?ends_with(".pdf")>
<a href="#" onclick="OfficeMyTasks.runAction('${doc_actions}','makepdf','${res.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
</#if>
</td>
<#else> <#else>
<td width="16"><img src="${url.context}${res.icon16}" alt="${res.name}"></td> <td width="16"><img src="${url.context}${res.icon16}" alt="${res.name}"></td>
<td> <td>

View File

@@ -2,7 +2,7 @@
<#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome></#if> <#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome></#if>
<#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"></#if><#assign extnx=extn+"x"> <#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"></#if><#assign extnx=extn+"x">
<#if args.n?exists><#assign nav=args.n><#else><#assign nav=""></#if> <#if args.n?exists><#assign nav=args.n><#else><#assign nav=""></#if>
<#assign searchCommand="OfficeSearch.runSearch('${url.serviceContext}/office/searchResults', '${path}&amp;e=${extn}')" > <#assign searchCommand="OfficeSearch.runSearch('${url.serviceContext}/office/searchResults', '${path?url}&amp;e=${extn}')" >
<#if (args.searchagain?exists)><#assign searchText=args.searchagain><#else><#assign searchText=""></#if> <#if (args.searchagain?exists)><#assign searchText=args.searchagain><#else><#assign searchText=""></#if>
<#if (args.maxresults?exists)><#assign maxResults=args.maxresults><#else><#assign maxResults="5"></#if> <#if (args.maxresults?exists)><#assign maxResults=args.maxresults><#else><#assign maxResults="5"></#if>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

View File

@@ -1,3 +1,5 @@
<#assign doc_actions="${url.serviceContext}/office/docActions">
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
<#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"></#if><#assign extnx=extn+"x"> <#if args.e?exists><#assign extn=args.e><#else><#assign extn="doc"></#if><#assign extnx=extn+"x">
<#if args.search?exists> <#if args.search?exists>
<#assign searchString = args.search> <#assign searchString = args.search>
@@ -28,8 +30,8 @@
<#list results as child> <#list results as child>
<#assign resCount=resCount + 1> <#assign resCount=resCount + 1>
<#if child.isDocument> <#if child.isDocument>
<#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 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 openURL = "#"> <#assign openURL = "#">
<#assign hrefExtra = " onClick=\"window.external.openDocument('${relativePath}')\""> <#assign hrefExtra = " onClick=\"window.external.openDocument('${relativePath}')\"">
<#else> <#else>
@@ -53,6 +55,21 @@
</#if> </#if>
<#if child.isDocument> <#if child.isDocument>
Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br /> Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br />
<#if child.isLocked >
<img src="${url.context}/images/office/lock.gif" style="padding:3px 6px 2px 0px;" alt="Locked" />
<#elseif hasAspect(child, "cm:workingcopy") == 1>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<#else>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkout','${child.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out" /></a>
</#if>
<a href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;w=new&amp;wd=${child.id}"><img src="${url.context}/images/office/new_workflow.gif" style="padding:3px 6px 2px 0px;" alt="Create Workflow..." title="Create Workflow..." /></a>
<a href="#" onclick="window.external.insertDocument('${relativePath}')"><img src="${url.context}/images/office/insert_document.gif" style="padding:3px 6px 2px 0px;" alt="Insert File into Current Document" title="Insert File into Current Document" /></a>
<#if !child.name?ends_with(".pdf")>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
</#if>
<#if !child.isLocked>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="${url.context}/images/office/delete.gif" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete" /></a>
</#if>
</#if> </#if>
</span> </span>
</div> </div>

View File

@@ -27,6 +27,7 @@ body {
a { a {
color: #0073e6; color: #0073e6;
text-decoration: none; text-decoration: none;
outline: none;
} }
a img { a img {

View File

@@ -228,6 +228,21 @@ var OfficeMyTasks =
myAjax.request(); 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() refreshPage: function()
{ {
// Remove any trailing hash // Remove any trailing hash

View File

@@ -91,7 +91,7 @@ var OfficeAddin =
}, },
/* AJAX call to perform server-side actions */ /* AJAX call to perform server-side actions */
runAction: function(useTemplate, Action, Doc, Msg) runAction: function(useTemplate, Action, Doc, Msg, extraParams)
{ {
if (Msg != "" && !confirm(Msg)) if (Msg != "" && !confirm(Msg))
{ {
@@ -114,6 +114,7 @@ var OfficeAddin =
{ {
href += (href.indexOf("?") == -1) ? "?" : "&"; href += (href.indexOf("?") == -1) ? "?" : "&";
href += "st=" + encodeURI(textResponse); href += "st=" + encodeURI(textResponse);
href += "&" + extraParams;
} }
window.location.href = href; window.location.href = href;
} }