Fix color issues on calendar page

merge-requests/62/head
Mike Koch 7 years ago
parent a219883117
commit 0caf4e740e

@ -207,7 +207,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
echo '<option value="">'.$hesklang['select'].'</option>'; echo '<option value="">'.$hesklang['select'].'</option>';
} }
foreach ($categories as $category): ?> foreach ($categories as $category): ?>
<option value="<?php echo $category['id']; ?>" data-color="<?php echo htmlspecialchars($category['color']); ?>"> <option value="<?php echo $category['id']; ?>" data-background-color="<?php echo htmlspecialchars($category['background_color']); ?>"
data-foreground-color="<?php echo htmlspecialchars($category['foreground_color']); ?>"
data-display-border="<?php echo htmlspecialchars($category['display_border_outline']); ?>">
<?php echo $category['name']; ?> <?php echo $category['name']; ?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>
@ -377,7 +379,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
echo '<option value="">'.$hesklang['select'].'</option>'; echo '<option value="">'.$hesklang['select'].'</option>';
} }
foreach ($categories as $category): ?> foreach ($categories as $category): ?>
<option value="<?php echo $category['id']; ?>" data-color="<?php echo $category['color']; ?>"> <option value="<?php echo $category['id']; ?>" data-background-color="<?php echo htmlspecialchars($category['background_color']); ?>"
data-foreground-color="<?php echo htmlspecialchars($category['foreground_color']); ?>"
data-display-border="<?php echo htmlspecialchars($category['display_border_outline']); ?>">
<?php echo $category['name']; ?> <?php echo $category['name']; ?>
</option> </option>
<?php endforeach; ?> <?php endforeach; ?>

@ -204,7 +204,9 @@ $(document).ready(function() {
categoryId: $createForm.find('select[name="category"]').val(), categoryId: $createForm.find('select[name="category"]').val(),
action: 'create', action: 'create',
type: 'CALENDAR', type: 'CALENDAR',
categoryColor: $createForm.find('select[name="category"] :selected').attr('data-color'), backgroundColor: $createForm.find('select[name="category"] :selected').attr('data-background-color'),
foregroundColor: $createForm.find('select[name="category"] :selected').attr('data-foreground-color'),
displayBorder: $createForm.find('select[name="category"] :selected').attr('data-display-border'),
categoryName: $createForm.find('select[name="category"] :selected').text().trim(), categoryName: $createForm.find('select[name="category"] :selected').text().trim(),
reminderValue: $createForm.find('input[name="reminder-value"]').val(), reminderValue: $createForm.find('input[name="reminder-value"]').val(),
reminderUnits: $createForm.find('select[name="reminder-unit"]').val() reminderUnits: $createForm.find('select[name="reminder-unit"]').val()
@ -249,7 +251,9 @@ $(document).ready(function() {
allDay: allDay, allDay: allDay,
comments: $form.find('textarea[name="comments"]').val(), comments: $form.find('textarea[name="comments"]').val(),
categoryId: $form.find('select[name="category"]').val(), categoryId: $form.find('select[name="category"]').val(),
categoryColor: $form.find('select[name="category"] :selected').attr('data-color'), backgroundColor: $form.find('select[name="category"] :selected').attr('data-background-color'),
foregroundColor: $form.find('select[name="category"] :selected').attr('data-foreground-color'),
displayBorder: $form.find('select[name="category"] :selected').attr('data-display-border'),
categoryName: $form.find('select[name="category"] :selected').text().trim(), categoryName: $form.find('select[name="category"] :selected').text().trim(),
action: 'update', action: 'update',
reminderValue: $form.find('input[name="reminder-value"]').val(), reminderValue: $form.find('input[name="reminder-value"]').val(),

Loading…
Cancel
Save