Commit 8b98d777 authored by gillesm's avatar gillesm

[NEW] Preparation of Group to alert by mail in Calendar

parent 7384a429
......@@ -5166,6 +5166,7 @@ $lang=Array(
"Permissions" => "Droits d'accès",
"Add Event" => "Ajouter un évènement",
"Custom Locations" => "Lieux configurables",
"Group of users alerted when calendar event is modified"=>"Groupe d'utilisateurs alerté quand le calendrier est modifié",
"Custom Participants" => "Participants configurables",
"Custom Categories" => "Catégories configurables",
"Custom Languages" => "Langues configurables",
......
......@@ -3,7 +3,7 @@
{if $calendarId}
<div class="navbar">
{button _text="{tr}Create Calendar{/tr}" href="tiki-admin_calendars.php?show=mod"}
</div>
</div>
{/if}
{if $prefs.feature_tabs eq 'y'}
......@@ -173,6 +173,16 @@
{tr}Show in popup box{/tr}<input type="checkbox" name="show[status]" value="on"{if $info.show_status eq 'y'} checked="checked"{/if} />
{tr}Show in calendar view{/tr}<input type="checkbox" name="show[status_calview]" value="on"{if $info.show_status_calview ne 'n'} checked="checked"{/if} />
</td></tr>
<tr class="formcolor">
<td>{tr}Group of users alerted when calendar event is modified{/tr}</td>
<td>
<select id="groupforAlert" name="groupforAlert">
<option value="">&nbsp;</option>
{foreach key=k item=i from=$groupforAlertList}
<option value="{$k}" {$i}>{$k}</option>
{/foreach}
</select></td>
</tr>
<tr class="formcolor"><td>&nbsp;</td><td><input type="submit" name="save" value="{tr}Save{/tr}" /></td></tr>
</table>
<br />
......
......@@ -32,7 +32,7 @@ if (isset($_REQUEST["drop"])) {
$calendarlib->drop_calendar($_REQUEST["drop"]);
$_REQUEST["calendarId"] = 0;
} else {
key_get($area);
key_get($area);
}
}
......@@ -46,11 +46,13 @@ if (isset($_REQUEST["save"])) {
$customflags["customsubscription"] = isset($_REQUEST["customsubscription"]) ? $_REQUEST["customsubscription"] : 'n';
$customflags["personal"] = $_REQUEST["personal"];
$customflags['customstatus'] = isset($_REQUEST['customstatus']) ? $_REQUEST['customstatus'] : 'y';
$customflags['groupforAlert']=$_REQUEST['groupforAlert'];
$options = $_REQUEST['options'];
if (!preg_match('/^[0-9a-fA-F]{3,6}$/',$options['customfgcolor'])) $options['customfgcolor'] = '000000';
if (!preg_match('/^[0-9a-fA-F]{3,6}$/',$options['custombgcolor'])) $options['custombgcolor'] = 'ffffff';
$options['startday'] = $_REQUEST['startday_Hour']*60*60;
$options['endday'] = $_REQUEST['endday_Hour']*60*60 - 1;
$extra = array('calname','description','location','description','language','category','participants','url', 'status', 'status_calview');
foreach ($extra as $ex) {
if (isset($_REQUEST['show'][$ex]) and $_REQUEST['show'][$ex] == 'on') {
......@@ -121,6 +123,8 @@ if ($_REQUEST["calendarId"]) {
$info["personal"] = 'n';
$info["startday"] = '25200';
$info["endday"] = '72000';
$info["groupforAlertList"] = array();
$info["groupforAlert"] = '';
$info["defaulteventstatus"] = 0;
if (!empty($_REQUEST['show']) && $_REQUEST['show'] == 'mod') {
$cookietab = '2';
......@@ -128,6 +132,14 @@ if ($_REQUEST["calendarId"]) {
$cookietab = 1;
}
}
$all_groups = $userlib->list_all_groups();
if ( is_array($all_groups) ) {
foreach ( $all_groups as $g ){
$groupforAlertList[$g] = ( $g == $info["groupforAlert"] ) ? 'selected' : '';
}
}
setcookie('tab', $cookietab);
$smarty->assign_by_ref('cookietab', $cookietab);
......@@ -152,6 +164,9 @@ $smarty->assign('show_participants', $info["show_participants"]);
$smarty->assign('show_url', $info["show_url"]);
$smarty->assign('calendarId', $_REQUEST["calendarId"]);
$smarty->assign('personal', $info["personal"]);
$smarty->assign('groupforAlert', $info["groupforAlert"]);
$smarty->assign_by_ref('groupforAlertList', $groupforAlertList);
$smarty->assign('startday', $info["startday"] < 0 ?0: round($info['startday']/(60*60)));
$smarty->assign('endday', $info["endday"] < 0 ?0: round($info['endday']/(60*60)));
$smarty->assign('hours', array('0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24'));
......
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