Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typos #478

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Typos #478

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 3 additions & 6 deletions autocomplete_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,10 @@
if (empty($query))
$query = getValue('query');

$sendPlainText = false;
$format = getValue('format');
if (
!empty($format) &&
($format == 'text' || $format == 'plain')
);
$sendPlainText = true;
$sendPlainText = (! empty ( $format ) &&
( $format === 'text' || $format === 'plain' ) );

if ($sendPlainText) {
Header('Content-Type: text/plain');
} else {
Expand Down
8 changes: 4 additions & 4 deletions edit_entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -1196,10 +1196,10 @@ function time_selection($prefix, $time = '', $trigger = false)
$rpt_byday_label++
) {
$rpt_byday_mod = $rpt_byday_label % 7;
$class = (is_weekend($rpt_byday_mod) ? ' class="weekend" ' : '');
echo '
<th width="50px"' . $class . '><label>'
. translate($weekday_names[$rpt_byday_mod]) . '</label></th>';
$class = ( is_weekend ( $rpt_byday_mod ) ? 'class="weekend" ' : '' );
echo "
<th $class" . 'width="50px"><label>' .
$weekday_names[$rpt_byday_mod] . '</label></th>';
}
echo '
</tr>
Expand Down
5 changes: 2 additions & 3 deletions events_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@
$user = $login;
$get_unapproved = true;

$sendPlainText = false;
$format = getValue ( 'format' );
if ( ! empty ( $format ) &&

$sendPlainText = ( ! empty ( $format ) &&
( $format == 'text' || $format == 'plain' ) );
$sendPlainText = true;

$startdate = getIntValue ( 'startdate' );
if ( empty ( $startdate ) )
Expand Down
4 changes: 2 additions & 2 deletions export.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<tr>
<td><label for="exformat">' . translate ( 'Export format' )
. ':</label></td>
<td>' . generate_export_select ( 'toggel_catfilter' ) . '
<td>' . generate_export_select ( 'toggle_catfilter' ) . '
</td>
</tr>';

Expand Down Expand Up @@ -126,7 +126,7 @@ function toggle_datefields( name, ele ) {
updateDateFields();
}

function toggel_catfilter() {
function toggle_catfilter() {
if ( $('#exformat option:selected').index() == 0 ) {
// ICalendar
$('#catfilter').show();
Expand Down
4 changes: 2 additions & 2 deletions groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@
<div class="modal-body">
<!-- Error Alert -->
<div id="edit-group-dialog-alert" class="alert alert-danger" style="display: none">
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="errorMessage">A problem has been occurred while submitting your data.</span>
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="errorMessage">A problem has occurred while submitting your data.</span>
<button type="button" class="close" onclick="$('.alert').hide()">&times;</button>
</div>
<form name="editGroupForm" id="editGroupForm">
<input type="hidden" name="editGroupAdd" id="editGroupAdd" value="0">
<input type="hidden" name="editGroupId" id="editGroupId" value="0">
<div class="form-inline" is="divEditName">
<div class="form-inline" id="divEditName">
<label class="col-5" for="editName"><?php etranslate('Group name') ?>: </label>
<input required type="text" class="col-7 form-control" id="editName" name="editName" placeholder="<?php echo translate('New group name') . ' (' . translate('required') . ')'; ?>">
<div id="invalid-name-error" class="invalid-feedback text-right">
Expand Down
4 changes: 2 additions & 2 deletions icalclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@
if ( ( empty( $_SERVER['PHP_AUTH_USER'] )
or empty( $_SERVER['PHP_AUTH_PW'] ) )
and isset( $_REQUEST['BAD_HOSTING'] )
and preg_match( '/Basic\s+(.*)$/i', $_REQUEST['BAD_HOSTING'], $matc ) )
AND preg_match ( '/Basic\s+(.*)$/i', $_REQUEST['BAD_HOSTING'], $match ) )
list( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) =
explode( ':', base64_decode( $matc[1] ) );
explode ( ':', base64_decode ( $match[1] ) );

unset( $_ENV['REMOTE_USER'] );

Expand Down
10 changes: 5 additions & 5 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ function build_entry_label ( $event, $popupid,
* @param string $time Input time in HHMMSS format
* @param bool $round_down Should we change 1100 to 1059?
* (This will make sure a 10AM-100AM appointment just
* shows up in the 10AM slow and not in the 11AM slot
* shows up in the 10AM slot and not in the 11AM slot
* also.)
*
* @return int The time slot index.
Expand Down Expand Up @@ -2581,9 +2581,9 @@ function get_groups($user, $includeUserlist=false)
$res = dbi_execute($sql, [$groups[$i]['cal_group_id']]);
while ($row = dbi_fetch_row($res)) {
if (isset($users_by_name[$row[0]])){
// It is possible some users assigned to this group may not exist,
// so we skip those that don't. For example, if users are fetched
// from an external source via user-app-*.php, and one of those
// It is possible some users assigned to this group may not exist,
// so we skip those that don't. For example, if users are fetched
// from an external source via user-app-*.php, and one of those
// users is deleted externally.
$users[] = $users_by_name[$row[0]];
}
Expand Down Expand Up @@ -4632,7 +4632,7 @@ function print_color_input_html ($varname, $title, $varval = '', $id='', $tag='d
}

return '<' . $tag . ' class="form-inline">' .
(empty($title) ? '' : ('<label class="' . $class . '" for="' . $prefix . $varname . '">' . $title . '</label>')) .
(empty($title) ? '' : ('<label class="' . $class . '" for="' . $prefix . $id . '">' . $title . '</label>')) .
'<input class="form-control" style="height: 2em; width: 4em;" name="' . $prefix . $varname . '" id="' . $prefix . $id .
'" type="color" value="' . $setting . '"' . (empty($onchange) ? '' : ' onchange="' . $onchange . '()"') .
'></' . $tag . '>';
Expand Down
12 changes: 6 additions & 6 deletions includes/xcal.php
Original file line number Diff line number Diff line change
Expand Up @@ -2208,23 +2208,23 @@ function parse_ical ( $cal_file, $source = 'file' ) {
$event[$substate] = $match[1];
} elseif ( preg_match ( '/^EXDATE.*:(.+)$/i', $buff, $match ) ) {
$substate = 'exdate';
// allows multiple ocurrances of EXDATE to be processed
// allows multiple occurrences of EXDATE to be processed
if ( isset ( $event[$substate] ) )
$event[$substate] .= ',' . $match[1];
else
$event[$substate] = $match[1];

} elseif ( preg_match ( '/^RDATE.*:(.+)$/i', $buff, $match ) ) {
$substate = 'rdate';
// allows multiple ocurrances of RDATE to be processed
// allows multiple occurrences of RDATE to be processed
if ( isset ( $event[$substate] ) )
$event[$substate] .= ',' . $match[1];
else
$event[$substate] = $match[1];

} elseif ( preg_match ( '/^CATEGORIES.*:(.+)$/i', $buff, $match ) ) {
$substate = 'categories';
// allows multiple ocurrances of CATEGORIES to be processed
// allows multiple occurrences of CATEGORIES to be processed
if ( isset ( $event[$substate] ) )
$event[$substate] .= ',' . $match[1];
else
Expand Down Expand Up @@ -2429,23 +2429,23 @@ function parse_hcal ( $hcal_array ) {
$event[$substate] = $value;
} elseif ( $key == 'EXDATE' ) {
$substate = 'exdate';
// allows multiple ocurrances of EXDATE to be processed
// allows multiple occurrences of EXDATE to be processed
if ( isset ( $event[$substate] ) )
$event[$substate] .= ',' . $value;
else
$event[$substate] = $value;

} elseif ( $key == 'RDATE' ) {
$substate = 'rdate';
// allows multiple ocurrances of RDATE to be processed
// allows multiple occurrences of RDATE to be processed
if ( isset ( $event[$substate] ) )
$event[$substate] .= ',' . $value;
else
$event[$substate] = $value;

} elseif ( $key == 'CATEGORIES' ) {
$substate = 'categories';
// allows multiple ocurrances of CATEGORIES to be processed
// allows multiple occurrences of CATEGORIES to be processed
if ( isset ( $event[$substate] ) )
$event[$substate] .= ',' . $value;
else
Expand Down
6 changes: 2 additions & 4 deletions layers_ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@

$action = getValue ( 'action' );
$public = getValue ( 'public' );

$sendPlainText = false;
$format = getValue ( 'format' );
if ( ! empty ( $format ) &&

$sendPlainText = ( ! empty ( $format ) &&
( $format == 'text' || $format == 'plain' ) );
$sendPlainText = true;

$error = '';

Expand Down
2 changes: 1 addition & 1 deletion purge.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
$M_ids = get_ids ( 'SELECT DISTINCT(we.cal_id) FROM webcal_entry we,
webcal_entry_user weu, webcal_entry_repeats wer
WHERE we.cal_type = \'M\'
AND we.cal_id = wer.cal_id AND we.cal_id = wer.cal_id '
AND we.cal_id = wer.cal_id AND weu.cal_id = wer.cal_id '
. "AND cal_end IS NOT NULL AND cal_end < '$end_date' $tail",
$ALL );
$ids = array_merge ( $E_ids, $M_ids );
Expand Down
2 changes: 1 addition & 1 deletion remotecal_mgmt.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<div class="modal-body">
<!-- Error Alert -->
<div id="edit-user-dialog-alert" class="alert alert-danger" style="display: none">
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="errorMessage">A problem has been occurred while submitting your data.</span>
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="errorMessage">A problem has occurred while submitting your data.</span>
<button type="button" class="close" onclick="$('.alert').hide()">&times;</button>
</div>
<form class="needs-validation" novalidate name="editUserForm" id="editUserForm">
Expand Down
2 changes: 1 addition & 1 deletion resourcecal_mgmt.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<div class="modal-body">
<!-- Error Alert -->
<div id="edit-user-dialog-alert" class="alert alert-danger" style="display: none">
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="errorMessage">A problem has been occurred while submitting your data.</span>
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="errorMessage">A problem has occurred while submitting your data.</span>
<button type="button" class="close" onclick="$('.alert').hide()">&times;</button>
</div>
<form class="needs-validation" novalidate name="editUserForm" id="editUserForm">
Expand Down
2 changes: 1 addition & 1 deletion rss_unapproved.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
if ( access_is_enabled() ) {
if ( ! access_user_calendar ( 'approve', $user ) ) {
// not allowed
$user = login;
$user = $login;
}
} else if ( ! $is_admin && $user != $login && ! $is_assistant &&
! access_is_enabled() ) {
Expand Down
17 changes: 6 additions & 11 deletions upcoming.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,12 @@ function print_upcoming_event ( $e, $date ) {

$popupid = 'pop' . $e->getId() . '-' . $date;

$private = $confidential = false;
// Access: P=Public, R=Private, C=Confidential
if ( $e->getAccess() == 'R' ) {
// not a public event, so we will just display "Private"
$private = true;
}
else if ( $e->getAccess() == 'C' ) {
// not a public event, so we will just display "Confidential"
$confidential = true;
}

// not a public event, just "Private"
$private = ( $e->getAccess() == 'R' );
// not a public event, just "Confidential"
$confidential = ( $e->getAccess() == 'C' );

if ( ! empty ( $SERVER_URL ) && ! $private && ! $confidential) {
echo "<div class=\"vevent\">\n";
if ( $display_link ) {
Expand All @@ -192,7 +187,7 @@ function print_upcoming_event ( $e, $date ) {
$catNum = abs(intval($e->getCategory()));
if ($catNum > 0 && !empty($categories[$catNum]['cat_icon_mime'])) {
$catIcon = "getIcon.php?cat_id=" . $catNum;
$link .= '<img src="' . $catIcon . '" alt="category icon"></a>';
$link .= '<img src="' . $catIcon . '" alt="category icon">';
}
}
echo $link;
Expand Down
36 changes: 18 additions & 18 deletions user_mgmt.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
<!-- dropdown menu -->
</th>
</tr>
</thead>
<tbody id="user-tbody">
</tbody>
</thead>
</table>

<br>
Expand All @@ -89,42 +89,42 @@
<div class="modal-body">
<!-- Error Alert -->
<div id="edit-user-dialog-alert" class="alert alert-danger" style="display: none">
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="errorMessage">A problem has been occurred while submitting your data.</span>
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="errorMessage">A problem has occurred while submitting your data.</span>
<button type="button" class="close" onclick="$('.alert').hide()">&times;</button>
</div>
<form name="editUserForm" id="editUserForm">
<input type="hidden" name="editUserDelete" id="editUserDelete" value="0">
<input type="hidden" name="editUserAdd" id="editUserAdd" value="0">
<div class="form-inline" is="divEditUsername">
<div class="form-inline" id="divEditUsername">
<label class="col-5" for="editUsername"><?php etranslate('Username') ?>: </label>
<input type="text" class="col-7 form-control" id="editUsername" name="editUsername" placeholder="<?php echo translate('New username') . ' (' . translate('required') . ')'; ?>" MAXLENGTH="25">
<input type="text" class="col-7 form-control" id="editUsername" name="editUsername" placeholder="<?php echo translate('New username') . ' (' . translate('required') . ')'; ?>" maxlength="25">
</div>
<div class="form-inline mt-1" id="div-editFirstname">
<label class="col-5 for=" editFirstname"><?php etranslate('First Name') ?>: </label>
<input type="text" class="col-7 form-control" id="editFirstname" name="editFirstname" MAXLENGTH="25">
<label class="col-5" for="editFirstname"><?php etranslate('First Name') ?>: </label>
<input type="text" class="col-7 form-control" id="editFirstname" name="editFirstname" maxlength="25">
</div>
<div class="form-inline mt-1" id="div-editLastname">
<label class="col-5 for=" editLastname"><?php etranslate('Last Name') ?>: </label>
<input type="text" class="col-7 form-control" id="editLastname" name="editLastname" MAXLENGTH="25">
<label class="col-5" for="editLastname"><?php etranslate('Last Name') ?>: </label>
<input type="text" class="col-7 form-control" id="editLastname" name="editLastname" maxlength="25">
</div>
<div class="form-inline mt-1" id="div-editEmail">
<label class="col-5 for=" editEmail"><?php etranslate('Email') ?>: </label>
<input type="email" class="col-7 form-control" id="editEmail" name="editEmail" MAXLENGTH="75">
<label class="col-5" for="editEmail"><?php etranslate('Email') ?>: </label>
<input type="email" class="col-7 form-control" id="editEmail" name="editEmail" maxlength="75">
</div>
<div class="form-inline mt-1" id="div-editPassword1">
<label class="col-5 for=" editPassword1"><?php etranslate('Password') ?>: </label>
<label class="col-5" for="editPassword1"><?php etranslate('Password') ?>: </label>
<input type="password" class="col-7 form-control" id="editPassword1" name="editPassword1">
</div>
<div class="form-inline mt-1" id="div-editPassword2">
<label class="col-5 for=" editPassword2"><?php etranslate('Password (again)'); ?>: </label>
<label class="col-5" for="editPassword2"><?php etranslate('Password (again)'); ?>: </label>
<input type="password" class="col-7 form-control" id="editPassword2" name="editPassword2">
</div>
<div class="form-inline mt-1 mb-2" id="div-editEnabled">
<label class="col-5 for=" editEnabled"><?php etranslate('Enabled') ?>: </label>
<label class="col-5" for="editEnabled"><?php etranslate('Enabled') ?>: </label>
<?php echo print_radio('editEnabled'); ?>
</div>
<div class="form-inline mt-1 mb-2" id="div-editIsAdmin">
<label class="col-5 for=" editIsAdmin"><?php etranslate('Admin') ?>: </label>
<label class="col-5" for="editIsAdmin"><?php etranslate('Admin') ?>: </label>
<?php echo print_radio('editIsAdmin'); ?>
</div>

Expand Down Expand Up @@ -154,7 +154,7 @@
<div class="modal-body">
<!-- Error Alert -->
<div id="edit-password-dialog-alert" class="alert alert-danger" style="display: none">
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="changePasswordErrorMessage">A problem has been occurred while submitting your data.</span>
<strong><?php etranslate("Error"); ?>!</strong>&nbsp;<span id="changePasswordErrorMessage">A problem has occurred while submitting your data.</span>
<button type="button" class="close" onclick="$('.alert').hide()">&times;</button>
</div>
<form name="editPasswordForm" id="editPasswordForm">
Expand All @@ -163,11 +163,11 @@
<input disabled type="text" class="col-7 form-control" id="editPasswordUsername" name="editPasswordUsername">
</div>
<div class="form-inline mt-1" id="div-setPassword1">
<label class="col-5 for=" setPassword1"><?php etranslate('Password') ?>: </label>
<label class="col-5" for="setPassword1"><?php etranslate('Password') ?>: </label>
<input type="password" class="col-7 form-control" id="setPassword1" name="setPassword1">
</div>
<div class="form-inline mt-1" id="div-setPassword2">
<label class="col-5 for=" setPassword2"><?php etranslate('Password (again)'); ?>: </label>
<label class="col-5" for="setPassword2"><?php etranslate('Password (again)'); ?>: </label>
<input type="password" class="col-7 form-control" id="setPassword2" name="setPassword2">
</div>

Expand Down Expand Up @@ -201,7 +201,7 @@
<div class="p-3"><?php echo $areYouSure; ?></div>
<div class="p-3 m-3 text-danger"><?php echo $deleteUserInfo; ?></div>
<form name="deleteUserForm" id="deleteUserForm">
<div class="form-inline" is="divdeleteUsername">
<div class="form-inline" id="divdeleteUsername">
<label class="col-5" for="deleteUsername"><?php etranslate('Username') ?>: </label>
<input disabled type="text" class="col-7 form-control" id="deleteUsername" name="deleteUsername">
</div>
Expand Down
14 changes: 8 additions & 6 deletions view_entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,15 @@
if ($single_user == 'N' && !empty($createby_fullname)) {
echo '<div class="row"><div class="col-3">' . translate('Created by') . "</div>\n";
echo '<div class="col-9">';
if ($is_private && !access_is_enabled()) {
echo '[' . translate('Private') . ']';
} else if ($is_confidential && !access_is_enabled()) {
echo '[' . translate('Confidential') . ']';

if ( ! access_is_enabled() ) {
if ( $is_private ) {
echo '[' . translate ( 'Private' ) . ']';
} elseif ( $is_confidential ) {
echo '[' . translate ( 'Confidential' ) . ']';
}
} else {
if (access_is_enabled()) {
$can_email = access_user_calendar('email', $create_by);
$can_email = access_user_calendar ( 'email', $create_by );
}
$pubAccStr = ($row[0] == '__public__') ? translate('Public Access') : $createby_fullname;
if (strlen($email_addr) && $can_email != 'N') {
Expand Down