Login   Register  
PHP Classes
elePHPant
Icontem

File: add.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michael J. Fuhrman  >  Task Types  >  add.php  >  Download  
File: add.php
Role: Example script
Content type: text/plain
Description: Adds a task type to the task list
Class: Task Types
Manage a list of types of tasks of a to do list
Author: By
Last change:
Date: 4 years ago
Size: 1,343 bytes
 

Contents

Class file image Download
<?
function dirPath() { return ("../../"); }

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

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

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

    
if ($nFolderID == 0) return;

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

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

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

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

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

    
$itmTaskType $fldrTarget->Create_Item ("TaskType""Test TaskType"$clsCommon_TaskType);

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

    
$pnlTaskType = new ENetArch_Panels_Common_TaskType();

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

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

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

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

    return;
}
?>