Skip to content

Commit

Permalink
Merge pull request sakaiproject#274 from clhedrick/SAK-28112
Browse files Browse the repository at this point in the history
SAK-28112 file helper import doesn't work
  • Loading branch information
ottenhoff committed Mar 17, 2015
2 parents 3e2e161 + 2ff6b53 commit 7ceecfb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,10 @@ protected void initState(SessionState state, VelocityPortlet portlet, RunData da
public void doAttachitem(RunData data)
{

if (!"POST".equals(data.getRequest().getMethod())) {
return;
}

SessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());
ToolSession toolSession = SessionManager.getCurrentToolSession();
ParameterParser params = data.getParameters ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
}
//-->
</script>

<div class="portletBody specialLink">
#if ($alertMessage)
<div class="alertMessage">$tlang.getString("gen.alert") $validator.escapeHtml($alertMessage)</div><div style="display:block;clear:both" ></div>
Expand All @@ -43,6 +44,21 @@
#end
</div>

<form name="doattachitem" style="display:none" id="doattachitem" action="#toolForm("FilePickerAction" "Main")" method=post enctype="multipart/form-data">
<input type="hidden" name="sakai_action" value="doAttachitem">
<input type="hidden" name="itemId" id="doattachitemid" />
<input type="hidden" name="sakai_csrf_token" value="$sakai_csrf_token" />
</form>

<script language="JavaScript" type="text/JavaScript">
function doattachsubmit(itemId) {
document.getElementById('doattachitemid').setAttribute('value',itemId);
var f = document.getElementById('doattachitem');
f.submit();
return false;
}
</script>

<form name="attachForm" id="attachForm" action="#toolForm("FilePickerAction" "Main")" method="post" enctype="multipart/form-data">
<input type="hidden" name="source" value="0" />
<input type="hidden" name="collectionId" value="$validator.escapeHtml($collectionId)" />
Expand Down Expand Up @@ -272,7 +288,7 @@
|
#end
#set ($itemsOnLine = $itemsOnLine + 1)
<a href="#toolLinkParam("FilePickerAction" "doAttachitem" "itemId=$validator.escapeUrl(${item.id})")" title ="$tlang.getString('att.copy')">$tlang.getString("att.copy") <span class="skip">$validator.escapeHtml($item.name)</span></a>
<a href="#" onclick="return doattachsubmit('$validator.escapeUrl(${item.id})')" title ="$tlang.getString('att.copy')">$tlang.getString("att.copy") <span class="skip">$validator.escapeHtml($item.name)</span></a>
#end
#end
#end
Expand Down Expand Up @@ -443,7 +459,7 @@
|
#end
#set ($itemsOnLine = $itemsOnLine + 1)
<a href="#toolLinkParam("FilePickerAction" "doAttachitem" "itemId=$validator.escapeUrl(${root.id})")" title ="$tlang.getString('att.copy')">$tlang.getString("att.copy")</a>
<a href="#" onclick="return doattachsubmit('$validator.escapeUrl(${root.id})')" title ="$tlang.getString('att.copy')">$tlang.getString("att.copy") <span class="skip">$validator.escapeHtml($item.name)</span></a>
#end
#end
#end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,21 @@ $(document).ready(function() {
#end
</div>

<form name="doattachitem" style="display:none" id="doattachitem" action="#toolForm("ResourcesAction" "Main")" method=post enctype="multipart/form-data">
<input type="hidden" name="sakai_action" value="doAttachitem">
<input type="hidden" name="itemId" id="doattachitemid" />
<input type="hidden" name="sakai_csrf_token" value="$sakai_csrf_token" />
</form>

<script language="JavaScript" type="text/JavaScript">
function doattachsubmit(itemId) {
document.getElementById('doattachitemid').setAttribute('value',itemId);
var f = document.getElementById('doattachitem');
f.submit();
return false;
}
</script>

<form name="attachForm" id="attachForm" action="#toolForm("FilePickerAction" "Main")" method="post">
<input type="hidden" name="source" value="0" />
<input type="hidden" name="collectionId" value="$validator.escapeHtml($collectionId)" />
Expand Down Expand Up @@ -322,7 +337,7 @@ $(document).ready(function() {
#end
#elseif($item.canSelect())
<div class="itemAction" style="margin:0;">
<a href="#toolLinkParam("ResourcesAction" "doAttachitem" "itemId=$validator.escapeUrl(${item.id})")" title ="$tlang.getString('att.select')">$tlang.getString("att.select")</a>
<a href="#" onclick="return doattachsubmit('$validator.escapeUrl(${item.id})')" title ="$tlang.getString('att.select')">$tlang.getString("att.select")</a>
</div>
#end
#end
Expand Down Expand Up @@ -528,7 +543,7 @@ $(document).ready(function() {
#end
#elseif($item.canSelect())
<div class="itemAction">
<a href="#toolLinkParam("ResourcesAction" "doAttachitem" "itemId=$validator.escapeUrl(${item.id})")" title ="$tlang.getString('att.select')">$tlang.getString("att.select")</a>
<a href="#" onclick="return doattachsubmit('$validator.escapeUrl(${item.id})')" title ="$tlang.getString('att.select')">$tlang.getString("att.select")</a>
</div>
#end
#end
Expand Down

0 comments on commit 7ceecfb

Please sign in to comment.