ソースを参照

runnable app, might still contain errors

master
Daniel 2年前
コミット
232961be02
34個のファイルの変更163行の追加59行の削除
  1. +103
    -0
      1-update-frontend.sh
  2. +1
    -1
      httpdocs/angular.json
  3. +0
    -6
      httpdocs/src/app/app-routing.module.ts
  4. +1
    -0
      httpdocs/src/app/app.component.ts
  5. +2
    -1
      httpdocs/src/app/app.module.ts
  6. +3
    -3
      httpdocs/src/app/components/aside/aside.component.html
  7. +1
    -8
      httpdocs/src/app/components/aside/aside.component.ts
  8. +0
    -0
      httpdocs/src/app/interceptor/http.interceptor.ts
  9. +4
    -1
      httpdocs/src/app/interceptor/route-interceptor.ts
  10. +0
    -1
      httpdocs/src/app/model/entities/user-type.ts
  11. +1
    -1
      httpdocs/src/app/model/entities/user.ts
  12. +5
    -1
      httpdocs/src/app/services/app.service.ts
  13. +1
    -1
      httpdocs/src/app/services/http.service.ts
  14. +0
    -5
      httpdocs/src/app/utils/const.ts
  15. +1
    -1
      httpdocs/src/app/views/customer-management/customer-contact-list/customer-contact-list.component.html
  16. +2
    -2
      httpdocs/src/app/views/customer-management/customer-contact-list/customer-contact-list.component.ts
  17. +1
    -1
      httpdocs/src/app/views/customer-management/customer-list/customer-list.component.html
  18. +2
    -2
      httpdocs/src/app/views/customer-management/customer-list/customer-list.component.ts
  19. +1
    -1
      httpdocs/src/app/views/customer-management/customer-view/customer-contact-person-detail/customer-contact-person-detail.component.html
  20. +2
    -2
      httpdocs/src/app/views/customer-management/customer-view/customer-contact-person-detail/customer-contact-person-detail.component.ts
  21. +1
    -1
      httpdocs/src/app/views/customer-management/customer-view/customer-contact-person-view/customer-contact-person-view.component.html
  22. +2
    -2
      httpdocs/src/app/views/customer-management/customer-view/customer-contact-person-view/customer-contact-person-view.component.ts
  23. +1
    -1
      httpdocs/src/app/views/customer-management/customer-view/customer-data-view/customer-data-view.component.html
  24. +2
    -2
      httpdocs/src/app/views/customer-management/customer-view/customer-data-view/customer-data-view.component.ts
  25. +1
    -1
      httpdocs/src/app/views/customer-management/customer-view/customer-meeting-view/customer-meeting-view.component.html
  26. +2
    -2
      httpdocs/src/app/views/customer-management/customer-view/customer-meeting-view/customer-meeting-view.component.ts
  27. +1
    -1
      httpdocs/src/app/views/customer-management/customer-view/customer-note-detail/customer-note-detail.component.html
  28. +2
    -2
      httpdocs/src/app/views/customer-management/customer-view/customer-note-detail/customer-note-detail.component.ts
  29. +1
    -1
      httpdocs/src/app/views/customer-management/customer-view/customer-note-view/customer-note-view.component.html
  30. +2
    -2
      httpdocs/src/app/views/customer-management/customer-view/customer-note-view/customer-note-view.component.ts
  31. +3
    -0
      httpdocs/src/app/views/login/login.component.html
  32. +12
    -5
      httpdocs/src/app/views/login/login.component.ts
  33. +1
    -1
      httpdocs/src/app/views/start/meeting-calendar/meeting-calendar.component.html
  34. +1
    -0
      httpdocs/src/environments/environment.ts

+ 103
- 0
1-update-frontend.sh ファイルの表示

@@ -0,0 +1,103 @@
#!/bin/bash

#export PATH=/opt/plesk/php/7.2/bin:$PATH;

# Go into Maintenance Mode
#cp -rf /var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/src/maintenance/index.php #/var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/
#mv /var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/index.html #/var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/_index.html
#echo "$(tput setab 1)too1s is now in MAINTENANCE MODE!$(tput sgr 0)"

# Check out beta
echo "$(tput setab 2)CRM backend will now be PULLED on LIVE$(tput sgr 0)"
cd /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs
git pull

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/composer.json
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/composer.json /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/composer.lock
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/composer.lock /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/symfony.lock
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/symfony.lock /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/updateDb.php
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/updateDb.php /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/assets/
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/assets /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/import/
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/import /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/public/
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/public /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/src/
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/src /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/templates/
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/templates /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/services.yaml
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/services.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/doctrine.yaml
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/doctrine.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/framework.yaml
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/framework.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/nelmio_cors.yaml
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/nelmio_cors.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/security.yaml
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/security.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/

rm -rf /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/swiftmailer.yaml
cp -rf /var/www/vhosts/plp-tool.de/httpdocs/git_repository/spt-plp-tool-gamma/httpdocs/symfony/config/packages/swiftmailer.yaml /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/config/packages/

cd /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony

#php /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/bin/console doctrine:schema:update --force
composer update
php updateDb.php

echo "$(tput setab 2)DATABASE SCHEMA updated$(tput sgr 0)"

php /var/www/vhosts/plp-tool.de/httpdocs/plp-tool-live/symfony/bin/console cache:clear --env=prod --no-debug --no-warmup

echo "$(tput setab 2)CACHE cleared$(tput sgr 0)"

rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/e2e/
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/src/
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/.htaccess
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/.htpasswd
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/README.md
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/angular.json
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/browserslist
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/karma.conf.json
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/package.json
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/package-lock.json
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/tsconfig.json
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/tsconfig.app.json
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/tsconfig.spec.json
rm -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/tslint.json

cp -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/git_repo/spt-crm-frontend/httpdocs/* /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/

echo "$(tput setab 2)Files have been copied to ANGULAR LIVE$(tput sgr 0)"

cd /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/
ng build --configuration=gamma --prod --aot

cp -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/git_repo/spt-crm-frontend/httpdocs/.htaccess /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/dist/
cp -rf /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/git_repo/spt-crm-frontend/httpdocs/.htpasswd /var/www/vhosts/spawntree.de/crm.spawntree.de/httpdocs/dist/

echo "$(tput setab 2)ANGULAR APP built on LIVE$(tput sgr 0)"

# Remove Maintenance Mode
# Angular App will publish all data in /dist/ folder so maintenance data does not have to be removed.
#mv /var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/_index.html #/var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/index.html
#rm /var/www/vhosts/h2790573.stratoserver.net/beta-too1s.h2790573.stratoserver.net/dist/index.php
echo "$(tput setab 2)PLP TOOL is now LIVE!$(tput sgr 0)"

+ 1
- 1
httpdocs/angular.json ファイルの表示

@@ -62,7 +62,7 @@
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": true,


+ 0
- 6
httpdocs/src/app/app-routing.module.ts ファイルの表示

@@ -4,9 +4,6 @@ import { StartComponent } from './views/start/start.component';
import {CustomerManagementComponent} from './views/customer-management/customer-management.component';
import {LoginComponent} from './views/login/login.component';
import {RouteInterceptor} from './interceptor/route-interceptor';
import {AccountingComponent} from './views/accounting/accounting.component';
import {TechniqueComponent} from './views/technique/technique.component';
import {SalesComponent} from './views/sales/sales.component';


const routes: Routes = [
@@ -33,7 +30,4 @@ export const routingComponents = [
LoginComponent,
StartComponent,
CustomerManagementComponent,
AccountingComponent,
TechniqueComponent,
SalesComponent,
];

+ 1
- 0
httpdocs/src/app/app.component.ts ファイルの表示

@@ -25,6 +25,7 @@ export class AppComponent implements OnInit, OnDestroy {
// Observe login state
this.loginSub = this.appService.getLoginState$().subscribe(
data => {
console.log(data);
if (data !== null) {
this.isLoggedIn = true;
} else {


+ 2
- 1
httpdocs/src/app/app.module.ts ファイルの表示

@@ -21,7 +21,7 @@ import {CacheService} from './services/cache.service';
import {MessageService} from './services/message.service';
import {HttpService} from './services/http.service';
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
import {HttpClientInterceptor} from './services/http.interceptor';
import {RouteInterceptor} from './interceptor/route-interceptor';
import { TechniqueComponent } from './views/technique/technique.component';
import { SalesComponent } from './views/sales/sales.component';
@@ -65,6 +65,7 @@ import { CalendarLegendComponent } from './components/calendar-legend/calendar-l
import { CommonService } from './services/common.service';
import {GridRendererComponent} from './grid-cellrenderer/grid-renderer-component';
import {GridEditorComponent} from './grid-cellrenderer/grid-editor-component';
import {HttpClientInterceptor} from "./interceptor/http.interceptor";


registerLocaleData(localeDe);


+ 3
- 3
httpdocs/src/app/components/aside/aside.component.html ファイルの表示

@@ -1,6 +1,6 @@
<div class="home-btn" routerLink="/start">
Startseite
</div>
<!--<div class="home-btn" routerLink="/start">-->
<!-- Startseite-->
<!--</div>-->
<ul id="navigation">
<li *ngFor="let navItem of navItems" routerLink="{{navItem.route}}">
<p>{{navItem.name}}</p>


+ 1
- 8
httpdocs/src/app/components/aside/aside.component.ts ファイルの表示

@@ -16,15 +16,8 @@ export class AsideComponent implements OnInit {

ngOnInit() {
this.navItems = [];
this.navItems.push({name: 'Start', route: '/start', className: 'start'});
this.navItems.push({name: 'Kunden', route: '/customer-management', className: 'customer-management'});
this.navItems.push({name: 'Betreiber', route: '/operators', className: 'operators'});
this.navItems.push({name: 'Produzenten', route: '/productions', className: 'productions'});
this.navItems.push({name: 'Service', route: '/service', className: 'service'});
// this.navItems.push({name: 'Buchhaltung', route: '/accounting', className: 'accounting'});
// this.navItems.push({name: 'Produktion', route: '/production', className: 'production'});
// this.navItems.push({name: 'Service', route: '/service', className: 'service'});
// this.navItems.push({name: 'Technik', route: '/technique', className: 'technique'});
// this.navItems.push({name: 'Vertrieb', route: '/sales', className: 'sales'});
}

/**


httpdocs/src/app/services/http.interceptor.ts → httpdocs/src/app/interceptor/http.interceptor.ts ファイルの表示


+ 4
- 1
httpdocs/src/app/interceptor/route-interceptor.ts ファイルの表示

@@ -25,10 +25,13 @@ export class RouteInterceptor {
* @returns {boolean}
*/
canActivate(): boolean {
if (this.loginState == null || !this.loginState.isLoggedIn) {
console.log(this.loginState);
if (this.loginState === null || !this.loginState.isLoggedIn) {
this.router.navigate(['./login']);
console.log('no routing');
return false;
}
console.log('routing works');
return true;
}
}

+ 0
- 1
httpdocs/src/app/model/entities/user-type.ts ファイルの表示

@@ -3,5 +3,4 @@ import {EntityInterface} from '../interface/entity-interface';
export interface IUserType extends EntityInterface {
user_type_id: number;
type: string;
v_roles: string[];
}

+ 1
- 1
httpdocs/src/app/model/entities/user.ts ファイルの表示

@@ -7,6 +7,6 @@ export interface IUser extends EntityInterface {
lastname: string;
active: boolean;
visible: boolean;
roles: string[];
v_translated_role: string;
v_user_type: IUserType;
}

+ 5
- 1
httpdocs/src/app/services/app.service.ts ファイルの表示

@@ -65,7 +65,7 @@ export class AppService {
* @returns {boolean}
*/
public userHasRole(role: string): boolean {
return this.getAppUser().v_user_type.v_roles.indexOf(role) > -1;
return this.getAppUser().roles.indexOf(role) > -1;
}

/**
@@ -89,11 +89,15 @@ export class AppService {
this.httpService.apiPost('login', postData).subscribe(
data => {
const result: ILoginState = data as ILoginState;
result.isLoggedIn = true;
this.cacheService.setItem('loginState', result);
this.cacheService.setItem('user', result.user);
this.loginState.next(data);
this.user.next(data.user);
this.setConfig(data.config);
},
error => {

}
);
}


+ 1
- 1
httpdocs/src/app/services/http.service.ts ファイルの表示

@@ -24,7 +24,7 @@ export class HttpService {
}

private static AUTHENTICATION_ERROR_CODE = 401;
private static AUTHENTICATION_ERROR_MESSAGE = 'Sie sind nicht mehr im System eingeloggt. Bitte loggen Sie sich erneut ein.';
private static AUTHENTICATION_ERROR_MESSAGE = 'Sie sind nicht mehr im System eingeloggt bzw. ihre Login-Daten sind falsch. Bitte loggen Sie sich erneut ein.';
private renderer: Renderer2;

private dataServiceData$: Observable<IAppServiceData>;


+ 0
- 5
httpdocs/src/app/utils/const.ts ファイルの表示

@@ -1,11 +1,6 @@
export class Const {
static readonly USER_ROLE_ADMIN: string = 'ROLE_ADMIN';
static readonly USER_ROLE_USER: string = 'ROLE_USER';
static readonly USER_ROLE_SALES: string = 'ROLE_SALES';
static readonly USER_ROLE_TECHNIQUE: string = 'ROLE_TECHNIQUE';
static readonly USER_ROLE_PRODUCTION: string = 'ROLE_PRODUCTION';
static readonly USER_ROLE_ACCOUNTING: string = 'ROLE_ACCOUNTING';
static readonly USER_ROLE_SERVICE: string = 'ROLE_SERVICE';

static readonly CSS_NO_EDIT: string = 'not-editable';



+ 1
- 1
httpdocs/src/app/views/customer-management/customer-contact-list/customer-contact-list.component.html ファイルの表示

@@ -1,5 +1,5 @@
<div class="button" id="export-customer-contacts" (click)="exportCustomerContactsPdf()" *ngIf="hasExportRights">Ansprechpartner exportieren</div>
<div class="button" id="xmas-mail" (click)="exportXmasPdf()" *ngIf="hasAdminRights">Weihnachtspost-Etiketten</div>
<div class="button" id="xmas-mail" (click)="exportXmasPdf()" *ngIf="hasRights">Weihnachtspost-Etiketten</div>
<form class="searchForm">
<input type="text" name="search" class="search" (input)="searchFormSubmit($event)" placeholder="Ansprechpartner suchen" />
<button class="resetSearch" [hidden]="!resetSearchBtn"></button>


+ 2
- 2
httpdocs/src/app/views/customer-management/customer-contact-list/customer-contact-list.component.ts ファイルの表示

@@ -27,7 +27,7 @@ export class CustomerContactListComponent extends AgGridComponent implements OnI
public customersById: {};
private customerContacts: ICustomerContact[];
public customerContactsById: {};
public hasAdminRights: boolean;
public hasRights: boolean;
public hasExportRights: boolean;

constructor(private customerService: CustomerService, private appService: AppService, private commonService: CommonService) {
@@ -35,7 +35,7 @@ export class CustomerContactListComponent extends AgGridComponent implements OnI
}

ngOnInit() {
this.hasAdminRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.hasRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.hasExportRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.customers = [];
this.customersById = {};


+ 1
- 1
httpdocs/src/app/views/customer-management/customer-list/customer-list.component.html ファイルの表示

@@ -1,4 +1,4 @@
<div class="button" id="create-customer" (click)="createCustomer()" *ngIf="hasSalesRights">Kunden anlegen</div>
<div class="button" id="create-customer" (click)="createCustomer()" *ngIf="hasRights">Kunden anlegen</div>

<form class="searchForm">
<input type="text" name="search" class="search" (input)="searchFormSubmit($event)" placeholder="Kunden suchen" />


+ 2
- 2
httpdocs/src/app/views/customer-management/customer-list/customer-list.component.ts ファイルの表示

@@ -17,7 +17,7 @@ export class CustomerListComponent extends AgGridComponent implements OnInit {

private customers: ICustomer[];
public rowClassRules: {};
public hasSalesRights: boolean;
public hasRights: boolean;
public usersById: {};

constructor(public appService: AppService) {
@@ -26,7 +26,7 @@ export class CustomerListComponent extends AgGridComponent implements OnInit {

ngOnInit() {
this.usersById = this.appService.getConfig().vc_user_by_id;
this.hasSalesRights = this.appService.userHasRole(Const.USER_ROLE_SALES);
this.hasRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.customers = [];

this.defaultColDef = {


+ 1
- 1
httpdocs/src/app/views/customer-management/customer-view/customer-contact-person-detail/customer-contact-person-detail.component.html ファイルの表示

@@ -33,7 +33,7 @@
</dl>
</div>
</div>
<div class="form" *ngIf="hasSalesRights">
<div class="form" *ngIf="hasRights">
<div class="row row--last">
<div class="column button-row">
<span class="button-row--link" (click)="customerShortcut()">Zum Kundenprofil</span>


+ 2
- 2
httpdocs/src/app/views/customer-management/customer-view/customer-contact-person-detail/customer-contact-person-detail.component.ts ファイルの表示

@@ -25,12 +25,12 @@ export class CustomerContactPersonDetailComponent implements OnInit {
public customer: ICustomer;
public customerContact: ICustomerContact;
public config: IConfig;
public hasSalesRights: boolean;
public hasRights: boolean;

constructor(public appService: AppService) { }

ngOnInit() {
this.hasSalesRights = this.appService.userHasRole(Const.USER_ROLE_SALES);
this.hasRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.config = this.appService.getConfig();
this.isEditMode = false;
this.customer = Factory.getEmptyCustomer();


+ 1
- 1
httpdocs/src/app/views/customer-management/customer-view/customer-contact-person-view/customer-contact-person-view.component.html ファイルの表示

@@ -1,6 +1,6 @@
<h3>Ansprechpartner</h3>
<p>Hier sind die Ansprechpartner zu sehen:</p>
<div class="button" id="create-customer-contact" (click)="create()" *ngIf="hasSalesRights">Ansprechpartner anlegen</div>
<div class="button" id="create-customer-contact" (click)="create()" *ngIf="hasRights">Ansprechpartner anlegen</div>
<form class="searchForm">
<input type="text" name="search" class="search" (input)="searchFormSubmit($event)" placeholder="Ansprechpartner suchen" />
<button class="resetSearch" [hidden]="!resetSearchBtn"></button>


+ 2
- 2
httpdocs/src/app/views/customer-management/customer-view/customer-contact-person-view/customer-contact-person-view.component.ts ファイルの表示

@@ -32,14 +32,14 @@ export class CustomerContactPersonViewComponent extends AgGridComponent implemen
public customerContacts: ICustomerContact[];
public customerContactsById: {};
public config: IConfig;
public hasSalesRights: boolean;
public hasRights: boolean;

constructor(private appService: AppService) {
super();
}

ngOnInit() {
this.hasSalesRights = this.appService.userHasRole(Const.USER_ROLE_SALES);
this.hasRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.config = this.appService.getConfig();
this.customer = Factory.getEmptyCustomer();
this.customerContacts = [];


+ 1
- 1
httpdocs/src/app/views/customer-management/customer-view/customer-data-view/customer-data-view.component.html ファイルの表示

@@ -29,7 +29,7 @@
</dl>
</div>
<div class="grid-item">
<div class="button button--inline right" (click)="edit()" *ngIf="hasSalesRights">bearbeiten</div>
<div class="button button--inline right" (click)="edit()" *ngIf="hasRights">bearbeiten</div>
</div>
</div>



+ 2
- 2
httpdocs/src/app/views/customer-management/customer-view/customer-data-view/customer-data-view.component.ts ファイルの表示

@@ -23,13 +23,13 @@ export class CustomerDataViewComponent implements OnInit {
public customer: ICustomer;
public checkedUrl: string;
public config: IConfig;
public hasSalesRights: boolean;
public hasRights: boolean;
public usersById: {};

constructor(private appService: AppService) { }

ngOnInit() {
this.hasSalesRights = this.appService.userHasRole(Const.USER_ROLE_SALES);
this.hasRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.config = this.appService.getConfig();
this.customer = Factory.getEmptyCustomer();
this.checkedUrl = '';


+ 1
- 1
httpdocs/src/app/views/customer-management/customer-view/customer-meeting-view/customer-meeting-view.component.html ファイルの表示

@@ -1,5 +1,5 @@
<h3>Termine</h3>
<div class="button" id="create-meeting" (click)="create()" *ngIf="hasSalesRights">Termin hinzufügen</div>
<div class="button" id="create-meeting" (click)="create()" *ngIf="hasRights">Termin hinzufügen</div>
<form class="searchForm">
<input type="text" name="search" class="search" (input)="searchFormSubmit($event)" placeholder="Termin suchen" />
<button class="resetSearch" [hidden]="!resetSearchBtn"></button>


+ 2
- 2
httpdocs/src/app/views/customer-management/customer-view/customer-meeting-view/customer-meeting-view.component.ts ファイルの表示

@@ -38,14 +38,14 @@ export class CustomerMeetingViewComponent extends AgGridComponent implements OnI
public date: string;
public timeStart: string;
public timeEnd: string;
public hasSalesRights: boolean;
public hasRights: boolean;

constructor(public appService: AppService) {
super();
}

ngOnInit() {
this.hasSalesRights = this.appService.userHasRole(Const.USER_ROLE_SALES);
this.hasRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.customer = Factory.getEmptyCustomer();
this.customerMeeting = [];
this.customerMeetingEntriesById = {};


+ 1
- 1
httpdocs/src/app/views/customer-management/customer-view/customer-note-detail/customer-note-detail.component.html ファイルの表示

@@ -29,7 +29,7 @@
</div>
</div>
<div class="form">
<div class="row row--last" *ngIf="hasSalesRights && appService.getAppUser().id === customerNote.creation_user_id">
<div class="row row--last" *ngIf="hasRights && appService.getAppUser().id === customerNote.creation_user_id">
<div class="column">
<div class="button button--inline" (click)="editEntry()">Eintrag bearbeiten</div>
<div class="button button--inline" (click)="deleteEntry()">Eintrag löschen</div>


+ 2
- 2
httpdocs/src/app/views/customer-management/customer-view/customer-note-detail/customer-note-detail.component.ts ファイルの表示

@@ -24,12 +24,12 @@ export class CustomerNoteDetailComponent implements OnInit {
public creationDate: string;
public isEditMode: boolean;
public noteDate: string;
public hasSalesRights: boolean;
public hasRights: boolean;

constructor(public appService: AppService) { }

ngOnInit() {
this.hasSalesRights = this.appService.userHasRole(Const.USER_ROLE_SALES);
this.hasRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.customer = Factory.getEmptyCustomer();
this.customerNote = Factory.getEmptyCustomerNote();
this.creationDate = '';


+ 1
- 1
httpdocs/src/app/views/customer-management/customer-view/customer-note-view/customer-note-view.component.html ファイルの表示

@@ -1,5 +1,5 @@
<h3>Notizen</h3>
<div class="button" id="create-history" (click)="create()" *ngIf="hasSalesRights">Notiz hinzufügen</div>
<div class="button" id="create-history" (click)="create()" *ngIf="hasRights">Notiz hinzufügen</div>
<form class="searchForm">
<input type="text" name="search" class="search" (input)="searchFormSubmit($event)" placeholder="Notiz suchen" />
<button class="resetSearch" [hidden]="!resetSearchBtn"></button>


+ 2
- 2
httpdocs/src/app/views/customer-management/customer-view/customer-note-view/customer-note-view.component.ts ファイルの表示

@@ -29,14 +29,14 @@ export class CustomerNoteViewComponent extends AgGridComponent implements OnInit
public customer: ICustomer;
public customerNote: ICustomerNote[];
public customerNoteEntriesById: {};
public hasSalesRights: boolean;
public hasRights: boolean;

constructor(public appService: AppService) {
super();
}

ngOnInit() {
this.hasSalesRights = this.appService.userHasRole(Const.USER_ROLE_SALES);
this.hasRights = this.appService.userHasRole(Const.USER_ROLE_ADMIN);
this.customer = Factory.getEmptyCustomer();
this.customerNote = [];
this.customerNoteEntriesById = {};


+ 3
- 0
httpdocs/src/app/views/login/login.component.html ファイルの表示

@@ -17,6 +17,9 @@
</p>
</div>
</div>
<p *ngIf="loginFailed" class="error-msg">
Fehler beim Login.
</p>
<div class="row">
<label for="email" [class.error]="email.invalid && email.touched && email?.errors?.required">E-Mail</label>
<input type="email" [class.error]="email.invalid && email.touched && email?.errors?.required" id="email" required name="email" placeholder="E-Mail"


+ 12
- 5
httpdocs/src/app/views/login/login.component.ts ファイルの表示

@@ -14,10 +14,13 @@ import {Router} from '@angular/router';
export class LoginComponent implements OnInit {

private loginSub: Subscription;
public isLoggedIn: boolean;
public loginFailed: boolean;
public loginAttempt: boolean;
public errorMsg: string;
public loginForm: UntypedFormGroup;



/**
* Gets email
*/
@@ -37,7 +40,8 @@ export class LoginComponent implements OnInit {
}

ngOnInit() {
this.isLoggedIn = false;
this.loginAttempt = false;
this.loginFailed = false;
this.loginForm = this.fb.group({
email: ['', [Validators.required, Validators.email]],
password: [environment.password, [Validators.required, Validators.minLength(4)]]
@@ -46,11 +50,13 @@ export class LoginComponent implements OnInit {
// Observe login state
this.loginSub = this.appService.getLoginState$().subscribe(
data => {
console.log(data);
if (data !== null) {
this.isLoggedIn = true;
this.router.navigate(['./start']);
} else {
this.isLoggedIn = false;
if (this.loginAttempt) {
this.loginFailed = true;
}
}
}
);
@@ -61,6 +67,7 @@ export class LoginComponent implements OnInit {
*/
public onFormSubmit(): void {
if (this.loginForm.valid) {
this.loginFailed = false;
this.appService.login(this.email.value, this.password.value);
}
}
@@ -69,7 +76,7 @@ export class LoginComponent implements OnInit {
* Forgot password
*/
public forgotPassword(): void {
alert('Hier folgt in Zukunft die Funktionalität \'Neues Passwort vergeben\'.\nBei Problemen wenden Sie sich bitte an admin@plp-tool.de.');
window.alert('-');
}

}

+ 1
- 1
httpdocs/src/app/views/start/meeting-calendar/meeting-calendar.component.html ファイルの表示

@@ -2,7 +2,7 @@
<h2>Termin-Kalender</h2>
<div class="form user-filter">
<div>
<label for="mcCalendarUser"><strong>PLP Mitarbeiter</strong></label>
<label for="mcCalendarUser"><strong>Mitarbeiter</strong></label>
<select id="mcCalendarUser" name="mcCalendarUser" [(ngModel)]="selectedUserIndex" (change)="changeUserFilter($event)" #mcCalendarUser="ngModel">
<option [ngValue]=null>Alle</option>
<option *ngFor="let u of selectableUsers; let i = index" value="{{i+1}}">{{u.firstname}} {{u.lastname}}</option>


+ 1
- 0
httpdocs/src/environments/environment.ts ファイルの表示

@@ -19,6 +19,7 @@ export const environment = {
apiUrl: 'http://localhost:8000/',
apiAssetPath: 'http://localhost:8000/assets/',
debugParam: '?XDEBUG_SESSION_START=',
//debugParam: '',
password: 'plpSpawnTr33!'
};



読み込み中…
キャンセル
保存