fix for new entries

This commit is contained in:
skeeter 2000-12-06 12:15:45 +00:00
parent 921954c7bd
commit a11423802d
2 changed files with 50 additions and 11 deletions

View File

@ -41,7 +41,7 @@
$cal_info = $phpgw->common->appsession(); $cal_info = $phpgw->common->appsession();
$can_edit = true; $can_edit = true;
} else { } else {
// $cal_info->owner = $phpgw_info["user"]["account_id"]; $cal_info->owner = $phpgw_info["user"]["account_id"];
$can_edit = true; $can_edit = true;
if (!isset($day) || !$day) if (!isset($day) || !$day)

View File

@ -9,34 +9,73 @@ function validate_and_submit() {
document.addform.name.focus(); document.addform.name.focus();
return false; return false;
} }
h = parseInt(document.addform.hour.value); sh = parseInt(document.addform.hour.value);
m = parseInt(document.addform.minute.value); sm = parseInt(document.addform.minute.value);
if (h < 0 || h > 23) { if (sh < 0 || sh > 23) {
alert ("{time_error}"); alert ("{time_error}");
document.addform.hour.select(); document.addform.hour.select();
document.addform.hour.focus(); document.addform.hour.focus();
return false; return false;
} }
if (m < 0 || m > 59) { if (sm < 0 || sm > 59) {
alert ("{time_error}"); alert ("{time_error}");
document.addform.minute.select(); document.addform.minute.select();
document.addform.minute.focus(); document.addform.minute.focus();
return false; return false;
} }
h = parseInt(document.addform.end_hour.value); eh = parseInt(document.addform.end_hour.value);
m = parseInt(document.addform.end_minute.value); em = parseInt(document.addform.end_minute.value);
if (h < 0 || h > 23) { if (eh < 0 || eh > 23) {
alert ("{time_error}"); alert ("{time_error}");
document.addform.end_hour.select(); document.addform.end_hour.select();
document.addform.end_hour.focus(); document.addform.end_hour.focus();
return false; return false;
} }
if (m < 0 || m > 59) { if (em < 0 || em > 59) {
alert ("{time_error}"); alert ("{time_error}");
document.addform.end_minute.select(); document.addform.end_minute.select();
document.addform.end_minute.focus(); document.addform.end_minute.focus();
return false; return false;
} }
// so = parseInt(document.addform.month.value);
// sd = parseInt(document.addform.day.value);
// sy = parseInt(document.addform.year.value);
// eo = parseInt(document.addform.end_month.value);
// ed = parseInt(document.addform.end_day.value);
// ey = parseInt(document.addform.end_year.value);
// if (sy == ey && so == eo && sd == ed) {
// if (sh > eh) {
// alert ("{time_error}");
// document.addform.end_hour.select();
// document.addform.end_hour.focus();
// return false;
// }
// if (sh == eh && sm > em) {
// alert ("{time_error}");
// document.addform.end_hour.select();
// document.addform.end_hour.focus();
// return false;
// }
// }
// if (sy == ey && so == eo && sd > ed) {
// alert ("{date_error}");
// document.addform.end_day.select();
// document.addform.end_day.focus();
// return false;
// }
// if (sy == ey && so > eo) {
// alert ("{date_error}");
// document.addform.end_month.select();
// document.addform.end_month.focus();
// return false;
// }
// if (sy > ey) {
// alert ("{date_error}");
// document.addform.end_year.select();
// document.addform.end_year.focus();
// return false;
// }
// would be nice to also check date to not allow Feb 31, etc... // would be nice to also check date to not allow Feb 31, etc...
document.addform.submit(); document.addform.submit();
// return true; // return true;
@ -56,8 +95,8 @@ function validate_and_submit() {
<!-- BEGIN edit_entry_end --> <!-- BEGIN edit_entry_end -->
</table> </table>
<!-- <input type="hidden" name="participant_list" value=""> --> <input type="button" value="{submit_button}" onClick="validate_and_submit();">
<input type="button" value="{submit_button}" onClick="validate_and_submit()"> <!-- <noscript><input type="button" value="{submit_button}"></noscript> -->
</form> </form>
{delete_button} {delete_button}