$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 { print '<FORM METHOD="POST" ACTION="zogiEnt.php">'; print '</U>Provide username and password</U><BR/>'; print 'Username: <INPUT SIZE=10 NAME="username"/><BR/>'; print 'Password: <INPUT SIZE=10 NAME="password"/><BR/>'; print '<INPUT TYPE="SUBMIT" VALUE="Login"/>';
$notation2['entityName'] = 'note'; $notation2['objectId'] = 0; $app = array(); $app['entityName'] = 'Appointment'; $app['objectId'] = '0'; $app['keywords'] = 'ZOGI'; $app['comment'] = 'COMMENT COMMENT COMMENT'; $app['start'] = '2007-02-18 13:00'; $app['end'] = '2007-02-18 15:00'; $app['title'] = 'My New 2007 Appointment'; $app['location'] = 'Sardinia'; $app['_FLAGS'] = 'ignoreConflicts'; $app['_NOTES'] = array($notation1); $app['_PARTICIPANTS'] = array($participant1, $participant2); print "<BR/>--Create--<BR/>"; $app = $ogo->putObject($app); print_r($app); print "<BR/>--Put Note ---<BR/>"; /* This adds a second note, we preserve the first note */ $app['_NOTES'] = array($app['_NOTES'][0], $notation2); $app['_FLAGS'] = 'ignoreConflicts'; $app = $ogo->putObject($app); print_r($app['_NOTES']); print "<BR/>--Update, updating note--<BR/>"; print "objectId: " . $app['objectId']; $app['title'] = 'Modified Appointment'; $app['_FLAGS'] = 'ignoreConflicts'; /* We are dropping one of the participants */ $app['_PARTICIPANTS'] = array($participant2); /* We are changing the content of one of the notes */ $app['_NOTES'][0]['title'] = 'Updated note title';