Esempio n. 1
0
    }
}
${${"GLOBALS"}["naiwewqgmfo"]} = $_SESSION["import_" . $_POST["importHash"]];
if (!empty($_REQUEST["currentExecID"]) && $_REQUEST["currentExecID"] != "false") {
    ${"GLOBALS"}["wcryxtb"] = "sql";
    ${${"GLOBALS"}["ugugdkb"]} = Workflow_Queue::getQueueEntryByExecId($_REQUEST["currentExecID"]);
    ${"GLOBALS"}["wyclrj"] = "sql";
    ${${"GLOBALS"}["wcryxtb"]} = "DELETE FROM vtiger_wf_queue WHERE id = " . ${${"GLOBALS"}["ugugdkb"]}["queue_id"] . "";
    $adb->query(${${"GLOBALS"}["wyclrj"]});
    Workflow_Queue::runEntry(${${"GLOBALS"}["ugugdkb"]});
    return;
}
$kwobypqbows = "objWorkflow";
${${"GLOBALS"}["lwecbbczg"]} = \Workflow\VTEntity::getDummy();
${$kwobypqbows} = new Workflow_Main(${${"GLOBALS"}["naiwewqgmfo"]}["workflow"], false, ${${"GLOBALS"}["kjnqzghg"]});
${"GLOBALS"}["cmtzjsz"] = "environment";
${${"GLOBALS"}["fuyqviyk"]} = array("_internal" => array("pos" => ${${"GLOBALS"}["naiwewqgmfo"]}["position"], "file" => ${${"GLOBALS"}["naiwewqgmfo"]}["filePath"], "total" => ${${"GLOBALS"}["naiwewqgmfo"]}["total"], "delimiter" => ${${"GLOBALS"}["naiwewqgmfo"]}["delimiter"], "hash" => $_REQUEST["process"]));
${"GLOBALS"}["serpblbvexb"] = "lines";
$context->loadEnvironment(${${"GLOBALS"}["lugpficbacd"]});
$rplfbjvktbsi = "result";
$objWorkflow->setContext(${${"GLOBALS"}["ylbodgr"]});
$objWorkflow->start();
${${"GLOBALS"}["fuyqviyk"]} = $context->getEnvironment();
$_SESSION["import_" . $_REQUEST["process"]]["position"] = ${${"GLOBALS"}["cmtzjsz"]}["_internal"]["pos"];
${${"GLOBALS"}["serpblbvexb"]} = lineCount(${${"GLOBALS"}["xpbckrdoygu"]}["_internal"]["file"]);
${$rplfbjvktbsi} = array("done" => ${${"GLOBALS"}["fuyqviyk"]}["_internal"]["pos"], "ready" => true);
if (${${"GLOBALS"}["fuyqviyk"]}["_internal"]["pos"] == ${${"GLOBALS"}["etuviryrf"]} || ${${"GLOBALS"}["fuyqviyk"]}["_internal"]["finish"] === true) {
    $owmmjnuu = "result";
    ${$owmmjnuu}["ready"] = true;
}
echo json_encode(${${"GLOBALS"}["cekoig"]});
Esempio n. 2
0
            echo "<td style='padding:10px;border-left:1px solid #dddddd;border-right:1px solid #dddddd;'>" . htmlentities(${$vnsjtiqqkd}) . "</td>";
        }
        echo "</tr>";
    }
    echo "</table>";
    ${${"GLOBALS"}["tbnxsr"]} = md5(microtime());
    $_SESSION["import_" . ${$zbsfforeogh}] = array("filePath" => ${$wupphqbxld}, "position" => 0, "delimiter" => $_REQUEST["import_delimiter"], "total" => lineCount(${${"GLOBALS"}["pqtmbzhfz"]}), "workflow" => $_REQUEST["exec_this_workflow"]);
    ${${"GLOBALS"}["eiwdtehbiv"]} = array();
    echo "<a href='index.php?module=Workflow2&action=Importer&step=2&process=" . ${${"GLOBALS"}["mryncrknhzj"]} . "'>start Import</a>";
} elseif (${${"GLOBALS"}["nqhtuqlmox"]} == 2) {
    if (!isset($_SESSION["import_" . $_REQUEST["process"]])) {
        echo "ERROR: import process not exist!";
        return;
    }
    echo "                    <div id=\"import_progress\"></div>\n                    <script type=\"text/javascript\">\n                        var importHash = '";
    echo $_REQUEST["process"];
    echo "';\n                        var currentExecId = false;\n                        var totalRows = ";
    echo lineCount($_SESSION["import_" . $_REQUEST["process"]]["filePath"]);
    echo ";\n                        function startImport() {\n                            jQuery.post(\"index.php?module=Workflow2&action=Workflow2Ajax&file=AjaxImporter\", {importHash: importHash, currentExecID: currentExecId}, function(response) {\n\n                                if(response.ready == true) {\n                                    window.location.href = \"index.php?module=Workflow2&action=Importer&step=3&process=";
    echo $_REQUEST["process"];
    echo "\";\n                                } else {\n                                    jQuery(\"#import_progress\").html(response.done + \" of \" + totalRows + \" Rows done!\");\n                                    currentExecId = response.execID;\n                                    window.setTimeout(\"startImport()\", 1000);\n                                }\n\n                            }, \"json\");\n                        }\n                        jQuery(function() {\n                            startImport();\n                        });\n                    </script>\n                    ";
} elseif (${$ludtelbt} == 3) {
    if (!isset($_SESSION["import_" . $_REQUEST["process"]])) {
        echo "ERROR: import process not exist!";
        return;
    }
    ${${"GLOBALS"}["glxats"]} = $_SESSION["import_" . $_REQUEST["process"]];
    @unlink(${${"GLOBALS"}["glxats"]}["filePath"]);
    echo "<p>Import finished</p>";
}
echo "        </td>\n    </tr>\n    </table>\n";
Esempio n. 3
0
function buildViewOptions()
{
    /*
    Build the advanced view options.
    If MODE == 'buildViewOptions' advanced view options will be returned, otherwise the basic view options.	
    Database columns and what are acceptable values:
    orderBy = char(86) tcIn reel scene character completed deleted createdDate modifiedDate deletedDate tcOut
    orderDirection = char(4) ASC
    viewReels = varchar(255) viewAll. An empty value '' indicates no reel. 0 is a valid reel. If the user wanted to view three reels the format would be 1 3 4, identifying three reels.
    viewCharacters = text. There is no default allowed for text columns. If the user wanted to view three characters the format would be 23 45 35, identifying three characters. An empty value '' implies view all characters.
    	
    $userOrderByArray = a numeric array of the user's order by options.
    $orderByArray = an associative array of the user's order by options associated with their visible title equivalents.
    
    $viewCharacters = a nested array of the characters in the list with the charId as the key:
    array (
    	'David' => 
    	array (
    		'charId' => '188',
    		'charColor' => 'BFE1FF',
    		'activeLinesCount' => '2',
    		'totalLinesCount' => '2',
    		'deletedLinesCount' => 0,
    		'completedLinesCount' => 0
    	),...
    
    $userViewCharactersArray = the characters selected for the current list:
    array (
      0 => '188',
      1 => '190',
    )
    
    $userReelsArray = the reels selected for the current list:
    array (
      0 => '1',
      1 => '2',
    )
    
    $viewReelsArray = nested arrays showing the line count for each reel.
    array (
      0 => 
      array (
    	'reel' => '',
    	'count' => '2',
      ),
      1 => 
      array (
    	'reel' => '1',
    	'count' => '10',
      ),...
    */
    global $debug, $message, $success, $Dbc, $returnThis;
    //Build the view options.
    try {
        if (!isset($_SESSION['userId'])) {
            throw new Adrlist_CustomException('', '$_SESSION[\'userId\'] is not set.');
        } elseif (!is_numeric($_SESSION['userId'])) {
            throw new Adrlist_CustomException('', '$_SESSION[\'userId\'] is not numeric.');
        }
        //Order by options.
        $userOrderByArray = explode(' ', $_SESSION['orderBy']);
        //An array of order by options.
        //$debug->printArray($userOrderByArray,'$userOrderByArray in build view options.');
        $tempOrderByArray = array('tcIn' => 'TC In', 'character' => 'Character', 'deleted' => 'Deleted', 'completed' => 'Completed', 'reel' => 'Reel', 'scene' => 'Scene', 'tcOut' => 'TC Out', 'createdDate' => 'Created Date', 'modifiedDate' => 'Modified Date', 'deletedDate' => 'Deleted Date');
        $orderByArray = array();
        foreach ($userOrderByArray as $key => $value) {
            $orderByArray[$tempOrderByArray[$value]] = $value;
        }
        //$debug->printArray($orderByArray,'$orderByArray in build view options.');
        $orderByOptions = '	<div class="textLeft ui-field-contain" style="margin-bottom:.5em;margin-top:.5em">
		<div class="textLeft">Order By</div>
';
        $orderByOptionsCount = count($orderByArray);
        $orderByLoopCount = 1;
        $class = 'FFFFFF';
        $super = 0;
        foreach ($orderByArray as $key => $value) {
            $super++;
            if ($class == 'rowWhite') {
                $class = 'rowAlt';
            } else {
                $class = 'rowWhite';
            }
            $orderByOptionFirst = $orderByLoopCount == 1 ? true : false;
            $orderByOptionLast = $orderByLoopCount == $orderByOptionsCount ? true : false;
            if ($orderByOptionFirst) {
                $orderByOptions .= '		<div id="orderByOptionsFirstRow" class="' . $class . '">
			<div class="inline-block viewOptionsItem" id="orderByOptionsFirstUpArrows" style="width:38px"></div>
			<div class="inline-block orderByOption textCenter" id="orderByOptionsFirstValue" style="width:10em;vertical-align:middle" value="' . $value . '">
				' . $key . '
			</div>
			<div class="inline-block viewOptionsItem" id="orderByOptionsFirstDownArrows">
				<img class="arrowDownOne" src="' . LINKIMAGES . '/arrowDown.png" onClick=""><img class="arrowBottom" src="' . LINKIMAGES . '/arrowBottom.png" onClick="">
			</div>';
            } elseif ($orderByOptionLast) {
                $orderByOptions .= '		<div id="orderByOptionsLastRow" class="' . $class . '">
			<div class="inline-block viewOptionsItem" id="orderByOptionsLastUpArrows">
				<img class="arrowTop" src="' . LINKIMAGES . '/arrowTop.png" onClick=""><img class="arrowUpOne" src="' . LINKIMAGES . '/arrowUp.png" onClick="">
			</div>
			<div class="inline-block orderByOption textCenter" id="orderByOptionsLastValue" style="width:10em;vertical-align:middle" value="' . $value . '">
				' . $key . '
			</div>
			<div class="inline-block viewOptionsItem" id="orderByOptionsLastDownArrows" style="width:38px">
			</div>';
            } else {
                $orderByOptions .= '		<div class="' . $class . '">
			<div class="inline-block viewOptionsItem">
				<img class="arrowTop" src="' . LINKIMAGES . '/arrowTop.png" onClick=""><img class="arrowUpOne" src="' . LINKIMAGES . '/arrowUp.png" onClick="">
			</div>
			<div class="inline-block orderByOption textCenter" style="width:10em" value="' . $value . '">
				' . $key . '
			</div>
			<div class="inline-block viewOptionsItem">
				<img class="arrowDownOne" src="' . LINKIMAGES . '/arrowDown.png" onClick=""><img class="arrowBottom" src="' . LINKIMAGES . '/arrowBottom.png" onClick="">
			</div>';
            }
            $orderByOptions .= '</div>';
            $orderByLoopCount++;
        }
        //$debug->add('$orderByLoopCount: ' . "$orderByLoopCount in build view options.");
        $orderByOptions .= '		<div><div></div></div>
	</div>
';
        //The order direction.
        $orderDirectionOptions = '<fieldset class="viewOptionsItem" data-role="controlgroup" data-type="horizontal" data-mini="true">
    <legend>Direction</legend>
        <input id="orderDirectionAscending" name="orderDirection" value="list" ';
        $orderDirectionOptions .= $_SESSION['orderDirection'] == 'ASC' ? 'checked="checked" ' : '';
        $orderDirectionOptions .= 'type="radio">
        <label for="orderDirectionAscending">Ascending</label>
        <input id="orderDirectionDescending" name="orderDirection" value="list" ';
        $orderDirectionOptions .= $_SESSION['orderDirection'] == 'DESC' ? 'checked="checked" ' : '';
        $orderDirectionOptions .= 'type="radio">
        <label for="orderDirectionDescending">Descending</label>
</fieldset>';
        //Build the characters options. We will get three sets: active, deleted, completed.
        $viewCharacters = array();
        //The characters with active lines.
        $viewCharactersActiveStmt = $Dbc->prepare("SELECT\n\tcharacters.charId AS 'charId',\n\tcharacters.charName AS 'charName',\n\tcharacters.charColor AS 'charColor',\n\tCOUNT(characters.charId) AS 'count'\nFROM\n\tcharacters\nJOIN\n\tlinesTable ON linesTable.charId = characters.charId AND\n\tlinesTable.listId = characters.listId AND\n\tcharacters.listId = ? AND\n\tlinesTable.completed IS NULL AND\n\tlinesTable.deleted IS NULL\nGROUP BY\n\tcharacters.charName");
        $viewCharactersActiveStmt->execute(array($_SESSION['listId']));
        $totalActiveLines = 0;
        while ($viewCharactersActiveRow = $viewCharactersActiveStmt->fetch(PDO::FETCH_ASSOC)) {
            $viewCharacters[$viewCharactersActiveRow['charName']]['charId'] = $viewCharactersActiveRow['charId'];
            $viewCharacters[$viewCharactersActiveRow['charName']]['charColor'] = $viewCharactersActiveRow['charColor'];
            $viewCharacters[$viewCharactersActiveRow['charName']]['activeLinesCount'] = $viewCharactersActiveRow['count'];
            $viewCharacters[$viewCharactersActiveRow['charName']]['totalLinesCount'] = $viewCharactersActiveRow['count'];
            $totalActiveLines = $totalActiveLines + $viewCharactersActiveRow['count'];
        }
        //The characters with deleted lines. When a line is deleted it is irrelevant if it is marked as completed.
        $viewCharactersDeletedStmt = $Dbc->prepare("SELECT\n\tcharacters.charId AS 'charId',\n\tcharacters.charName AS 'charName',\n\tcharacters.charColor AS 'charColor',\n\tCOUNT(characters.charId) AS 'count'\nFROM\n\tcharacters\nJOIN\n\tlinesTable ON linesTable.charId = characters.charId AND\n\tlinesTable.listId = characters.listId AND\n\tcharacters.listId = ? AND\n\tlinesTable.deleted IS NOT NULL\nGROUP BY\n\tcharacters.charName");
        $viewCharactersDeletedStmt->execute(array($_SESSION['listId']));
        $totalDeletedLines = 0;
        while ($viewCharactersDeletedRow = $viewCharactersDeletedStmt->fetch(PDO::FETCH_ASSOC)) {
            $viewCharacters[$viewCharactersDeletedRow['charName']]['charId'] = $viewCharactersDeletedRow['charId'];
            $viewCharacters[$viewCharactersDeletedRow['charName']]['charColor'] = $viewCharactersDeletedRow['charColor'];
            $viewCharacters[$viewCharactersDeletedRow['charName']]['deletedLinesCount'] = $viewCharactersDeletedRow['count'];
            $viewCharacters[$viewCharactersDeletedRow['charName']]['totalLinesCount'] = isset($viewCharacters[$viewCharactersDeletedRow['charName']]['totalLinesCount']) ? $viewCharacters[$viewCharactersDeletedRow['charName']]['totalLinesCount'] : '';
            $totalDeletedLines = $totalDeletedLines + $viewCharactersDeletedRow['count'];
        }
        //The characters with completed lines. Completed lines marked as deleted are ignored.
        $viewCharactersCompletedStmt = $Dbc->prepare("SELECT\n\tcharacters.charId AS 'charId',\n\tcharacters.charName AS 'charName',\n\tcharacters.charColor AS 'charColor',\n\tCOUNT(characters.charId) AS 'count'\nFROM\n\tcharacters\nJOIN\n\tlinesTable ON linesTable.charId = characters.charId AND\n\tlinesTable.listId = characters.listId AND\n\tcharacters.listId = ? AND\n\tlinesTable.deleted IS NULL AND\n\tlinesTable.completed IS NOT NULL\nGROUP BY\n\tcharacters.charName");
        $viewCharactersCompletedStmt->execute(array($_SESSION['listId']));
        $totalCompletedLines = 0;
        while ($viewCharactersCompletedRow = $viewCharactersCompletedStmt->fetch(PDO::FETCH_ASSOC)) {
            $viewCharacters[$viewCharactersCompletedRow['charName']]['charId'] = $viewCharactersCompletedRow['charId'];
            $viewCharacters[$viewCharactersCompletedRow['charName']]['charColor'] = $viewCharactersCompletedRow['charColor'];
            $viewCharacters[$viewCharactersCompletedRow['charName']]['completed'] = true;
            $viewCharacters[$viewCharactersCompletedRow['charName']]['completedLinesCount'] = $viewCharactersCompletedRow['count'];
            $totalCompletedLines = $totalCompletedLines + $viewCharactersCompletedRow['count'];
        }
        ksort($viewCharacters, SORT_STRING);
        //$debug->printArray($viewCharacters,'$viewCharacters');
        $userViewCharactersArray = explode(' ', $_SESSION['viewCharacters']);
        //An array of character Ids.
        //$debug->printArray($userViewCharactersArray,'$userViewCharactersArray');
        //View reels options.
        $viewReelsStmt = $Dbc->prepare("SELECT\n\tlinesTable.reel AS 'reel',\n\tCOUNT(linesTable.reel) AS 'count'\nFROM\n\tlinesTable\nWHERE\n\tlinesTable.listId = ?\nGROUP BY\n\tLENGTH(linesTable.reel), linesTable.reel");
        $viewReelsStmt->execute(array($_SESSION['listId']));
        $reelsOptions = '<fieldset class="viewOptionsItem" data-mini="true" data-role="controlgroup">
    <legend>View Reels</legend>
    <input callback="checkAll"';
        $reelsOptions .= $_SESSION['viewReels'] == 'viewAll' ? ' checked="checked"' : '';
        $reelsOptions .= '" id="viewReelsMaster" name="viewReelsMaster" type="checkbox" viewReelsValue="viewAll">
    <label for="viewReelsMaster">All Reels</label>
';
        $userReelsArray = explode(' ', $_SESSION['viewReels']);
        //An array of reel ids.
        //$debug->printArray($userReelsArray,'$userReelsArray in build view options.');
        $viewReelsArray = array();
        $reelId = 0;
        while ($viewReelsRow = $viewReelsStmt->fetch(PDO::FETCH_ASSOC)) {
            $reelCount = lineCount($viewReelsRow['count']);
            if (empty($viewReelsRow['reel'])) {
                if (in_array('', $userReelsArray) || $_SESSION['viewReels'] == 'viewAll') {
                    $checked = 'checked="checked"';
                    $reelsValue = 'no reel ' . $reelCount;
                } else {
                    $checked = '';
                    $reelsValue = 'no reel ' . $reelCount;
                }
            } else {
                if (in_array($viewReelsRow['reel'], $userReelsArray) || $_SESSION['viewReels'] == 'viewAll') {
                    $checked = 'checked="checked"';
                    $reelsValue = 'Reel ' . $viewReelsRow['reel'] . ' ' . $reelCount;
                } else {
                    $checked = '';
                    $reelsValue = 'Reel ' . $viewReelsRow['reel'] . ' ' . $reelCount;
                }
            }
            $reelsOptions .= '    <input callback="masterState" master="viewReelsMaster" name="viewReel' . $reelId . '" id="viewReel' . $reelId . '" type="checkbox" ' . $checked . ' viewReelsValue="' . $viewReelsRow['reel'] . '">
    <label for="viewReel' . $reelId . '">' . $reelsValue . '</label>';
            $viewReelsArray[] = $viewReelsRow;
            $reelId++;
        }
        $reelsOptions .= '</fieldset>';
        //$debug->printArray($viewReelsArray,'$viewReelsArray');
        //Build the character view options
        $characterOptions = '<fieldset class="viewOptionsItem" data-mini="true" data-role="controlgroup">
    <legend class="ui-controlgroup-vertical"><span class="mobile">View Characters</span><table class="desktop tablet ui-controlgroup-controls textCenter" style="padding:0 1em"><tr><td style="min-width:10em">View Characters</td><td style="padding:.5em 0;width:33%">active</td><td style="background-color:#B1FF99;padding:.5em 0;width:33%">completed</td><td style="background-color:#FF7070;padding:.5em 0;width:33%">deleted</td></tr></table></legend>
    <input callback="checkAll"';
        $characterOptions .= empty($_SESSION['viewCharacters']) ? ' checked="checked"' : '';
        $characterOptions .= '" id="viewCharactersMaster" name="viewCharactersMaster" viewCharactersValue="viewAll" type="checkbox">
    <label for="viewCharactersMaster"><span class="mobile">All Characters</span><table class="desktop tablet textCenter" style="width:100%"><tr><td style="min-width:10em">All Characters</td><td style="width:33%">' . $totalActiveLines . '</td><td style="width:33%">' . $totalDeletedLines . '</td><td style="width:33%">' . $totalCompletedLines . '</td></tr></table></label>';
        $characterCount = count($userViewCharactersArray);
        foreach ($viewCharacters as $key => $value) {
            //Determine the line count.
            $lineCount = 0;
            if ($_SESSION['showCompletedLines'] == true) {
                $lineCount = empty($value['completedLinesCount']) ? 0 : $value['completedLinesCount'];
                //$debug->add('$lineCount first if for ' . $key . ': ' . "$lineCount.");
            }
            if ($_SESSION['showDeletedLines'] == true) {
                $lineCount += empty($value['deletedLinesCount']) ? 0 : $value['deletedLinesCount'];
                //$debug->add('$lineCount second if for ' . $key . ': ' . "$lineCount.");
            }
            $lineCount = empty($value['activeLinesCount']) ? lineCount($lineCount) : lineCount($lineCount + $value['activeLinesCount']);
            //Determine what character color to show.
            if ($_SESSION['showCharacterColors'] == false || empty($value['charColor'])) {
                $characterColor = 'FFF';
            } else {
                $characterColor = $value['charColor'];
            }
            if (in_array($value['charId'], $userViewCharactersArray) || empty($_SESSION['viewCharacters'])) {
                $checked = ' checked="checked"';
                $checkedOld = 'checked';
            } else {
                $checked = '';
                $checkedOld = 'unchecked';
            }
            $characterOptions .= '<input callback="masterState" master="viewCharactersMaster" name="viewCharacter' . $value['charId'] . '" id="viewCharacter' . $value['charId'] . '" type="checkbox" ' . $checked . ' viewCharactersValue="' . $value['charId'] . '">
    <label for="viewCharacter' . $value['charId'] . '" style="background-color:#' . $characterColor . '"><span class="mobile">' . $key . '</span><table class="desktop tablet textCenter" style="width:100%"><tr>
			<td style="min-width:10em">' . $key . '</td><td style="width:33%">';
            $characterOptions .= empty($value['activeLinesCount']) ? '0' : $value['activeLinesCount'];
            $characterOptions .= '</td><td style="width:33%">';
            $characterOptions .= empty($value['completedLinesCount']) ? '0' : $value['completedLinesCount'];
            $characterOptions .= '</td><td style="width:33%">';
            $characterOptions .= empty($value['deletedLinesCount']) ? '0' : $value['deletedLinesCount'];
            $characterOptions .= '</td>
		</tr>
	</table>
</label>';
        }
        $characterOptions .= '</fieldset>';
        //The show options.
        $showOptions = '	
			<fieldset class="textLeft" data-role="controlgroup" data-type="vertical" data-mini="true">
		<legend>Show</legend>
		<input callback="advancedViewColorWheel" id="advancedShowCharacterColors" name="advancedShowCharacterColors" type="checkbox"';
        $showOptions .= $_SESSION['showCharacterColors'] == true ? ' checked="checked"' : '';
        $showOptions .= '">
		<label for="advancedShowCharacterColors">Character Colors <img class="middle" id="advancedSaveColorWheel" src="' . LINKIMAGES . '/colorWheel.png" style="height:1.3em;width:1.3em;"></label>
		
		<input id="advancedShowCompletedLines" name="advancedShowCompletedLines" style="background-color:#FF7070" type="checkbox"';
        $showOptions .= $_SESSION['showCompletedLines'] == true ? ' checked="checked"' : '';
        $showOptions .= '">
		<label for="advancedShowCompletedLines" style="background-color:#B1FF99">Completed Lines</label>
		
		<input data-wrapper-class="textLeft" id="advancedShowDeletedLines" name="advancedShowDeletedLines" type="checkbox"';
        $showOptions .= $_SESSION['showDeletedLines'] == true ? ' checked="checked"' : '';
        $showOptions .= '">
		<label for="advancedShowDeletedLines" style="background-color:#FF7070">Deleted Lines</label>
	</fieldset>';
        $advancedViewOptionsBlueButtons = '<div class="break" id="advancedViewOptions">
		<button class="ui-btn ui-btn-inline ui-shadow ui-corner-all" id="resetViewOptionsToDefault" onClick="">Reset To Default</button>';
        $advancedViewOptionsBlueButtons .= isset($_SESSION['listRoleId']) && $_SESSION['listRoleId'] > 1 ? '<button class="ui-btn ui-btn-inline ui-shadow ui-corner-all" id="tcValidateAll" onClick="">Validate TC</button>' : '';
        $advancedViewOptionsBlueButtons .= '
	<button class="ui-btn ui-icon-refresh ui-btn-icon-left ui-btn-inline ui-shadow ui-corner-all" id="refreshAdvancedViewOptions" onClick="">Refresh</button><button class="ui-btn ui-icon-heart ui-btn-icon-left ui-btn-inline ui-shadow ui-corner-all" id="saveAdvancedViewOptions" onClick="">Save</span>' . cancelButton() . '</div>
';
        //Print options.
        $printOptions = '<div class="break center textCenter" style="margin:1em">
	<button class="export ui-btn ui-btn-inline ui-corner-all ui-mini" exportFor="engineer">PDF for Engineer</button>
	<button class="export ui-btn ui-btn-inline ui-corner-all ui-mini" exportFor="talent">PDF for Talent</button>
	<div class="textCenter" style="margin-top:1em">Options</div>
	<div class="ui-field-contain">
		<input name="viewListOnLogin" id="exportShowComments" type="checkbox" data-wrapper-class="true">
		<label for="exportShowComments">Show Comments</label>
	</div>
</div>';
        $tabs = '<div style="height:2em"></div><div data-role="tabs" id="tabs">
	<div data-role="navbar">
		<ul>
			<li><a class="ui-btn-active" data-theme="c" data-ajax="false" href="#viewOptions"><i class="fa fa-cogs desktopInline tabletInline"></i>View<span class="desktopInline tabletInline">&nbsp;Options</span></a></li>
			<li><a data-theme="c" data-ajax="false" href="#export"><i class="fa fa-share desktopInline tabletInline"></i>Export</a></li>
			<li><a data-theme="c" data-ajax="false" href="#reports"><i class="fa fa-bar-chart-o desktopInline tabletInline"></i>Reports</a></li>
		</ul>
	</div>
	<div id="viewOptions" class="ui-body-c ui-content">
		' . $orderByOptions . $orderDirectionOptions . $reelsOptions . $characterOptions . $showOptions . $advancedViewOptionsBlueButtons . '
	</div>
	<div id="export">
		' . $printOptions . '
	</div>
	<div id="reports">
		nothing here yet
	</div>
</div>';
        $advancedViewOptions = $tabs;
        if (MODE == 'buildViewOptions') {
            $success = true;
            $returnThis['buildViewOptions'] = $advancedViewOptions;
        }
    } catch (Adrlist_CustomException $e) {
    } catch (PDOException $e) {
        error(__LINE__, '', '<pre>' . $e . '</pre>');
    }
    if (MODE == 'buildViewOptions') {
        returnData();
    }
}