Location: PHPKode > scripts > Task Types > task-types/update.php
<?
/*	=======================================
	Copyright 1998 - 2010 - E Net Arch
	This program is distributed under the terms of the GNU
	General Public License (or the Lesser GPL).
	======================================= */

function dirPath() { return ("../../"); }

Include_Once (dirPath() . "Shared/Classes/Ladder/Ladder_Ladder.cls");
Include_Once ("Common_Panel.cls");
Include_Once ("Common_TaskTypes.cls");
Include_Once ("TaskType_Edit.cls");
Include_Once (dirPath() . "Shared/_app.inc");

Function php_Main ()
{
	$nFolderID = 0;
	if (isset ($_REQUEST ['nFolderID']))
		$nFolderID = $_REQUEST ['nFolderID'];

	$nPos = 0;
	if (isset ($_REQUEST ['nPos']))
		$nPos = $_REQUEST ['nPos'];

	// ==========================================
	// Validations

	if ($nFolderID == 0) return;
	if ($nPos == 0) header ("Location:List.php");

	// =======================================
	// Classes

	$clsCommon_TaskType = gblLadder()->getClass ("Common_TaskType")->ID();

	// ==========================================
	// Get TaskTypes Folder

	$fldrTarget = gblLadder()->getItem ($nFolderID);

	// =======================================
	// Set TaskTypes Folder

	$fldrTaskTypes = New ENetArch_Common_TaskTypes();
	$fldrTaskTypes->setState ($fldrTarget);

	// ==========================================
	// Panels

	$pnlTaskType = new ENetArch_Panels_Common_TaskType();

	// ==========================================
	// Get Item

	$itmTaskType = $fldrTaskTypes->Item ($nPos, Array (1=>$clsCommon_TaskType));

	// ==========================================
	// View

	$pnlTaskType->setPanelName ("ENetArch.TaskTypes");
	$pnlTaskType->getPOST();

	$pnlTaskType->updateObject ($itmTaskType);
	$itmTaskType->Store();

	header ("Location:view.php?nFolderID=" . $nFolderID . "&nPos=" . $nPos . "&");

	return;
}
?>
Return current item: Task Types