PHP Classes

File: edit.php

Recommend this page to a friend!
  Classes of Michael J. Fuhrman   Todo List   edit.php   Download  
File: edit.php
Role: Example script
Content type: text/plain
Description: Edits a Todo from the Folder
Class: Todo List
Manage a list of tasks of a to do list
Author: By
Last change:
Date: 14 years ago
Size: 3,384 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'];

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

   
if ($nFolderID == 0) return;
    if (
$nPos == 0) return;

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

   
$pnlApt = new ENetArch_Panels_Common_Todo();

   
$pnlTask_Priorities = new ENetArch_Panels_Common_Task_Priorities();
   
$pnlTask_Types = new ENetArch_Panels_Common_Task_Types();

   
$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

   
$pnlApt->setPanelName ("ENetArch.Todos");
   
$pnlApt->setPanelPriorities ($pnlTask_Priorities);
   
$pnlApt->setPanelTaskTypes ($pnlTask_Types);
   
$pnlApt->setPanel ($itmTodo);

?>
<style> @import url("styles.css"); </style>
    <script src="jquery_lite.js"></script>
    <script src="trgrs_Todos.js"></script>
    <script>
        ENetArch.Todos.nFolderID = <?= $nFolderID ?>;
        ENetArch.Todos.nPos = <?= $nPos ?>;
    </script>
<?
    $pnlCalendar
->drawPanel();
?>
<div ID="ENetArch_Navigation">
    <a href="javascript:void(0);" onClick="ENetArch.Todos.List ();">List</a> |
    <a href="javascript:void(0);" onClick="ENetArch.Todos.New ();">New</a> |
    <a href="javascript:void(0);" onClick="ENetArch.Todos.View ();">View</a> |
    <a href="javascript:void(0);" onClick="ENetArch.Todos.Edit ();">Edit</a> |
    <a href="javascript:void(0);" onClick="ENetArch.Todos.Delete ();">Delete</a>
    </div>
<?
   
print ("<form name=\"ENetArch_Todos_Form\" onSubmit =\"ENetArch.Todos.Update(this)\" >");
    print (
"<table ID=\"" . $pnlApt->getPanelID() . "\">\n");
   
$pnlApt->drawHeader();
   
$pnlApt->drawPanel();
    print (
"</table>\n");
    print (
'<input type="submit" name="submit" value="submit">');
    print (
"</form>");
?>
<script>ENetArch_Calendar
        $("ENetArch_Navigation").style.width = $("ENetArch_Todos").offsetWidth - 6;
        $("ENetArch_Calendar").style.width = $("ENetArch_Todos").offsetWidth;
    </script>
<?
}
?>