Point check-in. Office AddIn web scripts.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5842 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"statusString":"${resultString}",
|
||||||
|
"statusCode":${resultCode?string}
|
||||||
|
}
|
@@ -1,40 +1,79 @@
|
|||||||
// Generate a PDF transform of the current object
|
// Client has requested certain actions on the current document
|
||||||
|
|
||||||
if (document.isDocument)
|
/* Inputs */
|
||||||
|
var docId = args["d"],
|
||||||
|
runAction = args["a"];
|
||||||
|
|
||||||
|
/* Outputs */
|
||||||
|
var resultString = "Action failed.",
|
||||||
|
resultCode = false;
|
||||||
|
|
||||||
|
var doc = search.findNode("workspace://SpacesStore/" + docId);
|
||||||
|
|
||||||
|
if (doc != null && doc.isDocument)
|
||||||
{
|
{
|
||||||
var runAction = args['action'];
|
try
|
||||||
var result = "Action failed.";
|
|
||||||
|
|
||||||
if (runAction == "makepdf")
|
|
||||||
{
|
{
|
||||||
var trans = document.transformDocument("application/pdf");
|
if (runAction == "makepdf")
|
||||||
result = "Action completed.";
|
{
|
||||||
|
resultString = "Could not convert document";
|
||||||
|
var nodeTrans = doc.transformDocument("application/pdf");
|
||||||
|
if (nodeTrans != null)
|
||||||
|
{
|
||||||
|
resultString = "Document converted";
|
||||||
|
resultCode = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (runAction == "delete")
|
||||||
|
{
|
||||||
|
resultString = "Could not delete document";
|
||||||
|
if (doc.remove())
|
||||||
|
{
|
||||||
|
resultString = "Document deleted";
|
||||||
|
resultCode = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (runAction == "checkout")
|
||||||
|
{
|
||||||
|
var workingCopy = doc.checkout();
|
||||||
|
if (workingCopy != null)
|
||||||
|
{
|
||||||
|
resultString = "Document checked out";
|
||||||
|
resultCode = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (runAction == "checkin")
|
||||||
|
{
|
||||||
|
var originalDoc = doc.checkin();
|
||||||
|
if (originalDoc != null)
|
||||||
|
{
|
||||||
|
resultString = "Document checked in";
|
||||||
|
resultCode = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (runAction == "makeversion")
|
||||||
|
{
|
||||||
|
resultString = "Could not version document";
|
||||||
|
if (doc.addAspect("cm:versionable"))
|
||||||
|
{
|
||||||
|
resultString = "Document versioned";
|
||||||
|
resultCode = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (runAction == "test")
|
||||||
|
{
|
||||||
|
resultString = "Test complete.";
|
||||||
|
resultCode = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
resultString = "Unknown action.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (runAction == "delete")
|
catch(e)
|
||||||
{
|
{
|
||||||
var rc = document.remove();
|
resultString = "Action failed due to exception";
|
||||||
result = "Action completed.";
|
|
||||||
}
|
}
|
||||||
else if (runAction == "checkout")
|
}
|
||||||
{
|
model.resultString = resultString;
|
||||||
var wc = null;
|
model.resultCode = resultCode;
|
||||||
wc = document.checkout();
|
|
||||||
result = "Action completed.";
|
|
||||||
}
|
|
||||||
else if (runAction == "checkin")
|
|
||||||
{
|
|
||||||
var wc = document.checkin();
|
|
||||||
result = "Action completed.";
|
|
||||||
}
|
|
||||||
else if (runAction == "makeversion")
|
|
||||||
{
|
|
||||||
var wc = document.addAspect("cm:versionable");
|
|
||||||
result = "Action completed.";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = "Unknown action.";
|
|
||||||
}
|
|
||||||
|
|
||||||
result;
|
|
||||||
}
|
|
@@ -1,8 +1,10 @@
|
|||||||
<#assign doc_actions="${url.context}/scripts/office/docActions.js">
|
<#assign doc_actions="${url.context}/service/office/docActions">
|
||||||
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||||
<#-- resolve the path (from Company Home) into a node -->
|
<#-- resolve the path (from Company Home) into a node -->
|
||||||
<#if path?starts_with("/Company Home")>
|
<#if path?starts_with("/Company Home")>
|
||||||
<#if companyhome.childByNamePath[args.p[14..]]?exists>
|
<#if path?length=13>
|
||||||
|
<#assign d=companyhome>
|
||||||
|
<#elseif companyhome.childByNamePath[args.p[14..]]?exists>
|
||||||
<#assign d=companyhome.childByNamePath[args.p[14..]]>
|
<#assign d=companyhome.childByNamePath[args.p[14..]]>
|
||||||
<#else>
|
<#else>
|
||||||
<#assign d=companyhome>
|
<#assign d=companyhome>
|
||||||
@@ -10,32 +12,29 @@
|
|||||||
<#else>
|
<#else>
|
||||||
<#assign d=companyhome>
|
<#assign d=companyhome>
|
||||||
</#if>
|
</#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">
|
||||||
<!-- ${args.p} -->
|
|
||||||
<!-- ${path} -->
|
|
||||||
<!-- ${d.id} -->
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Document Details</title>
|
<title>Document Details</title>
|
||||||
<link rel="stylesheet" type="text/css" href="${url.context}/css/taskpane.css" />
|
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||||
<script type="text/javascript" src="${url.context}/scripts/office/doc_details.js"></script>
|
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||||
|
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="tabBar">
|
<div id="tabBar">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="${url.context}/scripts/office/myAlfresco?p=${path}"><img src="${url.context}/images/taskpane/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
|
<li><a title="My Alfresco" href="${url.context}/service/office/myAlfresco?p=${path}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
|
||||||
<li><a href="${url.context}/scripts/office/navigation?p=${path}"><img src="${url.context}/images/taskpane/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
|
<li><a title="Browse Spaces and Documents" href="${url.context}/service/office/navigation?p=${path}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
|
||||||
<li style="padding-right:6px;"><a href="${url.context}/scripts/office/search?p=${path}"><img src="${url.context}/images/taskpane/search.gif" border="0" alt="Search Alfresco" /></a></li>
|
<li><a title="Search Alfresco" href="${url.context}/service/office/search?p=${path}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
|
||||||
<li id="current"><a href="#"><img src="${url.context}/images/taskpane/document_details.gif" border="0" alt="View Details" /></a></li>
|
<li id="current"><a title="View Details" href="${url.context}/service/office/documentDetails?p=${path}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
|
||||||
<li><a href="${url.context}/scripts/office/versionHistory?p=${path}"><img src="${url.context}/images/taskpane/version_history.gif" border="0" alt="View Version History" /></a></li>
|
<li><a title="My Tasks" href="${url.context}/service/office/myTasks?p=${path}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="detailsListHeader"><span style="font-weight:bold">Details</span></div>
|
<div class="header">Current Document Details</div>
|
||||||
|
|
||||||
<div id="detailsList">
|
<div class="listMedium">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -43,22 +42,23 @@
|
|||||||
<#if d.isDocument>
|
<#if d.isDocument>
|
||||||
<img src="${url.context}${d.icon32}" border="0" alt="${d.name}" />
|
<img src="${url.context}${d.icon32}" border="0" alt="${d.name}" />
|
||||||
</td>
|
</td>
|
||||||
<td style="line-height:16px;" width="100%">
|
<td width="100%" style="padding-top: 4px;">
|
||||||
<span style="font-weight:bold;">${d.name}
|
<span style="font-weight:bold; vertical-align: top;">${d.name}
|
||||||
<#if d.isLocked >
|
<#if d.isLocked >
|
||||||
<img src="${url.context}/images/taskpane/lock.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Locked">
|
<img src="${url.context}/images/office/lock.gif" alt="Locked" title="Locked" style="margin: -2px 0px;" />
|
||||||
</#if>
|
</#if>
|
||||||
</span><br/>
|
</span>
|
||||||
<table>
|
<br />
|
||||||
|
<table style="margin-top: 4px;">
|
||||||
<#if d.properties.title?exists>
|
<#if d.properties.title?exists>
|
||||||
<tr><td>Title:</td><td>${d.properties.title}</td></tr>
|
<tr><td>Title:</td><td>${d.properties.title}</td></tr>
|
||||||
<#else>
|
<#else>
|
||||||
<tr><td>Title:</td><td></td></tr>
|
<tr><td>Title:</td><td> </td></tr>
|
||||||
</#if>
|
</#if>
|
||||||
<#if d.properties.description?exists>
|
<#if d.properties.description?exists>
|
||||||
<tr><td>Description:</td><td>${d.properties.description}</td></tr>
|
<tr><td>Description:</td><td>${d.properties.description}</td></tr>
|
||||||
<#else>
|
<#else>
|
||||||
<tr><td valign="top">Description:</td><td></td></tr>
|
<tr><td valign="top">Description:</td><td> </td></tr>
|
||||||
</#if>
|
</#if>
|
||||||
<tr><td>Creator:</td><td>${d.properties.creator}</td></tr>
|
<tr><td>Creator:</td><td>${d.properties.creator}</td></tr>
|
||||||
<tr><td>Created:</td><td>${d.properties.created?datetime}</td></tr>
|
<tr><td>Created:</td><td>${d.properties.created?datetime}</td></tr>
|
||||||
@@ -69,44 +69,98 @@
|
|||||||
<td>
|
<td>
|
||||||
<#if d.hasAspect("cm:generalclassifiable")>
|
<#if d.hasAspect("cm:generalclassifiable")>
|
||||||
<#list d.properties.categories as category>
|
<#list d.properties.categories as category>
|
||||||
${companyhome.nodeByReference[category].name};
|
${companyhome.nodeByReference[category].name};
|
||||||
</#list>
|
</#list>
|
||||||
<#else>
|
<#else>
|
||||||
None.
|
None.
|
||||||
</#if>
|
</#if>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<#else>
|
<#else>
|
||||||
The current document is not managed by Alfresco.
|
The current document is not managed by Alfresco.
|
||||||
</#if>
|
</#if>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="documentActions">
|
<div class="header">Version History
|
||||||
<span style="font-weight:bold;">Document Actions</span><br/>
|
|
||||||
<#if d.isDocument>
|
<#if d.isDocument>
|
||||||
<ul>
|
for ${d.name}
|
||||||
<#if d.isLocked >
|
|
||||||
<#elseif hasAspect(d, "cm:workingcopy") == 1>
|
|
||||||
<li><a href="#" onClick="javascript:runAction('${doc_actions}','checkin','${d.id}', '');"><img src="${url.context}/images/taskpane/checkin.gif" border="0" style="padding-right:6px;" alt="Check In">Check In</a></li>
|
|
||||||
<#else>
|
|
||||||
<li><a href="#" onClick="javascript:runAction('${doc_actions}','checkout','${d.id}', '');"><img src="${url.context}/images/taskpane/checkout.gif" border="0" style="padding-right:6px;" alt="Check Out">Check Out</a></li>
|
|
||||||
</#if>
|
|
||||||
<li><a href="#" onClick="javascript:runAction('${doc_actions}','makepdf','${d.id}', '');"><img src="${url.context}/images/taskpane/makepdf.gif" border="0" style="padding-right:6px;" alt="Transform to PDF">Transform to PDF</a></li>
|
|
||||||
<li><a href="${url.context}/navigate/showDocDetails/workspace/SpacesStore/${d.id}?ticket=${session.ticket}" target="_blank"><img src="${url.context}/images/taskpane/document_details.gif" border="0" style="padding-right:6px;" alt="Open Full Details">Open Full Details</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<#else>
|
|
||||||
No actions available.
|
|
||||||
</#if>
|
</#if>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="bottomMargin"><span id="statusArea"> </span>
|
<div class="listMedium">
|
||||||
|
<table>
|
||||||
|
<#if d.isDocument >
|
||||||
|
<#if hasAspect(d, "cm:versionable") == 1>
|
||||||
|
<#assign versionRow=0>
|
||||||
|
<#list d.versionHistory?sort_by("versionLabel")?reverse as record>
|
||||||
|
<#assign versionRow=versionRow+1>
|
||||||
|
<tr class="${(versionRow % 2 = 0)?string("odd", "even")}">
|
||||||
|
<td valign="top">
|
||||||
|
<a title="Open ${record.versionLabel}" href="$(url.context}${d.url}"><img src="${url.context}/images/office/document.gif" alt="Open ${record.versionLabel}" /></a>
|
||||||
|
</td>
|
||||||
|
<td width="100%">
|
||||||
|
<a title="Open ${record.versionLabel}" href="#"><span style="font-weight:bold;">${record.versionLabel}</span></a><br />
|
||||||
|
Author: ${record.creator}<br/>
|
||||||
|
Date: ${record.createdDate?datetime}<br/>
|
||||||
|
<#if record.description?exists>
|
||||||
|
Notes: ${record.description}<br/>
|
||||||
|
</#if>
|
||||||
|
<!-- <a href="#" onClick="window.external.compareDocument('/alfresco${d.url}')" title="Compare with current">Compare with current</a><br/> -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</#list>
|
||||||
|
<#else>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">
|
||||||
|
The current document is not versioned.<br />
|
||||||
|
<br />
|
||||||
|
<ul>
|
||||||
|
<li><a title="Make Versionable" href="#" onClick="OfficeAddin.runAction('${doc_actions}','makeversion','${d.id}', '');">
|
||||||
|
<img src="${url.context}/images/office/make_versionable.gif" alt="Make Versionable" /> Make Versionable
|
||||||
|
</a></li>
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">
|
||||||
|
The current document is not managed by Alfresco.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</#if>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">Document Actions</div>
|
||||||
|
|
||||||
|
<div id="documentActions">
|
||||||
|
<div id="nonStatusText">
|
||||||
|
<#if d.isDocument>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#" onClick="OfficeAddin.runAction('${doc_actions}','test','${d.id}', '');"><img src="${url.context}/images/office/checkin.gif" border="0" style="padding-right:6px;" alt="Test">Test</a></li>
|
||||||
|
<#if d.isLocked >
|
||||||
|
<#elseif hasAspect(d, "cm:workingcopy") == 1>
|
||||||
|
<li><a href="#" onClick="OfficeAddin.runAction('${doc_actions}','checkin','${d.id}', '');"><img src="${url.context}/images/office/checkin.gif" border="0" style="padding-right:6px;" alt="Check In">Check In</a></li>
|
||||||
|
<#else>
|
||||||
|
<li><a href="#" onClick="OfficeAddin.runAction('${doc_actions}','checkout','${d.id}', '');"><img src="${url.context}/images/office/checkout.gif" border="0" style="padding-right:6px;" alt="Check Out">Check Out</a></li>
|
||||||
|
</#if>
|
||||||
|
<li><a href="#" onClick="OfficeAddin.runAction('${doc_actions}','makepdf','${d.id}', '');"><img src="${url.context}/images/office/makepdf.gif" border="0" style="padding-right:6px;" alt="Transform to PDF">Transform to PDF</a></li>
|
||||||
|
<li><a href="${url.context}/navigate/showOfficeAddin/workspace/SpacesStore/${d.id}?ticket=${session.ticket}" target="_blank"><img src="${url.context}/images/office/document_details.gif" border="0" style="padding-right:6px;" alt="Open Full Details">Open Full Details</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<#else>
|
||||||
|
No actions available.
|
||||||
|
</#if>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="statusText"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,92 +1,112 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
<#assign doc_actions="${url.context}/service/office/docActions">
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||||
|
<#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome></#if>
|
||||||
|
<#-- resolve the path (from Company Home) into a node -->
|
||||||
|
<#if path?starts_with("/Company Home")>
|
||||||
|
<#if path?length=13>
|
||||||
|
<#assign d=companyhome>
|
||||||
|
<#elseif companyhome.childByNamePath[args.p[14..]]?exists>
|
||||||
|
<#assign d=companyhome.childByNamePath[args.p[14..]]>
|
||||||
|
<#else>
|
||||||
|
<#assign d=companyhome>
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<#assign d=companyhome>
|
||||||
|
</#if>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>My Alfresco</title>
|
<title>My Alfresco</title>
|
||||||
<link rel="stylesheet" type="text/css" href="/alfresco/css/taskpane.css" />
|
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||||
<script type="text/javascript" src="/alfresco/scripts/office/my_alfresco.js"></script>
|
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||||
|
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="tabBar">
|
<div id="tabBar">
|
||||||
<ul>
|
<ul>
|
||||||
<li id="current"><a href="#"><img src="/alfresco/images/office/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
|
<li id="current"><a title="My Alfresco" href="${url.context}/service/office/myAlfresco?p=${path}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/office/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
|
<li><a title="Browse Spaces and Documents" href="${url.context}/service/office/navigation?p=${path}&n=${d.id}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
|
||||||
<li style="padding-right:6px;"><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_search}"><img src="/alfresco/images/office/search.gif" border="0" alt="Search Alfresco" /></a></li>
|
<li><a title="Search Alfresco" href="${url.context}/service/office/search?p=${path}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_details}"><img src="/alfresco/images/office/document_details.gif" border="0" alt="View Details" /></a></li>
|
<li><a title="View Details" href="${url.context}/service/office/documentDetails?p=${path}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_history}"><img src="/alfresco/images/office/version_history.gif" border="0" alt="View Version History" /></a></li>
|
<li><a title="My Tasks" href="${url.context}/service/office/myTasks?p=${path}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="mycheckedoutdocsListHeader"><span style="font-weight:bold">My checked out documents</span></div>
|
<div class="header">My Checked Out Documents</div>
|
||||||
|
|
||||||
<div id="mycheckedoutdocsList">
|
<div class="listMedium">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<#assign rowNum=0>
|
||||||
<#assign query="@cm\\:workingCopyOwner:${person.properties.userName}">
|
<#assign query="@cm\\:workingCopyOwner:${person.properties.userName}">
|
||||||
<#list companyhome.childrenByLuceneSearch[query] as child>
|
<#list companyhome.childrenByLuceneSearch[query] as child>
|
||||||
<#if child.isDocument>
|
<#if child.isDocument>
|
||||||
<!-- lb: start repeat -->
|
<#assign rowNum=rowNum+1>
|
||||||
<tr>
|
<tr class="${(rowNum % 2 = 0)?string("odd", "even")}">
|
||||||
<td>
|
<td valign="top">
|
||||||
<a href="#"><img src="/alfresco/images/office/document.gif" border="0" alt="Open ${child.name}" /></a>
|
<img src="${url.context}${child.icon32}" alt="${child.name}" />
|
||||||
</td>
|
</td>
|
||||||
<td style="line-height:16px;" width="100%">
|
<td style="line-height:16px;" width="100%">
|
||||||
<a href="#" title="Open ${child.name}">${child.name}</a><br/>
|
<a href="#" title="Open ${child.name}" style="font-weight: bold;">${child.name}</a><br/>
|
||||||
<#if child.properties.description?exists>
|
<#if child.properties.description?exists>
|
||||||
${child.properties.description}<br/>
|
${child.properties.description}<br/>
|
||||||
</#if>
|
</#if>
|
||||||
Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb<br/>
|
Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br/>
|
||||||
<a href="#" onClick="javascript:runAction('checkin','${child.id}', '');"><img src="/alfresco/images/office/checkin.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In"></a>
|
<a href="#" onClick="OfficeAddin.runAction('checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In"></a>
|
||||||
<a href="#" onClick="javascript:runAction('makepdf','${child.id}', '');"><img src="/alfresco/images/office/makepdf.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF"></a>
|
<a href="#" onClick="OfficeAddin.runAction('makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF"></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- lb: end repeat -->
|
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
|
</table>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div id="mytodoListHeader"><span style="font-weight:bold;">My Communities</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="mytodoList">
|
<div class="header">My Tasks<span class="headerExtra"><img src="${url.context}/images/office/task_overdue.gif" alt="overdue">=overdue, <img src="${url.context}/images/office/task_today.gif" alt="due today">=due today</span></div>
|
||||||
<table>
|
|
||||||
<tbody>
|
<div class="listMedium">
|
||||||
<#list companyhome.childrenByXPath["*[@cm:name='Communities']/*"] as child>
|
<table width="100%">
|
||||||
<!-- lb: start repeat -->
|
<#assign taskNum=0>
|
||||||
<tr>
|
<#list workflow.assignedTasks?sort_by('startDate') as t>
|
||||||
<td>
|
<#assign taskNum=taskNum+1>
|
||||||
<a href="#"><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
|
<tr class="${(taskNum % 2 = 0)?string("odd", "even")}">
|
||||||
</td>
|
<td>
|
||||||
<td width="100%">
|
<#assign hasDue=t.properties["bpm:dueDate"]?exists>
|
||||||
<a href="/alfresco/template/workspace/SpacesStore/${child.id}/workspace/SpacesStore/${office_browse}" title="Open ${child.name}">${child.name}</a><br/>
|
<#if hasDue>
|
||||||
<#if child.properties.description?exists>
|
<#assign due=t.properties["bpm:dueDate"]>
|
||||||
${child.properties.description}
|
<#-- items due today? -->
|
||||||
</#if>
|
<#if (dateCompare(date?date, due?date, 0, "==") == 1)>
|
||||||
</td>
|
<img src="${url.context}/images/office/task_today.gif">
|
||||||
</tr>
|
<#-- items overdue? -->
|
||||||
<!-- lb: end repeat -->
|
<#elseif (dateCompare(date?date, due?date) == 1)>
|
||||||
|
<img src="${url.context}/images/office/task_overdue.gif">
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
|
||||||
|
</#if>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
${t.description?html} (${t.type?html})
|
||||||
|
<#if hasDue>
|
||||||
|
<br />Due date: ${due?date}
|
||||||
|
</#if>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</#list>
|
</#list>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="header">Other Actions</div>
|
||||||
|
|
||||||
<div id="documentActions">
|
<div id="documentActions">
|
||||||
<span style="font-weight:bold;">Other Actions</span><br/>
|
<ul>
|
||||||
<div id="yellowbox" style="background:#ffffcc;border: 1px solid #cccccc; margin-top:6px; padding-bottom:6px;">
|
<li><a title="Save to Alfresco" href="${url.context}/service/office/navigation?p=${path}"><img src="${url.context}/images/office/save_to_alfresco.gif" alt="Save to Alfresco"><b> Save to Alfresco</b></a><br />Allows you to place the current document under Alfresco management.</li>
|
||||||
<ul>
|
<li><a title="Browse Alfresco" href="${url.context}/service/office/navigation?p=${path}"><img src="${url.context}/images/office/navigator.gif" alt="Browse Alfresco"><b> Browse Alfresco</b></a><br />Navigate around the Alfresco repository for documents.</li>
|
||||||
<li style="padding-bottom:4px;"><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/office/save_to_alfresco.gif" border="0" style="padding-right:6px;" alt="Save to Alfresco"><b>Save to Alfresco</b></a><br> Allows you to place the current document under Alfresco management.</li>
|
<li><a title="Search" href="${url.context}/service/office/search?p=${path}"><img src="${url.context}/images/office/search.gif" alt="Search"><b> Find Documents</b></a><br />Search Alfresco for documents by name and content.</li>
|
||||||
<li style="padding-bottom:4px;"><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/office/navigator.gif" border="0" style="padding-right:6px;" alt="Browse"><b>Browse Alfresco</b></a><br> Navigate around the Alfresco repository for documents.</li>
|
<li><a title="Launch Alfresco" href="${url.context}/navigate/browse?ticket=${session.ticket}" target="_blank"><img src="${url.context}/images/logo/AlfrescoLogo16.gif" alt="Launch Alfresco"><b> Launch Alfresco</b></a><br />Start the Alfresco Web Client.</li>
|
||||||
<li style="padding-bottom:4px;"><a href="/alfresco/template/workspace/SpacesStore/${thisContext.id}/workspace/SpacesStore/${office_search}"><img src="/alfresco/images/office/search.gif" border="0" style="padding-right:6px;" alt="Search"><b>Find Documents</b></a><br> Search Alfresco for documents by name and content.</li>
|
</ul>
|
||||||
<li style="padding-bottom:4px;"><a href="/alfresco/navigate/browse?ticket=${session.ticket}" target="_blank"><img src="/alfresco/images/logo/AlfrescoLogo16.gif" border="0" style="padding-right:6px;" alt="Save to Alfresco"><b>Launch Alfresco</b></a><br> Start the Alfresco Web Client.</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="bottomMargin" style="height:24px;"><span id="statusArea"> </span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="statusText"></div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@@ -0,0 +1,7 @@
|
|||||||
|
<webscript>
|
||||||
|
<shortname>My Tasks (Office Add-In)</shortname>
|
||||||
|
<description>Generate the Office Add-In My Tasks page</description>
|
||||||
|
<url format="html" template="/office/myTasks?p={path}" />
|
||||||
|
<authentication>user</authentication>
|
||||||
|
<transaction>required</transaction>
|
||||||
|
</webscript>
|
@@ -0,0 +1,73 @@
|
|||||||
|
<#assign doc_actions="${url.context}/service/office/docActions">
|
||||||
|
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||||
|
<#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome></#if>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>My Tasks</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||||
|
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||||
|
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
|
||||||
|
<script type="text/javascript" src="${url.context}/scripts/office/my_tasks.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div id="tabBar">
|
||||||
|
<ul>
|
||||||
|
<li><a title="My Alfresco" href="${url.context}/service/office/myAlfresco?p=${path}"><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.context}/service/office/navigation?p=${path}&n=${node.id}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
|
||||||
|
<li><a title="Search Alfresco" href="${url.context}/service/office/search?p=${path}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
|
||||||
|
<li><a title="View Details" href="${url.context}/service/office/documentDetails?p=${path}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
|
||||||
|
<li id="current"><a title="My Tasks" href="${url.context}/service/office/myTasks?p=${path}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">My Tasks<span class="headerExtra"><img src="${url.context}/images/office/task_overdue.gif" alt="overdue">=overdue, <img src="${url.context}/images/office/task_today.gif" alt="due today">=due today</span></div>
|
||||||
|
|
||||||
|
<div id="taskList" class="listMedium">
|
||||||
|
<table width="100%">
|
||||||
|
<#assign taskNum=0>
|
||||||
|
<#list workflow.assignedTasks?sort_by('startDate') as t>
|
||||||
|
<#assign taskNum=taskNum+1>
|
||||||
|
<tr id="${t.id}" class="taskItem ${(taskNum % 2 = 0)?string("odd", "even")}">
|
||||||
|
<td>
|
||||||
|
<#assign hasDue=t.properties["bpm:dueDate"]?exists>
|
||||||
|
<#if hasDue>
|
||||||
|
<#assign due=t.properties["bpm:dueDate"]>
|
||||||
|
<#-- items due today? -->
|
||||||
|
<#if (dateCompare(date?date, due?date, 0, "==") == 1)>
|
||||||
|
<img src="${url.context}/images/office/task_today.gif">
|
||||||
|
<#-- items overdue? -->
|
||||||
|
<#elseif (dateCompare(date?date, due?date) == 1)>
|
||||||
|
<img src="${url.context}/images/office/task_overdue.gif">
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
|
||||||
|
</#if>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span style="font-weight: bold;">${t.description?html}</span> (${t.type?html})
|
||||||
|
<#if hasDue>
|
||||||
|
<br />Due date: ${due?date}
|
||||||
|
<#else>
|
||||||
|
<br />(No due date)
|
||||||
|
</#if>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</#list>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">Workflow</div>
|
||||||
|
|
||||||
|
<div class="listBig">
|
||||||
|
<div id="nonStatusText">
|
||||||
|
<div id="taskDetails"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="statusText"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@@ -0,0 +1,7 @@
|
|||||||
|
<webscript>
|
||||||
|
<shortname>My Tasks Detail (Office Add-In)</shortname>
|
||||||
|
<description>Generate the Office Add-In Task Detail page</description>
|
||||||
|
<url format="html" template="/office/myTasksDetail?t={taskId}" />
|
||||||
|
<authentication>user</authentication>
|
||||||
|
<transaction>required</transaction>
|
||||||
|
</webscript>
|
@@ -0,0 +1,70 @@
|
|||||||
|
<#if args.t?exists>
|
||||||
|
<#assign taskid = args.t>
|
||||||
|
<#if taskid != "">
|
||||||
|
<#assign task = workflow.getTaskById(taskid)>
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#if task?exists>
|
||||||
|
<table width="100%">
|
||||||
|
<tr>
|
||||||
|
<td width="32" valign="top"><img src="${url.context}/images/office/task_item.gif" alt="Task item" /></td>
|
||||||
|
<td>
|
||||||
|
<span style="font-weight: bold;">${task.description?html}</span>
|
||||||
|
<br />
|
||||||
|
<table style="margin-top: 4px;">
|
||||||
|
<tr>
|
||||||
|
<td>Status:</td>
|
||||||
|
<td>${task.properties["bpm:status"]}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Priority:</td>
|
||||||
|
<td>${task.properties["bpm:priority"]}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Start Date:</td>
|
||||||
|
<td>${task.startDate?date}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Type:</td>
|
||||||
|
<td>${task.type?html}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Complete:</td>
|
||||||
|
<td>${task.properties["bpm:percentComplete"]}%</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div style="margin-top: 8px; font-weight: bold;">${task.name?html}:</div>
|
||||||
|
<div class="taskResources">
|
||||||
|
<table width="100%">
|
||||||
|
<#list task.packageResources as res>
|
||||||
|
<tr>
|
||||||
|
<td width="16"><a href="${url.context}${res.url}" target="new"><img src="${url.context}${res.icon16}" alt="${res.name}"></a></td>
|
||||||
|
<td>
|
||||||
|
<#if res.isDocument>
|
||||||
|
<a href="${url.context}${res.url}" target="_blank">${res.name}</a>
|
||||||
|
<#else>
|
||||||
|
<span>${res.name}</span>
|
||||||
|
</#if>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</#list>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<table class="taskActions" style="padding-left:16px">
|
||||||
|
<tr>
|
||||||
|
<#list task.transitions as wt>
|
||||||
|
<td>
|
||||||
|
<a class="taskAction" href="#" onclick="OfficeAddin.transitionTask('/command/task/end/${task.id}<#if wt.id?exists>/${wt.id}</#if>', 'Workflow action \'${wt.label?html}\' completed.');">${wt.label?html}</a>
|
||||||
|
</td>
|
||||||
|
</#list>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</#if>
|
@@ -1,161 +1,154 @@
|
|||||||
<!DOCTYPE html
|
<#assign doc_actions="${url.context}/service/office/docActions">
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
<#if node.isDocument>
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<#assign thisSpace = node.parent>
|
||||||
<#list template.parent.children as child>
|
|
||||||
<#if child.name = "my_alfresco.ftl"><#assign office_home = child.id>
|
|
||||||
<#elseif child.name = "navigation.ftl"><#assign office_browse = child.id>
|
|
||||||
<#elseif child.name = "search.ftl"><#assign office_search = child.id>
|
|
||||||
<#elseif child.name = "document_details.ftl"><#assign office_details = child.id>
|
|
||||||
<#elseif child.name = "version_history.ftl"><#assign office_history = child.id>
|
|
||||||
<#elseif child.name = "doc_actions.js"><#assign doc_actions = child.id>
|
|
||||||
<#elseif child.name = "navigation.js"><#assign nav_script = child>
|
|
||||||
</#if>
|
|
||||||
</#list>
|
|
||||||
<#if document.isDocument>
|
|
||||||
<#assign thisSpace = document.parent>
|
|
||||||
<#else>
|
<#else>
|
||||||
<#assign thisSpace = document>
|
<#assign thisSpace = node>
|
||||||
</#if>
|
</#if>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Basic Navigation</title>
|
<title>Browse Spaces and Documents</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||||
<link rel="stylesheet" type="text/css"
|
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||||
href="/alfresco/css/taskpane.css" />
|
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="/alfresco${nav_script.url}" >
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="tabBar">
|
<div id="tabBar">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_home}"><img src="/alfresco/images/taskpane/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
|
<li><a title="My Alfresco" href="${url.context}/service/office/myAlfresco?p=${path}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
|
||||||
<li id="current"><a href="#"><img src="/alfresco/images/taskpane/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
|
<li id="current"><a title="Browse Spaces and Documents" href="${url.context}/service/office/navigation?p=${path}&n=${node.id}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
|
||||||
<li style="padding-right:6px;"><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_search}"><img src="/alfresco/images/taskpane/search.gif" border="0" alt="Search Alfresco" /></a></li>
|
<li><a title="Search Alfresco" href="${url.context}/service/office/search?p=${path}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_details}"><img src="/alfresco/images/taskpane/document_details.gif" border="0" alt="View Details" /></a></li>
|
<li><a title="View Details" href="${url.context}/service/office/documentDetails?p=${path}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_history}"><img src="/alfresco/images/taskpane/version_history.gif" border="0" alt="View Version History" /></a></li>
|
<li><a title="My Tasks" href="${url.context}/service/office/myTasks?p=${path}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="currentSpaceInfo">
|
<div id="currentSpaceInfo">
|
||||||
<table>
|
<table width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan=2 class="valign">
|
<td width="10">In:</td>
|
||||||
In:<img src="/alfresco${thisSpace.icon32}" border="0"/>
|
<td width="16"><img src="${url.context}${thisSpace.icon16}" alt="${thisSpace.name}" /></td>
|
||||||
</td>
|
<td>
|
||||||
<td>
|
<span class="bold">${thisSpace.name}</span>
|
||||||
<span style="font-weight:bold;">${thisSpace.name}</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<#if thisSpace.properties.description?exists>
|
<#if thisSpace.properties.description?exists>
|
||||||
${thisSpace.properties.description}
|
<br />${thisSpace.properties.description}
|
||||||
</#if>
|
</#if>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td width="34" align="right">
|
||||||
|
<#if thisSpace=companyhome>
|
||||||
<#if thisSpace = companyhome>
|
|
||||||
<#else>
|
<#else>
|
||||||
<img src="/alfresco/images/taskpane/go_up.gif" border="0" width="16" height="16" alt="go up to parent space"/><a href="/alfresco/template/workspace/SpacesStore/${thisSpace.parent.id}/workspace/SpacesStore/${template.id}"><span title="Go up to parent space">Up</span></a>
|
<a title="Up to Parent Space" href="${url.context}/service/office/navigation?p=${path}&n=${thisSpace.parent.id}">
|
||||||
|
<img src="${url.context}/images/office/go_up.gif" alt="Up to Parent Space" />
|
||||||
|
<span>Up</span>
|
||||||
|
</a>
|
||||||
</#if>
|
</#if>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="spaceListHeader"><span style="font-weight:bold">Spaces in ${thisSpace.name}</span></div>
|
<div class="header">Spaces in ${thisSpace.name}<span class="headerExtra"><span class="toggle"></span></span></div>
|
||||||
|
|
||||||
<div id="spaceList">
|
<div id="spaceList" class="listMedium">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<#assign spacesFound = 0>
|
||||||
<#list thisSpace.children as child>
|
<#list thisSpace.children as child>
|
||||||
<#if child.isContainer>
|
<#if child.isContainer>
|
||||||
<!-- lb: start repeat -->
|
<#assign spacesFound = spacesFound + 1>
|
||||||
<tr>
|
<tr class="${(spacesFound % 2 = 0)?string("odd", "even")}">
|
||||||
<td>
|
<td>
|
||||||
<a href="#"><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
|
<a href="${url.context}/service/office/navigation?p=${path}&n=${child.id}"><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
|
||||||
</td>
|
</td>
|
||||||
<td width="100%">
|
<td width="100%">
|
||||||
<a href="/alfresco/template/workspace/SpacesStore/${child.id}/workspace/SpacesStore/${template.id}" title="Open ${child.name}">${child.name}</a><br/>
|
<a href="${url.context}/service/office/navigation?p=${path}&n=${child.id}" title="Open ${child.name}">
|
||||||
<#if child.properties.description?exists>
|
<span class="bold">${child.name}</span>
|
||||||
${child.properties.description}
|
</a>
|
||||||
</#if>
|
<#if child.properties.description?exists>
|
||||||
</td>
|
<br/>${child.properties.description}
|
||||||
</tr>
|
</#if>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
<!-- lb: end repeat -->
|
<#if spacesFound = 0>
|
||||||
</tbody>
|
<tr>
|
||||||
</table>
|
<td>(No subspaces)</td>
|
||||||
|
</tr>
|
||||||
|
</#if>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="contentListHeader"><span style="font-weight:bold;">Documents in ${thisSpace.name}</span>
|
<div class="header">Documents in ${thisSpace.name}<span class="headerExtra"><span class="toggle"></span></span></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="contentList">
|
<div id="documentList" class="listMedium">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<#assign documentsFound = 0>
|
||||||
<#list thisSpace.children as child>
|
<#list thisSpace.children as child>
|
||||||
<#if child.isDocument>
|
<#if child.isDocument>
|
||||||
<!-- lb: start repeat -->
|
<#assign documentsFound = documentsFound + 1>
|
||||||
<#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
|
<#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
|
||||||
<tr>
|
<tr class="${(documentsFound % 2 = 0)?string("odd", "even")}">
|
||||||
<td>
|
<td valign="top">
|
||||||
<#if child.name?ends_with(".doc")>
|
<#if child.name?ends_with(".doc")>
|
||||||
<a href="#" onClick="window.external.openDocument('${webdavPath}')"><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
|
<a href="#" onClick="window.external.openDocument('${webdavPath}')"><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
|
||||||
<#else>
|
<#else>
|
||||||
<a href="/alfresco${child.url}?ticket=${session.ticket}" target="_blank"><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
|
<a href="${url.context}${child.url}?ticket=${session.ticket}" target="_blank"><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
|
||||||
</#if>
|
</#if>
|
||||||
</td>
|
</td>
|
||||||
<td style="line-height:16px;" width="100%">
|
<td width="100%">
|
||||||
<#if child.name?ends_with(".doc")>
|
<#if child.name?ends_with(".doc")>
|
||||||
<a href="#" onClick="window.external.openDocument('${webdavPath}')" title="Open ${child.name}">${child.name}</a><br/>
|
<a href="#" onClick="window.external.openDocument('${webdavPath}')" title="Open ${child.name}">
|
||||||
<#else>
|
<span class="bold">${child.name}</span>
|
||||||
<a href="/alfresco${child.url}?ticket=${session.ticket}" target="_blank" title="Open ${child.name}">${child.name}</a><br/>
|
</a><br/>
|
||||||
</#if>
|
<#else>
|
||||||
<#if child.properties.description?exists>
|
<a href="${url.context}${child.url}?ticket=${session.ticket}" target="_blank" title="Open ${child.name}">
|
||||||
${child.properties.description}<br/>
|
<span class="bold">${child.name}</span>
|
||||||
</#if>
|
</a><br/>
|
||||||
Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb<br/>
|
</#if>
|
||||||
<#if child.isLocked >
|
<#if child.properties.description?exists>
|
||||||
<img src="/alfresco/images/taskpane/lock.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Locked">
|
${child.properties.description}<br/>
|
||||||
<#elseif hasAspect(child, "cm:workingcopy") == 1>
|
</#if>
|
||||||
<a href="#" onClick="javascript:runAction('${doc_actions}','checkin','${child.id}', '');"><img src="/alfresco/images/taskpane/checkin.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In"></a>
|
Modified: ${child.properties.modified?datetime}, Size: ${(child.size / 1024)?int}Kb<br/>
|
||||||
<#else>
|
<#if child.isLocked >
|
||||||
<a href="#" onClick="javascript:runAction('${doc_actions}','checkout','${child.id}', '');"><img src="/alfresco/images/taskpane/checkout.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out"></a>
|
<img src="${url.context}/images/office/lock.gif" style="padding:3px 6px 2px 0px;" alt="Locked">
|
||||||
</#if>
|
<#elseif hasAspect(child, "cm:workingcopy") == 1>
|
||||||
<a href="#" onClick="javascript:runAction('${doc_actions}','makepdf','${child.id}', '');"><img src="/alfresco/images/taskpane/makepdf.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF"></a>
|
<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>
|
||||||
<#if !child.isLocked >
|
<#else>
|
||||||
<a href="#" onClick="javascript:runAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="/alfresco/images/taskpane/delete.gif" border="0" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete"></a>
|
<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>
|
</#if>
|
||||||
</td>
|
<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>
|
||||||
</tr>
|
<#if !child.isLocked >
|
||||||
<!-- lb: end repeat -->
|
<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>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
</tbody>
|
<#if documentsFound = 0>
|
||||||
</table>
|
<tr>
|
||||||
|
<td>(No documents)</td>
|
||||||
|
</tr>
|
||||||
|
</#if>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="documentActions">
|
<div class="header">Document Actions</div>
|
||||||
<span style="font-weight:bold;">Document Actions</span><br/>
|
|
||||||
<ul>
|
<div id="documentActionsNavigation">
|
||||||
|
<div id="nonStatusText">
|
||||||
|
<ul>
|
||||||
<#assign currentPath = thisSpace.displayPath + '/' + thisSpace.name />
|
<#assign currentPath = thisSpace.displayPath + '/' + thisSpace.name />
|
||||||
<#assign webdavPath = currentPath?substring(13)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
|
<#assign webdavPath = currentPath?substring(13)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
|
||||||
<li><a href="#" onClick="window.external.saveToAlfresco('${webdavPath}')"><img src="/alfresco/images/taskpane/save_to_alfresco.gif" border="0" style="padding-right:6px;" alt="Save to Alfresco">Save to Alfresco</a></li>
|
<li><a href="#" onClick="window.external.saveToAlfresco('${webdavPath}')"><img src="${url.context}/images/office/save_to_alfresco.gif" style="padding-right:6px;" alt="Save to Alfresco">Save to Alfresco</a></li>
|
||||||
<#if args.search?exists>
|
<#if args.search?exists>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_search}?searchagain=${args.search}&maxresults=${args.maxresults}"><img src="/alfresco/images/taskpane/placeholder.gif" border="0" style="padding-right:6px;" alt="Back to results">Back to search results</a></li>
|
<li><a href="${url.context}/service/office/search?p=${path}&searchagain=${args.search}&maxresults=${args.maxresults}"><img src="${url.context}/images/office/search_again.gif" style="padding-right:6px;" alt="Back to results">Back to search results</a></li>
|
||||||
</#if>
|
</#if>
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="statusText"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="bottomMargin" style="height:24px; padding-left:6px;"><span id="statusArea"> </span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
if ((args.n) && (args.n != ""))
|
||||||
|
{
|
||||||
|
model.node = search.findNode("workspace://SpacesStore/" + args.n);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
model.node = companyhome;
|
||||||
|
}
|
||||||
|
model.path = args.p;
|
@@ -1,150 +1,62 @@
|
|||||||
<#list template.parent.children as child>
|
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||||
<#if child.name = "my_alfresco.ftl"><#assign office_home = child.id>
|
<#if args.n?exists><#assign node=args.n><#else><#assign node=companyhome></#if>
|
||||||
<#elseif child.name = "navigation.ftl"><#assign office_browse = child.id>
|
<#assign searchCommand="OfficeAddin.runSearch('${url.context}/service/office/searchResults', '${path}')" >
|
||||||
<#elseif child.name = "search.ftl"><#assign office_search = child.id>
|
<#if (args.searchagain?exists)><#assign searchText=args.searchagain><#else><#assign searchText=""></#if>
|
||||||
<#elseif child.name = "document_details.ftl"><#assign office_details = child.id>
|
<#if (args.maxresults?exists)><#assign maxResults=args.maxresults><#else><#assign maxResults="5"></#if>
|
||||||
<#elseif child.name = "version_history.ftl"><#assign office_history = child.id>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<#elseif child.name = "doc_actions.js"><#assign doc_actions = child.id>
|
|
||||||
<#elseif child.name = "search.js"><#assign srch_script = child>
|
|
||||||
</#if>
|
|
||||||
</#list>
|
|
||||||
|
|
||||||
<#if args.search?exists>
|
|
||||||
<#assign searchString = args.search>
|
|
||||||
<#if searchString != "">
|
|
||||||
<#assign queryString = "TEXT:\"${searchString}\" @cm\\:title:${searchString}">
|
|
||||||
</#if>
|
|
||||||
<#else>
|
|
||||||
<#assign searchString = "">
|
|
||||||
<#assign queryString = "">
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<#if searchString != "">
|
|
||||||
<#if args.maxresults?exists>
|
|
||||||
<#assign maxresults=args.maxresults?number>
|
|
||||||
<#else>
|
|
||||||
<#assign maxresults=10>
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
<#assign rescount=1>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Start output -->
|
|
||||||
<table>
|
|
||||||
<tbody style="font-family: tahoma, sans-serif; font-size: 11px;">
|
|
||||||
<#assign results = companyhome.childrenByLuceneSearch[queryString] >
|
|
||||||
<#if results?size = 0>
|
|
||||||
<tr><td>No results found.</td></tr>
|
|
||||||
<#else>
|
|
||||||
<#list results as child>
|
|
||||||
<!-- lb: start repeat -->
|
|
||||||
<#if child.isDocument>
|
|
||||||
<#if child.name?ends_with(".pdf")>
|
|
||||||
<#assign openURL = "/alfresco${child.url}">
|
|
||||||
<#assign hrefExtra = " target=\"_blank\"">
|
|
||||||
<#else>
|
|
||||||
<#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
|
|
||||||
<#assign openURL = "#">
|
|
||||||
<#assign hrefExtra = " onClick=\"window.external.openDocument('${webdavPath}')\"">
|
|
||||||
</#if>
|
|
||||||
<#else>
|
|
||||||
<#assign openURL = "/alfresco/template/workspace/SpacesStore/${child.id}/workspace/SpacesStore/${office_browse}?search=${searchString}&maxresults=${maxresults}">
|
|
||||||
<#assign hrefExtra = "">
|
|
||||||
</#if>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<a href="${openURL}" ${hrefExtra}><img src="/alfresco${child.icon32}" border="0" alt="Open ${child.name}" /></a>
|
|
||||||
</td>
|
|
||||||
<td width="100%">
|
|
||||||
<a href="${openURL}" ${hrefExtra} title="Open ${child.name}">${child.name}</a><br/>
|
|
||||||
<#if child.properties.description?exists>
|
|
||||||
${child.properties.description}<br/>
|
|
||||||
</#if>
|
|
||||||
<#if child.isDocument>
|
|
||||||
Modified: ${child.properties.modified?datetime}, Size: ${child.size / 1024} Kb<br/>
|
|
||||||
</#if>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- lb: end repeat -->
|
|
||||||
<#if rescount = maxresults>
|
|
||||||
<#break>
|
|
||||||
</#if>
|
|
||||||
<#assign rescount=rescount + 1>
|
|
||||||
</#list>
|
|
||||||
</#if>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<!-- End output -->
|
|
||||||
|
|
||||||
</#if>
|
|
||||||
<!-- End of returning search results -->
|
|
||||||
|
|
||||||
<!-- Display Search UI -->
|
|
||||||
<#if !args.search?exists>
|
|
||||||
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Search</title>
|
<title>Browse Spaces and Documents</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" />
|
||||||
<link rel="stylesheet" type="text/css"
|
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.js"></script>
|
||||||
href="/alfresco/css/taskpane.css" />
|
<script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="/alfresco${srch_script.url}" >
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<#if args.searchagain?exists>
|
<body>
|
||||||
<#assign onLoad = "onLoad = \"doSearch('${args.searchagain}', '${args.maxresults}');\"">
|
|
||||||
<#else>
|
|
||||||
<#assign onLoad = "">
|
|
||||||
</#if>
|
|
||||||
<body ${onLoad}>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="tabBar">
|
<div id="tabBar">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_home}"><img src="/alfresco/images/taskpane/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
|
<li><a title="My Alfresco" href="${url.context}/service/office/myAlfresco?p=${path}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/taskpane/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
|
<li><a title="Browse Spaces and Documents" href="${url.context}/service/office/navigation?p=${path}&n=${node.id}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
|
||||||
<li id="current" style="padding-right:6px;"><a href="#"><img src="/alfresco/images/taskpane/search.gif" border="0" alt="Search Alfresco" /></a></li>
|
<li id="current"><a title="Search Alfresco" href="${url.context}/service/office/search?p=${path}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_details}"><img src="/alfresco/images/taskpane/document_details.gif" border="0" alt="View Details" /></a></li>
|
<li><a title="View Details" href="${url.context}/service/office/documentDetails?p=${path}"><span><img src="${url.context}/images/office/document_details.gif" alt="View Details" /></span></a></li>
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_history}"><img src="/alfresco/images/taskpane/version_history.gif" border="0" alt="View Version History" /></a></li>
|
<li><a title="My Tasks" href="${url.context}/service/office/myTasks?p=${path}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="header">Search</div>
|
||||||
|
|
||||||
<div id="search">
|
<div id="search">
|
||||||
<table width="100%" border="0" style="font-family: tahoma, sans-serif; font-size: 11px;">
|
<table width="100%" border="0" style="font-family: tahoma, sans-serif; font-size: 11px;">
|
||||||
<tr valign="top">
|
<tr valign="top">
|
||||||
<td align="left" valign="middle">
|
<td align="left" valign="middle">
|
||||||
Search for <input type="text" id="searchText" name="searchText" value="" maxlength='1024' style='width:140px;font-size:10px' onkeyup="return handleTextEnter(event);" /><input type="button" name="simpleSearchButton" id="simpleSearchButton" class="button" onClick="javascript:runSearch('${office_search}');" value="Search"/><br/>
|
Search for
|
||||||
<label><SELECT id="maxresults" NAME="maxresults" onchange="javascript:runSearch('${office_search}');">
|
<input type="text" id="searchText" name="searchText" value="${searchText}" maxlength="1024" style="width:140px; font-size:10px" />
|
||||||
<option id="5" name="5" value=5>5</option>
|
<input type="button" name="simpleSearchButton" id="simpleSearchButton" class="button" onClick="${searchCommand}" value="Search" /><br />
|
||||||
<option id="10" name="10" value=10>10</option>
|
<br />
|
||||||
<option id="15" name="15" value=15>15</option>
|
Return a maximum of <select id="maxResults" name="maxResults" onChange="${searchCommand}">
|
||||||
<option id="20" name="20" value=20>20</option>
|
<option <#if maxResults="5">selected</#if> value="5">5</option>
|
||||||
<option id="50" name="50" value=50>50</option>
|
<option <#if maxResults="10">selected</#if> value="10">10</option>
|
||||||
</select> Items</label><br/>
|
<option <#if maxResults="15">selected</#if>value="15">15</option>
|
||||||
</td>
|
<option <#if maxResults="20">selected</#if>value="20">20</option>
|
||||||
</tr>
|
<option <#if maxResults="50">selected</#if>value="50">50</option>
|
||||||
</table>
|
</select> items
|
||||||
</div>
|
<br/>
|
||||||
|
</td>
|
||||||
<div id="searchResultsListHeader"><span style="font-weight:bold">Items Found</span></div>
|
</tr>
|
||||||
|
|
||||||
<div id="searchResultsList">
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="bottomMargin" style="height:24px;"><span id="statusArea"> </span>
|
<div class="header">Items Found</div>
|
||||||
|
|
||||||
|
<div class="listBig">
|
||||||
|
<div id="searchResultsList"></div>
|
||||||
|
<div id="statusText"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<#if (args.searchagain?exists)>
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.addEvent('domready', function(){${searchCommand}});
|
||||||
|
</script>
|
||||||
|
</#if>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
</#if>
|
|
||||||
<!-- End of Search UI -->
|
|
@@ -0,0 +1,7 @@
|
|||||||
|
<webscript>
|
||||||
|
<shortname>Search Results (Office Add-In)</shortname>
|
||||||
|
<description>Generate the Office Add-In Search Results page</description>
|
||||||
|
<url format="html" template="/office/searchResults?search={searchString?}&maxresults={maxresults?}" />
|
||||||
|
<authentication>user</authentication>
|
||||||
|
<transaction>required</transaction>
|
||||||
|
</webscript>
|
@@ -0,0 +1,62 @@
|
|||||||
|
<#if args.search?exists>
|
||||||
|
<#assign searchString = args.search>
|
||||||
|
<#if searchString != "">
|
||||||
|
<#assign queryString = "TEXT:\"${searchString}\" @cm\\:title:${searchString}">
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<#assign searchString = "">
|
||||||
|
<#assign queryString = "">
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#if searchString != "">
|
||||||
|
<#if args.maxresults?exists>
|
||||||
|
<#assign maxresults=args.maxresults?number>
|
||||||
|
<#else>
|
||||||
|
<#assign maxresults=10>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#assign rescount=1>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<#assign results = companyhome.childrenByLuceneSearch[queryString] >
|
||||||
|
<#if results?size = 0>
|
||||||
|
<tr>
|
||||||
|
<td>(No results found)</td>
|
||||||
|
</tr>
|
||||||
|
<#else>
|
||||||
|
<#list results as child>
|
||||||
|
<#if child.isDocument>
|
||||||
|
<#if child.name?ends_with(".pdf")>
|
||||||
|
<#assign openURL = "${url.context}${child.url}">
|
||||||
|
<#assign hrefExtra = " target=\"_blank\"">
|
||||||
|
<#else>
|
||||||
|
<#assign webdavPath = (child.displayPath?substring(13) + '/' + child.name)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
|
||||||
|
<#assign openURL = "#">
|
||||||
|
<#assign hrefExtra = " onClick=\"window.external.openDocument('${webdavPath}')\"">
|
||||||
|
</#if>
|
||||||
|
<#else>
|
||||||
|
<#assign openURL = "${url.context}/service/office/navigation?p=${args.p}&n=${child.id}&search=${searchString}&maxresults=${maxresults}">
|
||||||
|
<#assign hrefExtra = "">
|
||||||
|
</#if>
|
||||||
|
<tr>
|
||||||
|
<td width="32">
|
||||||
|
<a href="${openURL}" ${hrefExtra}><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="${openURL}" ${hrefExtra} title="Open ${child.name}">${child.name}</a><br/>
|
||||||
|
<#if child.properties.description?exists>
|
||||||
|
${child.properties.description}<br/>
|
||||||
|
</#if>
|
||||||
|
<#if child.isDocument>
|
||||||
|
Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br/>
|
||||||
|
</#if>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<#if rescount = maxresults>
|
||||||
|
<#break>
|
||||||
|
</#if>
|
||||||
|
<#assign rescount=rescount + 1>
|
||||||
|
</#list>
|
||||||
|
</#if>
|
||||||
|
</table>
|
||||||
|
</#if>
|
@@ -1,7 +0,0 @@
|
|||||||
<webscript>
|
|
||||||
<shortname>Version History (Office Add-In)</shortname>
|
|
||||||
<description>Generate the Office Add-In Version History page</description>
|
|
||||||
<url format="html" template="/office/versionHistory?p={path?}" />
|
|
||||||
<authentication>user</authentication>
|
|
||||||
<transaction>required</transaction>
|
|
||||||
</webscript>
|
|
@@ -1,88 +0,0 @@
|
|||||||
<#list template.parent.children as child>
|
|
||||||
<#if child.name = "my_alfresco.ftl"><#assign office_home = child.id>
|
|
||||||
<#elseif child.name = "navigation.ftl"><#assign office_browse = child.id>
|
|
||||||
<#elseif child.name = "search.ftl"><#assign office_search = child.id>
|
|
||||||
<#elseif child.name = "document_details.ftl"><#assign office_details = child.id>
|
|
||||||
<#elseif child.name = "version_history.ftl"><#assign office_history = child.id>
|
|
||||||
<#elseif child.name = "doc_actions.js"><#assign doc_actions = child.id>
|
|
||||||
<#elseif child.name = "version.js"><#assign ver_script = child>
|
|
||||||
</#if>
|
|
||||||
</#list>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Version History</title>
|
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css"
|
|
||||||
href="/alfresco/css/taskpane.css" />
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" src="/alfresco${ver_script.url}">
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div id="tabBar">
|
|
||||||
<ul>
|
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_home}"><img src="/alfresco/images/taskpane/my_alfresco.gif" border="0" alt="My Alfresco" /></a></li>
|
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_browse}"><img src="/alfresco/images/taskpane/navigator.gif" border="0" alt="Browse Spaces and Documents" /></a></li>
|
|
||||||
<li style="padding-right:6px;"><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_search}"><img src="/alfresco/images/taskpane/search.gif" border="0" alt="Search Alfresco" /></a></li>
|
|
||||||
<li><a href="/alfresco/template/workspace/SpacesStore/${document.id}/workspace/SpacesStore/${office_details}"><img src="/alfresco/images/taskpane/document_details.gif" border="0" alt="View Details" /></a></li>
|
|
||||||
<li id="current"><a href="#"><img src="/alfresco/images/taskpane/version_history.gif" border="0" alt="View Version History" /></a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="versionListHeader"><span style="font-weight:bold">Version History for ${document.name}</span></div>
|
|
||||||
|
|
||||||
<div id="versionList">
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
<#if document.isDocument >
|
|
||||||
<#if hasAspect(document, "cm:versionable") == 1 >
|
|
||||||
<!-- lb: start repeat row -->
|
|
||||||
<#list document.versionHistory?sort_by("versionLabel")?reverse as record>
|
|
||||||
<tr>
|
|
||||||
<td valign="top">
|
|
||||||
<a href="/alfresco${document.url}"><img src="/alfresco/images/taskpane/document.gif" border="0" alt="Open ${record.versionLabel}"/></a>
|
|
||||||
</td>
|
|
||||||
<td style="line-height:16px;" width="100%">
|
|
||||||
<a href="#" title="Open ${record.versionLabel}"><span style="font-weight:bold;">${record.versionLabel}</span></a><br/>
|
|
||||||
Author: ${record.creator}<br/>
|
|
||||||
Date: ${record.createdDate?datetime}<br/>
|
|
||||||
<#if record.description?exists>
|
|
||||||
Notes: ${record.description}<br/>
|
|
||||||
</#if>
|
|
||||||
<!-- <a href="#" onClick="window.external.compareDocument('/alfresco${document.url}')" title="Compare with current">Compare with current</a><br/> -->
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</#list>
|
|
||||||
<#else>
|
|
||||||
<tr>
|
|
||||||
<td valign="top">
|
|
||||||
The current document is not versioned.<br>
|
|
||||||
<a href="#" onClick="javascript:runAction('${doc_actions}','makeversion','${document.id}', '');">Make Versionable</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</#if>
|
|
||||||
<!-- lb: end repeat row -->
|
|
||||||
<#else>
|
|
||||||
<tr>
|
|
||||||
<td valign="top">
|
|
||||||
The current document is not managed by Alfresco.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</#if>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="bottomMargin" style="height:24px; padding-left:6px;"><span id="statusArea"> </span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@@ -1,119 +1,204 @@
|
|||||||
html, body {
|
html, body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow:hidden;
|
overflow: hidden;
|
||||||
font-family: tahoma, sans-serif;
|
font-family: tahoma, sans-serif;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: #0073e6;
|
color: #0073e6;
|
||||||
background: url("../images/taskpane/view_bg.gif") top;
|
background: url("../images/office/view_bg.gif") top;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {margin:0px;padding:0px;}
|
body {
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #0073e6;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a img {
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bold {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
#tabBar {
|
#tabBar {
|
||||||
float:left;
|
float: left;
|
||||||
width:100%;
|
width: 100%;
|
||||||
background:#d4eaff url("../images/taskpane/bg.gif") repeat-x bottom;
|
background: #efefef;
|
||||||
font-size:93%;
|
border-bottom: 1px solid #ccc;
|
||||||
line-height:normal;
|
}
|
||||||
}
|
|
||||||
#tabBar ul {
|
#tabBar ul {
|
||||||
margin:0;
|
margin: 0px;
|
||||||
padding:10px 10px 0;
|
padding: 4px 10px 0px 4px;
|
||||||
list-style:none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
#tabBar li {
|
#tabBar li {
|
||||||
float:left;
|
display: inline;
|
||||||
background:url("../images/taskpane/norm_left.gif") no-repeat left top;
|
margin: 0px;
|
||||||
margin:0;
|
padding: 0px;
|
||||||
padding:0 0 0 9px;
|
}
|
||||||
}
|
#tabBar a {
|
||||||
#tabBar a {
|
background: url("../images/office/tab_left.gif") no-repeat left top;
|
||||||
display:block;
|
float:left;
|
||||||
background:url("../images/taskpane/norm_right.gif") no-repeat right top;
|
margin: 0px;
|
||||||
padding:5px 15px 4px 6px;
|
padding: 0px 0px 0px 4px;
|
||||||
text-decoration:none;
|
text-decoration: none;
|
||||||
font-weight:bold;
|
}
|
||||||
color:#765;
|
#tabBar a span {
|
||||||
}
|
background: url("../images/office/tab_right.gif") no-repeat right top;
|
||||||
#tabBar a:hover {
|
color: #666;
|
||||||
color:#333;
|
display: block;
|
||||||
}
|
float: none;
|
||||||
#tabBar #current {
|
padding: 5px 15px 4px 6px;
|
||||||
background-image:url("../images/taskpane/norm_left_on.gif");
|
height: 18px;
|
||||||
}
|
}
|
||||||
#tabBar #current a {
|
|
||||||
background-image:url("../images/taskpane/norm_right_on.gif");
|
|
||||||
color:#333;
|
|
||||||
padding-bottom:5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#spaceListHeader {width:100%;
|
#tabBar a:hover span {
|
||||||
height:auto;
|
color: #FFF;
|
||||||
padding:6px;}
|
}
|
||||||
|
#tabBar a:hover {
|
||||||
|
background-position: 0% -42px;
|
||||||
|
}
|
||||||
|
#tabBar a:hover span {
|
||||||
|
background-position: 100% -42px;
|
||||||
|
}
|
||||||
|
|
||||||
#mycheckedoutdocsListHeader {width:100%;
|
#tabBar #current a {
|
||||||
height:auto;
|
background-position: 0% -42px;
|
||||||
padding:6px;}
|
}
|
||||||
|
#tabBar #current a span {
|
||||||
|
background-position: 100% -42px;
|
||||||
|
}
|
||||||
|
|
||||||
#mytodoListHeader {width:100%;
|
.header {
|
||||||
height:auto;
|
clear: both;
|
||||||
padding:6px;}
|
width: 282px;
|
||||||
|
padding: 6px 0px 2px 4px;
|
||||||
|
font-weight: bold;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
#contentListHeader {width:100%;
|
.headerExtra {
|
||||||
height:auto;padding:6px;}
|
font-weight: normal;
|
||||||
|
float: right;
|
||||||
|
margin-top: -13px;
|
||||||
|
}
|
||||||
|
|
||||||
#searchResultsListHeader {width:100%;
|
.listBig {
|
||||||
height:auto;padding:6px;}
|
clear: both;
|
||||||
|
float: left;
|
||||||
|
width: 282px;
|
||||||
|
height: 378px;
|
||||||
|
overflow: auto;
|
||||||
|
border: 1px solid #cccccc;
|
||||||
|
margin: 0px 4px 0px 4px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
.listMedium {
|
||||||
|
clear: both;
|
||||||
|
float: left;
|
||||||
|
width: 282px;
|
||||||
|
height: 204px;
|
||||||
|
overflow: auto;
|
||||||
|
border: 1px solid #cccccc;
|
||||||
|
margin: 0px 4px 0px 4px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
#detailsListHeader {width:100%;
|
.listMediumGrow {
|
||||||
height:auto;padding:6px;}
|
height: 354px !important;
|
||||||
|
}
|
||||||
|
.listMediumShrink {
|
||||||
|
height: 54px !important;
|
||||||
|
}
|
||||||
|
|
||||||
#versionListHeader {width:100%;
|
.odd {
|
||||||
height:auto;padding:6px;}
|
background-color: #f8f8f8 !important;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
.even {
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
#advWorkflowListHeader {width:100%;
|
#currentSpaceInfo {
|
||||||
height:auto;padding:6px;}
|
clear: both;
|
||||||
|
float: left;
|
||||||
|
width: 282px;
|
||||||
|
height: 34px;
|
||||||
|
overflow: none;
|
||||||
|
border: 1px solid #cccccc;
|
||||||
|
margin: 4px 4px 0px;
|
||||||
|
padding: 4px 0px 0px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
#myTasksListHeader {width:100%;
|
TABLE, TR, TD {
|
||||||
height:auto;padding:6px;}
|
border: 0px;
|
||||||
|
border-collapse: collapse;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
#simpleWorkflowHeader {width:100%;
|
ul {
|
||||||
height:auto;padding:6px;}
|
margin: 0px;
|
||||||
|
list-style: none;
|
||||||
|
padding: 2px 0px 0px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
#currentSpaceInfo {width:100%;
|
#documentActions {
|
||||||
padding: 6px}
|
clear: both;
|
||||||
|
background-color: #ffffcc;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
float: left;
|
||||||
|
margin: 0px 4px;
|
||||||
|
height: 150px;
|
||||||
|
width: 282px;
|
||||||
|
}
|
||||||
|
|
||||||
#simpleWorkflowInfo {width:100%;
|
#documentActionsNavigation {
|
||||||
padding: 6px}
|
clear: both;
|
||||||
|
background-color: #ffffcc;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
float: left;
|
||||||
|
margin: 0px 4px;
|
||||||
|
height: 106px;
|
||||||
|
width: 282px;
|
||||||
|
}
|
||||||
|
|
||||||
#spaceList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
|
#nonStatusText {
|
||||||
#mycheckedoutdocsList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
|
min-height: 100%;
|
||||||
#mytodoList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
|
position: relative;
|
||||||
#contentList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
|
}
|
||||||
#searchResultsList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
|
|
||||||
#detailsList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
|
|
||||||
#versionList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
|
|
||||||
#advWorkflowList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
|
|
||||||
#myTasksList {width:97%;overflow:auto; border: 1px solid #cccccc;margin-left:6px;background:#fff;}
|
|
||||||
|
|
||||||
TABLE {border:0px;
|
#searchResultsList {
|
||||||
padding:2px;}
|
min-height: 100%;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
A {color:#0073e6; }
|
#statusText {
|
||||||
|
border: none;
|
||||||
|
float: left;
|
||||||
|
margin: -22px 0px;
|
||||||
|
padding: 2px;
|
||||||
|
position: relative;
|
||||||
|
height: 17px;
|
||||||
|
width: 278px;
|
||||||
|
}
|
||||||
|
|
||||||
#bottomMargin {height:6px;}
|
#search {
|
||||||
|
clear: both;
|
||||||
|
float: left;
|
||||||
|
width: 282px;
|
||||||
|
border: 1px solid #cccccc;
|
||||||
|
margin: 0px 4px;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
#documentActions ul {
|
input.button {
|
||||||
margin:0;
|
|
||||||
padding:10px 10px 0;
|
|
||||||
list-style:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#documentActions {width:97%;margin-left:6px;padding-top:6px;padding-bottom:6px;}
|
|
||||||
|
|
||||||
#search {padding: 24px 0px 0px 10px;}
|
|
||||||
|
|
||||||
input.button{
|
|
||||||
color:#0073e6;
|
color:#0073e6;
|
||||||
font-size:11px;
|
font-size:11px;
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
@@ -124,7 +209,22 @@ input.button{
|
|||||||
border-right-color:#0073e6;
|
border-right-color:#0073e6;
|
||||||
border-bottom-color:#0073e6;
|
border-bottom-color:#0073e6;
|
||||||
filter:progid:DXImageTransform.Microsoft.Gradient
|
filter:progid:DXImageTransform.Microsoft.Gradient
|
||||||
(GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff');
|
(GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff');
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
margin-left:6px;
|
margin-left:6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#taskDetails {
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.taskItemSelected {
|
||||||
|
background-color: #ffe500 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.taskResources {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
margin: 4px;
|
||||||
|
height: 128px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
BIN
source/web/images/icons/make_versionable.gif
Normal file
After Width: | Height: | Size: 278 B |
BIN
source/web/images/office/action_failed.gif
Normal file
After Width: | Height: | Size: 374 B |
BIN
source/web/images/office/action_successful.gif
Normal file
After Width: | Height: | Size: 394 B |
BIN
source/web/images/office/ajax_anim.gif
Normal file
After Width: | Height: | Size: 970 B |
BIN
source/web/images/office/make_versionable.gif
Normal file
After Width: | Height: | Size: 278 B |
BIN
source/web/images/office/my_tasks.gif
Normal file
After Width: | Height: | Size: 595 B |
BIN
source/web/images/office/search_again.gif
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
source/web/images/office/tab_left.gif
Normal file
After Width: | Height: | Size: 377 B |
BIN
source/web/images/office/tab_right.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
source/web/images/office/task_item.gif
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
source/web/images/office/task_overdue.gif
Normal file
After Width: | Height: | Size: 110 B |
BIN
source/web/images/office/task_today.gif
Normal file
After Width: | Height: | Size: 104 B |
98
source/web/scripts/office/my_tasks.js
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
* Prerequisites: mootools.v1.1.js
|
||||||
|
*/
|
||||||
|
var OfficeMyTasks =
|
||||||
|
{
|
||||||
|
init: function()
|
||||||
|
{
|
||||||
|
var tasks = $$('#taskList .taskItem');
|
||||||
|
|
||||||
|
tasks.each(function(task, i)
|
||||||
|
{
|
||||||
|
task.isOpen = false;
|
||||||
|
|
||||||
|
// register 'mouseenter' event for each task
|
||||||
|
task.addEvent('mouseenter', function(e)
|
||||||
|
{
|
||||||
|
if (task.isOpen)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// highlight the item title
|
||||||
|
task.addClass('taskItemSelected');
|
||||||
|
|
||||||
|
// reset styles on all closed tasks
|
||||||
|
tasks.each(function(otherTask, j)
|
||||||
|
{
|
||||||
|
if ((otherTask != task) && (!otherTask.isOpen))
|
||||||
|
{
|
||||||
|
// reset selected class
|
||||||
|
otherTask.removeClass('taskItemSelected');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// register 'mouseleave' event for each task
|
||||||
|
task.addEvent('mouseleave', function(e)
|
||||||
|
{
|
||||||
|
if (task.isOpen)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// unhighlight the item title
|
||||||
|
task.removeClass('taskItemSelected');
|
||||||
|
});
|
||||||
|
|
||||||
|
// register 'click' event for each task
|
||||||
|
task.addEvent('click', function(e)
|
||||||
|
{
|
||||||
|
if (!task.isOpen)
|
||||||
|
{
|
||||||
|
// open up this task
|
||||||
|
// flag this task as open
|
||||||
|
task.isOpen = true;
|
||||||
|
|
||||||
|
OfficeAddin.showStatusText("Loading task...", "ajax_anim.gif", false);
|
||||||
|
|
||||||
|
// ajax call to load task details
|
||||||
|
var actionURL = "/alfresco/service/office/myTasksDetail?t=" + task.id;
|
||||||
|
var myAjax = new Ajax(actionURL, {
|
||||||
|
method: 'get',
|
||||||
|
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
|
||||||
|
onComplete: function(textResponse, xmlResponse)
|
||||||
|
{
|
||||||
|
OfficeAddin.hideStatusText();
|
||||||
|
$("taskDetails").innerHTML = textResponse;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
myAjax.request();
|
||||||
|
|
||||||
|
// close other open tasks
|
||||||
|
tasks.each(function(otherTask, j)
|
||||||
|
{
|
||||||
|
if (otherTask != task)
|
||||||
|
{
|
||||||
|
// close any other open tasks
|
||||||
|
otherTask.isOpen = false;
|
||||||
|
|
||||||
|
// unhighlight the item title
|
||||||
|
otherTask.removeClass('taskItemSelected');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('taskList').addEvent('mouseleave', function(e)
|
||||||
|
{
|
||||||
|
// handler for mouse leaving the entire task list
|
||||||
|
tasks.each(function(task, i)
|
||||||
|
{
|
||||||
|
if (!task.isOpen)
|
||||||
|
{
|
||||||
|
task.removeClass('taskItemSelected');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEvent('domready', OfficeMyTasks.init);
|
160
source/web/scripts/office/office_addin.js
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
/*
|
||||||
|
* Prerequisites: mootools.v1.1.js
|
||||||
|
*/
|
||||||
|
var OfficeAddin =
|
||||||
|
{
|
||||||
|
ANIM_LENGTH: 300,
|
||||||
|
STATUS_FADE: 10000,
|
||||||
|
LIST_DEF_HEIGHT: 204,
|
||||||
|
|
||||||
|
init: function()
|
||||||
|
{
|
||||||
|
this.queryObject = OfficeAddin.toQueryObject(document.location.search);
|
||||||
|
|
||||||
|
/* Update needed after page load? */
|
||||||
|
if(this.queryObject.st)
|
||||||
|
{
|
||||||
|
var objResponse = Json.evaluate(this.queryObject.st);
|
||||||
|
var imgSuccess = (objResponse.statusCode ? "action_successful.gif" : "action_failed.gif");
|
||||||
|
OfficeAddin.showStatusText(objResponse.statusString, imgSuccess, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Have search box? */
|
||||||
|
if ($("searchText"))
|
||||||
|
{
|
||||||
|
$("searchText").addEvent("keydown", function(event)
|
||||||
|
{
|
||||||
|
event = new Event(event);
|
||||||
|
if (event.key == 'enter')
|
||||||
|
{
|
||||||
|
$("simpleSearchButton").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Have expandos? */
|
||||||
|
if ($("toggleSpaceList"))
|
||||||
|
{
|
||||||
|
$("toggleSpaceList").addEvent("click", function()
|
||||||
|
{
|
||||||
|
$("spaceList").removeClass("listMediumShrink");
|
||||||
|
$("spaceList").addClass("listMediumGrow");
|
||||||
|
$("documentList").removeClass("listMediumGrow");
|
||||||
|
$("documentList").addClass("listMediumShrink");
|
||||||
|
});
|
||||||
|
$("toggleDocumentList").addEvent("click", function()
|
||||||
|
{
|
||||||
|
$("documentList").removeClass("listMediumShrink");
|
||||||
|
$("documentList").addClass("listMediumGrow");
|
||||||
|
$("spaceList").removeClass("listMediumGrow");
|
||||||
|
$("spaceList").addClass("listMediumShrink");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
toQueryObject: function(s)
|
||||||
|
{
|
||||||
|
var obj = {};
|
||||||
|
$A(s.substring(1).split('&')).each(function(param)
|
||||||
|
{
|
||||||
|
param = decodeURIComponent(param).split("=");
|
||||||
|
obj[param[0]] = param[1];
|
||||||
|
});
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
|
|
||||||
|
showStatusText: function(statusText, statusImage, fadeOut)
|
||||||
|
{
|
||||||
|
var e = $("statusText");
|
||||||
|
if (statusImage)
|
||||||
|
{
|
||||||
|
statusText = "<img src=\"../../images/office/" + statusImage + "\" alt=\"*\" style=\"padding-right: 8px;\" align=\"top\" />" + statusText;
|
||||||
|
}
|
||||||
|
e.innerHTML = statusText;
|
||||||
|
e.setStyle("opacity", "1");
|
||||||
|
if (statusText == "")
|
||||||
|
{
|
||||||
|
e.setStyle("border-top", "");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e.setStyle("border-top", "1px dashed #808080");
|
||||||
|
var fx = new Fx.Style(e, 'background-color',
|
||||||
|
{
|
||||||
|
duration: OfficeAddin.ANIM_LENGTH,
|
||||||
|
transition: Fx.Transitions.linear
|
||||||
|
});
|
||||||
|
if (fadeOut)
|
||||||
|
{
|
||||||
|
fx.onComplete = new function()
|
||||||
|
{
|
||||||
|
OfficeAddin.hideStatusText.delay(OfficeAddin.STATUS_FADE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fx.start('#ffffcc', '#ffffff');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
hideStatusText: function()
|
||||||
|
{
|
||||||
|
var e = $("statusText");
|
||||||
|
e.setStyle("opacity", "1");
|
||||||
|
var fx = new Fx.Style(e, 'opacity',
|
||||||
|
{
|
||||||
|
duration: OfficeAddin.ANIM_LENGTH
|
||||||
|
}).start('1', '0');
|
||||||
|
},
|
||||||
|
|
||||||
|
/* AJAX call to perform server-side actions */
|
||||||
|
runAction: function(useTemplate, Action, Doc, Msg)
|
||||||
|
{
|
||||||
|
if (Msg != "" && !confirm(Msg))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
OfficeAddin.showStatusText("Running action...", "ajax_anim.gif", false);
|
||||||
|
var actionURL = useTemplate + "?a=" + Action + "&d=" + Doc;
|
||||||
|
var myAjax = new Ajax(actionURL, {
|
||||||
|
method: 'get',
|
||||||
|
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
|
||||||
|
onComplete: function(textResponse, xmlResponse)
|
||||||
|
{
|
||||||
|
// Remove any trailing hash
|
||||||
|
var href = window.location.href.replace("#", "")
|
||||||
|
// Remove any previous "&st=" strings
|
||||||
|
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
||||||
|
// Optionally add a status string
|
||||||
|
if (textResponse != "")
|
||||||
|
{
|
||||||
|
href += "&st=" + encodeURI(textResponse);
|
||||||
|
}
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
myAjax.request();
|
||||||
|
},
|
||||||
|
|
||||||
|
/* AJAX call to perform server-side search */
|
||||||
|
runSearch: function(useTemplate, argPath)
|
||||||
|
{
|
||||||
|
OfficeAddin.showStatusText("Searching...", "ajax_anim.gif", false);
|
||||||
|
|
||||||
|
var searchString = $("searchText").value;
|
||||||
|
var maxResults = $("maxResults").value;
|
||||||
|
|
||||||
|
var actionURL = useTemplate + "?p=" + argPath + "&search=" + searchString + "&maxresults=" + maxResults;
|
||||||
|
var myAjax = new Ajax(actionURL, {
|
||||||
|
method: 'get',
|
||||||
|
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
|
||||||
|
onComplete: function(textResponse, xmlResponse)
|
||||||
|
{
|
||||||
|
OfficeAddin.hideStatusText();
|
||||||
|
$("searchResultsList").innerHTML = textResponse;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
myAjax.request();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEvent('domready', OfficeAddin.init);
|