I have recently "upgraded" to SP2013 from SP2010. My infopath 2010 forms go through an approval workflow. In the tasks created by this workflow is a link to the document:
This link opens the document in Infopath Filler (if installed) not in browser which is requiered. My old workaround was to add a small java script to the WrkTaskIP.aspx file on the server:
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">
//check if this page is the WrkTaskIP.aspx page.
//get the content link that this workflow task applies to
var linkToForm= $(".ms-informationbar").find("a");
//check if the content is an xml file. It applies to all XML files included in InfoPath Forms.
// If you used to manage regular XML files in SharePoint libraries you will need to add additional filters to this function.
if (linkToForm.attr("href").indexOf(".xml")>-1)
{
//replace the link
var newLink = "FormServer.aspx?XmlLocation=" + linkToForm.attr("href") + "&DefaultItemOpen=1" ;
linkToForm.attr("href",newLink);
linkToForm.attr("onclick","");
}
</script>
However, I cannont get this to work on SP2013 (the link remains unchanged).
I can hide the link by adding another javascript to the master page in SP2013 but adding the above code in the same place does not change the hyperlink.
jQuery.noConflict();
jQuery( document ).ready(function() {
if(window.location.href.indexOf("WrkTaskIP.aspx") > -1) {
//jQuery('table.ms-informationbar').hide();
}
The form opens in browser fine under every other circumstance.
Is there a solution to this in SP2013? (I have little to no expirence with java and the above code was taken from other guides, I do not have access to Infopath 2013)
Thanks!