Compare commits
14 Commits
9f257e569d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7566cb2e6b | ||
|
|
e043a1b022 | ||
|
|
e88e5477de | ||
|
|
dd8ce88556 | ||
|
|
8ed62b86bc | ||
|
|
d73f287f7b | ||
|
|
7682671a79 | ||
|
|
c8475be001 | ||
|
|
6b27f094a2 | ||
|
|
4dd6b9ffca | ||
|
|
8cebbf17d2 | ||
|
|
d37805a798 | ||
|
|
32cf68e3ac | ||
|
|
bc2eefd305 |
@@ -11,8 +11,8 @@
|
|||||||
"mail": "",
|
"mail": "",
|
||||||
"bulkmail": "Emailverteiler",
|
"bulkmail": "Emailverteiler",
|
||||||
"logout": "",
|
"logout": "",
|
||||||
"savemail": "Ideenboard",
|
"savemail": "",
|
||||||
"planboard": "",
|
"planboard": "Ideenboard",
|
||||||
"projectsmanagement": "Förderprojekte",
|
"projectsmanagement": "Förderprojekte",
|
||||||
"memberlistdownload": ""
|
"memberlistdownload": ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,10 @@ class Bulkmail extends Renderer {
|
|||||||
['label' => 'Signatur', 'type' => 'combobox', 'size' => 5, 'name' => 'signature', 'combine_with_next_line' => false,
|
['label' => 'Signatur', 'type' => 'combobox', 'size' => 5, 'name' => 'signature', 'combine_with_next_line' => false,
|
||||||
'values' => ['Persönliche Signatur', 'Vorstandssignatur'],
|
'values' => ['Persönliche Signatur', 'Vorstandssignatur'],
|
||||||
],
|
],
|
||||||
|
['label' => 'An normale Mitglieder', 'type' => 'checkbox', 'size' => 50, 'name' => 'custommembers', 'size' => 1, 'value' => 1, 'combine_with_next_line' => false],
|
||||||
|
['label' => 'An den Vorstand', 'type' => 'checkbox', 'size' => 50, 'name' => 'board', 'size' => 1, 'value' => 1, 'combine_with_next_line' => false],
|
||||||
];
|
];
|
||||||
protected string $formSendButtonLabel = 'Email an alle aktiven Mitglieder absenden';
|
protected string $formSendButtonLabel = 'Email an ausgewählte Empfängergruppe senden';
|
||||||
|
|
||||||
protected function formAction(): void {
|
protected function formAction(): void {
|
||||||
$this->sendEmail($this->generateSubject(), $this->generateBody(), $this->generateSignature(filter_input(INPUT_POST, 'signature')));
|
$this->sendEmail($this->generateSubject(), $this->generateBody(), $this->generateSignature(filter_input(INPUT_POST, 'signature')));
|
||||||
@@ -26,23 +28,32 @@ class Bulkmail extends Renderer {
|
|||||||
protected function sendEmail(string $subject, string $body, string $signature): void {
|
protected function sendEmail(string $subject, string $body, string $signature): void {
|
||||||
$mail = $this->initSmtpMailer();;
|
$mail = $this->initSmtpMailer();;
|
||||||
$bccRecipients = $this->loadReceivers();
|
$bccRecipients = $this->loadReceivers();
|
||||||
|
$sendToCustomMembers = intval(filter_input(INPUT_POST, 'custommembers')) === 1;
|
||||||
|
$sendToBoard = intval(filter_input(INPUT_POST, 'board')) === 1;
|
||||||
|
$sendTo = [];
|
||||||
try {
|
try {
|
||||||
$mail->setFrom('foerderverein-ajs@gmx.de', 'Förderverein der Steffi-Jones-Schule');
|
$mail->setFrom('foerderverein-ajs@gmx.de', 'Förderverein der Steffi-Jones-Schule');
|
||||||
$mail->addReplyTo('foerderverein-ajs@gmx.de', 'Förderverein der Steffi-Jones-Schule');
|
$mail->addReplyTo('foerderverein-ajs@gmx.de', 'Förderverein der Steffi-Jones-Schule');
|
||||||
$mail->addAddress('vorstand@fvajs.de', 'Vorstand des FVAJS');
|
$mail->addAddress('vorstand@fvajs.de', 'Vorstand des FVAJS');
|
||||||
foreach ($bccRecipients as $recipient) {
|
foreach ($bccRecipients as $recipient) {
|
||||||
$mail->addBCC($recipient);
|
if (($sendToCustomMembers && $recipient['position'] === null)
|
||||||
|
|| ($sendToBoard && $recipient['position'] !== null)) {
|
||||||
|
$mail->addBCC($recipient['email']);
|
||||||
|
$sendTo[] = $recipient['email'];
|
||||||
|
} else {
|
||||||
|
var_dump($recipient['position']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->sendMail($mail, $subject, $body, $signature);
|
$this->sendMail($mail, $subject, $body, $signature);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->templateName = 'error_smtp';
|
$this->templateName = 'error_smtp';
|
||||||
}
|
}
|
||||||
$this->templateName = 'bulkmail_success';
|
$this->templateName = 'bulkmail_success';
|
||||||
$this->content['recipients'] = implode('<br />', $bccRecipients);
|
$this->content['recipients'] = implode('<br />', $sendTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function loadReceivers(): array {
|
protected function loadReceivers(): array {
|
||||||
$query = 'SELECT c.first_name, c.last_name, c.email, c.salt
|
$query = 'SELECT c.first_name, c.last_name, c.email, c.salt, c.position_id
|
||||||
FROM clubmember c
|
FROM clubmember c
|
||||||
JOIN clubmember_status cs
|
JOIN clubmember_status cs
|
||||||
ON cs.id = c.membership_status
|
ON cs.id = c.membership_status
|
||||||
@@ -50,7 +61,7 @@ class Bulkmail extends Renderer {
|
|||||||
$dbResult = mysqli_query($this->dbConnection, $query);
|
$dbResult = mysqli_query($this->dbConnection, $query);
|
||||||
$recipientsList = [];
|
$recipientsList = [];
|
||||||
while ($row = mysqli_fetch_assoc($dbResult)) {
|
while ($row = mysqli_fetch_assoc($dbResult)) {
|
||||||
$recipientsList[] = $this->decode($row['email'], $row['salt']);
|
$recipientsList[] = ['email' => $this->decode($row['email'], $row['salt']), 'position' => $row['position_id'] ];
|
||||||
}
|
}
|
||||||
return $recipientsList;
|
return $recipientsList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,13 +55,13 @@ class Projectsmanagement extends Renderer {
|
|||||||
WHERE caption = "Fortlaufende Projekte"', $newName);
|
WHERE caption = "Fortlaufende Projekte"', $newName);
|
||||||
mysqli_query($this->dbConnection, $query);
|
mysqli_query($this->dbConnection, $query);
|
||||||
$id = mysqli_insert_id($this->dbConnection);
|
$id = mysqli_insert_id($this->dbConnection);
|
||||||
$query = 'SELECT id, short_title FROM project p ORDER BY short_title';
|
$query = 'SELECT id, short_title, project_type_id FROM project p ORDER BY short_title';
|
||||||
$dbResult = mysqli_query($this->dbConnection, $query);
|
$dbResult = mysqli_query($this->dbConnection, $query);
|
||||||
$list = [];
|
$list = [];
|
||||||
while ($row = mysqli_fetch_assoc($dbResult)) {
|
while ($row = mysqli_fetch_assoc($dbResult)) {
|
||||||
$list[] = ['id' => $row['id'], 'title' => $row['short_title'] ];
|
$list[] = ['id' => $row['id'], 'title' => $row['short_title'], 'project_type_id' => $row['project_type_id'] ];
|
||||||
}
|
}
|
||||||
echo json_encode(['list' => $list, 'id' => $id]);
|
echo json_encode(['list' => $list, 'id' => $id, 'types' => $this->getProjectTypes()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setDescription(): void {
|
protected function setDescription(): void {
|
||||||
@@ -90,15 +90,10 @@ class Projectsmanagement extends Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function generateContent(): void {
|
protected function generateContent(): void {
|
||||||
$typesQuery = 'SELECT * FROM project_type ORDER BY id';
|
$types = $this->getProjectTypes();
|
||||||
$typesResult = mysqli_query($this->dbConnection, $typesQuery);
|
|
||||||
$types = [];
|
|
||||||
while ($row = mysqli_fetch_assoc($typesResult)) {
|
|
||||||
$types[$row['id'] ] = $row['caption'];
|
|
||||||
}
|
|
||||||
$query = 'SELECT * FROM project ORDER BY short_title';
|
$query = 'SELECT * FROM project ORDER BY short_title';
|
||||||
$result = mysqli_query($this->dbConnection, $query);
|
$result = mysqli_query($this->dbConnection, $query);
|
||||||
$overviewHtml = '<table><thead><tr><th>Projekt</th><th>Projekttyp</th><tr><thead><tbody>';
|
$overviewHtml = '<table id="projectoverview"><thead><tr><th>Projekt</th><th>Projekttyp</th><tr><thead><tbody>';
|
||||||
while ($row = mysqli_fetch_assoc($result)) {
|
while ($row = mysqli_fetch_assoc($result)) {
|
||||||
$overviewHtml .= '<tr><td>' . $row['short_title'] . '</td>';
|
$overviewHtml .= '<tr><td>' . $row['short_title'] . '</td>';
|
||||||
$overviewHtml .= '<td><select name="project_type" data="' . $row['id'] . '">';
|
$overviewHtml .= '<td><select name="project_type" data="' . $row['id'] . '">';
|
||||||
@@ -111,4 +106,14 @@ class Projectsmanagement extends Renderer {
|
|||||||
$overviewHtml .= '</tbody></table>';
|
$overviewHtml .= '</tbody></table>';
|
||||||
$this->content['projects'] = $overviewHtml;
|
$this->content['projects'] = $overviewHtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getProjectTypes(): array {
|
||||||
|
$typesQuery = 'SELECT * FROM project_type ORDER BY id';
|
||||||
|
$typesResult = mysqli_query($this->dbConnection, $typesQuery);
|
||||||
|
$types = [];
|
||||||
|
while ($row = mysqli_fetch_assoc($typesResult)) {
|
||||||
|
$types[$row['id'] ] = $row['caption'];
|
||||||
|
}
|
||||||
|
return $types;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,23 @@ class Register extends Renderer {
|
|||||||
'value' => 1],
|
'value' => 1],
|
||||||
];
|
];
|
||||||
protected string $formSendButtonLabel = 'Zugang beantragen';
|
protected string $formSendButtonLabel = 'Zugang beantragen';
|
||||||
|
protected string $templateName = 'renderer';
|
||||||
|
|
||||||
protected function formAction(): void {
|
protected function formAction(): void {
|
||||||
|
error_log('DEBUG Register::formAction aufgerufen');
|
||||||
|
if (!$this->formCheckFields()) {
|
||||||
|
error_log('DEBUG Register::formCheckFields fehlgeschlagen: ' . print_r($this->errors, true));
|
||||||
|
// Bei Validierungsfehlern: nichts speichern, keine Mail, Fehler im Formular anzeigen
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
error_log('DEBUG Register::formCheckFields ok, schreibe in DB');
|
||||||
$this->writeToDb();
|
$this->writeToDb();
|
||||||
|
error_log('DEBUG Register::writeToDb erledigt, sende Mail');
|
||||||
$this->sendEmail();
|
$this->sendEmail();
|
||||||
$this->templateName = 'register_successful';
|
error_log('DEBUG Register::sendEmail beendet, Errors: ' . print_r($this->errors, true));
|
||||||
|
if (count($this->errors) === 0) {
|
||||||
|
$this->templateName = 'register_successful';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function formCheckFields(): bool {
|
protected function formCheckFields(): bool {
|
||||||
@@ -28,7 +40,10 @@ class Register extends Renderer {
|
|||||||
if (!preg_match('/^([a-z0-9]{3,16})$/', $username)) {
|
if (!preg_match('/^([a-z0-9]{3,16})$/', $username)) {
|
||||||
$this->errors['username'] = 'Der Benutzername darf nur aus Buchstaben (ohne Umlaute) und Zahlen bestehen und muss zwischen drei und sechzen Zeichen lang sein.';
|
$this->errors['username'] = 'Der Benutzername darf nur aus Buchstaben (ohne Umlaute) und Zahlen bestehen und muss zwischen drei und sechzen Zeichen lang sein.';
|
||||||
}
|
}
|
||||||
if (!filter_var(strtolower(trim(filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL)), FILTER_VALIDATE_EMAIL))) {
|
if (!filter_var(
|
||||||
|
strtolower(trim(filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL))),
|
||||||
|
FILTER_VALIDATE_EMAIL
|
||||||
|
)) {
|
||||||
$this->errors['email'] = 'Die Email-Adresse ist inkorrekt';
|
$this->errors['email'] = 'Die Email-Adresse ist inkorrekt';
|
||||||
}
|
}
|
||||||
if (strlen(filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING)) < 8) {
|
if (strlen(filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING)) < 8) {
|
||||||
@@ -40,22 +55,22 @@ class Register extends Renderer {
|
|||||||
if (filter_input(INPUT_POST, 'accept', FILTER_SANITIZE_NUMBER_INT) !== '1') {
|
if (filter_input(INPUT_POST, 'accept', FILTER_SANITIZE_NUMBER_INT) !== '1') {
|
||||||
$this->errors['accept'] = 'Sie müssen der Speicherung Ihrer Daten zustimmen.';
|
$this->errors['accept'] = 'Sie müssen der Speicherung Ihrer Daten zustimmen.';
|
||||||
}
|
}
|
||||||
return (count($errors) === 0);
|
return (count($this->errors) === 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function writeToDb(): void {
|
protected function writeToDb(): void {
|
||||||
$salt = $this->generateRandomString();
|
$salt = $this->generateRandomString();
|
||||||
$encryptedName = $this->encode(trim(filter_input(INPUT_POST, 'fullname', FILTER_SANITIZE_STRING), $salt));
|
$encryptedName = $this->encode(trim(filter_input(INPUT_POST, 'fullname', FILTER_SANITIZE_STRING)), $salt);
|
||||||
$email = strtolower(trim(filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL)));
|
$email = strtolower(trim(filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL)));
|
||||||
$encryptedEmail = $this->encode($email, $salt);
|
$encryptedEmail = $this->encode($email, $salt);
|
||||||
$query = sprintf("INSERT INTO ffajs.`user` (username, password, realname, email, active, save_data_accepted, salt, color_id) "
|
$query = sprintf("INSERT INTO ffajs.`user` (username, password, realname, email, active, save_data_accepted, salt, color_id) "
|
||||||
. "VALUES('%s', '%s', '%s', '%s', 0, %d, '%s', (SELECT c.id
|
. "VALUES('%s', '%s', '%s', '%s', 0, %d, '%s', COALESCE((SELECT c.id
|
||||||
FROM color c
|
FROM color c
|
||||||
left join `user` u
|
left join `user` u
|
||||||
on u.color_id = c.id
|
on u.color_id = c.id
|
||||||
where u.id is null
|
where u.id is null
|
||||||
order by rand()
|
order by rand()
|
||||||
limit 1))",
|
limit 1), 1))",
|
||||||
strtolower(trim(filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING))),
|
strtolower(trim(filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING))),
|
||||||
password_hash(filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING), PASSWORD_DEFAULT),
|
password_hash(filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING), PASSWORD_DEFAULT),
|
||||||
$encryptedName,
|
$encryptedName,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use Webklex\PHPIMAP\Client;
|
|||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
|
|
||||||
class Renderer {
|
class Renderer {
|
||||||
protected string $templateName;
|
protected string $templateName = 'index';
|
||||||
private array $menuItems = [];
|
private array $menuItems = [];
|
||||||
protected array $internalMenuItems = [];
|
protected array $internalMenuItems = [];
|
||||||
protected $hiddenCount = 0;
|
protected $hiddenCount = 0;
|
||||||
@@ -48,10 +48,11 @@ class Renderer {
|
|||||||
$scriptName = $this->getScriptName();
|
$scriptName = $this->getScriptName();
|
||||||
if (!in_array($scriptName, array_merge($this->menuItems, $this->internalMenuItems))) {
|
if (!in_array($scriptName, array_merge($this->menuItems, $this->internalMenuItems))) {
|
||||||
header('Location: /', true, 301);
|
header('Location: /', true, 301);
|
||||||
return;
|
exit;
|
||||||
}
|
}
|
||||||
$this->templateName = $templateName ?: (!in_array($scriptName, ['ffajs', 'fvajs', '', '/']) ? $scriptName : 'index');
|
$this->templateName = $templateName ?: (!in_array($scriptName, ['ffajs', 'fvajs', '', '/']) ? $scriptName : 'index');
|
||||||
$this->connectDb();
|
$this->connectDb();
|
||||||
|
$this->content['year'] = date('Y');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createPublicMenuItems(): void {
|
private function createPublicMenuItems(): void {
|
||||||
@@ -173,7 +174,9 @@ class Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function footer(): void {
|
private function footer(): void {
|
||||||
$this->website = str_replace('{{footer}}', file_get_contents('templates/footer.html'), $this->website);
|
$footerTemplate = file_get_contents('templates/footer.html');
|
||||||
|
$footer = str_replace('{{year}}', date('Y'), $footerTemplate);
|
||||||
|
$this->website = str_replace('{{footer}}', $footer, $this->website);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function showInputField(array $errors, string $inputType, string $fieldName, int $fieldLength): void {
|
protected function showInputField(array $errors, string $inputType, string $fieldName, int $fieldLength): void {
|
||||||
@@ -184,7 +187,7 @@ class Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function renderForm(): string {
|
protected function renderForm(): string {
|
||||||
$form = '<form method="post" action="' . $this->getUrl() . '" enctype="' . $this->encType . '"><table class="form">';
|
$form = '<form method="post" action="' . str_replace('.php', '', $this->getUrl()) . '" enctype="' . $this->encType . '"><table class="form">';
|
||||||
$label = '';
|
$label = '';
|
||||||
$input = '';
|
$input = '';
|
||||||
$error = '';
|
$error = '';
|
||||||
@@ -458,7 +461,12 @@ class Renderer {
|
|||||||
$mail->addStringAttachment($attachment['content'], $fileName, 'base64', $attachment['type']);
|
$mail->addStringAttachment($attachment['content'], $fileName, 'base64', $attachment['type']);
|
||||||
|
|
||||||
}
|
}
|
||||||
$mail->send();
|
try {
|
||||||
|
$mail->send();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log('Mailversand fehlgeschlagen: ' . $e->getMessage());
|
||||||
|
$this->errors[] = 'Die Bestätigungs-Email konnte nicht versendet werden. Bitte versuchen Sie es später erneut oder kontaktieren Sie uns direkt.';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function connectToImap($folder = ''): bool {
|
protected function connectToImap($folder = ''): bool {
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Temporäre Fehlerausgabe und Logging für Debugzwecke
|
||||||
|
ini_set('display_errors', '0');
|
||||||
|
ini_set('log_errors', '1');
|
||||||
|
ini_set('error_reporting', (string)E_ALL);
|
||||||
|
ini_set('error_log', __DIR__ . '/php-error.log');
|
||||||
|
|
||||||
if (isset($_REQUEST['q']) && substr($_REQUEST['q'], -4) === '.php') {
|
if (isset($_REQUEST['q']) && substr($_REQUEST['q'], -4) === '.php') {
|
||||||
$url = substr($_REQUEST['q'], 0, -4);
|
$url = substr($_REQUEST['q'], 0, -4);
|
||||||
header('Location: ' . $url, true, 301);
|
header('Location: ' . $url, true, 301);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<h2>Nicht bearbeitete Anfragen</h2>
|
<h2>Nicht bearbeitete Anfragen</h2>
|
||||||
<form action="accounts.php" method="post">
|
<form action="accounts" method="post">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<footer>
|
<footer>
|
||||||
<span class="footer-copyright">(c) 2023 Verein der Freunde und Förderer der <a href="https://www.steffi-jones-schule.com" target="_blank">Steffi-Jones-Schule e.V.</a></span>
|
<span class="footer-copyright">© {{year}} Verein der Freunde und Förderer der <a href="https://www.steffi-jones-schule.com" target="_blank">Steffi-Jones-Schule e.V.</a></span>
|
||||||
<a href="imprint" class="footer-imprint">Impressum</a>
|
<a href="imprint" class="footer-imprint">Impressum</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -11,5 +11,5 @@ Tel: xxx-xxxxxxx
|
|||||||
</ul>
|
</ul>
|
||||||
<h2>Amtliche Informationen</h2>
|
<h2>Amtliche Informationen</h2>
|
||||||
Registergericht: Amtsgericht Frankfurt a.M., Gerichtsstraße 2, 60313 Frankfurt am Main<br/>
|
Registergericht: Amtsgericht Frankfurt a.M., Gerichtsstraße 2, 60313 Frankfurt am Main<br/>
|
||||||
Vereinsregisternummer: <br/>
|
Vereinsregisternummer: 13422<br/>
|
||||||
Umsatzsteueridentifkationsnummer: <br/>
|
Umsatzsteueridentifkationsnummer: 4525075625<br/>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ $(document).ready(function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$("#shorttitle > option:not(:first-child)").remove();
|
$("#shorttitle > option:not(:first-child)").remove();
|
||||||
|
$("#projectoverview > tbody > tr").remove();
|
||||||
response.list.forEach(function(item) {
|
response.list.forEach(function(item) {
|
||||||
let newItem = $("<option></option>");
|
let newItem = $("<option></option>");
|
||||||
newItem.attr("id", item.id);
|
newItem.attr("id", item.id);
|
||||||
@@ -26,7 +27,17 @@ $(document).ready(function() {
|
|||||||
if (item.id == response.id) {
|
if (item.id == response.id) {
|
||||||
newItem.attr("selected", "selected");
|
newItem.attr("selected", "selected");
|
||||||
}
|
}
|
||||||
|
let newRow = $('<tr><td>' + item.title + '</td></tr>');
|
||||||
|
let selectElement = $('<select name="project_type" data="' + item.id + '"></select>');
|
||||||
|
for (let typeId in response.types) {
|
||||||
|
if (response.types.hasOwnProperty(typeId)) {
|
||||||
|
let option = $('<option value="' + typeId + '"' + (typeId == item.project_type_id ? ' selected' : '') + '>' + response.types[typeId] + '</option>');
|
||||||
|
selectElement.append(option);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
newRow.append('<td>' + selectElement.prop('outerHTML') + '</td>');
|
||||||
$("#shorttitle").append(newItem);
|
$("#shorttitle").append(newItem);
|
||||||
|
$("#projectoverview > tbody").append(newRow);
|
||||||
});
|
});
|
||||||
}).fail(function(response) {
|
}).fail(function(response) {
|
||||||
alert(response);
|
alert(response);
|
||||||
|
|||||||
Reference in New Issue
Block a user