Beispiel #1
0
function newIndividualAndCase()
{
    $individualId = uniqid();
    $caseId = uniqid();
    return buildBatch(array(buildCommand('CreateIndividual', array(buildParameter('ExternalSystemId', $individualId), buildParameter('FirstName', 'Foo'), buildParameter('LastName', 'Bar'), buildParameter('HomeEmail', '*****@*****.**'), buildParameter('HomePhone', '+469928372832'), buildParameter('HomeAttention', 'Attention'), buildParameter('HomeStreet', 'Street'), buildParameter('HomeStreetNumber', '42'), buildParameter('HomeZip', 'S-12345'), buildParameter('HomeCity', 'City'))), buildCommand('CreateCase', array(buildParameter('Title', 'Test case from PHP'), buildParameter('Description', 'Test case with linked individual containing contact information'), buildParameter('Note', 'Test case from PHP'), buildParameter('Type', 'Support'), buildParameter('Individuals', $individualId), buildParameter('Attention', 'Attention'), buildParameter('Street', 'Street'), buildParameter('StreetNumber', '42'), buildParameter('Zip', 'S-12345'), buildParameter('City', 'City'), buildParameter('FinancialSystemId', $caseId))), buildCommand('CreateWorkOrder', array(buildParameter('Case', $caseId)))));
}
#!/usr/bin/php
<?php 
require_once __DIR__ . '/cygwin.inc.php';
require_once __DIR__ . '/vendor/autoload.php';
$color = new \Colors\Color();
$cmd = buildCommand();
$dir = '';
$regexp = '';
$replacement = '';
if ($cmd['l']) {
    $preset = parse_ini_file(__DIR__ . '/preset.ini', true);
    foreach ($preset as $presetName => $preset) {
        echo "{$presetName}\n";
    }
    exit;
}
if (strlen($cmd['preset'])) {
    $preset = parse_ini_file(__DIR__ . '/preset.ini', true);
    $presetName = $cmd['preset'];
    if (empty($preset[$presetName])) {
        die($color("Preset <{$presetName}> is not exist.\n")->bg('red')->bold()->white());
    }
    $preset = $preset[$presetName];
    $dir = $preset['dir'];
    $regexp = $preset['regexp'];
    $replacement = $preset['replacement'];
}
if (strlen($cmd['dir'])) {
    $dir = $cmd['dir'];
    $dir = _cp($dir);
    echo $dir;