Skip to content

Commit

Permalink
Configuration Update
Browse files Browse the repository at this point in the history
ApiClient improved
  • Loading branch information
Vitexus committed Jan 14, 2025
1 parent 60f556d commit a2a902f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
30 changes: 24 additions & 6 deletions multiflexi/discomp2abraflexi.multiflexi.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,49 @@
"description": "Intial storage Code",
"defval": "SKLAD",
"required": false
},
},
"ABRAFLEXI_DISCOMP_CODE": {
"type": "string",
"description": "Discomp Addressbook Code",
"defval": "DISCOMP",
"required": false
},
},
"DISCOMP_USERNAME": {
"type": "string",
"description": "Your Discomp username",
"defval": "",
"required": true
},
},
"DISCOMP_PASSWORD": {
"type": "password",
"description": "Your Discomp password",
"defval": "",
"required": true
},
},
"DISCOMP_TYP_ZASOBY": {
"type": "string",
"description": "Intial storage Code",
"defval": "typZasoby.material",
"required": false
}
},
"DISCOMP_API_DEBUG": {
"type": "checkbox",
"description": "Show API debug messages",
"defval": "False",
"required": false
},
"APP_DEBUG": {
"type": "checkbox",
"description": "Show debug messages",
"defval": "False",
"required": false
},
"EASE_LOGGER": {
"type": "string",
"description": "Logger type",
"defval": "syslog|console",
"required": false
}
},
"multiflexi": "1.7.2"
"multiflexi": "1.20"
}
4 changes: 2 additions & 2 deletions src/Discomp/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public function __construct($username = '', $password = '')
{
$this->apiUsername = \strlen($username) ? $username : \Ease\Shared::cfg('DISCOMP_USERNAME');
$this->apiPassword = \strlen($password) ? $password : \Ease\Shared::cfg('DISCOMP_PASSWORD');
$this->debug = \Ease\Shared::cfg('DISCOMP_API_DEBUG', false);
$this->debug = strtolower((string) \Ease\Shared::cfg('DISCOMP_API_DEBUG', false)) === 'True';
$this->curlInit();
$this->setObjectName();
}

/**
* Close Curl Handle before serizaliation.
* Close Curl Handle before serialization.
*/
public function __destruct()
{
Expand Down
2 changes: 1 addition & 1 deletion src/discomp2abraflexi.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$importer = new Discomp\Importer();

try {
if (\Ease\Shared::cfg('DISCOMP_SCOPE') === 'all') {
if (\Ease\Shared::cfg('DISCOMP_SCOPE', false) === 'all') {
$importer->allTimeItems();
} else {
$importer->freshItems();
Expand Down

0 comments on commit a2a902f

Please sign in to comment.