Esempio n. 1
0
<?php

/*  
  License: LGPL
  Copyright 2007, Whitemice Consulting
  Adam Tauno Williams
  awilliam@whitemiceconsulting.com
  
  This file is a test/demonstation of all the actions that can be performed
  on an appointment.
*/
require_once "zogi.php";
$ogo = new OpenGroupwareServer("localhost", "awilliam", "fred");
echo "Account Object Id is:" . $ogo->getLoginAccountId() . "<BR/>";
$participant1 = array();
$participant1['participantObjectId'] = 10160;
$participant1['role'] = 'CHAIR';
$participant1['comment'] = 'This dude rocks';
$participant2 = array();
$participant2['participantObjectId'] = 10003;
$participant2['role'] = 'REQ-PARTICIPANT';
# Setup note
$notation1 = array();
$notation1['title'] = 'Title Of First Note';
$notation1['content'] = 'Content of first appointment notation';
$notation1['entityName'] = 'note';
$notation1['objectId'] = 0;
$notation2 = array();
$notation2['title'] = 'Title Of Second Note';
$notation2['content'] = 'Content of second appointment notation';
$notation2['entityName'] = 'note';
Esempio n. 2
0
<?php

require_once "zogi.php";
if (isset($_POST["username"])) {
    $ogo = new OpenGroupwareServer("tor", $_POST["username"], $_POST["password"]);
    $accountId = @$ogo->getLoginAccountId();
    if ($accountId == null) {
        print 'Cannot connect to groupware using provided credentials';
        die(0);
    }
    print 'Retrieving enterprise...<br/>';
    $enterprise = $ogo->getObject(3049570, 32767);
    printf('Name: %s<br/>', $enterprise['name']);
    /* Change the division, this demonstrates using getSubkeyReference 
       A reference to the dictionary (keyed array) in _COMPANYVALUES
       with an "attribute" equal to "division" is returned.  Then its
       other components can be modified. */
    $cv =& $ogo->getSubkeyReference($enterprise, '_COMPANYVALUES', 'attribute', 'division');
    printf('Division: %s<br/>', $cv['value']);
    $cv['value'] = 'Test';
    $enterprise = $ogo->putObject($enterprise);
    $cv =& $ogo->getSubkeyReference($enterprise, '_COMPANYVALUES', 'attribute', 'division');
    printf('Division: %s<br/>', $cv['value']);
    $cv['value'] = 'MVP';
    $enterprise = $ogo->putObject($enterprise);
    $cv =& $ogo->getSubkeyReference($enterprise, '_COMPANYVALUES', 'attribute', 'division');
    printf('Division: %s<br/>', $cv['value']);
    /* Display the city from the ship address */
    $ship =& $ogo->getSubkeyReference($enterprise, '_ADDRESSES', 'type', 'ship');
    printf('City: %s<br/>', $ship['city']);
} else {
Esempio n. 3
0
<?php

/*  
  License: LGPL
  Copyright 2007, Whitemice Consulting
  Adam Tauno Williams
  awilliam@whitemiceconsulting.com
*/
require_once "zogi.php";
$ogo = new OpenGroupwareServer("localhost", "awilliam", "fred");
echo "Account Object Id is:" . $ogo->getLoginAccountId() . "<BR/>";
/*
echo "<BR/>Get Login Account<BR/>";
$result = $ogo->getLoginAccount(65535);
print_r($result);

echo "<BR/>Get Object<BR/>";
$result = $ogo->getObject(491010, 65535);
print_r($result);

echo "<BR/>Get Objects<BR/>";
$result = $ogo->getObjects(array(10160, 491010), 65535);
print_r($result);

echo "<BR/>Create Task<BR/>";
$task = array();
$task['entityName'] = 'Task';
$task['name'] = 'New ZOGI/PHP Task 5';
$task['executantObjectId'] = 10160;
$task['objectId'] = '0';  
$task['keywords'] = 'ZOGI';