Skip to content

Commit

Permalink
Merge branch 'craigk5n:master' into xact
Browse files Browse the repository at this point in the history
  • Loading branch information
bbannon authored Sep 18, 2023
2 parents f4e6379 + 5589ae7 commit 05d3e81
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 6 deletions.
29 changes: 25 additions & 4 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,30 @@ function save_pref ( $prefs, $src ) {
. translate ( 'Weekend starts on' ) . ':</label>
<select name="admin_WEEKEND_START" id="admin_WEEKEND_START">'
. $start_wkend_on . '
</select></div>
<div class="form-inline mt-1 mb-2"><label title="' . tooltip ( 'time-format-help' ) . '">'
. translate ( 'Time format' ) . ':</label>' . print_radio ( 'TIME_FORMAT',
</select></div>';

echo '<div class="form-inline mt-1 mb-2" id="default_visibility_div"><label title="' . tooltip("preferred-event-visibility")
. '">' . translate('Default Visibility') . ':</label>';
echo '<select name="admin_DEFAULT_VISIBILITY" id="pref_DEFAULT_VISIBILITY"><option value="P"';
if (isset($prefarray['DEFAULT_VISIBILITY']) &&
$prefarray['DEFAULT_VISIBILITY'] == 'P') {
echo " selected ";
}
echo ">" . translate('Public') . "</option>\n";
echo '<option value="R"';
if (empty($prefarray['DEFAULT_VISIBILITY'] ) || $prefarray['DEFAULT_VISIBILITY'] == 'R') {
echo " selected ";
}
echo ">" . translate('Private') . "</option>\n";
echo '<option value="C"';
if (isset($prefarray['DEFAULT_VISIBILITY']) && $prefarray['DEFAULT_VISIBILITY'] == 'C') {
echo " selected ";
}
echo ">" . translate('Confidential') . "</option>\n";
echo '</select></div>';

echo '<div class="form-inline mt-1 mb-2"><label title="' . tooltip ( 'time-format-help' ) . '">' .
translate ( 'Time format' ) . ':</label>' . print_radio ( 'TIME_FORMAT',
['12' => translate ( '12 hour' ), '24' => translate ( '24 hour' )] )
. '</div>
<div class="form-inline mt-1 mb-2"><label title="' . tooltip ( 'timed-evt-len-help' ) . '">'
Expand Down Expand Up @@ -479,7 +500,7 @@ function save_pref ( $prefs, $src ) {
. print_radio ( 'DISABLE_PRIORITY_FIELD' ) . '</div>
<div class="form-inline mt-1 mb-2"><label title="' . tooltip ( 'disable-access-field-help' ) . '">'
. translate ( 'Disable Access field' ) . ':</label>'
. print_radio ( 'DISABLE_ACCESS_FIELD' ) . '</div>
. print_radio ( 'DISABLE_ACCESS_FIELD', '', "disable_access_handler" ) . '</div>
<div class="form-inline mt-1 mb-2"><label title="' . tooltip ( 'disable-participants-field-help' )
. '">' . translate ( 'Disable Participants field' ) . ':</label>'
. print_radio ( 'DISABLE_PARTICIPANTS_FIELD' ) . '</div>
Expand Down
6 changes: 4 additions & 2 deletions edit_entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,9 @@ function time_selection($prefix, $time = '', $trigger = false)
}
$cal_time = ($hour * 10000) + (isset($minute) ? $minute * 100 : 0);

if (empty($access))
if (empty($access) && isset($DEFAULT_VISIBILITY))
$access = $DEFAULT_VISIBILITY;
else if (empty($access))
$access = '';

if (empty($cal_url))
Expand Down Expand Up @@ -775,7 +777,7 @@ function time_selection($prefix, $time = '', $trigger = false)

<label for="due_YMD" data-toggle="tooltip" data-placement="top" data-html="true" title="<?php etooltip('date-help'); ?>">
<?php etranslate('Due Date'); ?>:</label>
<?php echo time_selection('due_', $due_date); ?>
<?php echo date_selection('due_', $due_date); ?>

<label for="due_hour" data-toggle="tooltip" data-placement="top" data-html="true" title="<?php etooltip('date-help'); ?>">
<?php etranslate('Due Time'); ?>:</label>
Expand Down
11 changes: 11 additions & 0 deletions includes/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function init_admin() {
popup_handler();
public_handler();
sr_handler();
disable_access_handler();

return true;
}
Expand Down Expand Up @@ -182,6 +183,16 @@ function email_handler() {
}
}

// Gets called when the user changes the selection from "Disable Access"
function disable_access_handler () {
if ($('#admin_DISABLE_ACCESS_FIELD_N').is(':checked')) {
$('#default_visibility_div').show();
} else {
$('#default_visibility_div').hide();
}
}


function showPreview() {
var theme = document.forms['prefform'].admin_THEME.value.toLowerCase();

Expand Down
27 changes: 27 additions & 0 deletions pref.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,33 @@ function save_pref( $prefs, $src) {

<tr><td height="0.5 em"><!-- small vertical spacing--><span style="font-size: 25%">&nbsp;</span> </td></tr>

<tr><td data-toggle="tooltip" data-placement="top" title="<?php etooltip ("preferred-event-visibility");?>"><label for="pref_DEFAULT_VISIBILITY"><?php
etranslate ('Default Visibility')?>:</label></td><td>
<select class="form-control" name="pref_DEFAULT_VISIBILITY" id="pref_DEFAULT_VISIBILITY">
<option value="P"
<?php if (isset($prefarray['DEFAULT_VISIBILITY']) &&
$prefarray['DEFAULT_VISIBILITY'] == 'P') {
echo " selected ";
}
echo ">" . translate('Public');
?> </option>
<option value="R"
<?php if (empty($prefarray['DEFAULT_VISIBILITY'] ) ||
$prefarray['DEFAULT_VISIBILITY'] == 'R') {
echo " selected ";
}
echo ">" . translate('Private');
?> </option>
<option value="C"
<?php if (isset($prefarray['DEFAULT_VISIBILITY']) &&
$prefarray['DEFAULT_VISIBILITY'] == 'C') {
echo " selected ";
}
echo ">" . translate('Confidential');
?> </option>
</select>
</td></tr>

<tr><td data-toggle="tooltip" data-placement="top" title="<?php etooltip ("time-format-help");?>">
<label for="pref_TIME_FORMAT"><?php etranslate ('Time format')?>:</label></td><td class="form-inline mt-1 mb-2">
<?php echo print_radio ( 'TIME_FORMAT',
Expand Down

0 comments on commit 05d3e81

Please sign in to comment.