Weiterer ausbau
This commit is contained in:
parent
dfd79d1048
commit
c0da34309b
|
|
@ -5,7 +5,7 @@
|
||||||
<name>Agency</name>
|
<name>Agency</name>
|
||||||
<summary>App for managing Agency of DA</summary>
|
<summary>App for managing Agency of DA</summary>
|
||||||
<description><![CDATA[test]]></description>
|
<description><![CDATA[test]]></description>
|
||||||
<version>0.0.2</version>
|
<version>0.0.1</version>
|
||||||
<licence></licence>
|
<licence></licence>
|
||||||
<namespace>Agency</namespace>
|
<namespace>Agency</namespace>
|
||||||
<category>tools</category>
|
<category>tools</category>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
return [
|
return [
|
||||||
'resources' => [
|
//'resources' => [
|
||||||
'agency' => ['url' => '/agencys'],
|
// 'agency' => ['url' => '/agencys'],
|
||||||
],
|
//],
|
||||||
'routes' => [
|
'routes' => [
|
||||||
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
|
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
|
||||||
['name' => 'agency#getagencyidbyuser', 'url' => '/getagencyidbyuser', 'verb' => 'GET'],
|
['name' => 'agency#show', 'url' => '/getagencydata', 'verb' => 'GET'],
|
||||||
['name' => 'test#filetest', 'url' => '/filetest', 'verb' => 'GET'],
|
['name' => 'test#filetest', 'url' => '/filetest', 'verb' => 'GET'],
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,56 @@
|
||||||
<?php
|
<?php
|
||||||
namespace OCA\Agency\Agency;
|
namespace OCA\Agency\Agency;
|
||||||
|
|
||||||
|
use OCP\IRequest;
|
||||||
|
use OCP\IUserSession;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
use OCA\Agency\Db\AgencyMapper;
|
use OCA\Agency\Db\AgencyMapper;
|
||||||
use OCA\Agency\Service\AgencyService;
|
use OCA\Agency\Service\AgencyService;
|
||||||
|
|
||||||
|
use OCP\IGroupManager;
|
||||||
|
|
||||||
class AgencyManager {
|
class AgencyManager {
|
||||||
|
|
||||||
protected $agencyMapper;
|
protected $agencyMapper;
|
||||||
|
protected $groupManager;
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
public function __construct(IDBConnection $db) {
|
public function __construct($AppName, IDBConnection $db, IRequest $request, AgencyMapper $agencyMapper, IGroupManager $groupManager) {
|
||||||
$this->appName = $appName;
|
$this->agencyMapper = $agencyMapper;
|
||||||
$this->agencyMapper = new AgencyMapper($db);
|
$this->groupManager = $groupManager;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
public function createAgencyOnReg(string $agencygid, string $agencydirid, string $standarddirid){
|
* Creates a new Agency and save it to the database.
|
||||||
|
*
|
||||||
|
* @param:
|
||||||
|
* agencygid - GrouopID of the Agency
|
||||||
|
* agencydirid - ID for the Grouopfolder for AgencyData
|
||||||
|
* standarddirid - ID for the Groupfolder for all Uploaded Standardfiles
|
||||||
|
*/
|
||||||
|
public function createAgencyOnReg(string $agencygid, int $agencydirid, int $standarddirid){
|
||||||
$agencyService = new AgencyService($this->agencyMapper);
|
$agencyService = new AgencyService($this->agencyMapper);
|
||||||
return $agencyService->create(null, null, null, null, null, null, null, $agencygid, $agencydirid, $standarddirid);
|
return $agencyService->create(null, null, null, null, null, null, null, $agencygid, $agencydirid, $standarddirid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getAgencyIdByUser
|
||||||
|
*
|
||||||
|
* @param:
|
||||||
|
* - $request
|
||||||
|
* - $userSession
|
||||||
|
*
|
||||||
|
* Return the Agency-ID by filtering the id from default agency-group, ex: agency_1 -> 1 (int)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function getAgencyIdByUser(IUserSession $userSession){
|
||||||
|
$groups = $this->groupManager->getUserGroups($userSession->getUser());
|
||||||
|
$agency_group_id = "";
|
||||||
|
foreach($groups as $group){
|
||||||
|
if(str_contains($group->getGId(), 'agency')){
|
||||||
|
$agency_group_id = explode("_", strval($group->getGId()))[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return intval($agency_group_id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -10,6 +10,8 @@ use OCP\AppFramework\Http\JSONResponse;
|
||||||
use OCP\AppFramework\Controller;
|
use OCP\AppFramework\Controller;
|
||||||
|
|
||||||
use OCA\Agency\Service\AgencyService;
|
use OCA\Agency\Service\AgencyService;
|
||||||
|
use OCA\Agency\Agency\AgencyManager;
|
||||||
|
use OCP\IDBConnection;
|
||||||
|
|
||||||
class AgencyController extends Controller {
|
class AgencyController extends Controller {
|
||||||
|
|
||||||
|
|
@ -18,14 +20,16 @@ class AgencyController extends Controller {
|
||||||
private $Id;
|
private $Id;
|
||||||
protected $userSession;
|
protected $userSession;
|
||||||
protected $request;
|
protected $request;
|
||||||
|
protected $agencyManager;
|
||||||
|
|
||||||
use Errors;
|
use Errors;
|
||||||
|
|
||||||
public function __construct(string $AppName, IRequest $request, IUserSession $userSession, AgencyService $service){
|
public function __construct(string $AppName, IRequest $request, IUserSession $userSession, AgencyService $service, IDBConnection $connection, AgencyManager $agencymanager){
|
||||||
parent::__construct($AppName, $request);
|
parent::__construct($AppName, $request);
|
||||||
$this->service = $service;
|
$this->service = $service;
|
||||||
$this->userSession = $userSession;
|
$this->userSession = $userSession;
|
||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
|
$this->agencyManager = $agencymanager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -41,7 +45,8 @@ class AgencyController extends Controller {
|
||||||
*
|
*
|
||||||
* @param int $id
|
* @param int $id
|
||||||
*/
|
*/
|
||||||
public function show(int $id) {
|
public function show() {
|
||||||
|
$id = $this->agencyManager->getAgencyIdByUser($this->userSession);
|
||||||
return $this->handleNotFound(function () use ($id) {
|
return $this->handleNotFound(function () use ($id) {
|
||||||
return $this->service->find($id);
|
return $this->service->find($id);
|
||||||
});
|
});
|
||||||
|
|
@ -73,7 +78,7 @@ class AgencyController extends Controller {
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @param string $title
|
* @param string $title
|
||||||
*/
|
*/
|
||||||
public function update(int $id, string $name, string $inhaber, string $street, string $plz, string $city, string $agencymail, string $phone) {
|
public function update(int $id, string $name = null, string $inhaber = null, string $street = null, string $plz = null, string $city = null, string $agencymail = null, string $phone = null) {
|
||||||
return $this->handleNotFound(function () use ($id, $name, $inhaber, $street, $plz, $city, $agencymail, $phone) {
|
return $this->handleNotFound(function () use ($id, $name, $inhaber, $street, $plz, $city, $agencymail, $phone) {
|
||||||
# TODO: ABfrage machen!
|
# TODO: ABfrage machen!
|
||||||
return $this->service->update($id, $name, $inhaber, $street, $plz, $city, $agencymail, $phone);
|
return $this->service->update($id, $name, $inhaber, $street, $plz, $city, $agencymail, $phone);
|
||||||
|
|
|
||||||
|
|
@ -10,18 +10,27 @@ use OCP\Util;
|
||||||
use OCP\AppFramework\Http\JSONResponse;
|
use OCP\AppFramework\Http\JSONResponse;
|
||||||
use OCP\AppFramework\Http\DataResponse;
|
use OCP\AppFramework\Http\DataResponse;
|
||||||
|
|
||||||
|
|
||||||
use OCA\Agency\Agency\AgencyManager;
|
use OCA\Agency\Agency\AgencyManager;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
|
|
||||||
|
use OCP\IGroupManager;
|
||||||
|
use OCP\IUserManager;
|
||||||
|
|
||||||
class TestController extends Controller {
|
class TestController extends Controller {
|
||||||
|
|
||||||
protected $appName;
|
protected $appName;
|
||||||
protected $agencyManager;
|
protected $agencyManager;
|
||||||
|
|
||||||
public function __construct($appName, IRequest $request, IDBConnection $db) {
|
private $groupManager;
|
||||||
|
private $userManager;
|
||||||
|
|
||||||
|
public function __construct($appName, IRequest $request, IDBConnection $db, IGroupManager $gm, IUserManager $userManager) {
|
||||||
parent::__construct($appName, $request);
|
parent::__construct($appName, $request);
|
||||||
$this->appName = $appName;
|
$this->appName = $appName;
|
||||||
$this->agencyManager = new AgencyManager($db);
|
$this->agencyManager = new AgencyManager($db);
|
||||||
|
$this->groupManager = $gm;
|
||||||
|
$this->userManager = $userManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -29,8 +38,17 @@ class TestController extends Controller {
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
*/
|
*/
|
||||||
public function filetest() {
|
public function filetest() {
|
||||||
# TODO: Diese Erstellung hier portieren, damit bei neuem User auch eine neue Agentur mit den Infos zur GruppenID und den Ordner-IDs für Standards und Dateien erstellt wird
|
$user = $this->userManager->get('holger');
|
||||||
return $this->agencyManager->createAgencyOnReg("0","0","0");
|
$groups = $this->groupManager->getUserGroups($user);
|
||||||
|
|
||||||
|
$agency_group_id = "";
|
||||||
|
foreach($groups as $group){
|
||||||
|
if(str_contains($group->getGId(), 'agency')){
|
||||||
|
$agency_group_id = explode("_", strval($group->getGId()))[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $agency_group_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -67,15 +67,15 @@
|
||||||
'length' => 200
|
'length' => 200
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$table->addColumn('agencydirid', 'string', [
|
$table->addColumn('agencydirid', 'integer', [
|
||||||
'notnull' => true,
|
'notnull' => true,
|
||||||
'default' => '',
|
'default' => 0,
|
||||||
'length' => 200
|
'length' => 200
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$table->addColumn('standarddirid', 'string', [
|
$table->addColumn('standarddirid', 'integer', [
|
||||||
'notnull' => true,
|
'notnull' => true,
|
||||||
'default' => '',
|
'default' => 0,
|
||||||
'length' => 200
|
'length' => 200
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class AgencyService {
|
||||||
return $this->mapper->insert($agency);
|
return $this->mapper->insert($agency);
|
||||||
}
|
}
|
||||||
//Update an Agency
|
//Update an Agency
|
||||||
public function update(int $id, string $name, string $inhaber, string $street, string $plz, string $city, string $agencymail, string $phone) {
|
public function update(int $id, string $name = null, string $inhaber = null, string $street = null, string $plz = null, string $city = null, string $agencymail = null, string $phone = null) {
|
||||||
try {
|
try {
|
||||||
$agency = $this->mapper->find($id);
|
$agency = $this->mapper->find($id);
|
||||||
} catch(Exception $e) {
|
} catch(Exception $e) {
|
||||||
|
|
|
||||||
|
|
@ -2264,6 +2264,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.0.1.tgz",
|
||||||
"integrity": "sha512-Fl79+wsLOZKoiU345KeEaWD0ik8WKRI5zm0YSPj2oF1Qr+BO7z0fco6GbUtqjoG1h4VI89PeKJnMsMMVQdKKTw=="
|
"integrity": "sha512-Fl79+wsLOZKoiU345KeEaWD0ik8WKRI5zm0YSPj2oF1Qr+BO7z0fco6GbUtqjoG1h4VI89PeKJnMsMMVQdKKTw=="
|
||||||
},
|
},
|
||||||
|
"bootstrap-icons-vue": {
|
||||||
|
"version": "0.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/bootstrap-icons-vue/-/bootstrap-icons-vue-0.7.0.tgz",
|
||||||
|
"integrity": "sha512-bxdJB3GKJ1MaJxbMbK8xkM+EADELF1XYx9KLNFZD/k0Rt7Zp+h8h+zKe31npqHPr1UllRThiGxESs3e/EORiRg=="
|
||||||
|
},
|
||||||
"bootstrap-vue": {
|
"bootstrap-vue": {
|
||||||
"version": "2.21.2",
|
"version": "2.21.2",
|
||||||
"resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.21.2.tgz",
|
"resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-2.21.2.tgz",
|
||||||
|
|
@ -2621,7 +2626,6 @@
|
||||||
"version": "3.5.1",
|
"version": "3.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz",
|
||||||
"integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==",
|
"integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==",
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"anymatch": "3.1.2",
|
"anymatch": "3.1.2",
|
||||||
"braces": "3.0.2",
|
"braces": "3.0.2",
|
||||||
|
|
@ -2637,7 +2641,6 @@
|
||||||
"version": "3.1.2",
|
"version": "3.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz",
|
||||||
"integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==",
|
"integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==",
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"normalize-path": "3.0.0",
|
"normalize-path": "3.0.0",
|
||||||
"picomatch": "2.2.3"
|
"picomatch": "2.2.3"
|
||||||
|
|
@ -2646,14 +2649,12 @@
|
||||||
"binary-extensions": {
|
"binary-extensions": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
|
||||||
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
|
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA=="
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"braces": {
|
"braces": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"fill-range": "7.0.1"
|
"fill-range": "7.0.1"
|
||||||
}
|
}
|
||||||
|
|
@ -2662,7 +2663,6 @@
|
||||||
"version": "7.0.1",
|
"version": "7.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"to-regex-range": "5.0.1"
|
"to-regex-range": "5.0.1"
|
||||||
}
|
}
|
||||||
|
|
@ -2671,7 +2671,6 @@
|
||||||
"version": "5.1.2",
|
"version": "5.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
||||||
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"is-glob": "4.0.1"
|
"is-glob": "4.0.1"
|
||||||
}
|
}
|
||||||
|
|
@ -2680,7 +2679,6 @@
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
||||||
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
|
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"binary-extensions": "2.2.0"
|
"binary-extensions": "2.2.0"
|
||||||
}
|
}
|
||||||
|
|
@ -2688,14 +2686,12 @@
|
||||||
"is-number": {
|
"is-number": {
|
||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"readdirp": {
|
"readdirp": {
|
||||||
"version": "3.5.0",
|
"version": "3.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz",
|
||||||
"integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==",
|
"integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==",
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"picomatch": "2.2.3"
|
"picomatch": "2.2.3"
|
||||||
}
|
}
|
||||||
|
|
@ -2704,7 +2700,6 @@
|
||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"is-number": "7.0.0"
|
"is-number": "7.0.0"
|
||||||
}
|
}
|
||||||
|
|
@ -8107,6 +8102,14 @@
|
||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"sass": {
|
||||||
|
"version": "1.34.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.34.1.tgz",
|
||||||
|
"integrity": "sha512-scLA7EIZM+MmYlej6sdVr0HRbZX5caX5ofDT9asWnUJj21oqgsC+1LuNfm0eg+vM0fCTZHhwImTiCU0sx9h9CQ==",
|
||||||
|
"requires": {
|
||||||
|
"chokidar": "3.5.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"sass-graph": {
|
"sass-graph": {
|
||||||
"version": "2.2.5",
|
"version": "2.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz",
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@
|
||||||
"@nextcloud/vue": "^3.7.0",
|
"@nextcloud/vue": "^3.7.0",
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"bootstrap": "^5.0.1",
|
"bootstrap": "^5.0.1",
|
||||||
|
"bootstrap-icons-vue": "^0.7.0",
|
||||||
"bootstrap-vue": "^2.21.2",
|
"bootstrap-vue": "^2.21.2",
|
||||||
|
"sass": "^1.34.1",
|
||||||
"vue": "^2.6.12",
|
"vue": "^2.6.12",
|
||||||
"vue-router": "^3.5.1",
|
"vue-router": "^3.5.1",
|
||||||
"vuex": "^3.6.2"
|
"vuex": "^3.6.2"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
.btn-secondary {
|
||||||
|
background-color: rgb(84, 69, 69) !important;
|
||||||
|
}
|
||||||
|
|
@ -2,11 +2,20 @@
|
||||||
<AppNavigation>
|
<AppNavigation>
|
||||||
<template #list>
|
<template #list>
|
||||||
<AppNavigationItem to="/"
|
<AppNavigationItem to="/"
|
||||||
title="Agenturdaten"
|
title="Agentur"
|
||||||
icon="icon-category-customization" />
|
icon="" />
|
||||||
|
<AppNavigationItem to=""
|
||||||
|
title="Abrechnung"
|
||||||
|
icon="" />
|
||||||
|
<AppNavigationItem to=""
|
||||||
|
title="Mitarbeiter"
|
||||||
|
icon="icon-user" />
|
||||||
<AppNavigationItem to="/groupmanagement"
|
<AppNavigationItem to="/groupmanagement"
|
||||||
title="Gruppenverwaltung"
|
title="Gruppen"
|
||||||
icon="icon-category-customization" />
|
icon="icon-group" />
|
||||||
|
<AppNavigationItem to=""
|
||||||
|
title="Module"
|
||||||
|
icon="" />
|
||||||
<AppNavigationItem to="/testing"
|
<AppNavigationItem to="/testing"
|
||||||
title="Tests"
|
title="Tests"
|
||||||
icon="icon-category-customization" />
|
icon="icon-category-customization" />
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,11 @@ import VueRouter from 'vue-router'
|
||||||
import Routes from './router/routes'
|
import Routes from './router/routes'
|
||||||
import VueFormulate from '@braid/vue-formulate'
|
import VueFormulate from '@braid/vue-formulate'
|
||||||
import { de } from '@braid/vue-formulate-i18n'
|
import { de } from '@braid/vue-formulate-i18n'
|
||||||
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
|
import { BootstrapVue, BootstrapVueIcons } from 'bootstrap-vue'
|
||||||
import 'bootstrap/dist/css/bootstrap.css'
|
import 'bootstrap/dist/css/bootstrap.css'
|
||||||
import 'bootstrap-vue/dist/bootstrap-vue.css'
|
import 'bootstrap-vue/dist/bootstrap-vue.css'
|
||||||
import store from './store'
|
import 'bootstrap-vue/dist/bootstrap-vue-icons.min.css'
|
||||||
|
// import store from './store'
|
||||||
|
|
||||||
Vue.use(VueRouter)
|
Vue.use(VueRouter)
|
||||||
Vue.use(VueFormulate, {
|
Vue.use(VueFormulate, {
|
||||||
|
|
@ -15,7 +16,7 @@ Vue.use(VueFormulate, {
|
||||||
locale: 'de',
|
locale: 'de',
|
||||||
})
|
})
|
||||||
Vue.use(BootstrapVue)
|
Vue.use(BootstrapVue)
|
||||||
Vue.use(IconsPlugin)
|
Vue.use(BootstrapVueIcons)
|
||||||
Vue.prototype.$hostname = 'http://localhost:8080'
|
Vue.prototype.$hostname = 'http://localhost:8080'
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
|
|
@ -25,6 +26,6 @@ const router = new VueRouter({
|
||||||
export default new Vue({
|
export default new Vue({
|
||||||
el: '#content',
|
el: '#content',
|
||||||
router,
|
router,
|
||||||
store,
|
// store,
|
||||||
render: h => h(App),
|
render: h => h(App),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,12 @@ export default new Vuex.Store({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
loadAgencyData({ commit }) {
|
async loadAgencyData({ commit }) {
|
||||||
// axios.get(generateUrl('/apps/agency/getagencyidbyuser')).then(response => {
|
// axios.get(generateUrl('/apps/agency/getagencyidbyuser')).then(response => {
|
||||||
// console.log('Here we load...')
|
// console.log('Here we load...')
|
||||||
// this.agencyId = response.data.agency
|
// this.agencyId = response.data.agency
|
||||||
// }) + this.$store.state.agencyId
|
// }) + this.$store.state.agencyId
|
||||||
const agencydata = axios.get(generateUrl('/apps/agency/agencys/4')).then(function() {
|
const agencydata = await axios.get(generateUrl('/apps/agency/agencys/4')).then(function() {
|
||||||
commit('setAgency', agencydata.data)
|
commit('setAgency', agencydata.data)
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
<FormulateForm
|
<FormulateForm
|
||||||
v-model="agency"
|
v-model="agency"
|
||||||
@submit="submitHandler">
|
@submit="submitHandler">
|
||||||
<b-row cols="1"
|
<b-row cols="2"
|
||||||
cols-sm="1"
|
cols-sm="2"
|
||||||
cols-md="2"
|
cols-md="2"
|
||||||
cols-lg="4">
|
cols-lg="4">
|
||||||
<b-col>
|
<b-col>
|
||||||
|
|
@ -20,8 +20,8 @@
|
||||||
type="text" />
|
type="text" />
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
<b-row cols="1"
|
<b-row cols="2"
|
||||||
cols-sm="1"
|
cols-sm="2"
|
||||||
cols-md="2"
|
cols-md="2"
|
||||||
cols-lg="4">
|
cols-lg="4">
|
||||||
<b-col>
|
<b-col>
|
||||||
|
|
@ -35,8 +35,8 @@
|
||||||
type="text" />
|
type="text" />
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
<b-row cols="1"
|
<b-row cols="2"
|
||||||
cols-sm="1"
|
cols-sm="2"
|
||||||
cols-md="2"
|
cols-md="2"
|
||||||
cols-lg="4">
|
cols-lg="4">
|
||||||
<b-col>
|
<b-col>
|
||||||
|
|
@ -46,12 +46,12 @@
|
||||||
</b-col>
|
</b-col>
|
||||||
<b-col>
|
<b-col>
|
||||||
<FormulateInput name="agencymail"
|
<FormulateInput name="agencymail"
|
||||||
label="Agentur-Email-Adresse"
|
label="Agentur-Email-Adressedd"
|
||||||
type="text" />
|
type="text" />
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
<b-row cols="1"
|
<b-row cols="2"
|
||||||
cols-sm="1"
|
cols-sm="2"
|
||||||
cols-md="2"
|
cols-md="2"
|
||||||
cols-lg="4">
|
cols-lg="4">
|
||||||
<b-col>
|
<b-col>
|
||||||
|
|
@ -62,9 +62,11 @@
|
||||||
</b-row>
|
</b-row>
|
||||||
<b-row class="mt-2">
|
<b-row class="mt-2">
|
||||||
<b-col>
|
<b-col>
|
||||||
<FormulateInput
|
<b-button
|
||||||
type="submit"
|
variant="secondary"
|
||||||
label="Aktualisieren" />
|
type="submit">
|
||||||
|
Aktualisieren
|
||||||
|
</b-button>
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
</FormulateForm>
|
</FormulateForm>
|
||||||
|
|
@ -77,6 +79,7 @@
|
||||||
<script>
|
<script>
|
||||||
import Content from '@nextcloud/vue/dist/Components/Content'
|
import Content from '@nextcloud/vue/dist/Components/Content'
|
||||||
import { generateUrl } from '@nextcloud/router'
|
import { generateUrl } from '@nextcloud/router'
|
||||||
|
import '@braid/vue-formulate/themes/snow/snow.scss'
|
||||||
const axios = require('axios').default
|
const axios = require('axios').default
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
|
|
@ -86,29 +89,21 @@ export default ({
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
agency: this.$store.agency,
|
agency: null,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loadInitialData()
|
this.loadingAgencyData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadInitialData() {
|
|
||||||
// await this.$store.dispatch('loadAgencyData') {
|
|
||||||
// console.log('Done!')
|
|
||||||
// console.log(this.$store.state)
|
|
||||||
// }
|
|
||||||
console.log('Loading something')
|
|
||||||
},
|
|
||||||
async loadingAgencyData() {
|
async loadingAgencyData() {
|
||||||
// const agencydata = await axios.get(generateUrl('/apps/agency/agencys/' + this.$store.state.agencyId))
|
const agencydata = await axios.get(generateUrl('/apps/agency/getagencydata'))
|
||||||
// this.agency = agencydata.data
|
this.agency = agencydata.data
|
||||||
// this.isLoading = true
|
this.isLoading = true
|
||||||
console.log('Now loading AgencyData')
|
|
||||||
},
|
},
|
||||||
async submitHandler(data) {
|
async submitHandler(data) {
|
||||||
const response = await axios.put(generateUrl('/apps/agency/agencys/' + this.$store.state.agencyid), data)
|
const response = await axios.put(generateUrl('/apps/agency/agencys/1'), data)
|
||||||
console.log(response)
|
console.log(response)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<Content app-name="GroupManagement">
|
<Content app-name="GroupManagement">
|
||||||
<b-container class="bv-example-row">
|
<b-container class="bv-example-row">
|
||||||
<h3>Gruppenverwaltung in Echt jetzt!</h3>
|
<h3>Gruppenverwaltung</h3>
|
||||||
|
<hr>
|
||||||
</b-container>
|
</b-container>
|
||||||
</Content>
|
</Content>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -22,13 +23,8 @@ export default ({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loadUserData()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadUserData() {
|
|
||||||
// const userdata = await axios.get(generateUrl('/apps/agency/getagencyidbyuser'))
|
|
||||||
// console.log(userdata)
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue