PHP Classes

File: delete.php

Recommend this page to a friend!
  Classes of Michael J. Fuhrman   Task Types   delete.php   Download  
File: delete.php
Role: Example script
Content type: text/plain
Description: Deletes a Task Type from the Folder
Class: Task Types
Manage a list of types of tasks of a to do list
Author: By
Last change:
Date: 14 years ago
Size: 1,664 bytes
 

Contents

Class file image Download
<?
/* =======================================
    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'];


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

   
if ($nFolderID == 0) return;

   
// =======================================
    // 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

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

   
if (isset ($_GET ['nPos']))
        for (
$t=0; $t<count ($_GET ['nPos']); $t++)
        {
           
$nPos = $_GET ['nPos'][$t];
            if (
$nPos != 0)
            {
               
$itmTaskType = $fldrTaskTypes->Item ($nPos, Array (1=>$clsCommon_TaskType));
               
$itmTaskType->Delete();
            }
        }

   
print_r ($_GET ['nPos']);

   
// header ("Location:List.php?nFolderID=" . $nFolderID . "&");
}
?>