Various updates to Office Addin web scripts

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5903 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2007-06-11 07:58:41 +00:00
parent a3c59244d1
commit 43b4bf058a
15 changed files with 428 additions and 176 deletions

View File

@@ -24,25 +24,25 @@
<div id="tabBar"> <div id="tabBar">
<ul> <ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path}"><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}"><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}"><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 id="current"><a title="View Details" href="${url.serviceContext}/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="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}"><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>
</ul> </ul>
</div> </div>
<div class="header">Current Document Details</div> <div class="header">Current Document Details</div>
<div class="containerMedium"> <div class="containerMedium">
<table> <table width="265">
<tbody> <tbody>
<tr> <tr>
<td valign="top"> <td valign="top">
<#if d.isDocument> <#if d.isDocument>
<img src="${url.context}${d.icon32}" border="0" alt="${d.name}" /> <img src="${url.context}${d.icon32}" alt="${d.name}" />
</td> </td>
<td width="100%" style="padding-top: 4px;"> <td style="padding-top: 4px;">
<span style="font-weight:bold; vertical-align: top;">${d.name} <span style="font-weight:bold; vertical-align: top;">${d.name}
<#if d.isLocked > <#if d.isLocked >
<img src="${url.context}/images/office/lock.gif" alt="Locked" title="Locked" style="margin: -2px 0px;" /> <img src="${url.context}/images/office/lock.gif" alt="Locked" title="Locked" style="margin: -2px 0px;" />
@@ -92,8 +92,8 @@
</#if> </#if>
</div> </div>
<div class="containerMedium"> <div id="versionList" class="containerMedium">
<table> <table width="265">
<#if d.isDocument > <#if d.isDocument >
<#if hasAspect(d, "cm:versionable") == 1> <#if hasAspect(d, "cm:versionable") == 1>
<#assign versionRow=0> <#assign versionRow=0>
@@ -103,14 +103,14 @@
<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 width="100%"> <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 />
Author: ${record.creator}<br/> Author: ${record.creator}<br/>
Date: ${record.createdDate?datetime}<br/> Date: ${record.createdDate?datetime}<br/>
<#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 href="#" onclick="window.external.compareDocument('/alfresco${d.url}')" title="Compare with current">Compare with current</a><br/> -->
</td> </td>
</tr> </tr>
</#list> </#list>
@@ -120,7 +120,7 @@
The current document is not versioned.<br /> The current document is not versioned.<br />
<br /> <br />
<ul> <ul>
<li><a title="Make Versionable" href="#" onClick="OfficeAddin.runAction('${doc_actions}','makeversion','${d.id}', '');"> <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 <img src="${url.context}/images/office/make_versionable.gif" alt="Make Versionable" /> Make Versionable
</a></li> </a></li>
</ul> </ul>
@@ -146,7 +146,7 @@
<#if d.isLocked > <#if d.isLocked >
<#elseif hasAspect(d, "cm:workingcopy") == 1> <#elseif hasAspect(d, "cm:workingcopy") == 1>
<li> <li>
<a href="#" onClick="OfficeAddin.runAction('${doc_actions}','checkin','${d.id}', '');"> <a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkin','${d.id}', '');">
<img src="${url.context}/images/office/checkin.gif" alt="Check In"> <img src="${url.context}/images/office/checkin.gif" alt="Check In">
Check In Check In
</a> </a>
@@ -154,7 +154,7 @@
</li> </li>
<#else> <#else>
<li> <li>
<a href="#" onClick="OfficeAddin.runAction('${doc_actions}','checkout','${d.id}', '');"> <a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkout','${d.id}', '');">
<img src="${url.context}/images/office/checkout.gif" alt="Check Out"> <img src="${url.context}/images/office/checkout.gif" alt="Check Out">
Check Out Check Out
</a> </a>
@@ -162,26 +162,26 @@
</li> </li>
</#if> </#if>
<li> <li>
<a href="#" onClick="OfficeAddin.runAction('${doc_actions}','makepdf','${d.id}', '');"> <a href="${url.serviceContext}/office/myTasks?p=${path?url}&amp;w=new">
<img src="${url.context}/images/office/makepdf.gif" alt="Transform to PDF"> <img src="${url.context}/images/office/new_workflow.gif" alt="Start Workflow" />
Start Workflow
</a>
<br />Start Advanced Workflow for the current document.
</li>
<li>
<a href="#" onclick="OfficeAddin.runAction('${doc_actions}','makepdf','${d.id}', '');">
<img src="${url.context}/images/office/makepdf.gif" alt="Transform to PDF" />
Transform to PDF Transform to PDF
</a> </a>
<br />Transform the current document to Adobe PDF format. <br />Transform the current document to Adobe PDF format.
</li> </li>
<li> <li>
<a href="${url.context}/navigate/showOfficeAddin/workspace/SpacesStore/${d.id}?ticket=${session.ticket}" target="_blank"> <a href="${url.context}/navigate/showOfficeAddin/workspace/SpacesStore/${d.id}?ticket=${session.ticket}" rel="_blank">
<img src="${url.context}/images/office/document_details.gif" alt="Open Full Details"> <img src="${url.context}/images/office/document_details.gif" alt="Open Full Details" />
Open Full Details Open Full Details
</a> </a>
<br />Open the document details in the Alfresco Web Client. <br />Open the document details in the Alfresco Web Client.
</li> </li>
<li>
<a href="${url.serviceContext}/office/myTasks?p=${path}&w=new">
<img src="${url.context}/images/office/new_workflow.gif" alt="Start Workflow">
Start Workflow
</a>
<br />Start Advanced Workflow for the current document.
</li>
</ul> </ul>
<#else> <#else>

View File

@@ -21,40 +21,46 @@
<script type="text/javascript" src="${url.context}/scripts/ajax/mootools.v1.1.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> <script type="text/javascript" src="${url.context}/scripts/office/office_addin.js"></script>
<script type="text/javascript" src="${url.context}/scripts/office/my_alfresco.js"></script> <script type="text/javascript" src="${url.context}/scripts/office/my_alfresco.js"></script>
<script type="text/javascript" src="/firebug.js"></script>
</head> </head>
<body> <body>
<div id="tabBar"> <div id="tabBar">
<ul> <ul>
<li id="current"><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path}"><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}&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}&amp;n=${d.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.serviceContext}/office/search?p=${path}"><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}"><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}"><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>
</ul> </ul>
</div> </div>
<div class="header">My Checked Out Documents</div> <div class="header">My Checked Out Documents<span class="headerExtra"><span class="toggle">&nbsp;</span></span></div>
<div class="containerMedium"> <div id="checkedoutList" class="containerMedium togglePanel">
<table> <table>
<#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="${(rowNum % 2 = 0)?string("odd", "even")}"> <tr class="checkedoutItem ${(rowNum % 2 = 0)?string("odd", "even")}">
<td valign="top"> <td valign="top">
<img src="${url.context}${child.icon32}" alt="${child.name}" /> <img src="${url.context}${child.icon32}" alt="${child.name}" />
</td> </td>
<td style="line-height:16px;" width="100%"> <td style="line-height:16px;">
<a href="#" title="Open ${child.name}" style="font-weight: bold;">${child.name}</a><br/> <#if child.name?ends_with(".doc")>
<#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/>
<#else>
<a href="${url.context}${child.url}?ticket=${session.ticket}" title="Open ${child.name}" style="font-weight: bold;">${child.name}</a><br/>
</#if>
<#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} (${(child.size / 1024)?int}Kb)<br/> Modified: ${child.properties.modified?datetime} (${(child.size / 1024)?int}Kb)<br/>
<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="OfficeAddin.runAction('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('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> <a href="#" onclick="OfficeAddin.runAction('makepdf','${child.id}', '');"><img src="${url.context}/images/office/makepdf.gif" style="padding:3px 6px 2px 0px;" alt="Make PDF..." title="Make PDF" /></a>
</td> </td>
</tr> </tr>
</#if> </#if>
@@ -62,24 +68,24 @@
</table> </table>
</div> </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 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"> <div id="taskList" class="containerMedium togglePanel">
<table width="100%"> <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}" class="taskItem ${(taskNum % 2 = 0)?string("odd", "even")}"> <tr id="${t.id?replace("$", ".")}" class="taskItem ${(taskNum % 2 = 0)?string("odd", "even")}">
<td> <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"]>
<#-- 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"> <img src="${url.context}/images/office/task_today.gif" alt="due today" />
<#-- items overdue? --> <#-- items overdue? -->
<#elseif (dateCompare(date?date, due?date) == 1)> <#elseif (dateCompare(date?date, due?date) == 1)>
<img src="${url.context}/images/office/task_overdue.gif"> <img src="${url.context}/images/office/task_overdue.gif" alt="overdue" />
</#if> </#if>
<#else> <#else>
&nbsp; &nbsp;
@@ -104,29 +110,29 @@
<div id="nonStatusText"> <div id="nonStatusText">
<ul> <ul>
<li> <li>
<a title="Save to Alfresco" href="${url.serviceContext}/office/navigation?p=${path}"> <a title="Save to Alfresco" href="${url.serviceContext}/office/navigation?p=${path?url}">
<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>
<br />Allows you to place the current document under Alfresco management. <br />Allows you to place the current document under Alfresco management.
</li> </li>
<li> <li>
<a title="Browse Alfresco" href="${url.serviceContext}/office/navigation?p=${path}"> <a title="Browse Alfresco" href="${url.serviceContext}/office/navigation?p=${path?url}">
<img src="${url.context}/images/office/navigator.gif" alt="Browse Alfresco"> <img src="${url.context}/images/office/navigator.gif" alt="Browse Alfresco" />
Browse Alfresco Browse Alfresco
</a> </a>
<br />Navigate around the Alfresco repository for documents. <br />Navigate around the Alfresco repository for documents.
</li> </li>
<li> <li>
<a title="Search" href="${url.serviceContext}/office/search?p=${path}"> <a title="Search" href="${url.serviceContext}/office/search?p=${path?url}">
<img src="${url.context}/images/office/search.gif" alt="Search"> <img src="${url.context}/images/office/search.gif" alt="Search" />
Find Documents Find Documents
</a> </a>
<br />Search Alfresco for documents by name and content. <br />Search Alfresco for documents by name and content.
</li> </li>
<li> <li>
<a title="Launch Alfresco" href="${url.context}/navigate/browse?ticket=${session.ticket}" target="_blank"> <a title="Launch Alfresco" href="${url.context}/navigate/browse?ticket=${session.ticket}" rel="_blank">
<img src="${url.context}/images/logo/AlfrescoLogo16.gif" alt="Launch Alfresco"> <img src="${url.context}/images/logo/AlfrescoLogo16.gif" alt="Launch Alfresco" />
Launch Alfresco Launch Alfresco
</a> </a>
<br />Start the Alfresco Web Client. <br />Start the Alfresco Web Client.

View File

@@ -28,32 +28,32 @@
<div id="tabBar"> <div id="tabBar">
<ul> <ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path}"><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}&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}&amp;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.serviceContext}/office/search?p=${path}"><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}"><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}"><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>
</ul> </ul>
</div> </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 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="100%"> <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}" class="taskItem ${(taskNum % 2 = 0)?string("odd", "even")}"> <tr id="${t.id?replace("$", ".")}" class="taskItem ${(taskNum % 2 = 0)?string("odd", "even")}">
<td> <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"]>
<#-- 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"> <img src="${url.context}/images/office/task_today.gif" alt="due today" />
<#-- items overdue? --> <#-- items overdue? -->
<#elseif (dateCompare(date?date, due?date) == 1)> <#elseif (dateCompare(date?date, due?date) == 1)>
<img src="${url.context}/images/office/task_overdue.gif"> <img src="${url.context}/images/office/task_overdue.gif" alt="overdue" />
</#if> </#if>
<#else> <#else>
&nbsp; &nbsp;
@@ -61,14 +61,19 @@
</td> </td>
<td> <td>
<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> </td>
</tr> </tr>
</#list> </#list>
<#if taskNum = 0>
<tr>
<td>(No tasks)</td>
</tr>
</#if>
</table> </table>
</div> </div>
@@ -80,7 +85,7 @@
<div id="taskDetails"> <div id="taskDetails">
<table width="100%"> <table width="100%">
<tr> <tr>
<td width="32" valign="top"><img src="${url.context}/images/office/new_workflow_large.gif" alt="Start workflow" /></td> <td valign="top"><img src="${url.context}/images/office/new_workflow_large.gif" alt="Start workflow" /></td>
<td> <td>
Start workflow on:<br /><span style="font-weight: bold; padding-left: 8px;">${d.name?html}</span> Start workflow on:<br /><span style="font-weight: bold; padding-left: 8px;">${d.name?html}</span>
</td> </td>

View File

@@ -11,57 +11,59 @@
<link rel="stylesheet" type="text/css" href="${url.context}/css/office.css" /> <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/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/office_addin.js"></script>
<script type="text/javascript" src="${url.context}/scripts/office/navigation.js"></script>
</head> </head>
<body> <body>
<div id="tabBar"> <div id="tabBar">
<ul> <ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path}"><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}&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}&amp;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.serviceContext}/office/search?p=${path}"><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}"><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}"><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>
</ul> </ul>
</div> </div>
<div class="header">Current Space</div>
<div id="currentSpaceInfo"> <div id="currentSpaceInfo">
<table width="100%"> <span style="float: left;">
<tr> <span style="float: left;">
<td width="10">In:</td> <img src="${url.context}${thisSpace.icon16}" alt="${thisSpace.name}" />
<td width="16"><img src="${url.context}${thisSpace.icon16}" alt="${thisSpace.name}" /></td> </span>
<td> <span style="float: left; padding-left: 6px;">
<span class="bold">${thisSpace.name}</span> <span class="bold">${thisSpace.name}</span><br />
<#if thisSpace.properties.description?exists> <#if thisSpace.properties.description?exists>
<br />${thisSpace.properties.description} ${thisSpace.properties.description}
</#if> </#if>
</td> </span>
<td width="34" align="right"> </span>
<#if thisSpace=companyhome> <#if thisSpace=companyhome>
<#else> <#else>
<a title="Up to Parent Space" href="${url.serviceContext}/office/navigation?p=${path}&n=${thisSpace.parent.id}"> <span style="float: right;">
<img src="${url.context}/images/office/go_up.gif" alt="Up to Parent Space" /> <a title="Up to Parent Space" href="${url.serviceContext}/office/navigation?p=${path?url}&amp;n=${thisSpace.parent.id}">
<span>Up</span> <img src="${url.context}/images/office/go_up.gif" alt="Up to Parent Space" />
</a> <span>Up</span>
</a>
</span>
</#if> </#if>
</td>
</tr>
</table>
</div> </div>
<div class="header">Spaces in ${thisSpace.name}<span class="headerExtra"><span class="toggle"></span></span></div> <div class="header">Spaces in ${thisSpace.name}<span class="headerExtra"><span class="toggle">&nbsp;</span></span></div>
<div id="spaceList" class="containerMedium"> <div id="spaceList" class="containerMedium togglePanel">
<table> <table width="265">
<#assign spacesFound = 0> <#assign spacesFound = 0>
<#list thisSpace.children as child> <#list thisSpace.children as child>
<#if child.isContainer> <#if child.isContainer>
<#assign spacesFound = spacesFound + 1> <#assign spacesFound = spacesFound + 1>
<tr class="${(spacesFound % 2 = 0)?string("odd", "even")}"> <tr class="${(spacesFound % 2 = 0)?string("odd", "even")}">
<td> <td style="width: 32px;">
<a href="${url.serviceContext}/office/navigation?p=${path}&n=${child.id}"><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a> <a href="${url.serviceContext}/office/navigation?p=${path?url}&amp;n=${child.id}"><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
</td> </td>
<td width="100%"> <td>
<a href="${url.serviceContext}/office/navigation?p=${path}&n=${child.id}" title="Open ${child.name}"> <a href="${url.serviceContext}/office/navigation?p=${path?url}&amp;n=${child.id}" title="Open ${child.name}">
<span class="bold">${child.name}</span> <span class="bold">${child.name}</span>
</a> </a>
<#if child.properties.description?exists> <#if child.properties.description?exists>
@@ -79,30 +81,30 @@
</table> </table>
</div> </div>
<div class="header">Documents in ${thisSpace.name}<span class="headerExtra"><span class="toggle"></span></span></div> <div class="header">Documents in ${thisSpace.name}<span class="headerExtra"><span class="toggle">&nbsp;</span></span></div>
<div id="documentList" class="containerMedium"> <div id="documentList" class="containerMedium togglePanel">
<table> <table width="265">
<#assign documentsFound = 0> <#assign documentsFound = 0>
<#list thisSpace.children as child> <#list thisSpace.children 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('\'', '\\\'') />
<tr class="${(documentsFound % 2 = 0)?string("odd", "even")}"> <tr class="${(documentsFound % 2 = 0)?string("odd", "even")}">
<td valign="top"> <td valign="top" style="width: 32px;">
<#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}" target="_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>
</td> </td>
<td width="100%"> <td>
<#if child.name?ends_with(".doc")> <#if child.name?ends_with(".doc")>
<a href="#" onClick="window.external.openDocument('${webdavPath}')" title="Open ${child.name}"> <a href="#" onclick="window.external.openDocument('${webdavPath}')" title="Open ${child.name}">
<span class="bold">${child.name}</span> <span class="bold">${child.name}</span>
</a><br/> </a><br/>
<#else> <#else>
<a href="${url.context}${child.url}?ticket=${session.ticket}" target="_blank" title="Open ${child.name}"> <a href="${url.context}${child.url}?ticket=${session.ticket}" rel="_blank" title="Open ${child.name}">
<span class="bold">${child.name}</span> <span class="bold">${child.name}</span>
</a><br/> </a><br/>
</#if> </#if>
@@ -111,15 +113,15 @@
</#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" />
<#elseif hasAspect(child, "cm:workingcopy") == 1> <#elseif hasAspect(child, "cm:workingcopy") == 1>
<a href="#" onClick="OfficeAddin.runAction('${doc_actions}','checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In"></a> <a href="#" onclick="OfficeAddin.runAction('${doc_actions}','checkin','${child.id}', '');"><img src="${url.context}/images/office/checkin.gif" style="padding:3px 6px 2px 0px;" alt="Check In" title="Check In" /></a>
<#else> <#else>
<a href="#" onClick="OfficeAddin.runAction('${doc_actions}','checkout','${child.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding:3px 6px 2px 0px;" alt="Check Out" title="Check Out"></a> <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>
<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 !child.isLocked > <#if !child.isLocked >
<a href="#" onClick="OfficeAddin.runAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="${url.context}/images/office/delete.gif" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete"></a> <a href="#" onclick="OfficeAddin.runAction('${doc_actions}','delete','${child.id}', 'Are you sure you want to delete this document?');"><img src="${url.context}/images/office/delete.gif" style="padding:3px 6px 2px 0px;" alt="Delete..." title="Delete" /></a>
</#if> </#if>
</td> </td>
</tr> </tr>
@@ -141,16 +143,16 @@
<div id="nonStatusText"> <div id="nonStatusText">
<ul> <ul>
<li> <li>
<a href="#" onClick="window.external.saveToAlfresco('${webdavPath}')"> <a href="#" onclick="window.external.saveToAlfresco('${webdavPath}')">
<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>
<br />Allows you to place the current document under Alfresco management. <br />Allows you to place the current document under Alfresco management.
</li> </li>
<#if args.search?exists> <#if args.search?exists>
<li> <li>
<a href="${url.serviceContext}/office/search?p=${path}&searchagain=${args.search}&maxresults=${args.maxresults}"> <a href="${url.serviceContext}/office/search?p=${path?url}&amp;searchagain=${args.search?url}&amp;maxresults=${args.maxresults}">
<img src="${url.context}/images/office/search_again.gif" alt="Back to results"> <img src="${url.context}/images/office/search_again.gif" alt="Back to results" />
Back to search results Back to search results
</a> </a>
<br />Return to the search tab. <br />Return to the search tab.

View File

@@ -16,11 +16,11 @@
<!-- ${maxResults} --> <!-- ${maxResults} -->
<div id="tabBar"> <div id="tabBar">
<ul> <ul>
<li><a title="My Alfresco" href="${url.serviceContext}/office/myAlfresco?p=${path}"><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}&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}&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="Search Alfresco" href="${url.serviceContext}/office/search?p=${path}"><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}"><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}"><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>
</ul> </ul>
</div> </div>
@@ -34,16 +34,16 @@
<input type="text" id="searchText" value="${searchText}" maxlength="512" /> <input type="text" id="searchText" value="${searchText}" maxlength="512" />
</span> </span>
<span> <span>
<a id="simpleSearchButton" class="taskAction" href="#" onClick="${searchCommand}">Search</a> <a id="simpleSearchButton" class="taskAction" href="#" onclick="${searchCommand}">Search</a>
</span> </span>
<span class="searchParam"> <span class="searchParam">
Return a maximum of Return a maximum of
<select id="maxResults" name="maxResults" onChange="${searchCommand}"> <select id="maxResults" name="maxResults" onchange="${searchCommand}">
<option <#if maxResults="5">selected </#if>value="5">5</option> <option <#if maxResults="5">selected="selected" </#if>value="5">5</option>
<option <#if maxResults="10">selected </#if>value="10">10</option> <option <#if maxResults="10">selected="selected" </#if>value="10">10</option>
<option <#if maxResults="15">selected </#if>value="15">15</option> <option <#if maxResults="15">selected="selected" </#if>value="15">15</option>
<option <#if maxResults="20">selected </#if>value="20">20</option> <option <#if maxResults="20">selected="selected" </#if>value="20">20</option>
<option <#if maxResults="50">selected </#if>value="50">50</option> <option <#if maxResults="50">selected="selected" </#if>value="50">50</option>
</select>&nbsp;items </select>&nbsp;items
</span> </span>
</div> </div>
@@ -53,9 +53,9 @@
</div> </div>
<div class="header">Items Found</div> <div class="header"><span id="itemsFound">&nbsp;</span></div>
<div class="containerBig"> <div id="resultsList" class="containerSearchResults">
<div id="searchResultsList"></div> <div id="searchResultsList"></div>
</div> </div>

View File

@@ -1,7 +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}\" @cm\\:title:*${searchString}*"> <#-- assign queryString = "(TEXT:\"${searchString}\") OR (@cm\\:name:*${searchString}*)" -->
<#assign queryString = "@\\{http\\://www.alfresco.org/model/content/1.0\\}name:*${searchString}*" >
</#if> </#if>
<#else> <#else>
<#assign searchString = ""> <#assign searchString = "">
@@ -15,7 +16,7 @@
<#assign maxresults=10> <#assign maxresults=10>
</#if> </#if>
<#assign rescount=1> <#assign rescount=0>
<table> <table>
<#assign results = companyhome.childrenByLuceneSearch[queryString] > <#assign results = companyhome.childrenByLuceneSearch[queryString] >
@@ -24,7 +25,9 @@
<td>(No results found)</td> <td>(No results found)</td>
</tr> </tr>
<#else> <#else>
<#assign totalResults = results?size>
<#list results as child> <#list results as child>
<#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}">
@@ -35,11 +38,11 @@
<#assign hrefExtra = " onClick=\"window.external.openDocument('${webdavPath}')\""> <#assign hrefExtra = " onClick=\"window.external.openDocument('${webdavPath}')\"">
</#if> </#if>
<#else> <#else>
<#assign openURL = "${url.serviceContext}/office/navigation?p=${args.p}&n=${child.id}&search=${searchString}&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> <tr>
<td width="32"> <td style="width: 32px;">
<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> </td>
<td> <td>
@@ -55,8 +58,10 @@
<#if rescount = maxresults> <#if rescount = maxresults>
<#break> <#break>
</#if> </#if>
<#assign rescount=rescount + 1>
</#list> </#list>
</#if> </#if>
</table> </table>
</#if> </#if>
<script type="text/javascript">
OfficeSearch.itemsFound(${rescount}, ${totalResults});
</script>

View File

@@ -1,3 +1,7 @@
html {
overflow: hidden;
}
body { body {
background: url("../images/office/view_bg.gif") top; background: url("../images/office/view_bg.gif") top;
color: #0073e6; color: #0073e6;
@@ -18,6 +22,30 @@ a img {
border: 0px; border: 0px;
} }
TABLE, TR, TD {
border: 0px;
border-collapse: collapse;
padding: 2px;
}
ul {
margin: 0px;
list-style: none;
padding: 2px 0px 0px 24px;
}
input.button {
background-color: #cce6ff;
border: 1px solid #0073e6;
color: #0073e6;
font-size: 11px;
font-weight: bold;
cursor: pointer;
margin-left: 6px;
padding: 1px 4px;
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#ffffff', EndColorStr='#cce6ff');
}
.bold { .bold {
font-weight: bold; font-weight: bold;
} }
@@ -73,16 +101,37 @@ a img {
.header { .header {
clear: both; clear: both;
width: 282px;
padding: 6px 0px 2px 4px;
font-weight: bold; font-weight: bold;
float: left; float: left;
padding: 6px 0px 2px 4px;
height: 13px;
width: 282px;
} }
.headerExtra { .headerExtra {
font-weight: normal; font-weight: normal;
float: right; float: right;
margin-top: -13px; height: 13px;
margin: -13px 0px 0px 0px;
}
.taskKey {
float: left;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
.toggle {
background: transparent url("../images/office/arrow_up.gif") no-repeat;
cursor: pointer;
display: block;
float: left;
margin: -3px -1px 0px 4px;
height: 16px;
width: 16px;
}
.toggled {
background-image: url("../images/office/arrow_down.gif") !important;
} }
.containerBig { .containerBig {
@@ -116,44 +165,38 @@ a img {
background: #fff; background: #fff;
} }
.containerMediumGrow { .containerSearchResults {
height: 354px !important; clear: both;
float: left;
width: 282px;
height: 497px;
overflow: auto;
border: 1px solid #cccccc;
margin: 0px 4px 0px 4px;
background: #fff;
} }
.containerMediumShrink {
height: 54px !important; #checkedoutList, #taskList, #spaceList, #documentList, #versionList, #resultsList {
overflow-y: scroll;
} }
.odd { .odd {
background-color: #f8f8f8 !important; background-color: #f8f8f8 !important;
border-bottom: 1px solid #eee;
} }
.even { .even {
background-color: #ffffff !important; background-color: #ffffff !important;
border-bottom: 1px solid #eee;
} }
#currentSpaceInfo { #currentSpaceInfo {
background: #fff;
border: 1px solid #cccccc;
clear: both; clear: both;
float: left; float: left;
width: 282px;
height: 34px; height: 34px;
width: 280px;
overflow: none; overflow: none;
border: 1px solid #cccccc; margin: 0px 4px;
margin: 4px 4px 0px; padding: 2px 0px 2px 2px;
padding: 4px 0px 0px;
background: #fff;
}
TABLE, TR, TD {
border: 0px;
border-collapse: collapse;
padding: 2px;
}
ul {
margin: 0px;
list-style: none;
padding: 2px 0px 0px 24px;
} }
#documentActions { #documentActions {
@@ -180,7 +223,7 @@ ul {
border: 1px solid #ccc; border: 1px solid #ccc;
float: left; float: left;
margin: 0px 4px; margin: 0px 4px;
height: 106px; height: 89px;
width: 282px; width: 282px;
} }
#documentActionsNavigation li a { #documentActionsNavigation li a {
@@ -228,16 +271,8 @@ ul {
overflow: hidden; overflow: hidden;
} }
input.button { .checkedoutItem {
background-color: #cce6ff; border-bottom: 1px solid #eee;
border: 1px solid #0073e6;
color: #0073e6;
font-size: 11px;
font-weight: bold;
cursor: pointer;
margin-left: 6px;
padding: 1px 4px;
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#ffffff', EndColorStr='#cce6ff');
} }
#taskDetails { #taskDetails {
@@ -246,10 +281,11 @@ input.button {
.taskItem { .taskItem {
cursor: pointer; cursor: pointer;
border-bottom: 1px solid #eee;
} }
.taskItemSelected { .taskItemSelected {
background-color: #ffe500 !important; background-color: #ffff90 !important;
} }
.taskResources { .taskResources {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 248 B

View File

@@ -4,7 +4,16 @@
*/ */
var OfficeMyAlfresco = var OfficeMyAlfresco =
{ {
TOGGLE_AMOUNT: 150,
ANIM_LENGTH: 800,
init: function() init: function()
{
OfficeMyAlfresco.setupTasks();
OfficeMyAlfresco.setupToggles();
},
setupTasks: function()
{ {
var tasks = $$('#taskList .taskItem'); var tasks = $$('#taskList .taskItem');
@@ -37,7 +46,7 @@ var OfficeMyAlfresco =
// register 'click' event for each task // register 'click' event for each task
task.addEvent('click', function(e) task.addEvent('click', function(e)
{ {
window.location.href = window.serviceContextPath + "/office/myTasks?p=" + window.queryObject.p + "&t=" + task.id; window.location.href = window.serviceContextPath + "/office/myTasks?p=" + window.queryObject.p + "&t=" + task.id.replace(/\./, "$");
}); });
}); });
@@ -49,8 +58,80 @@ var OfficeMyAlfresco =
task.removeClass('taskItemSelected'); task.removeClass('taskItemSelected');
}); });
}); });
} },
setupToggles: function()
{
// Elements of interest
var panels = $$('.togglePanel');
var toggles = $$('.toggle');
// Animation
var fxPanel = new Fx.Elements(panels, {wait: false, duration: OfficeMyAlfresco.ANIM_LENGTH, transition: Fx.Transitions.Back.easeInOut});
panels.each(function(panel, i)
{
toggle = toggles[i];
panel.defaultHeight = panel.getStyle('height').toInt();
panel.isToggled = false;
toggle.addEvent('click', function(e)
{
var animPanel = {};
if (panel.isToggled)
{
panel.isToggled = false;
this.removeClass('toggled');
animPanel[i] =
{
'height': [panel.getStyle('height').toInt(), panel.defaultHeight]
};
// reset all other panels
panels.each(function(otherPanel, j)
{
if (otherPanel != panel)
{
// reset panel
otherPanel.isToggled = false;
toggles[j].removeClass('toggled');
animPanel[j] =
{
'height': [otherPanel.getStyle('height').toInt(), otherPanel.defaultHeight]
};
}
});
}
else
{
panel.isToggled = true;
this.addClass('toggled');
animPanel[i] =
{
'height': [panel.getStyle('height').toInt(), panel.defaultHeight + (OfficeMyAlfresco.TOGGLE_AMOUNT * (panels.length - 1))]
};
// set all other panels
panels.each(function(otherPanel, j)
{
if (otherPanel != panel)
{
// set panel
otherPanel.isToggled = false;
toggles[j].removeClass('toggled');
animPanel[j] =
{
'height': [otherPanel.getStyle('height').toInt(), otherPanel.defaultHeight - OfficeMyAlfresco.TOGGLE_AMOUNT]
};
}
});
}
fxPanel.start(animPanel);
});
});
}
}; };
window.addEvent('domready', OfficeMyAlfresco.init); window.addEvent('domready', OfficeMyAlfresco.init);

View File

@@ -101,7 +101,7 @@ var OfficeMyTasks =
OfficeAddin.showStatusText("Loading task...", "ajax_anim.gif", false); OfficeAddin.showStatusText("Loading task...", "ajax_anim.gif", false);
// ajax call to load task details // ajax call to load task details
var actionURL = window.serviceContextPath + "/office/myTasksDetail?t=" + task.id; var actionURL = window.serviceContextPath + "/office/myTasksDetail?t=" + task.id.replace(/\./, "$");
var myAjax = new Ajax(actionURL, { var myAjax = new Ajax(actionURL, {
method: 'get', method: 'get',
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'}, headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},

View File

@@ -0,0 +1,89 @@
/*
* Prerequisites: mootools.v1.1.js
* office_addin.js
*/
var OfficeNavigation =
{
TOGGLE_AMOUNT: 150,
ANIM_LENGTH: 800,
init: function()
{
OfficeNavigation.setupToggles();
},
setupToggles: function()
{
// Elements of interest
var panels = $$('.togglePanel');
var toggles = $$('.toggle');
// Animation
var fxPanel = new Fx.Elements(panels, {wait: false, duration: OfficeNavigation.ANIM_LENGTH, transition: Fx.Transitions.Back.easeInOut});
panels.each(function(panel, i)
{
toggle = toggles[i];
panel.defaultHeight = panel.getStyle('height').toInt();
panel.isToggled = false;
toggle.addEvent('click', function(e)
{
var animPanel = {};
if (panel.isToggled)
{
panel.isToggled = false;
this.removeClass('toggled');
animPanel[i] =
{
'height': [panel.getStyle('height').toInt(), panel.defaultHeight]
};
// reset all other panels
panels.each(function(otherPanel, j)
{
if (otherPanel != panel)
{
// reset panel
otherPanel.isToggled = false;
toggles[j].removeClass('toggled');
animPanel[j] =
{
'height': [otherPanel.getStyle('height').toInt(), otherPanel.defaultHeight]
};
}
});
}
else
{
panel.isToggled = true;
this.addClass('toggled');
animPanel[i] =
{
'height': [panel.getStyle('height').toInt(), panel.defaultHeight + (OfficeNavigation.TOGGLE_AMOUNT * (panels.length - 1))]
};
// set all other panels
panels.each(function(otherPanel, j)
{
if (otherPanel != panel)
{
// set panel
otherPanel.isToggled = false;
toggles[j].removeClass('toggled');
animPanel[j] =
{
'height': [otherPanel.getStyle('height').toInt(), otherPanel.defaultHeight - OfficeNavigation.TOGGLE_AMOUNT]
};
}
});
}
fxPanel.start(animPanel);
});
});
}
};
window.addEvent('domready', OfficeNavigation.init);

View File

@@ -20,6 +20,19 @@ var OfficeAddin =
var imgSuccess = (objResponse.statusCode ? "action_successful.gif" : "action_failed.gif"); var imgSuccess = (objResponse.statusCode ? "action_successful.gif" : "action_failed.gif");
OfficeAddin.showStatusText(objResponse.statusString, imgSuccess, true); OfficeAddin.showStatusText(objResponse.statusString, imgSuccess, true);
} }
OfficeAddin.makeExternalLinks();
},
makeExternalLinks: function(e)
{
$$('a').each(function(anchor, i)
{
if (anchor.getProperty('rel') == '_blank')
{
anchor.target = "_blank";
}
});
}, },
toQueryObject: function(s) toQueryObject: function(s)

View File

@@ -6,7 +6,7 @@ var OfficeSearch =
{ {
init: function() init: function()
{ {
$("searchText").addEvent("keydown", function(event) $('searchText').addEvent('keydown', function(event)
{ {
event = new Event(event); event = new Event(event);
if (event.key == 'enter') if (event.key == 'enter')
@@ -14,6 +14,20 @@ var OfficeSearch =
$("simpleSearchButton").onclick(); $("simpleSearchButton").onclick();
} }
}); });
$('itemsFound').innerHTML = "Results Shown Below";
},
itemsFound: function(shownResults, totalResults)
{
if (shownResults < totalResults)
{
$('itemsFound').innerHTML = "Showing first " + shownResults + " of " + totalResults + " total items found";
}
else
{
$('itemsFound').innerHTML = "Showing all " + shownResults + " items found";
}
}, },
/* AJAX call to perform server-side search */ /* AJAX call to perform server-side search */
@@ -21,17 +35,18 @@ var OfficeSearch =
{ {
OfficeAddin.showStatusText("Searching...", "ajax_anim.gif", false); OfficeAddin.showStatusText("Searching...", "ajax_anim.gif", false);
var searchString = $("searchText").value; var searchString = $('searchText').value;
var maxResults = $("maxResults").value; var maxResults = $('maxResults').value;
var actionURL = useTemplate + "?p=" + argPath + "&search=" + searchString + "&maxresults=" + maxResults; var actionURL = useTemplate + "?p=" + argPath + "&search=" + searchString + "&maxresults=" + maxResults;
var myAjax = new Ajax(actionURL, { var myAjax = new Ajax(actionURL, {
method: 'get', method: 'get',
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'}, headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
evalScripts: true,
onComplete: function(textResponse, xmlResponse) onComplete: function(textResponse, xmlResponse)
{ {
OfficeAddin.hideStatusText(); OfficeAddin.hideStatusText();
$("searchResultsList").innerHTML = textResponse; $('searchResultsList').innerHTML = textResponse;
} }
}); });
myAjax.request(); myAjax.request();