Skip to content
Open
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/
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ NB: In general, you would never put a password in a URL or even in a `.env` file
we're doing this here to simplify the setup during rapid initial development. See [#9](https://github.com/pondersource/prejournal/issues/9).

# Usage (Heroku)
The app's main branch is automatically deployed to https://api.prejournal.org/ on each commit
The app's main branch is automatically deployed to https://api.prejournal..../ on each commit
You can try for instance:
```
curl -d'["alice","alice123"]' https://admin:secret@api.prejournal.org/v1/register # requires admin permissions
curl https://alice:alice123@api.prejournal.org/v1/hello
curl -d'["alice","alice123"]' https://admin:secret@api.prejournal..../v1/register # requires admin permissions
curl https://alice:alice123@api.prejournal..../v1/hello
```
You can also create a Heroku app yourself and deploy a branch of the code there. Feel free, it's open source!

Expand Down Expand Up @@ -212,7 +212,7 @@ That's why GAAP journals can not really be considered as a database model, they



See [https://prejournal.org/example](https://prejournal.org/example) for some example PHP code.
See [https://prejournal..../example](https://prejournal..../example) for some example PHP code.


#### Why?
Expand Down
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