Exemplo n.º 1
0
<?php

require_once "AMP/System/Page.inc.php";
require_once "Modules/Schedule/Item/ComponentMap.inc.php";
$map = new ComponentMap_ScheduleItem();
$page = new AMPSystem_Page($dbcon, $map);
if (isset($_GET['action']) && $_GET['action'] == "list") {
    $page->showList(true);
}
if (isset($_GET['schedule_id']) && $_GET['schedule_id']) {
    $page->addCallback('list', 'addCriteria', array('schedule_id=' . $_GET['schedule_id'], true));
    $page->addCallback('form', 'setDefaultValue', array('schedule_id', $_GET['schedule_id']));
}
if (isset($_GET['owner_id']) && $_GET['owner_id']) {
    $page->addCallback('list', 'addCriteria', array('owner_id=' . $_GET['owner_id'], true));
    $page->addCallback('form', 'setDefaultValue', array('owner_id', $_GET['owner_id']));
}
$page->execute();
print $page->output();
Exemplo n.º 2
0
require_once 'AMP/System/Page.inc.php';
$map = new ComponentMap_Appointment();
$page = new AMPSystem_Page($dbcon, $map);
if (isset($_GET['action']) && $_GET['action'] == 'list') {
    $page->showList(true);
}
$item_id = false;
// for single schedule items
if (isset($_GET['scheduleitem_id']) && $_GET['scheduleitem_id']) {
    $item_id = $_GET['scheduleitem_id'];
}
if (isset($_GET['action_id']) && $_GET['action_id']) {
    $item_id = $_GET['action_id'];
}
if ($item_id) {
    $page->addCallback('form', 'setDefaultValue', array('action_id', $item_id));
    $page->addCallback('list', 'addCriteria', array('action_id=' . $item_id, true));
}
// for single users
if (isset($_GET['userdata_id']) && ($user_id = $_GET['userdata_id'])) {
    $page->addCallback('form', 'setDefaultValue', array('userdata_id', $user_id));
    $page->addCallback('list', 'addCriteria', 'userdata_id=' . $user_id);
}
// for single schedules
if (isset($_GET['schedule_id']) && ($schedule_id = $_GET['schedule_id'])) {
    $page->addCallback('form', 'setSchedule', $schedule_id);
    $page->addCallback('list', 'appendEditLinkVar', 'schedule_id=' . $schedule_id);
    $itemset =& ScheduleLookup_ItemSet::instance($schedule_id);
    $itemcrit = count($itemset) ? "(" . join(",", $itemset) . ")" : false;
    if ($itemcrit) {
        $page->addCallback('list', 'addCriteria', array('scheduleitem_id in' . $itemcrit, false));