PHP Classes

File: move.php

Recommend this page to a friend!
  Classes of Michael J. Fuhrman   Todo List   move.php   Download  
File: move.php
Role: Example script
Content type: text/plain
Description: Moves Todos from one date to another
Class: Todo List
Manage a list of tasks of a to do list
Author: By
Last change:
Date: 14 years ago
Size: 2,112 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 (
"Task_Priorities.cls");
Include_Once (
"Task_Types.cls");
Include_Once (
"Calendar_Week.cls");
Include_Once (
"Common_Todos.cls");
Include_Once (
"Todo_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'];

   
$dTarget = "";
    if (isset (
$_REQUEST ['dTarget']))
       
$dTarget = $_REQUEST ['dTarget'];

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

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

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

   
$clsCommon_Todo = gblLadder()->getClass ("Common_Todo")->ID();

   
// ==========================================
    // Get Todos Folder

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

   
// =======================================
    // Set Todos Folder

   
$fldrApts = New ENetArch_Common_Todos();
   
$fldrApts->setState ($fldrTarget);

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

   
$pnlCalendar = new ENetArch_Panels_Common_Calendar_Week();

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

   
$pnlCalendar->setPanelName ("ENetArch.Calendar");
   
$pnlCalendar->getSession ();
   
$fldrApts->setDate ($pnlCalendar->getDate());

   
$itmTodo = $fldrApts->Item ($nPos, Array (1=>$clsCommon_Todo));

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

   
$itmTodo->setField ("dTarget", $dTarget);
   
$itmTodo->Store();

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

    return;
}
?>