Skip to content

Commit bd8881f

Browse files
committed
git init
0 parents  commit bd8881f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+31592
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Jason Watmore
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#A következő kódrészletek hozzáadása szükséges a FooEvents-hez
2+
3+
##fooevents/classes/apihelper.php
4+
5+
function getEventUpdatedTicketsWithStatus($eventID, $since) {
6+
7+
global $woocommerce;
8+
global $wpdb;
9+
10+
$table_name = $wpdb->prefix . 'fooevents_check_in';
11+
$postmeta_table_name = $wpdb->prefix . 'postmeta';
12+
13+
$ticketsArray = array();
14+
$ticketStatusOptions = array();
15+
16+
$eventID = sanitize_text_field($eventID);
17+
$since = sanitize_text_field($since);
18+
19+
$tickets = $wpdb->get_results("
20+
SELECT ".$table_name.".*, p1.meta_value AS ticketId, p2.meta_value AS name, p3.meta_value AS variation FROM ".$table_name."
21+
LEFT JOIN ".$postmeta_table_name." AS p1 ON
22+
".$table_name.".tid = p1.post_id AND
23+
p1.meta_key = 'WooCommerceEventsTicketID'
24+
LEFT JOIN ".$postmeta_table_name." AS p2 ON
25+
".$table_name.".tid = p2.post_id AND
26+
p2.meta_key = 'fooevents_custom_option_1'
27+
LEFT JOIN ".$postmeta_table_name." AS p3 ON
28+
".$table_name.".tid = p3.post_id AND
29+
p3.meta_key = 'WooCommerceEventsVariationID'
30+
WHERE
31+
eid = ".$eventID." AND
32+
checkin >= ".$since."
33+
ORDER BY ".$table_name.".`updated` DESC
34+
");
35+
36+
foreach ( $tickets as $ticket ) {
37+
38+
$ticketsArray[] = array(
39+
'wooCommerceEventsTicketID' => $ticket->ticketId,
40+
'status' => $ticket->status,
41+
'time' => (int)$ticket->checkin,
42+
'name' => $ticket->name,
43+
'variation' => (int)$ticket->variation,
44+
);
45+
46+
}
47+
48+
return $ticketsArray;
49+
50+
}
51+
52+
##fooevents/classes/restapihelper.php
53+
54+
public function fooevents_callback_get_check_in(WP_REST_Request $request) {
55+
$authorize_result = $this->fooevents_is_authorized_user($request->get_headers());
56+
57+
if ( $authorize_result && is_object($authorize_result) && is_a($authorize_result, 'WP_User') ) {
58+
error_reporting(0);
59+
ini_set('display_errors', 0);
60+
61+
set_time_limit(0);
62+
$memory_limit = ini_get('memory_limit');
63+
ini_set('memory_limit', '-1');
64+
65+
$eventID = $request->get_param("param2");
66+
$since = $request->get_param("param3");
67+
68+
echo json_encode(getEventUpdatedTicketsWithStatus($eventID, $since));
69+
70+
ini_set('memory_limit', $memory_limit);
71+
} else {
72+
echo json_encode($authorize_result);
73+
}
74+
75+
exit();
76+
}
77+
78+
Kódrészlet amit le ki kell egészíteni:
79+
80+
$rest_api_endpoints = array('login_status',
81+
'get_all_data',
82+
'get_list_of_events',
83+
'get_tickets_in_event',
84+
'get_updated_tickets_in_event',
85+
'get_single_ticket',
86+
87+
'update_ticket_status',
88+
'update_ticket_status_m',
89+
'update_ticket_status_multiday',
90+
91+
'get_check_in'
92+
);

angular.json

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular-9-basic-authentication-example": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "less"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"aot": true,
26+
"assets": [
27+
"src/favicon.ico",
28+
"src/assets"
29+
],
30+
"styles": [
31+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
32+
"src/styles.less"
33+
],
34+
"scripts": []
35+
},
36+
"configurations": {
37+
"production": {
38+
"fileReplacements": [
39+
{
40+
"replace": "src/environments/environment.ts",
41+
"with": "src/environments/environment.prod.ts"
42+
}
43+
],
44+
"optimization": true,
45+
"outputHashing": "all",
46+
"sourceMap": false,
47+
"extractCss": true,
48+
"namedChunks": false,
49+
"extractLicenses": true,
50+
"vendorChunk": false,
51+
"buildOptimizer": true,
52+
"budgets": [
53+
{
54+
"type": "initial",
55+
"maximumWarning": "2mb",
56+
"maximumError": "5mb"
57+
},
58+
{
59+
"type": "anyComponentStyle",
60+
"maximumWarning": "6kb",
61+
"maximumError": "10kb"
62+
}
63+
]
64+
}
65+
}
66+
},
67+
"serve": {
68+
"builder": "@angular-devkit/build-angular:dev-server",
69+
"options": {
70+
"browserTarget": "angular-9-basic-authentication-example:build",
71+
"proxyConfig": "src/proxy.conf.json"
72+
},
73+
"configurations": {
74+
"production": {
75+
"browserTarget": "angular-9-basic-authentication-example:build:production"
76+
}
77+
}
78+
},
79+
"extract-i18n": {
80+
"builder": "@angular-devkit/build-angular:extract-i18n",
81+
"options": {
82+
"browserTarget": "angular-9-basic-authentication-example:build"
83+
}
84+
},
85+
"test": {
86+
"builder": "@angular-devkit/build-angular:karma",
87+
"options": {
88+
"main": "src/test.ts",
89+
"polyfills": "src/polyfills.ts",
90+
"tsConfig": "tsconfig.spec.json",
91+
"karmaConfig": "karma.conf.js",
92+
"assets": [
93+
"src/favicon.ico",
94+
"src/assets"
95+
],
96+
"styles": [
97+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
98+
"src/styles.less"
99+
],
100+
"scripts": []
101+
}
102+
},
103+
"lint": {
104+
"builder": "@angular-devkit/build-angular:tslint",
105+
"options": {
106+
"tsConfig": [
107+
"tsconfig.app.json",
108+
"tsconfig.spec.json",
109+
"e2e/tsconfig.json"
110+
],
111+
"exclude": [
112+
"**/node_modules/**"
113+
]
114+
}
115+
},
116+
"e2e": {
117+
"builder": "@angular-devkit/build-angular:protractor",
118+
"options": {
119+
"protractorConfig": "e2e/protractor.conf.js",
120+
"devServerTarget": "angular-9-basic-authentication-example:serve"
121+
},
122+
"configurations": {
123+
"production": {
124+
"devServerTarget": "angular-9-basic-authentication-example:serve:production"
125+
}
126+
}
127+
},
128+
"deploy": {
129+
"builder": "angular-cli-ghpages:deploy"
130+
}
131+
}
132+
}
133+
},
134+
"defaultProject": "angular-9-basic-authentication-example"
135+
}

browserslist

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.

e2e/protractor.conf.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// @ts-check
2+
// Protractor configuration file, see link for more information
3+
// https://github.com/angular/protractor/blob/master/lib/config.ts
4+
5+
const { SpecReporter } = require('jasmine-spec-reporter');
6+
7+
/**
8+
* @type { import("protractor").Config }
9+
*/
10+
exports.config = {
11+
allScriptsTimeout: 11000,
12+
specs: [
13+
'./src/**/*.e2e-spec.ts'
14+
],
15+
capabilities: {
16+
browserName: 'chrome'
17+
},
18+
directConnect: true,
19+
baseUrl: 'http://localhost:4200/',
20+
framework: 'jasmine',
21+
jasmineNodeOpts: {
22+
showColors: true,
23+
defaultTimeoutInterval: 30000,
24+
print: function() {}
25+
},
26+
onPrepare() {
27+
require('ts-node').register({
28+
project: require('path').join(__dirname, './tsconfig.json')
29+
});
30+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31+
}
32+
};

e2e/src/app.e2e-spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage;
6+
7+
beforeEach(() => {
8+
page = new AppPage();
9+
});
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo();
13+
expect(page.getTitleText()).toEqual('angular-9-basic-authentication-example app is running!');
14+
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

e2e/src/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor';
2+
3+
export class AppPage {
4+
navigateTo(): Promise<unknown> {
5+
return browser.get(browser.baseUrl) as Promise<unknown>;
6+
}
7+
8+
getTitleText(): Promise<string> {
9+
return element(by.css('app-root .content span')).getText() as Promise<string>;
10+
}
11+
}

0 commit comments

Comments
 (0)