Fix Workflow Initiation Screen issue in 9.2

Customisation Title Fix Workflow Initiation Screen issue in 9.2
Purpose of Customisation Fix an issue with the Header frame when the Workflow Title is changed.
Author Greg Griffiths
Date of Customisation 15 August 2004
Covers Livelink Livelink 9.2
Livelink Modules WebWork
Affected Templates \webwork\html\tstartrightframe.html
\webwork\html\framestatustasksright.html
Customisation Format HTML
Download Here Download as a ZIP file

During a recent large scale workflow deployment on 9.2 we noticed a small bug in Livelink 9.2 where if you change the title of a workflow on either the Workflow Initiation screen or the General tab under Workflow Status, then the change is not initially populated into the other frames on the current page. Having previously resolved this issue of earlier versions of Livelink - customisation forty - we set about reimplementing this fix for 9.2.

First lets look at the Workflow Initiation screen

<SCRIPT LANGUAGE="JavaScript">
<!--
function SubmitApplyChanges( s )
{
    document.cookie = "llrefreshtitle=1";
    document.myForm.submit();
}
function markDirty()
{
    parent.FrameTop.markTaskEditDirty();
}
function markTaskEditDirty()
{
    parent.FrameTop.markTaskEditDirty();
}
function clearDirty()
{
    parent.FrameTop.istedirty=false;
}
clearDirty();
;// this function can be overriden by work packages defining their own with the same name
function onLoadStuff()
{
    return;
}
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    end = dc.length;
    return unescape(dc.substring(begin + prefix.length,end
}
function getTitle()
{
    if (getCookie("llrefreshtitle")==1)
    {
        // delete the cookie
        document.cookie = "llrefreshtitle=0; expires=Thu, 01-Jan-70 00:00:01 GMT";
        parent.parent.parent.location.reload(true);
    }
}

%// -->
</SCRIPT>
;Assoc paneData = taskData.PaneData
;Record taskInfo = taskData.TaskInfo
;String url = .URL()
;String img = .IMG()
;String htmlPrefix = .HTMLPrefix()
;if ( paneData.ShowBodyTags )
    <SCRIPT LANGUAGE="JavaScript1.2" SRC="`img`global.js"></SCRIPT>
    <SCRIPT LANGUAGE="JavaScript1.2" SRC="`img`functionmenu.js"></SCRIPT>
;end
<BODY CLASS="pageBody" ONLOAD="onLoadStuff();getTitle();">

When the users saves their new Workflow title, then the Javascript function SubmitApplyChanges is called, in which we set an extra cookie llrefreshtitle. When the page is loaded the getTitle function is called, in which we check for the presence of this cookie, and if found, we delete the cookie and then refresh the entire page, which will in turn, refresh the other frames to show the correct Workflow Title.

The other situation which we need to look at is when the user changes the Workflow Title through the Workflow Status screens. In this case, a different template - framestatustasksright.html - is used. In this case, the changes required are much simpler :

clearDirty();
function loadHandler()
{
    parent.parent.FrameTop.location.replace(parent.parent.FrameTop.location + "&title=" + escape(document.myForm.Title.value));
    parent.parent.FrameLeft.location.reload();
}

;if ( IamMac )
; openURL = url + "?func=work.framestatustasks"
;
; if ( IsDefined( mapID ) )
; openURL = Str.Format( '%1&mapid=%2', openURL, mapID )
; end
    function openWorkflow( workID, subWorkID )
    {
        var wfURL
        wfURL = "`%LopenURL`&workid=" + workID + "&subworkid=" + subWorkID + "&paneindex=0&title=`Web.Escape( label )`&status=`.fArgs.Status`&kind=`.fArgs.Kind`&sort=`.fArgs.Sort`&nexturl=`thisURL`";
        parent.location.href = wfURL;
    }
;end
%// -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript1.2" SRC="`img`global.js"></SCRIPT>

<HEAD>
    //Style Support
    `%L.Styles()`
    <TITLE>`[WebWork_HTMLLabel.LivelinkWorkflowDetails]`</TITLE>
</HEAD>
<BODY CLASS="pageBody" ONLOAD="onLoadFunctionMenu( '`img`actions.gif', '`img`menuwait.gif' );loadHandler();">

In this case, we simply refresh the other frames everytime this frame is loaded, this keeps the entire frameset correctly synchronised.
Website Designed by Adservio Consulting      Bookmark and Share Valid HTML 4.01 Strict    Valid CSS!    Level A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0