Skip to content

Commit

Permalink
Merge pull request #90 from bbannon/edit_entry.php_variables
Browse files Browse the repository at this point in the history
Edit entry.php variables
  • Loading branch information
craigk5n committed Jul 16, 2018
2 parents af18111 + 8866ce7 commit 5525ad5
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions includes/js/edit_entry.php
Expand Up @@ -4,20 +4,22 @@

$user = $arinc[3];

// Craig. This would be a good place to use the Date functions in js/chapman.js
// These arrays are already set. And translated. Wouldn't have to redo them again.
// There are other such places, too.
?>
var bydayAr = bymonthdayAr = bysetposAr = [];
var bydayLabels = ["SU","MO","TU","WE","TH","FR","SA"];
var bydayTrans = [

/* These are set in translate.js.php
However, I've changed the names here to match everywhere else.
var byday_labels = ['SU','MO','TU','WE','TH','FR','SA'];
var byday_names = [
"<?php etranslate ( 'SU' ) ?>"
, "<?php etranslate ( 'MO' ) ?>"
, "<?php etranslate ( 'TU' ) ?>"
, "<?php etranslate ( 'WE' ) ?>"
, "<?php etranslate ( 'TH' ) ?>"
, "<?php etranslate ( 'FR' ) ?>"
, "<?php etranslate ( 'SA' ) ?>"];
*/

// do a little form verifying
function validate_and_submit() {
if ( form.name.value == "" ) {
Expand All @@ -28,7 +30,7 @@ function validate_and_submit() {
showTab( 'details' );
<?php } ?>
form.name.focus();
alert ( "<?php etranslate ( 'You have not entered a Brief Description', true)?>.");
alert ( "<?php etranslate ( 'You have not entered a Brief Description.', true )?>");
return false;
}
if ( form.timetype &&
Expand Down Expand Up @@ -91,6 +93,7 @@ function validate_and_submit() {
var y = form.year.selectedIndex;
var valy = form.year.options[y].value;
var c = new Date(valy,valm -1,vald);

if ( c.getDate() != vald ) {
alert ("<?php etranslate ( 'Invalid Event Date', true)?>.");
form.day.focus();
Expand Down Expand Up @@ -347,7 +350,7 @@ function rpttype_weekly() {
var valy = form.year.options[y].value;
var c = new Date(valy,valm,vald);
var dayOfWeek = c.getDay();
var rpt_day = bydayLabels[dayOfWeek];
var rpt_day = byday_labels[dayOfWeek];
elements[rpt_day].checked = true;
}
}
Expand Down Expand Up @@ -456,8 +459,8 @@ function del_selected() {
}

function toggle_byday( ele ) {
var bydaytext = bydayTrans[ele.id.substr(2,1)];
var bydayVal = bydayLabels[ele.id.substr(2,1)];
var bydaytext = byday_names[ele.id.substr(2,1)];
var bydayVal = byday_labels[ele.id.substr(2,1)];
var tmp = '';
if (ele.value.length > 4 ) {
//blank
Expand Down

0 comments on commit 5525ad5

Please sign in to comment.