OfficeAddin - client updates to prompt for filename if none set on the current document. Web script updates to support filename prompt, also order tasks by due date

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6084 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2007-06-25 08:40:58 +00:00
parent 667b29e43c
commit 9d1f65e8b3
12 changed files with 283 additions and 84 deletions

View File

@@ -105,7 +105,7 @@
<#assign versionRow=versionRow+1> <#assign versionRow=versionRow+1>
<tr class="${(versionRow % 2 = 0)?string("odd", "even")}"> <tr class="${(versionRow % 2 = 0)?string("odd", "even")}">
<td valign="top"> <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> <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>
<td> <td>
<a title="Open ${record.versionLabel}" href="#"><span style="font-weight:bold;">${record.versionLabel}</span></a><br /> <a title="Open ${record.versionLabel}" href="#"><span style="font-weight:bold;">${record.versionLabel}</span></a><br />
@@ -114,7 +114,7 @@
<#if record.description?exists> <#if record.description?exists>
Notes: ${record.description}<br/> Notes: ${record.description}<br/>
</#if> </#if>
<!-- <a href="#" onclick="window.external.compareDocument('/alfresco${d.url}')" title="Compare with current">Compare with current</a><br/> --> <a class="bold" href="#" onclick="window.external.compareDocument('${d.url}')" title="Compare with current">Compare with current</a><br />
</td> </td>
</tr> </tr>
</#list> </#list>

View File

@@ -30,7 +30,7 @@
<div id="tabBar"> <div id="tabBar">
<ul> <ul>
<li id="current"><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}"><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}"><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;n=${d.id}"><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}"><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}"><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}"><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}"><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}"><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}"><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}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
@@ -40,56 +40,57 @@
<div class="header">My Checked Out Documents<span class="headerExtra"><span class="toggle">&nbsp;</span></span></div> <div class="header">My Checked Out Documents<span class="headerExtra"><span class="toggle">&nbsp;</span></span></div>
<div id="checkedoutList" class="containerMedium togglePanel"> <div id="checkedoutList" class="containerMedium togglePanel">
<table width="265">
<#assign rowNum=0> <#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>
<#assign rowNum=rowNum+1> <#assign rowNum=rowNum+1>
<tr class="checkedoutItem ${(rowNum % 2 = 0)?string("odd", "even")}"> <div class="documentItem ${(rowNum % 2 = 0)?string("odd", "even")}">
<td valign="top"> <span class="documentItemIcon">
<img src="${url.context}${child.icon32}" alt="${child.name}" /> <img src="${url.context}${child.icon32}" alt="${child.name}" />
</td> </span>
<td style="line-height:16px;"> <span class="documentItemDetails">
<#if child.name?ends_with(".doc")> <#if child.name?ends_with(".doc")>
<#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('\'', '\\\'') />
<a href="#" onclick="window.external.openDocument('${webdavPath}')" title="Open ${child.name}" style="font-weight: bold;">${child.name}</a><br/> <a href="#" onclick="window.external.openDocument('${webdavPath}')" title="Open ${child.name}" style="font-weight: bold;">${child.name}</a><br/>
<#else> <#else>
<a href="${url.context}${child.url}?ticket=${session.ticket}" title="Open ${child.name}" style="font-weight: bold;">${child.name}</a><br/> <a href="${url.context}${child.url}?ticket=${session.ticket}" target="_blank" title="Open ${child.name}" style="font-weight: bold;">${child.name}</a><br/>
</#if> </#if>
<#if child.properties.description?exists> <#if child.properties.description?exists>
<#if (child.properties.description?length > 0)>
${child.properties.description}<br /> ${child.properties.description}<br />
</#if> </#if>
</#if>
Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br/> Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br/>
<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> <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>
<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="${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>
<#if !child.name?ends_with(".pdf")> <#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> <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>
</td> </span>
</tr> </div>
</#if> </#if>
</#list> </#list>
<#if rowNum = 0> <#if rowNum = 0>
<tr> <div>
<td class="noItems">(No documents)</td> <span class="noItems">(No documents)</span>
</tr> </div>
</#if> </#if>
</table>
</div> </div>
<div class="header">My Tasks<span class="headerExtra"><span class="taskKey"><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><span class="toggle">&nbsp;</span></span></div> <div class="header">My Tasks<span class="headerExtra"><span class="taskKey"><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><span class="toggle">&nbsp;</span></span></div>
<div id="taskList" class="containerMedium togglePanel"> <div id="taskList" class="containerMedium togglePanel">
<table width="265">
<#assign taskNum=0> <#assign taskNum=0>
<#list workflow.assignedTasks?sort_by('startDate') as t> <#list workflow.assignedTasks?sort_by('startDate') as t>
<#assign taskNum=taskNum+1> <#assign taskNum=taskNum+1>
<tr id="${t.id?replace("$", ".")}" class="taskItem ${(taskNum % 2 = 0)?string("odd", "even")}">
<td>
<#assign hasDue=t.properties["bpm:dueDate"]?exists> <#assign hasDue=t.properties["bpm:dueDate"]?exists>
<#if hasDue> <#if hasDue>
<#assign due=t.properties["bpm:dueDate"]> <#assign due=t.properties["bpm:dueDate"]>
</#if>
<div id="${t.id?replace("$", ".")}" class="taskItem" rel="<#if hasDue>${due?date?string("yyyyMMddHHmmss")}<#else>99999999999999</#if>">
<span class="taskIndicator">
<#if hasDue>
<#-- items due today? --> <#-- items due today? -->
<#if (dateCompare(date?date, due?date, 0, "==") == 1)> <#if (dateCompare(date?date, due?date, 0, "==") == 1)>
<img src="${url.context}/images/office/task_today.gif" alt="due today" /> <img src="${url.context}/images/office/task_today.gif" alt="due today" />
@@ -100,23 +101,22 @@
<#else> <#else>
&nbsp; &nbsp;
</#if> </#if>
</td> </span>
<td> <span class="taskItemDetails">
<span style="font-weight: bold;">${t.description?html}</span> (${t.type?html}) <span style="font-weight: bold;">${t.description?html}</span> (${t.type?html})
<#if hasDue> <#if hasDue>
<br />Due date: ${due?date} <br />Due date: ${due?date}
<#else> <#else>
<br />(No due date) <br />(No due date)
</#if> </#if>
</td> </span>
</tr> </div>
</#list> </#list>
<#if taskNum = 0> <#if taskNum = 0>
<tr> <div>
<td class="noItems">(No tasks)</td> <span class="noItems">(No tasks)</span>
</tr> </div>
</#if> </#if>
</table>
</div> </div>
<div class="header">Actions</div> <div class="header">Actions</div>

View File

@@ -35,7 +35,7 @@
<div id="tabBar"> <div id="tabBar">
<ul> <ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li> <li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}"><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;n=${d.id}"><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}"><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}"><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}"><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}"><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}"><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.serviceContext}/office/myTasks?p=${path?url}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li> <li id="current"><a title="My Tasks" href="${url.serviceContext}/office/myTasks?p=${path?url}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
@@ -45,15 +45,16 @@
<div class="header">My Tasks<span class="headerExtra"><span class="taskKey"><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></span></div> <div class="header">My Tasks<span class="headerExtra"><span class="taskKey"><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></span></div>
<div id="taskList" class="containerMedium"> <div id="taskList" class="containerMedium">
<table width="265">
<#assign taskNum=0> <#assign taskNum=0>
<#list workflow.assignedTasks?sort_by('startDate') as t> <#list workflow.assignedTasks?sort_by('startDate') as t>
<#assign taskNum=taskNum+1> <#assign taskNum=taskNum+1>
<tr id="${t.id?replace("$", ".")}" class="taskItem ${(taskNum % 2 = 0)?string("odd", "even")}">
<td>
<#assign hasDue=t.properties["bpm:dueDate"]?exists> <#assign hasDue=t.properties["bpm:dueDate"]?exists>
<#if hasDue> <#if hasDue>
<#assign due=t.properties["bpm:dueDate"]> <#assign due=t.properties["bpm:dueDate"]>
</#if>
<div id="${t.id?replace("$", ".")}" class="taskItem" rel="<#if hasDue>${due?date?string("yyyyMMddHHmmss")}<#else>99999999999999</#if>">
<span class="taskIndicator">
<#if hasDue>
<#-- items due today? --> <#-- items due today? -->
<#if (dateCompare(date?date, due?date, 0, "==") == 1)> <#if (dateCompare(date?date, due?date, 0, "==") == 1)>
<img src="${url.context}/images/office/task_today.gif" alt="due today" /> <img src="${url.context}/images/office/task_today.gif" alt="due today" />
@@ -64,23 +65,22 @@
<#else> <#else>
&nbsp; &nbsp;
</#if> </#if>
</td> </span>
<td> <span class="taskItemDetails">
<span style="font-weight: bold;">${t.description?html}</span> (${t.type?html}) <span style="font-weight: bold;">${t.description?html}</span> (${t.type?html})
<#if hasDue> <#if hasDue>
<br />Due date: ${due?date} <br />Due date: ${due?date}
<#else> <#else>
<br />(No due date) <br />(No due date)
</#if> </#if>
</td> </span>
</tr> </div>
</#list> </#list>
<#if taskNum = 0> <#if taskNum = 0>
<tr> <div>
<td class="noItems">(No tasks)</td> <span class="noItems">(No tasks)</span>
</tr> </div>
</#if> </#if>
</table>
</div> </div>
<div class="header">Workflow</div> <div class="header">Workflow</div>

View File

@@ -17,10 +17,11 @@
<script type="text/javascript" src="${url.context}/scripts/office/navigation.js"></script> <script type="text/javascript" src="${url.context}/scripts/office/navigation.js"></script>
</head> </head>
<body> <body>
<div id="overlayPanel"></div>
<div id="tabBar"> <div id="tabBar">
<ul> <ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li> <li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li>
<li id="current"><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;n=${node.id}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li> <li id="current"><a title="Browse Spaces and Documents" href="${url.serviceContext}/office/navigation?p=${path?url}"><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}"><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}"><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}"><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}"><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}"><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}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>
@@ -100,7 +101,7 @@
</div> </div>
</div> </div>
<#assign spacesFound = 0> <#assign spacesFound = 0>
<#list thisSpace.children as child> <#list thisSpace.children?sort_by('name') as child>
<#if child.isContainer> <#if child.isContainer>
<#assign spacesFound = spacesFound + 1> <#assign spacesFound = spacesFound + 1>
<div class="spaceItem ${(spacesFound % 2 = 0)?string("even", "odd")}"> <div class="spaceItem ${(spacesFound % 2 = 0)?string("even", "odd")}">
@@ -127,19 +128,19 @@
<div id="documentList" class="containerMedium togglePanel"> <div id="documentList" class="containerMedium togglePanel">
<#assign documentsFound = 0> <#assign documentsFound = 0>
<#list thisSpace.children as child> <#list thisSpace.children?sort_by('name') as child>
<#if child.isDocument> <#if child.isDocument>
<#assign documentsFound = documentsFound + 1> <#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('\'', '\\\'') />
<div class="documentItem ${(documentsFound % 2 = 0)?string("even", "odd")}"> <div class="documentItem ${(documentsFound % 2 = 0)?string("even", "odd")}">
<span style="float: left; width: 36px;"> <span class="documentItemIcon">
<#if child.name?ends_with(".doc")> <#if child.name?ends_with(".doc")>
<a href="#" onclick="window.external.openDocument('${webdavPath}')"><img src="${url.context}${child.icon32}" 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="${url.context}${child.url}?ticket=${session.ticket}" rel="_blank"><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a> <a href="${url.context}${child.url}?ticket=${session.ticket}" rel="_blank"><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
</#if> </#if>
</span> </span>
<span> <span class="documentItemDetails">
<#if child.name?ends_with(".doc")> <#if child.name?ends_with(".doc")>
<a href="#" onclick="window.external.openDocument('${webdavPath}')"><span class="bold">${child.name}</span></a> <a href="#" onclick="window.external.openDocument('${webdavPath}')"><span class="bold">${child.name}</span></a>
<#else> <#else>
@@ -147,8 +148,10 @@
</#if> </#if>
<br /> <br />
<#if child.properties.description?exists> <#if child.properties.description?exists>
<#if (child.properties.description?length > 0)>
${child.properties.description}<br /> ${child.properties.description}<br />
</#if> </#if>
</#if>
Modified: ${child.properties.modified?datetime}, Size: ${(child.size / 1024)?int}Kb<br/> Modified: ${child.properties.modified?datetime}, Size: ${(child.size / 1024)?int}Kb<br/>
<#if child.isLocked > <#if child.isLocked >
<img src="${url.context}/images/office/lock.gif" style="padding:3px 6px 2px 0px;" alt="Locked" /> <img src="${url.context}/images/office/lock.gif" style="padding:3px 6px 2px 0px;" alt="Locked" />
@@ -174,13 +177,19 @@
<div class="header">Actions</div> <div class="header">Actions</div>
<#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 currentPath = currentPath?substring(13)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
<div id="documentActionsNavigation"> <div id="documentActionsNavigation">
<div id="saveDetailsPanel">
Document filename:<br />
<input class="saveDetailsItem" type="text" id="saveFilename" style="height: 18px; width: 168px;" />
<a class="spaceAction" href="#" onclick="OfficeNavigation.saveOK(this);">OK</a>
<a class="spaceAction" href="#" onclick="OfficeNavigation.saveCancel();">Cancel</a>
</div>
<div id="nonStatusText"> <div id="nonStatusText">
<ul> <ul>
<#if !node.isDocument> <#if !node.isDocument>
<li> <li>
<a href="#" onclick="window.external.saveToAlfresco('${webdavPath}')"> <a href="#" onclick="OfficeNavigation.saveToAlfresco('${currentPath}')">
<img src="${url.context}/images/office/save_to_alfresco.gif" alt="Save to Alfresco" /> <img src="${url.context}/images/office/save_to_alfresco.gif" alt="Save to Alfresco" />
Save to Alfresco Save to Alfresco
</a> </a>

View File

@@ -3,6 +3,26 @@ if ((args.n) && (args.n != ""))
{ {
model.node = search.findNode("workspace://SpacesStore/" + args.n); model.node = search.findNode("workspace://SpacesStore/" + args.n);
} }
else if ((args.p) && (args.p != ""))
{
var path = args.p;
if (path == "/Company Home")
{
model.node = companyhome;
}
else
{
var node = companyhome.childByNamePath(path.substring(13));
if (node != null)
{
model.node = node;
}
else
{
model.node = companyhome;
}
}
}
else else
{ {
model.node = companyhome; model.node = companyhome;

View File

@@ -20,7 +20,7 @@
<div id="tabBar"> <div id="tabBar">
<ul> <ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}"><span><img src="${url.context}/images/office/my_alfresco.gif" alt="My Alfresco" /></span></a></li> <li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path?url}"><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;n=${node.id}"><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}"><span><img src="${url.context}/images/office/navigator.gif" alt="Browse Spaces and Documents" /></span></a></li>
<li id="current"><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}"><span><img src="${url.context}/images/office/search.gif" alt="Search Alfresco" /></span></a></li> <li id="current"><a title="Search Alfresco" href="${url.serviceContext}/office/search?p=${path?url}"><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}"><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}"><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}"><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}"><span><img src="${url.context}/images/office/my_tasks.gif" alt="My Tasks" /></span></a></li>

View File

@@ -1,8 +1,8 @@
<#if args.search?exists> <#if args.search?exists>
<#assign searchString = args.search> <#assign searchString = args.search>
<#if searchString != ""> <#if searchString != "">
<#-- assign queryString = "(TEXT:\"${searchString}\") OR (@cm\\:name:*${searchString}*)" --> <#assign queryString = "(TEXT:\"${searchString}\") OR (@cm\\:name:*${searchString}*)" >
<#assign queryString = "@\\{http\\://www.alfresco.org/model/content/1.0\\}name:*${searchString}*" > <#-- assign queryString = "@\\{http\\://www.alfresco.org/model/content/1.0\\}name:*${searchString}*" -->
</#if> </#if>
<#else> <#else>
<#assign searchString = ""> <#assign searchString = "">
@@ -15,19 +15,16 @@
<#else> <#else>
<#assign maxresults=10> <#assign maxresults=10>
</#if> </#if>
<#assign resCount=0>
<#assign rescount=0>
<table>
<#assign results = companyhome.childrenByLuceneSearch[queryString] > <#assign results = companyhome.childrenByLuceneSearch[queryString] >
<#if results?size = 0> <#if results?size = 0>
<tr> <div>
<td>(No results found)</td> <span class="noItems">(No results found)</span>
</tr> </div>
<#else> <#else>
<#assign totalResults = results?size> <#assign totalResults = results?size>
<#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(".pdf")> <#if child.name?ends_with(".pdf")>
<#assign openURL = "${url.context}${child.url}"> <#assign openURL = "${url.context}${child.url}">
@@ -41,27 +38,28 @@
<#assign openURL = "${url.serviceContext}/office/navigation?p=${args.p?url}&amp;n=${child.id}&amp;search=${searchString?url}&amp;maxresults=${maxresults}"> <#assign openURL = "${url.serviceContext}/office/navigation?p=${args.p?url}&amp;n=${child.id}&amp;search=${searchString?url}&amp;maxresults=${maxresults}">
<#assign hrefExtra = ""> <#assign hrefExtra = "">
</#if> </#if>
<tr> <div class="documentItem ${(resCount % 2 = 0)?string("odd", "even")}"">
<td style="width: 32px;"> <span class="documentItemIcon">
<a href="${openURL}" ${hrefExtra}><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a> <a href="${openURL}" ${hrefExtra}><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
</td> </span>
<td> <span class="documentItemDetails">
<a href="${openURL}" ${hrefExtra} title="Open ${child.name}">${child.name}</a><br /> <a href="${openURL}" ${hrefExtra} title="Open ${child.name}">${child.name}</a><br />
<#if child.properties.description?exists> <#if child.properties.description?exists>
<#if (child.properties.description?length > 0)>
${child.properties.description}<br /> ${child.properties.description}<br />
</#if> </#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> </#if>
</td> </span>
</tr> </div>
<#if rescount = maxresults> <#if resCount = maxresults>
<#break> <#break>
</#if> </#if>
</#list> </#list>
</#if> </#if>
</table>
</#if> </#if>
<script type="text/javascript"> <script type="text/javascript">
OfficeSearch.itemsFound(${rescount}, ${totalResults}); OfficeSearch.itemsFound(${resCount}, ${totalResults});
</script> </script>

View File

@@ -13,6 +13,17 @@ body {
overflow: hidden; overflow: hidden;
} }
#overlayPanel
{
background-color: #ffffff;
position: absolute;
left: 0px;
top: 0px;
height: 652px;
width: 290px;
z-index: 1;
}
a { a {
color: #0073e6; color: #0073e6;
text-decoration: none; text-decoration: none;
@@ -278,11 +289,23 @@ input.button {
} }
.documentItem { .documentItem {
float: left;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
padding: 2px 0px 6px 0px; padding: 2px 0px 6px 0px;
width: 265px; width: 265px;
} }
.documentItemIcon {
float: left;
width: 36px;
padding: 0px 2px 0px 1px;
}
.documentItemDetails {
float: left;
width: 226px;
}
#documentActions { #documentActions {
clear: both; clear: both;
background-color: #ffffcc; background-color: #ffffcc;
@@ -325,6 +348,30 @@ input.button {
padding: 0px 3px 0px 0px; padding: 0px 3px 0px 0px;
} }
#saveDetailsPanel
{
position: absolute;
border: 1px solid #CCD4DB;
background-color: #EEF7FB;
height: 40px;
width: 267px;
margin: 8px 0px 0px;
padding: 8px;
display: none;
z-index: 1;
-moz-border-radius: 5px;
}
.saveDetailsItem
{
background-color: #ffffff;
border: 1px solid #CCD4DB;
color: #0073e6;
float: left;
font-size: 11px;
margin: 0px 4px 4px 4px;
padding: 2px;
}
#nonStatusText { #nonStatusText {
height: 100%; height: 100%;
@@ -373,6 +420,22 @@ input.button {
.taskItem { .taskItem {
cursor: pointer; cursor: pointer;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
float: left;
padding: 4px 0px;
}
.taskIndicator {
display: block;
float: left;
height: 12px;
padding: 0px 0px 0px 2px;
width: 12px;
}
.taskItemDetails {
display: block;
float: left;
width: 251px;
} }
.taskItemSelected { .taskItemSelected {
@@ -411,7 +474,7 @@ input.button {
float: left; float: left;
padding: 4px 4px 0px 0px; padding: 4px 4px 0px 0px;
text-align: right; text-align: right;
width: 64px; width: 62px;
} }
.taskValue { .taskValue {

View File

@@ -9,6 +9,7 @@ var OfficeMyAlfresco =
init: function() init: function()
{ {
OfficeAddin.sortTasks($('taskList'));
OfficeMyAlfresco.setupTasks(); OfficeMyAlfresco.setupTasks();
OfficeMyAlfresco.setupToggles(); OfficeMyAlfresco.setupToggles();
}, },

View File

@@ -7,6 +7,7 @@ var OfficeMyTasks =
{ {
init: function() init: function()
{ {
OfficeAddin.sortTasks($('taskList'));
OfficeMyTasks.setupEventHandlers(); OfficeMyTasks.setupEventHandlers();
if (window.queryObject.t) if (window.queryObject.t)
@@ -143,8 +144,11 @@ var OfficeMyTasks =
}, },
openTask: function(taskId) openTask: function(taskId)
{
if ($(taskId))
{ {
$(taskId).fireEvent("click"); $(taskId).fireEvent("click");
}
}, },
transitionTask: function(taskId, commandURL, successMessage) transitionTask: function(taskId, commandURL, successMessage)

View File

@@ -8,9 +8,12 @@ var OfficeNavigation =
ANIM_LENGTH: 800, ANIM_LENGTH: 800,
CREATE_SPACE_HEIGHT: 108, CREATE_SPACE_HEIGHT: 108,
CREATE_SPACE_TEMPLATE: 16, CREATE_SPACE_TEMPLATE: 16,
OVERLAY_ANIM_LENGTH: 300,
OVERLAY_OPACITY: 0.7,
init: function() init: function()
{ {
$('overlayPanel').setStyle('opacity', 0);
OfficeNavigation.setupToggles(); OfficeNavigation.setupToggles();
OfficeNavigation.setupCreateSpace(); OfficeNavigation.setupCreateSpace();
@@ -186,6 +189,82 @@ var OfficeNavigation =
} }
}); });
myAjax.request(); myAjax.request();
},
saveToAlfresco: function(currentPath)
{
// Does the current doc have an extension?
if (!window.external.docHasExtension())
{
// No - we need to ask for a filename
OfficeNavigation.showSaveFilenamePanel(currentPath);
}
else
{
window.external.saveToAlfresco(currentPath);
}
},
showSaveFilenamePanel: function(currentPath)
{
this.fxOverlay = $("overlayPanel").effect('opacity',
{
duration: OfficeNavigation.OVERLAY_ANIM_LENGTH
});
var panel = $("saveDetailsPanel");
panel.setStyle("opacity", 0);
panel.setStyle("display", "inline");
var anim = new Fx.Styles(panel,
{
duration: OfficeNavigation.ANIM_LENGTH,
transition: Fx.Transitions.linear,
onComplete: function()
{
$('saveFilename').addEvent('keydown', function(event)
{
event = new Event(event);
if (event.key == 'enter')
{
OfficeNavigation.saveOK();
}
else if (event.key == 'esc')
{
OfficeNavigation.saveCancel();
}
});
$('saveFilename').focus();
}
}).start({'opacity': 1});
this.fxOverlay.start(OfficeNavigation.OVERLAY_OPACITY);
this.popupPanel = panel;
this.popupPanel.currentPath = currentPath;
},
saveOK: function()
{
var filename = $('saveFilename').value;
var currentPath = this.popupPanel.currentPath;
if (filename.length > 0)
{
window.external.saveToAlfrescoAs(currentPath, filename);
}
OfficeNavigation.saveCancel();
},
saveCancel: function()
{
if (this.popupPanel != null)
{
this.popupPanel.setStyle("display", "none");
this.popupPanel = null;
}
if (this.fxOverlay)
{
this.fxOverlay.start(0);
}
} }
}; };

View File

@@ -157,6 +157,31 @@ var OfficeAddin =
} }
} }
return url; return url;
},
sortTasks: function(taskContainer)
{
var taskArray = new Array();
taskContainer.getElementsBySelector('.taskItem').each(function(task, i)
{
taskArray[i] = {dueDate: task.getProperty('rel'), theTask: task.clone()};
});
taskArray.sort(OfficeAddin.sortByDueDate);
taskContainer.empty();
for(var i = 0; i < taskArray.length; i++)
{
taskArray[i].theTask.addClass((i % 2 == 0) ? "odd" : "even");
taskArray[i].theTask.injectInside(taskContainer);
}
},
sortByDueDate: function(a, b)
{
var x = a.dueDate;
var y = b.dueDate;
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
} }
}; };