Should finish the basic holiday management.

This commit is contained in:
skeeter 2001-05-19 04:43:55 +00:00
parent a1491eda4a
commit d33f029162

View File

@ -37,6 +37,19 @@
{ {
$holiday['mday'] = 0; $holiday['mday'] = 0;
} }
if(!isset($locale) || $locale=='')
{
$locale = $holiday['locale'];
}
elseif(!isset($holiday['locale']) || $holiday['locale']=='')
{
$holiday['locale'] = $locale;
}
if(!isset($holiday['hol_id']))
{
$holiday['hol_id'] = $id;
}
// Still need to put some validation in here..... // Still need to put some validation in here.....
$ok = True; $ok = True;
@ -62,8 +75,11 @@
$title_descriptor = 'Edit'; $title_descriptor = 'Edit';
} }
else else
{
if(isset($locale) && $locale)
{ {
$holiday['locale'] = $locale; $holiday['locale'] = $locale;
}
$holiday['name'] = ''; $holiday['name'] = '';
$holiday['day'] = 0; $holiday['day'] = 0;
$holiday['month'] = 0; $holiday['month'] = 0;
@ -99,9 +115,7 @@
} }
$actionurl = $phpgw->link('/calendar/editholiday.php'); $actionurl = $phpgw->link('/calendar/editholiday.php');
$hidden_vars = '<input type="hidden" name="holiday[locale]" value="'.$locale.'">'."\n" $hidden_vars = '<input type="hidden" name="locale" value="'.$locale.'">'."\n"
. '<input type="hidden" name="holiday[hol_id]" value="'.$id.'">'."\n"
. '<input type="hidden" name="locale" value="'.$locale.'">'."\n"
. '<input type="hidden" name="id" value="'.$id.'">'."\n"; . '<input type="hidden" name="id" value="'.$id.'">'."\n";
$var = Array( $var = Array(
@ -113,6 +127,12 @@
$t->set_var($var); $t->set_var($var);
// Locale
if(!isset($locale))
{
display_item($t,lang('Country'),'<input name="holiday[locale]" size="2" maxlength="2" value="">');
}
// Title/Name // Title/Name
display_item($t,lang('title'),'<input name="holiday[name]" size="25" maxlength="50" value="'.$holiday['name'].'">'); display_item($t,lang('title'),'<input name="holiday[name]" size="25" maxlength="50" value="'.$holiday['name'].'">');
@ -175,8 +195,19 @@
$t->set_var('lang_add',lang('Save')); $t->set_var('lang_add',lang('Save'));
$t->set_var('lang_reset',lang('Reset')); $t->set_var('lang_reset',lang('Reset'));
if(isset($locale) && $locale)
{
$action_url_button = $phpgw->link('/calendar/editlocale.php','locale='.$locale);
}
else
{
$action_url_button = $phpgw->link('/calendar/holiday_admin.php');
}
$var = Array( $var = Array(
'action_url_button' => $phpgw->link('/calendar/editlocale.php','locale='.$locale), 'action_url_button' => $action_url_button,
'action_text_button' => lang('Cancel'), 'action_text_button' => lang('Cancel'),
'action_confirm_button' => '', 'action_confirm_button' => '',
'action_extra_field' => '' 'action_extra_field' => ''