Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for federation-tests #186

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion Dockerfile-postgres
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM postgres
ADD schema.sql .
COPY schema.sql /docker-entrypoint-initdb.d/
2 changes: 1 addition & 1 deletion src/api/wiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function importWikiFile()
function importWiki($data)
{

$result = 6; // fetchTabularId();
$result = $_SERVER["WIKI_TABULAR_ID"]; // fetchTabularId();
$url = $_SERVER["WIKI_HOST"] . '/' .$result . '/import';
$headers = array(
"Accept: application/json",
Expand Down
5 changes: 3 additions & 2 deletions src/commands/push-to-timeld.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function pushMovementsToTimesheet($worker, $arr)
}
$project = $_SERVER["TIMELD_PROJECT"]; // e.g. "fedb/fedt"
$timesheet = $_SERVER["TIMELD_TIMESHEET"]; // e.g. "fedb/from-pounder-source"

$hostUrl = $_SERVER["PREJOURNAL_HOST"];

var_dump([
"Push movement to timeld!",
$worker,
Expand Down Expand Up @@ -63,7 +64,7 @@ function pushMovementsToTimesheet($worker, $arr)
"@id" => $worker
],
"external" => [
"@id" => "http://time.pondersource.com/movement/" . $arr[$i]["id"]
"@id" => $hostUrl . "/movement/" . $arr[$i]["id"]
]
], JSON_UNESCAPED_SLASHES);
}
Expand Down
9 changes: 3 additions & 6 deletions src/commands/push-to-wikisuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ function pushMovementsToTabular($worker, $arr)
// echo "TIMELD_PROJECT not set!";
return;
}
$project = $_SERVER["TIMELD_PROJECT"]; // e.g. "fedb/fedt"
$timesheet = $_SERVER["TIMELD_TIMESHEET"]; // e.g. "fedb/from-pounder-source"
$hostUrl = $_SERVER["PREJOURNAL_HOST"];

var_dump([
"Push movement to wikisuite!",
$worker,
$project,
$timesheet
$worker
]);
var_dump($arr);
$data = array(
Expand All @@ -49,7 +46,7 @@ function pushMovementsToTabular($worker, $arr)
date_default_timezone_set('UTC');
for ($i = 0; $i < count($arr); $i++) {
$data[] = '"' . implode('","', [
"http://time.pondersource.com/movement/" . $arr[$i]["id"], // URI
$hostUrl . "/movement/" . $arr[$i]["id"], // URI
$worker, // User
"federated-timesheets", // Project
"", // Task
Expand Down
20 changes: 20 additions & 0 deletions testnet.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
DB_USER=prejournal_test
DB_DATABASE=prejournal_test
DB_PASSWORD=123456
DB_HOST=prejournal-db
DB_DRIVER=pdo_pgsql
PREJOURNAL_ADMIN_PARTY=true
PREJOURNAL_USERNAME=admin
PREJOURNAL_PASSWORD=secret
PREJOURNAL_DEFAULT_EMPLOYER=stichting
PREJOURNAL_HOST=http://prejournal.local
WIKI_TOKEN=testnet-supersecret-token
WIKI_HOST=http://tikiwiki.local/api/tabulars
WIKI_TABULAR_ID=3
TIMELD_HOST=http://timeld-gateway.local:8080/api
TIMELD_USERNAME=prejournal
TIMELD_PASSWORD=
TIMELD_TIMESHEET=prejournal/timesheet
TIMELD_PROJECT=prejournal/timesheet-project
#QUICKBOOK_API_URL=https://sandbox-quickbooks.api.intuit.com/v3/company/4620816365245459690
#QUICKBOOK_API_TOKEN=YOUR_API_TOKEN