mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Office Addin web scripts complete, incl new workflow (review and adhoc only)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5895 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
// Client has requested certain actions on the current document
|
||||
|
||||
/* Inputs */
|
||||
var docId = args["d"],
|
||||
runAction = args["a"];
|
||||
var docId = args.d,
|
||||
runAction = args.a;
|
||||
|
||||
/* Outputs */
|
||||
var resultString = "Action failed.",
|
||||
@@ -60,6 +60,25 @@ if (doc != null && doc.isDocument)
|
||||
resultCode = true;
|
||||
}
|
||||
}
|
||||
else if (runAction == "workflow")
|
||||
{
|
||||
var workflowType = "jbpm$wf:" + args.wt;
|
||||
var assignTo = people.getPerson(args.at);
|
||||
var dueDate = new Date(args.dd);
|
||||
var description = args.desc;
|
||||
|
||||
var workflow = actions.create("start-workflow");
|
||||
workflow.parameters.workflowName = workflowType;
|
||||
workflow.parameters["bpm:workflowDescription"] = description;
|
||||
workflow.parameters["bpm:assignee"] = assignTo;
|
||||
if ((args.dd) && (args.dd != ""))
|
||||
{
|
||||
workflow.parameters["bpm:workflowDueDate"] = dueDate;
|
||||
}
|
||||
workflow.execute(doc);
|
||||
resultString = "New workflow started.";
|
||||
resultCode = true;
|
||||
}
|
||||
else if (runAction == "test")
|
||||
{
|
||||
resultString = "Test complete.";
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<#assign doc_actions="${url.context}/service/office/docActions">
|
||||
<#assign doc_actions="${url.serviceContext}/office/docActions">
|
||||
<#if args.p?exists><#assign path=args.p><#else><#assign path=""></#if>
|
||||
<#-- resolve the path (from Company Home) into a node -->
|
||||
<#if path?starts_with("/Company Home")>
|
||||
@@ -24,17 +24,17 @@
|
||||
|
||||
<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}"><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 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 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>
|
||||
<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="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="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="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="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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="header">Current Document Details</div>
|
||||
|
||||
<div class="listMedium">
|
||||
<div class="containerMedium">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -92,7 +92,7 @@
|
||||
</#if>
|
||||
</div>
|
||||
|
||||
<div class="listMedium">
|
||||
<div class="containerMedium">
|
||||
<table>
|
||||
<#if d.isDocument >
|
||||
<#if hasAspect(d, "cm:versionable") == 1>
|
||||
@@ -145,13 +145,43 @@
|
||||
<ul>
|
||||
<#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" style="padding-right:6px;" alt="Check In">Check In</a></li>
|
||||
<li>
|
||||
<a href="#" onClick="OfficeAddin.runAction('${doc_actions}','checkin','${d.id}', '');">
|
||||
<img src="${url.context}/images/office/checkin.gif" alt="Check In">
|
||||
Check In
|
||||
</a>
|
||||
<br />Check in the current document.
|
||||
</li>
|
||||
<#else>
|
||||
<li><a href="#" onClick="OfficeAddin.runAction('${doc_actions}','checkout','${d.id}', '');"><img src="${url.context}/images/office/checkout.gif" style="padding-right:6px;" alt="Check Out">Check Out</a></li>
|
||||
<li>
|
||||
<a href="#" onClick="OfficeAddin.runAction('${doc_actions}','checkout','${d.id}', '');">
|
||||
<img src="${url.context}/images/office/checkout.gif" alt="Check Out">
|
||||
Check Out
|
||||
</a>
|
||||
<br />Check out the current document to a working copy.
|
||||
</li>
|
||||
</#if>
|
||||
<li><a href="#" onClick="OfficeAddin.runAction('${doc_actions}','makepdf','${d.id}', '');"><img src="${url.context}/images/office/makepdf.gif" 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>
|
||||
<li><a href="${url.context}/service/office/myTasks?p=${path}&w=new"><img src="${url.context}/images/office/new_workflow.gif" style="padding-right:6px;" alt="Start Workflow">Start Workflow</a></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
|
||||
</a>
|
||||
<br />Transform the current document to Adobe PDF format.
|
||||
</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" alt="Open Full Details">
|
||||
Open Full Details
|
||||
</a>
|
||||
<br />Open the document details in the Alfresco Web Client.
|
||||
</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>
|
||||
|
||||
<#else>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<#assign n=0>
|
||||
<#list searchResults as result>
|
||||
<#if (n > 0)>,<#else>[</#if>
|
||||
"${"${result.properties.firstName} ${result.properties.lastName}"?trim}"
|
||||
"${"${result.properties.firstName} ${result.properties.lastName}"?trim} (${result.properties.userName})"
|
||||
<#assign n=n+1>
|
||||
</#list>
|
||||
]
|
@@ -7,9 +7,9 @@ if ((args.s) && (args.s != ""))
|
||||
for (i = 0; i < terms.length; i++)
|
||||
{
|
||||
term = terms[i];
|
||||
query += "((@\\{http\\://www.alfresco.org/model/content/1.0\\}firstName:" + term;
|
||||
// query += "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}lastName:*" + term;
|
||||
// query += "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}userName:" + term;
|
||||
query += "((@\\{http\\://www.alfresco.org/model/content/1.0\\}firstName:*" + term;
|
||||
query += "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}lastName:*" + term;
|
||||
query += "*) OR (@\\{http\\://www.alfresco.org/model/content/1.0\\}userName:" + term;
|
||||
query += "*)) "; // final space here is important as default OR separator
|
||||
}
|
||||
query += ")";
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<#assign doc_actions="${url.context}/service/office/docActions">
|
||||
<#assign doc_actions="${url.serviceContext}/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>
|
||||
<#-- resolve the path (from Company Home) into a node -->
|
||||
@@ -26,17 +26,17 @@
|
||||
|
||||
<div id="tabBar">
|
||||
<ul>
|
||||
<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 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><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><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>
|
||||
<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><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="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="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="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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="header">My Checked Out Documents</div>
|
||||
|
||||
<div class="listMedium">
|
||||
<div class="containerMedium">
|
||||
<table>
|
||||
<#assign rowNum=0>
|
||||
<#assign query="@cm\\:workingCopyOwner:${person.properties.userName}">
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<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">
|
||||
<div id="taskList" class="containerMedium">
|
||||
<table width="100%">
|
||||
<#assign taskNum=0>
|
||||
<#list workflow.assignedTasks?sort_by('startDate') as t>
|
||||
@@ -101,15 +101,42 @@
|
||||
<div class="header">Other Actions</div>
|
||||
|
||||
<div id="documentActions">
|
||||
<ul>
|
||||
<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>
|
||||
<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><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><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>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="nonStatusText">
|
||||
<ul>
|
||||
<li>
|
||||
<a title="Save to Alfresco" href="${url.serviceContext}/office/navigation?p=${path}">
|
||||
<img src="${url.context}/images/office/save_to_alfresco.gif" alt="Save to Alfresco">
|
||||
Save to Alfresco
|
||||
</a>
|
||||
<br />Allows you to place the current document under Alfresco management.
|
||||
</li>
|
||||
<li>
|
||||
<a title="Browse Alfresco" href="${url.serviceContext}/office/navigation?p=${path}">
|
||||
<img src="${url.context}/images/office/navigator.gif" alt="Browse Alfresco">
|
||||
Browse Alfresco
|
||||
</a>
|
||||
<br />Navigate around the Alfresco repository for documents.
|
||||
</li>
|
||||
<li>
|
||||
<a title="Search" href="${url.serviceContext}/office/search?p=${path}">
|
||||
<img src="${url.context}/images/office/search.gif" alt="Search">
|
||||
Find Documents
|
||||
</a>
|
||||
<br />Search Alfresco for documents by name and content.
|
||||
</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">
|
||||
Launch Alfresco
|
||||
</a>
|
||||
<br />Start the Alfresco Web Client.
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="statusText"></div>
|
||||
<div id="statusText"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -1,4 +1,4 @@
|
||||
<#assign doc_actions="${url.context}/service/office/docActions">
|
||||
<#assign doc_actions="${url.serviceContext}/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>
|
||||
<#-- resolve the path (from Company Home) into a node -->
|
||||
@@ -20,6 +20,7 @@
|
||||
<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/autocompleter.js"></script>
|
||||
<script type="text/javascript" src="${url.context}/scripts/ajax/date_picker.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>
|
||||
@@ -27,17 +28,17 @@
|
||||
|
||||
<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>
|
||||
<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="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="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="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="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>
|
||||
</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">
|
||||
<div id="taskList" class="containerMedium">
|
||||
<table width="100%">
|
||||
<#assign taskNum=0>
|
||||
<#list workflow.assignedTasks?sort_by('startDate') as t>
|
||||
@@ -73,7 +74,7 @@
|
||||
|
||||
<div class="header">Workflow</div>
|
||||
|
||||
<div class="listBig">
|
||||
<div class="containerBig">
|
||||
<div id="nonStatusText">
|
||||
<#if args.w?exists && d.isDocument>
|
||||
<div id="taskDetails">
|
||||
@@ -90,18 +91,30 @@
|
||||
<div class="taskParameters">
|
||||
<div class="taskParam">Workflow:</div>
|
||||
<div class="taskValue">
|
||||
<select id="wrkType" style="font-size: 9pt;">
|
||||
<option value="review">Review & Approve</option>
|
||||
<select id="wrkType" style="width: 178px;">
|
||||
<option value="review" selected>Review & Approve</option>
|
||||
<option value="adhoc">Adhoc Task</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="taskParam">Assign to:</div>
|
||||
<div class="taskValue"><input id="wrkUser" type="text" style="font-size: 9pt;"/></div>
|
||||
<div id="ajxUser" style="display: none;"><img src="${url.context}/images/office/ajax_anim.gif" alt="*" /></div>
|
||||
<div class="taskValue">
|
||||
<input id="wrkAssignTo" type="text" value="" />
|
||||
<img id="ajxAssignTo" src="${url.context}/images/office/ajax_anim.gif" alt="*" style="display: none;" />
|
||||
</div>
|
||||
<div class="taskParam">Due on:</div>
|
||||
<div class="taskValue"><i>TODO: calendar picker</i></div>
|
||||
<div class="taskValue">
|
||||
<input type="text" id="wrkDueDate" value="" />
|
||||
<img src="${url.context}/images/office/date.gif" alt="date" />
|
||||
</div>
|
||||
<div class="taskParam">Description:</div>
|
||||
<div class="taskValue"><textarea id="wrkDescription" style="font-size: 9pt;"></textarea></div>
|
||||
<div class="taskValue"><textarea id="wrkDescription"></textarea></div>
|
||||
<div class="taskParam"> </div>
|
||||
<div class="taskValue">
|
||||
<a class="taskAction" href="#" onclick="OfficeMyTasks.startWorkflow('${url.serviceContext}/office/docActions', '${d.id}');">
|
||||
Submit
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<#else>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<#assign doc_actions="${url.context}/service/office/docActions">
|
||||
<#assign doc_actions="${url.serviceContext}/office/docActions">
|
||||
<#if node.isDocument>
|
||||
<#assign thisSpace = node.parent>
|
||||
<#else>
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
<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 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><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><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>
|
||||
<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 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><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="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="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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<td width="34" align="right">
|
||||
<#if thisSpace=companyhome>
|
||||
<#else>
|
||||
<a title="Up to Parent Space" href="${url.context}/service/office/navigation?p=${path}&n=${thisSpace.parent.id}">
|
||||
<a title="Up to Parent Space" href="${url.serviceContext}/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>
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<div class="header">Spaces in ${thisSpace.name}<span class="headerExtra"><span class="toggle"></span></span></div>
|
||||
|
||||
<div id="spaceList" class="listMedium">
|
||||
<div id="spaceList" class="containerMedium">
|
||||
<table>
|
||||
<#assign spacesFound = 0>
|
||||
<#list thisSpace.children as child>
|
||||
@@ -58,10 +58,10 @@
|
||||
<#assign spacesFound = spacesFound + 1>
|
||||
<tr class="${(spacesFound % 2 = 0)?string("odd", "even")}">
|
||||
<td>
|
||||
<a href="${url.context}/service/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}&n=${child.id}"><img src="${url.context}${child.icon32}" alt="Open ${child.name}" /></a>
|
||||
</td>
|
||||
<td width="100%">
|
||||
<a href="${url.context}/service/office/navigation?p=${path}&n=${child.id}" title="Open ${child.name}">
|
||||
<a href="${url.serviceContext}/office/navigation?p=${path}&n=${child.id}" title="Open ${child.name}">
|
||||
<span class="bold">${child.name}</span>
|
||||
</a>
|
||||
<#if child.properties.description?exists>
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
<div class="header">Documents in ${thisSpace.name}<span class="headerExtra"><span class="toggle"></span></span></div>
|
||||
|
||||
<div id="documentList" class="listMedium">
|
||||
<div id="documentList" class="containerMedium">
|
||||
<table>
|
||||
<#assign documentsFound = 0>
|
||||
<#list thisSpace.children as child>
|
||||
@@ -135,14 +135,26 @@
|
||||
|
||||
<div class="header">Document Actions</div>
|
||||
|
||||
<#assign currentPath = thisSpace.displayPath + '/' + thisSpace.name />
|
||||
<#assign webdavPath = currentPath?substring(13)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
|
||||
<div id="documentActionsNavigation">
|
||||
<div id="nonStatusText">
|
||||
<ul>
|
||||
<#assign currentPath = thisSpace.displayPath + '/' + thisSpace.name />
|
||||
<#assign webdavPath = currentPath?substring(13)?url('ISO-8859-1')?replace('%2F', '/')?replace('\'', '\\\'') />
|
||||
<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>
|
||||
<li>
|
||||
<a href="#" onClick="window.external.saveToAlfresco('${webdavPath}')">
|
||||
<img src="${url.context}/images/office/save_to_alfresco.gif" alt="Save to Alfresco">
|
||||
Save to Alfresco
|
||||
</a>
|
||||
<br />Allows you to place the current document under Alfresco management.
|
||||
</li>
|
||||
<#if args.search?exists>
|
||||
<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>
|
||||
<li>
|
||||
<a href="${url.serviceContext}/office/search?p=${path}&searchagain=${args.search}&maxresults=${args.maxresults}">
|
||||
<img src="${url.context}/images/office/search_again.gif" alt="Back to results">
|
||||
Back to search results
|
||||
</a>
|
||||
<br />Return to the search tab.
|
||||
</li>
|
||||
</#if>
|
||||
</ul>
|
||||
</div>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<#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>
|
||||
<#assign searchCommand="OfficeSearch.runSearch('${url.context}/service/office/searchResults', '${path}')" >
|
||||
<#assign searchCommand="OfficeSearch.runSearch('${url.serviceContext}/office/searchResults', '${path}')" >
|
||||
<#if (args.searchagain?exists)><#assign searchText=args.searchagain><#else><#assign searchText=""></#if>
|
||||
<#if (args.maxresults?exists)><#assign maxResults=args.maxresults><#else><#assign maxResults="5"></#if>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
@@ -13,45 +13,50 @@
|
||||
<script type="text/javascript" src="${url.context}/scripts/office/search.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- ${maxResults} -->
|
||||
<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 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 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 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>
|
||||
<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="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="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="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="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>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="header">Search</div>
|
||||
|
||||
<div id="search">
|
||||
<table width="100%" border="0" style="font-family: tahoma, sans-serif; font-size: 11px;">
|
||||
<tr valign="top">
|
||||
<td align="left" valign="middle">
|
||||
<div class="containerSmall">
|
||||
<div id="nonStatusText">
|
||||
<div class="searchBox">
|
||||
<span class="searchParam">
|
||||
Search for
|
||||
<input type="text" id="searchText" name="searchText" value="${searchText}" maxlength="1024" style="width:140px; font-size:10px" />
|
||||
<input type="button" name="simpleSearchButton" id="simpleSearchButton" class="button" onClick="${searchCommand}" value="Search" /><br />
|
||||
<br />
|
||||
Return a maximum of <select id="maxResults" name="maxResults" onChange="${searchCommand}">
|
||||
<option <#if maxResults="5">selected</#if> value="5">5</option>
|
||||
<option <#if maxResults="10">selected</#if> value="10">10</option>
|
||||
<option <#if maxResults="15">selected</#if>value="15">15</option>
|
||||
<option <#if maxResults="20">selected</#if>value="20">20</option>
|
||||
<option <#if maxResults="50">selected</#if>value="50">50</option>
|
||||
</select> items
|
||||
<br/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="text" id="searchText" value="${searchText}" maxlength="512" />
|
||||
</span>
|
||||
<span>
|
||||
<a id="simpleSearchButton" class="taskAction" href="#" onClick="${searchCommand}">Search</a>
|
||||
</span>
|
||||
<span class="searchParam">
|
||||
Return a maximum of
|
||||
<select id="maxResults" name="maxResults" onChange="${searchCommand}">
|
||||
<option <#if maxResults="5">selected </#if>value="5">5</option>
|
||||
<option <#if maxResults="10">selected </#if>value="10">10</option>
|
||||
<option <#if maxResults="15">selected </#if>value="15">15</option>
|
||||
<option <#if maxResults="20">selected </#if>value="20">20</option>
|
||||
<option <#if maxResults="50">selected </#if>value="50">50</option>
|
||||
</select> items
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="statusText"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="header">Items Found</div>
|
||||
|
||||
<div class="listBig">
|
||||
<div class="containerBig">
|
||||
<div id="searchResultsList"></div>
|
||||
<div id="statusText"></div>
|
||||
</div>
|
||||
|
||||
<#if (args.searchagain?exists)>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<#if args.search?exists>
|
||||
<#assign searchString = args.search>
|
||||
<#if searchString != "">
|
||||
<#assign queryString = "TEXT:\"${searchString}\" @cm\\:title:${searchString}">
|
||||
<#assign queryString = "TEXT:\"${searchString}\" @cm\\:title:*${searchString}*">
|
||||
</#if>
|
||||
<#else>
|
||||
<#assign searchString = "">
|
||||
@@ -35,7 +35,7 @@
|
||||
<#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 openURL = "${url.serviceContext}/office/navigation?p=${args.p}&n=${child.id}&search=${searchString}&maxresults=${maxresults}">
|
||||
<#assign hrefExtra = "">
|
||||
</#if>
|
||||
<tr>
|
||||
|
@@ -1,15 +1,12 @@
|
||||
html, body {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
body {
|
||||
background: url("../images/office/view_bg.gif") top;
|
||||
color: #0073e6;
|
||||
font-family: tahoma, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #0073e6;
|
||||
background: url("../images/office/view_bg.gif") top;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
a {
|
||||
@@ -40,6 +37,7 @@ a img {
|
||||
display: inline;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
height: 18px;
|
||||
}
|
||||
#tabBar a {
|
||||
background: url("../images/office/tab_left.gif") no-repeat left top;
|
||||
@@ -54,7 +52,6 @@ a img {
|
||||
display: block;
|
||||
float: none;
|
||||
padding: 5px 15px 4px 6px;
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
#tabBar a:hover span {
|
||||
@@ -88,31 +85,41 @@ a img {
|
||||
margin-top: -13px;
|
||||
}
|
||||
|
||||
.listBig {
|
||||
.containerBig {
|
||||
clear: both;
|
||||
float: left;
|
||||
width: 282px;
|
||||
height: 378px;
|
||||
height: 373px;
|
||||
overflow: auto;
|
||||
border: 1px solid #cccccc;
|
||||
margin: 0px 4px 0px 4px;
|
||||
background: #fff;
|
||||
}
|
||||
.listMedium {
|
||||
.containerMedium {
|
||||
clear: both;
|
||||
float: left;
|
||||
width: 282px;
|
||||
height: 204px;
|
||||
height: 200px;
|
||||
overflow: auto;
|
||||
border: 1px solid #cccccc;
|
||||
margin: 0px 4px 0px 4px;
|
||||
background: #fff;
|
||||
}
|
||||
.containerSmall {
|
||||
clear: both;
|
||||
float: left;
|
||||
width: 282px;
|
||||
height: 76px;
|
||||
overflow: auto;
|
||||
border: 1px solid #cccccc;
|
||||
margin: 0px 4px 0px 4px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.listMediumGrow {
|
||||
.containerMediumGrow {
|
||||
height: 354px !important;
|
||||
}
|
||||
.listMediumShrink {
|
||||
.containerMediumShrink {
|
||||
height: 54px !important;
|
||||
}
|
||||
|
||||
@@ -146,7 +153,7 @@ TABLE, TR, TD {
|
||||
ul {
|
||||
margin: 0px;
|
||||
list-style: none;
|
||||
padding: 2px 0px 0px 4px;
|
||||
padding: 2px 0px 0px 24px;
|
||||
}
|
||||
|
||||
#documentActions {
|
||||
@@ -158,6 +165,14 @@ ul {
|
||||
height: 150px;
|
||||
width: 282px;
|
||||
}
|
||||
#documentActions li a {
|
||||
font-weight: bold;
|
||||
margin: 0px 0px 0px -22px;
|
||||
}
|
||||
#documentActions li a img {
|
||||
margin: 0px 0px -2px 0px;
|
||||
padding: 0px 3px 0px 0px;
|
||||
}
|
||||
|
||||
#documentActionsNavigation {
|
||||
clear: both;
|
||||
@@ -168,13 +183,17 @@ ul {
|
||||
height: 106px;
|
||||
width: 282px;
|
||||
}
|
||||
|
||||
#nonStatusText {
|
||||
min-height: 100%;
|
||||
position: relative;
|
||||
#documentActionsNavigation li a {
|
||||
font-weight: bold;
|
||||
margin: 0px 0px 0px -22px;
|
||||
}
|
||||
#documentActionsNavigation li a img {
|
||||
margin: 0px 0px -2px 0px;
|
||||
padding: 0px 3px 0px 0px;
|
||||
}
|
||||
|
||||
#searchResultsList {
|
||||
|
||||
#nonStatusText {
|
||||
min-height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
@@ -189,25 +208,36 @@ ul {
|
||||
width: 278px;
|
||||
}
|
||||
|
||||
#search {
|
||||
clear: both;
|
||||
.searchBox {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.searchParam {
|
||||
float: left;
|
||||
width: 282px;
|
||||
border: 1px solid #cccccc;
|
||||
margin: 0px 4px;
|
||||
background: #fff;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#searchText {
|
||||
font-family: tahoma, sans-serif;
|
||||
font-size: 8pt;
|
||||
padding: 1px 0px 1px 2px;
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
#searchResultsList {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
input.button {
|
||||
background-color: #cce6ff;
|
||||
border: 1px solid #0073e6;
|
||||
color: #0073e6;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
background-color: #cce6ff;
|
||||
border: 1px solid #0073e6;
|
||||
filter:progid:DXImageTransform.Microsoft.Gradient
|
||||
(GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff');
|
||||
cursor: pointer;
|
||||
margin-left: 6px;
|
||||
padding: 1px 4px;
|
||||
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#ffffff', EndColorStr='#cce6ff');
|
||||
}
|
||||
|
||||
#taskDetails {
|
||||
@@ -230,16 +260,16 @@ input.button {
|
||||
}
|
||||
|
||||
.taskAction {
|
||||
background-color: #cce6ff;
|
||||
border: 1px solid #0073e6;
|
||||
color: #0073e6;
|
||||
float: left;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
background-color: #cce6ff;
|
||||
border: 1px solid #0073e6;
|
||||
cursor: pointer;
|
||||
margin: 0px 0px 0px 2px;
|
||||
padding: 4px;
|
||||
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ffffffff',EndColorStr='#6fb7ff');
|
||||
filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#ffffff', EndColorStr='#cce6ff');
|
||||
}
|
||||
|
||||
.taskParameters {
|
||||
@@ -252,19 +282,24 @@ input.button {
|
||||
.taskParam {
|
||||
clear: both;
|
||||
float: left;
|
||||
padding: 2px 0px 0px 4px;
|
||||
padding: 4px 4px 0px 0px;
|
||||
text-align: right;
|
||||
width: 64px;
|
||||
}
|
||||
|
||||
.taskValue {
|
||||
float: left;
|
||||
padding: 2px 0px 0px 0px;
|
||||
width: 164px;
|
||||
width: 196px;
|
||||
}
|
||||
|
||||
#ajxUser {
|
||||
float: left;
|
||||
margin: 2px;
|
||||
.taskValue img {
|
||||
margin: 0px 0px -2px -2px;
|
||||
}
|
||||
.taskValue select, .taskValue input, .taskValue textarea {
|
||||
font-family: tahoma, sans-serif;
|
||||
font-size: 8pt;
|
||||
padding: 1px 0px 1px 2px;
|
||||
width: 172px;
|
||||
}
|
||||
|
||||
/* Autocomplete pop-up */
|
||||
@@ -276,8 +311,6 @@ ul.autocompleter-choices
|
||||
list-style: none;
|
||||
border: 1px solid #ccc;
|
||||
background-color: white;
|
||||
border-right-color: #ddd;
|
||||
border-bottom-color: #ddd;
|
||||
text-align: left;
|
||||
z-index: 50;
|
||||
}
|
||||
@@ -285,7 +318,7 @@ ul.autocompleter-choices
|
||||
ul.autocompleter-choices li
|
||||
{
|
||||
position: relative;
|
||||
padding: 0.1em 1.5em 0.1em 1em;
|
||||
padding: 0.1em 0.5em 0.1em 1em;
|
||||
cursor: pointer;
|
||||
font-weight: normal;
|
||||
font-size: 1em;
|
||||
@@ -293,8 +326,8 @@ ul.autocompleter-choices li
|
||||
|
||||
ul.autocompleter-choices li.autocompleter-selected
|
||||
{
|
||||
background-color: #444;
|
||||
color: #fff;
|
||||
background-color: #eee;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
ul.autocompleter-choices span.autocompleter-queried
|
||||
@@ -304,5 +337,99 @@ ul.autocompleter-choices span.autocompleter-queried
|
||||
|
||||
ul.autocompleter-choices li.autocompleter-selected span.autocompleter-queried
|
||||
{
|
||||
color: #9FCFFF;
|
||||
color: #9FCFFF;
|
||||
}
|
||||
|
||||
/* Date Picker */
|
||||
#date-picker {
|
||||
margin-top: 3px;
|
||||
position: absolute;
|
||||
top: -1000px;
|
||||
left: 1000px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#date-wrapper {
|
||||
font-weight: normal !important;
|
||||
font-size: 11px !important;
|
||||
margin: 0px 1px;
|
||||
}
|
||||
|
||||
#date-wrapper .date-table {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
border: 1px solid #666;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
#date-wrapper .date-table th, #date-wrapper .date-table td {
|
||||
background-color: #fff;
|
||||
padding: 3px 5px;
|
||||
text-align: center;
|
||||
border: 1px solid #c0c0c0;
|
||||
}
|
||||
|
||||
#date-wrapper .date-table td {
|
||||
background-color: #f8f8f8;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
#date-wrapper .date-table td.date-monthswitch, #date-wrapper .date-table td.date-yearswitch {
|
||||
cursor: pointer;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#date-wrapper .date-table td.date-monthandyear {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#date-wrapper .date-table th {
|
||||
background-color: #004080;
|
||||
color: #fff;
|
||||
padding: 2px 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#date-wrapper .date-table tr {
|
||||
padding: 3px 5px;
|
||||
}
|
||||
|
||||
#date-wrapper td.date-weekend {
|
||||
font-weight: bold;
|
||||
background-color: #ffc;
|
||||
}
|
||||
|
||||
#date-wrapper td.date-workday {
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#date-wrapper td.date-offmonth {
|
||||
background-color: #fff;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
#date-wrapper td.date-day {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#date-wrapper td.date-todayfooter {
|
||||
background-color: #f8f8f8;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
/* Date highlighting */
|
||||
#date-wrapper td.date-today {
|
||||
background-color: #ffe500;
|
||||
}
|
||||
|
||||
#date-wrapper td.date-picked {
|
||||
border: 2px solid #0073e6;
|
||||
margin: -4px;
|
||||
}
|
||||
|
||||
#date-wrapper td.date-tdover {
|
||||
background-color: #0073e6;
|
||||
color: #fff;
|
||||
}
|
||||
|
BIN
source/web/images/office/date.gif
Normal file
BIN
source/web/images/office/date.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 127 B |
383
source/web/scripts/ajax/date_picker.js
Normal file
383
source/web/scripts/ajax/date_picker.js
Normal file
@@ -0,0 +1,383 @@
|
||||
if (!$defined(Element.getText))
|
||||
{
|
||||
Element.extend(
|
||||
{
|
||||
getText: function()
|
||||
{
|
||||
return this.innerText || this.textContent || "";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var DatePicker = new Class(
|
||||
{
|
||||
options:
|
||||
{
|
||||
onShow: Class.empty,
|
||||
onHide: Class.empty,
|
||||
readOnly: true,
|
||||
showToday: true,
|
||||
dateFormat: "string",
|
||||
monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
||||
monthNamesLong: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
||||
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
||||
dayNamesLong: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
||||
},
|
||||
|
||||
initialize: function(el, options)
|
||||
{
|
||||
this.element = el;
|
||||
this.setOptions(options);
|
||||
|
||||
this.calendar = new Element("div", {"id": "date-picker"}).inject(document.body);
|
||||
this.calendar.addEvent("mouseenter", this.onMouseEnter.bind(this));
|
||||
this.calendar.addEvent("mouseleave", this.onMouseLeave.bind(this));
|
||||
|
||||
this.wrapper = new Element("div", {"id": "date-wrapper"}).inject(this.calendar);
|
||||
|
||||
this.currentDate = null;
|
||||
this.isVisible = false;
|
||||
this.hasMouse = false;
|
||||
|
||||
if (this.options.readOnly)
|
||||
{
|
||||
el.setProperty("readonly", "readonly");
|
||||
}
|
||||
el.addEvent("click", this.toggleCalendar.bind(this));
|
||||
el.addEvent("blur", this.onBlur.bind(this));
|
||||
},
|
||||
|
||||
position: function(el)
|
||||
{
|
||||
var pos = $(el).getPosition();
|
||||
this.calendar.setStyles(
|
||||
{
|
||||
"left": pos.x,
|
||||
"top": pos.y + $(el).getCoordinates().height
|
||||
});
|
||||
},
|
||||
|
||||
show: function()
|
||||
{
|
||||
this.isVisible = true;
|
||||
this.calendar.setStyle("visibility", "visible");
|
||||
this.fireEvent("onShow", [this.calendar]);
|
||||
},
|
||||
|
||||
hide: function()
|
||||
{
|
||||
this.isVisible = false;
|
||||
this.hasMouse = false;
|
||||
this.calendar.setStyle("visibility", "hidden");
|
||||
this.fireEvent("onHide", [this.calendar]);
|
||||
},
|
||||
|
||||
onMouseEnter: function()
|
||||
{
|
||||
this.hasMouse = true;
|
||||
},
|
||||
|
||||
onMouseLeave: function()
|
||||
{
|
||||
this.hasMouse = false;
|
||||
this.onBlur.delay(500, this);
|
||||
},
|
||||
|
||||
onBlur: function()
|
||||
{
|
||||
if (!this.hasMouse)
|
||||
{
|
||||
this.hide();
|
||||
}
|
||||
},
|
||||
|
||||
toggleCalendar: function()
|
||||
{
|
||||
if (this.isVisible)
|
||||
{
|
||||
// Hide the calendar
|
||||
this.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.originalDate = this.convert(this.element.value.toString(), "date");
|
||||
this.renderCalendar(this.element);
|
||||
this.show();
|
||||
}
|
||||
},
|
||||
|
||||
/* Main calendar render function */
|
||||
renderCalendar: function(el, dt)
|
||||
{
|
||||
this.currentDate = this.convert((($defined(dt)) ? dt : el.value), "date");
|
||||
|
||||
this.position(el);
|
||||
|
||||
/** Set up all the dates we need */
|
||||
var lastMonth = new Date(this.currentDate).setMonth(this.currentDate.getMonth() - 1); // The previous month to the display date
|
||||
var nextMonth = new Date(this.currentDate).setMonth(this.currentDate.getMonth() + 1); // The next month to the display date
|
||||
var lastYear = new Date(this.currentDate).setFullYear(this.currentDate.getFullYear() - 1); // The previous year to the display date
|
||||
var nextYear = new Date(this.currentDate).setFullYear(this.currentDate.getFullYear() + 1); // The next year to the display date
|
||||
|
||||
var firstDay = new Date(this.currentDate); // The first day of the month for the display date
|
||||
firstDay.setDate(1);
|
||||
if (firstDay.getDay() > 0)
|
||||
{
|
||||
firstDay.setDate(-firstDay.getDay() + 1);
|
||||
}
|
||||
|
||||
var currentDay = new Date(firstDay);
|
||||
var today = new Date(); // Todays date
|
||||
|
||||
/** Clear any previous dom and refill it*/
|
||||
this.wrapper.empty();
|
||||
|
||||
/** Global vars and initial dom stuff */
|
||||
var table, tbody, row, td, highlight;
|
||||
table = new Element("table",
|
||||
{
|
||||
"id": "date-table",
|
||||
"class": "date-table"
|
||||
});
|
||||
tbody = new Element("tbody").injectInside(table)
|
||||
|
||||
/** Build the skip month/date controls */
|
||||
row = new Element("tr").injectInside(tbody);
|
||||
|
||||
new Element("td",
|
||||
{
|
||||
"class": "date-monthswitch",
|
||||
"events":
|
||||
{
|
||||
"click" : this.renderCalendar.bind(this, [el, lastMonth])
|
||||
}
|
||||
}).appendText("<").injectInside(row);
|
||||
|
||||
new Element("td",
|
||||
{
|
||||
"colSpan": 5,
|
||||
"rowSpan": 2,
|
||||
"class" : "date-monthandyear"
|
||||
}).appendText(this.options.monthNamesLong[this.currentDate.getMonth()] + " " + this.currentDate.getFullYear()).injectInside(row);
|
||||
|
||||
new Element("td",
|
||||
{
|
||||
"class": "date-monthswitch",
|
||||
"events":
|
||||
{
|
||||
"click" : this.renderCalendar.bind(this, [el, nextMonth])
|
||||
}
|
||||
}).appendText(">").injectInside(row);
|
||||
|
||||
row = new Element("tr").injectInside(tbody);
|
||||
|
||||
new Element("td",
|
||||
{
|
||||
"class": "date-yearswitch",
|
||||
"events":
|
||||
{
|
||||
"click" : this.renderCalendar.bind(this, [el, lastYear])
|
||||
}
|
||||
}).appendText("<<").injectInside(row);
|
||||
|
||||
new Element("td",
|
||||
{
|
||||
"class": "date-yearswitch",
|
||||
"events":
|
||||
{
|
||||
"click" : this.renderCalendar.bind(this, [el, nextYear])
|
||||
}
|
||||
}).appendText(">>").injectInside(row);
|
||||
|
||||
/** Push out the day names */
|
||||
row = new Element("tr").injectInside(tbody);
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
new Element("th").appendText(this.options.dayNamesShort[i].substr(0,2)).injectInside(row);
|
||||
}
|
||||
|
||||
highlight = this.highlight.bind(this);
|
||||
|
||||
/* Populate the dates we can pick */
|
||||
while (currentDay.getMonth() == this.currentDate.getMonth() || currentDay.getMonth() == firstDay.getMonth())
|
||||
{
|
||||
row = new Element("tr").injectInside(tbody);
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
td = new Element("td").appendText(currentDay.getDate()).injectInside(row);
|
||||
td.addClass((currentDay.getDay() == 0 || currentDay.getDay() == 6) ? "date-weekend" : "date-workday");
|
||||
if (currentDay.getMonth() != this.currentDate.getMonth())
|
||||
{
|
||||
td.addClass("date-offmonth");
|
||||
}
|
||||
else
|
||||
{
|
||||
td.addClass("date-day");
|
||||
td.addEvents(
|
||||
{
|
||||
"click": this.selectValue.bindWithEvent(this),
|
||||
"mouseenter": highlight,
|
||||
"mouseleave": highlight
|
||||
});
|
||||
}
|
||||
if (currentDay.getDate() == today.getDate() && currentDay.getMonth() == today.getMonth() && currentDay.getFullYear() == today.getFullYear())
|
||||
{
|
||||
td.addClass("date-today");
|
||||
}
|
||||
if (currentDay.getDate() == this.originalDate.getDate()
|
||||
&& currentDay.getMonth() == this.originalDate.getMonth()
|
||||
&& currentDay.getFullYear() == this.originalDate.getFullYear())
|
||||
{
|
||||
td.addClass("date-picked");
|
||||
}
|
||||
currentDay.setDate(currentDay.getDate() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
/** Add the select today choice */
|
||||
if (this.options.showToday)
|
||||
{
|
||||
row = new Element("tr").injectInside(tbody);
|
||||
new Element("td",
|
||||
{
|
||||
"colSpan": 7,
|
||||
"class" : "date-todayfooter",
|
||||
"events":
|
||||
{
|
||||
"click" : this.renderCalendar.bind(this, [el, today])
|
||||
}
|
||||
}).appendText("Today: " + this.convert(today, "dd/MMM/yyyy")).injectInside(row);
|
||||
}
|
||||
|
||||
table.injectInside(this.wrapper);
|
||||
},
|
||||
|
||||
highlight: function (ev)
|
||||
{
|
||||
var e = new Event(ev);
|
||||
e.target.toggleClass("date-tdover");
|
||||
},
|
||||
|
||||
selectValue: function (ev)
|
||||
{
|
||||
var e = new Event(ev);
|
||||
e.stopPropagation();
|
||||
var o = $(e.target);
|
||||
var pickedDate = this.currentDate.setDate(o.getText());
|
||||
this.element.value = this.convert(pickedDate, this.options.dateFormat);
|
||||
this.hide();
|
||||
},
|
||||
|
||||
convert: function(o, format)
|
||||
{
|
||||
var d = new Date();
|
||||
if (o.getFullYear)
|
||||
{
|
||||
d = o;
|
||||
}
|
||||
else if ($type(o) == "number")
|
||||
{
|
||||
d = new Date(o);
|
||||
}
|
||||
else if ($type(o) == "object")
|
||||
{
|
||||
d = new Date(o.year, o.month, o.date);
|
||||
}
|
||||
else if ($type(o) == "string")
|
||||
{
|
||||
d = new Date(o);
|
||||
if ((d.toString() == "Invalid Date") || (d.toString() == "NaN"))
|
||||
{
|
||||
d = new Date();
|
||||
}
|
||||
}
|
||||
|
||||
if (format == "date")
|
||||
{
|
||||
return d;
|
||||
}
|
||||
else if (format == "object")
|
||||
{
|
||||
return(
|
||||
{
|
||||
date: d.getDate(),
|
||||
month: d.getMonth(),
|
||||
year: d.getFullYear()
|
||||
});
|
||||
}
|
||||
else if (format == "number")
|
||||
{
|
||||
return d.getTime();
|
||||
}
|
||||
else if (format == "string")
|
||||
{
|
||||
return d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getFullYear();
|
||||
}
|
||||
|
||||
// Otherwise, assume we've been given a format string for formatDate
|
||||
return this.formatDate(d, format);
|
||||
},
|
||||
|
||||
formatDate: function(dt, format)
|
||||
{
|
||||
if (!dt.valueOf())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
window.monthNamesLong = this.options.monthNamesLong;
|
||||
window.monthNamesShort = this.options.monthNamesShort;
|
||||
window.dayNamesLong = this.options.dayNamesLong;
|
||||
window.dayNamesShort = this.options.dayNamesShort;
|
||||
|
||||
return format.replace(/(yyyy|yy|y|MMMM|MMM|MM|M|dddd|ddd|dd|d|HH|H|hh|h|mm|m|ss|s|t)/gi, function($1, $2, $3, $4, $5)
|
||||
{
|
||||
switch ($1)
|
||||
{
|
||||
case 'yyyy': return dt.getFullYear();
|
||||
case 'yy': return ('0' + (dt.getFullYear()%100)).zeroFill(2);
|
||||
case 'y': return (d.getFullYear()%100);
|
||||
case 'MMMM': return window.monthNamesLong[dt.getMonth()];
|
||||
case 'MMM': return window.monthNamesShort[dt.getMonth()];
|
||||
case 'MM': return (dt.getMonth() + 1).zeroFill(2);
|
||||
case 'M': return (dt.getMonth() + 1);
|
||||
case 'dddd': return window.dayNamesLong[dt.getDay()];
|
||||
case 'ddd': return window.dayNamesShort[dt.getDay()];
|
||||
case 'dd': return dt.getDate().zeroFill(2);
|
||||
case 'd': return dt.getDate();
|
||||
case 'HH': return dt.getHours().zeroFill(2);
|
||||
case 'H': return dt.getHours();
|
||||
case 'hh': return ((h = dt.getHours() % 12) ? h : 12).zeroFill(2);
|
||||
case 'h': return ((h = dt.getHours() % 12) ? h : 12);
|
||||
case 'mm': return dt.getMinutes().zeroFill(2);
|
||||
case 'm': return dt.getMinutes();
|
||||
case 'ss': return dt.getSeconds().zeroFill(2);
|
||||
case 's': return dt.getSeconds();
|
||||
case 't': return dt.getHours() < 12 ? 'A.M.' : 'P.M.';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
DatePicker.implement(new Events, new Options);
|
||||
|
||||
// Used by formatDate function */
|
||||
String.prototype.zeroFill = function(l)
|
||||
{
|
||||
return '0'.repeat(l - this.length) + this;
|
||||
}
|
||||
String.prototype.repeat = function(l)
|
||||
{
|
||||
var s = '', i = 0;
|
||||
while (i++ < l)
|
||||
{
|
||||
s += this;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
Number.prototype.zeroFill = function(l)
|
||||
{
|
||||
return this.toString().zeroFill(l);
|
||||
}
|
@@ -37,7 +37,7 @@ var OfficeMyAlfresco =
|
||||
// register 'click' event for each task
|
||||
task.addEvent('click', function(e)
|
||||
{
|
||||
window.location.href = window.contextPath + "/service/office/myTasks?p=" + window.queryObject.p + "&t=" + task.id;
|
||||
window.location.href = window.serviceContextPath + "/office/myTasks?p=" + window.queryObject.p + "&t=" + task.id;
|
||||
});
|
||||
});
|
||||
|
||||
|
@@ -14,11 +14,14 @@ var OfficeMyTasks =
|
||||
OfficeMyTasks.openTask(window.queryObject.t);
|
||||
}
|
||||
|
||||
if ($('wrkUser'))
|
||||
if ($('wrkAssignTo'))
|
||||
{
|
||||
var autoUser = new Autocompleter.Ajax.Json($('wrkUser'), window.contextPath + '/service/office/getUsers',
|
||||
var autoAssignTo = new Autocompleter.Ajax.Json($('wrkAssignTo'), window.serviceContextPath + '/office/getUsers',
|
||||
{
|
||||
postVar: 's',
|
||||
minLength: 2,
|
||||
useSelection: false,
|
||||
markQuery: false,
|
||||
ajaxOptions:
|
||||
{
|
||||
method: 'get',
|
||||
@@ -26,14 +29,23 @@ var OfficeMyTasks =
|
||||
},
|
||||
onRequest: function(el)
|
||||
{
|
||||
$('ajxUser').setStyle('display', '');
|
||||
$('ajxAssignTo').setStyle('display', '');
|
||||
},
|
||||
onComplete: function(el)
|
||||
{
|
||||
$('ajxUser').setStyle('display', 'none');
|
||||
$('ajxAssignTo').setStyle('display', 'none');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ($('wrkDueDate'))
|
||||
{
|
||||
var dueDate = new DatePicker($('wrkDueDate'),
|
||||
{
|
||||
readOnly: false,
|
||||
dateFormat: "dd MMMM yyyy"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
setupEventHandlers: function()
|
||||
@@ -89,7 +101,7 @@ var OfficeMyTasks =
|
||||
OfficeAddin.showStatusText("Loading task...", "ajax_anim.gif", false);
|
||||
|
||||
// ajax call to load task details
|
||||
var actionURL = window.contextPath + "/service/office/myTasksDetail?t=" + task.id;
|
||||
var actionURL = window.serviceContextPath + "/office/myTasksDetail?t=" + task.id;
|
||||
var myAjax = new Ajax(actionURL, {
|
||||
method: 'get',
|
||||
headers: {'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'},
|
||||
@@ -149,14 +161,13 @@ var OfficeMyTasks =
|
||||
var href = window.location.href.replace("#", "")
|
||||
// Remove any previous "&st=" string
|
||||
href = href.replace(/[?&]st=([^&$]+)/g, "");
|
||||
// Remove any previous "&t=" string
|
||||
href = href.replace(/[?&]t=([^&$]+)/g, "");
|
||||
// Remove any previous "&w=" string
|
||||
href = href.replace(/[?&]w=([^&$]+)/g, "");
|
||||
// Optionally add a status string
|
||||
if (successMessage != "")
|
||||
{
|
||||
var json = "{\"statusString\":\"" + successMessage + "\",\"statusCode\":true}";
|
||||
href += "&st=" + encodeURI(json);
|
||||
href += "&t=" + taskId;
|
||||
}
|
||||
window.location.href = href;
|
||||
},
|
||||
@@ -166,6 +177,53 @@ var OfficeMyTasks =
|
||||
}
|
||||
});
|
||||
myAjax.request();
|
||||
},
|
||||
|
||||
startWorkflow: function(useTemplate, Doc)
|
||||
{
|
||||
// OfficeAddin.runAction('${doc_actions}','makepdf','${d.id}', '');"
|
||||
|
||||
var wrkType=$('wrkType').value;
|
||||
// wrkAssignTo should be "First Last (Username)"
|
||||
var wrkAssignTo=$('wrkAssignTo').value;
|
||||
if (wrkAssignTo.test(/(?:\(([^\)]+)\))/))
|
||||
{
|
||||
// Extract the Username
|
||||
wrkAssignTo=wrkAssignTo.match(/(?:\(([^\)]+)\))/)[1];
|
||||
}
|
||||
var wrkDueDate = $('wrkDueDate').value;;
|
||||
var wrkDescription=$('wrkDescription').value;
|
||||
|
||||
OfficeAddin.showStatusText("Starting workflow...", "ajax_anim.gif", false);
|
||||
var actionURL = useTemplate + "?a=workflow&d=" + Doc;
|
||||
actionURL += "&wt=" + wrkType;
|
||||
actionURL += "&at=" + wrkAssignTo;
|
||||
// Date supplied?
|
||||
if (wrkDueDate != "")
|
||||
{
|
||||
actionURL += "&dd=" + wrkDueDate;
|
||||
}
|
||||
actionURL += "&desc=" + wrkDescription;
|
||||
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, "");
|
||||
// Remove any previous "&w=" strings
|
||||
href = href.replace(/[?&]w=([^&$]+)/g, "");
|
||||
// Optionally add a status string
|
||||
if (textResponse != "")
|
||||
{
|
||||
href += "&st=" + encodeURI(textResponse);
|
||||
}
|
||||
window.location.href = href;
|
||||
}
|
||||
});
|
||||
myAjax.request();
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -11,6 +11,7 @@ var OfficeAddin =
|
||||
{
|
||||
window.queryObject = OfficeAddin.toQueryObject(document.location.search);
|
||||
window.contextPath = OfficeAddin.getContextPath();
|
||||
window.serviceContextPath = window.contextPath + "/wcservice";
|
||||
|
||||
/* Update needed after page load? */
|
||||
if(this.queryObject.st)
|
||||
|
@@ -11,7 +11,7 @@ var OfficeSearch =
|
||||
event = new Event(event);
|
||||
if (event.key == 'enter')
|
||||
{
|
||||
$("simpleSearchButton").click();
|
||||
$("simpleSearchButton").onclick();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Reference in New Issue
Block a user