Commit 62e1b5be authored by sylvieg's avatar sylvieg

[NEW]calendar: option default new event to all day + option to put name of the event on each day

parent 4d9b9ec1
......@@ -136,6 +136,7 @@ class CalendarLib extends TikiLib
} else {
$cal['viewdays'] = $prefs['calendar_view_days'];
}
$cal = array_merge(array('allday'=>'n', 'nameoneachday' => 'n'), $cal);
return $cal;
}
......
......@@ -291,6 +291,14 @@
</td>
</tr>
{/if}
<tr>
<td>{tr}Default event to all day{/tr}</td>
<td><input type="checkbox" name="allday"{if $info.allday eq 'y'} checked="checked"{/if} /></td>
</tr>
<tr>
<td>{tr}Event name on each day in calendar view{/tr}</td>
<td><input type="checkbox" name="nameoneachday"{if $info.nameoneachday eq 'y'} checked="checked"{/if} /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
......
......@@ -56,7 +56,7 @@
{popup vauto=true hauto=true sticky=false fullhtml="1" text=$over|escape:"javascript"|escape:"html"}
{/if}>
{if $myurl eq "tiki-action_calendar.php" or ($cell[w][d].items[item].startTimeStamp >= $cell[w][d].day or $smarty.section.d.index eq '0' or $cell[w][d].firstDay)}
{if $myurl eq "tiki-action_calendar.php" or ($cell[w][d].items[item].startTimeStamp >= $cell[w][d].day or $smarty.section.d.index eq '0' or $cell[w][d].firstDay or $infocals[$cell[w][d].items[item].calendarId].nameoneachday eq 'y')}
<a style="padding:1px 3px;{if $cell[w][d].items[item].status eq '2'}text-decoration:line-through;{/if}"
{if $myurl eq "tiki-action_calendar.php"}
{if $cell[w][d].items[item].modifiable eq "y" || $cell[w][d].items[item].visible eq 'y'}href="{$cell[w][d].items[item].url}"{/if}
......
......@@ -82,6 +82,8 @@ if (isset($_REQUEST["save"])) {
}
}
if (isset($_REQUEST['viewdays'])) $options['viewdays'] = $_REQUEST['viewdays'];
$options['allday'] = isset($_REQUEST['allday'])? 'y':'n';
$options['nameoneachday'] = isset($_REQUEST['nameoneachday'])? 'y': 'n';
$_REQUEST["calendarId"] = $calendarlib->set_calendar($_REQUEST["calendarId"], $user, $_REQUEST["name"], $_REQUEST["description"], $customflags, $options);
$info = $calendarlib->get_calendar($_REQUEST['calendarId']);
if ($prefs['feature_groupalert'] == 'y') {
......
......@@ -398,6 +398,8 @@ if (isset($_REQUEST["delete"]) and ($_REQUEST["delete"]) and isset($_REQUEST["ca
} elseif (isset($_REQUEST['changeCal'])) {
$calitem = $save;
$calendar = $calendarlib->get_calendar($calitem['calendarId']);
if (empty($save['calitemId']))
$calitem['allday'] = $calendar['allday']=='y'?true: false;
$smarty->assign('edit',true);
$id = isset($save['calitemId'])?$save['calitemId']: 0;
$hour_minmax = ceil(($calendar['startday'])/(60*60)).'-'. ceil(($calendar['endday'])/(60*60));
......@@ -458,6 +460,7 @@ if (isset($_REQUEST["delete"]) and ($_REQUEST["delete"]) and isset($_REQUEST["ca
'end'=>$now_end,
'duration'=>(60*60),
'recurrenceId'=>0,
'allday'=>$calendar['allday']=='y'?true: false
);
$hour_minmax = abs(ceil(($calendar['startday']-1)/(60*60))). '-' . ceil(($calendar['endday'])/(60*60));
$id = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment