Main Page | Directories | File List | File Members

editgroupnotifications.php

Go to the documentation of this file.
00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: editgroupnotifications.php 5429 2006-02-17 22:59:20Z toddy $
00006 #
00007 #  Copyright 2003-2004 (c) Yves Perrin <Yves.Perrin@cern.ch>
00008 #                          Mathieu Roy <yeupou--at--gnu.org>
00009 #
00010 # The Savane project is free software; you can redistribute it and/or
00011 # modify it under the terms of the GNU General Public License
00012 # as published by the Free Software Foundation; either version 2
00013 # of the License, or (at your option) any later version.
00014 #
00015 # The Savane project is distributed in the hope that it will be useful,
00016 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 # GNU General Public License for more details.
00019 #
00020 # You should have received a copy of the GNU General Public License
00021 # along with the Savane project; if not, write to the Free Software
00022 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00023 
00024 
00025 require "../../include/pre.php";
00026 require $GLOBALS['sys_www_topdir']."/include/vars.php";
00027 
00028 require_directory("trackers");
00029 
00030 session_require(array('group'=>$group_id,'admin_flags'=>'A'));
00031 
00032 if ($update)
00033 {
00034 
00035   group_add_history('Changed Group Notification Settings','',$group_id);
00036 
00037   $res_new = trackers_data_post_notification_settings($group_id, "bugs");
00038   $res_new = trackers_data_post_notification_settings($group_id, "support");
00039   $res_new = trackers_data_post_notification_settings($group_id, "task");
00040   $res_new = trackers_data_post_notification_settings($group_id, "patch");
00041   $res_new = trackers_data_post_notification_settings($group_id, "cookbook");
00042   db_query("UPDATE groups SET "
00043            ."new_news_address=".($form_news_address? "'".safeinput($form_news_address)."' " : "''")
00044            . " WHERE group_id=$group_id");
00045 
00046  
00047   # CERN SPECIFIC (at least for now) BEGIN
00048   ######### Notification content
00049 
00050   if ($sys_default_domain == "savannah.cern.ch" || $sys_debug_cerntest)
00051     {
00052       if (group_set_preference($group_id, "notif_content", safeinput($notif_content)))
00053         { fb(_("Successfully updated notification content settings")); }
00054       else
00055         { fb(_("Failed to update notification content settings"), 1); } 
00056     }
00057   # CERN SPECIFIC (at least for now) END
00058 
00059 
00060   ######### Reminder
00061   if (group_set_preference($group_id, "batch_frequency", safeinput($form_frequency)))
00062     { fb(_("Successfully Updated Reminder Settings")); }
00063   else
00064     { fb(_("Failed to Update Reminder Setting"), 1); }
00065 
00066   if (group_get_preference($group_id, "batch_lastsent") == "")
00067     { 
00068       if (group_set_preference($group_id, "batch_lastsent", "0"))
00069         { fb(_("Successfully set Timestamp of the Latest Reminder")); }
00070       else
00071         { fb(_("Failed to Reset Timestamp of the Latest Reminder"), 1); }
00072     }
00073 
00074 }
00075 
00076 # update info for page
00077 $res_grp = db_query("SELECT * FROM groups WHERE group_id=$group_id");
00078 if (db_numrows($res_grp) < 1)
00079 {
00080   exit_no_group();
00081 }
00082 $row_grp = db_fetch_array($res_grp);
00083 
00084 
00085 site_project_header(array('title'=>_("Editing Notification settings"),'group'=>$group_id,'context'=>'ahome'));
00086 
00087 
00088 
00089 # ####################################### General Description
00090 
00091 print '
00092 <form action="'.$PHP_SELF.'" method="post">
00093 <input type="hidden" name="group_id" value="'.$group_id.'" />';
00094 
00095 print '<h3>'.("Bug Trackers Email Notification Settings").'</h3>';
00096 trackers_data_show_notification_settings($group_id, 'bugs', 0);
00097 print '<br />';
00098 
00099 print '<h3>'._("Support Tracker Email Notification Settings").'</h3>';
00100 trackers_data_show_notification_settings($group_id, 'support', 0);
00101 print '<br />';
00102 
00103 print '<h3>'._("Task Tracker Email Notification Settings").'</h3>';
00104 trackers_data_show_notification_settings($group_id, 'task', 0);
00105 print '<br />';
00106 
00107 print '<h3>'._("Patch Tracker Email Notification Settings").'</h3>';
00108 trackers_data_show_notification_settings($group_id, 'patch', 0);
00109 print '<br />';
00110 
00111 print '<h3>'._("Cookbook Manager Email Notification Settings").'</h3>';
00112 trackers_data_show_notification_settings($group_id, 'cookbook', 0);
00113 print '<br />';
00114 
00115 # yeupou--gnu.org 2004-09-17: in the end, the goal is to make news
00116 # using the common tracker code
00117 print '<h3>'._("News Manager Email Notification Settings").'</h3>';
00118 print '<span class="preinput">'._("Carbon-Copy List:").'</span><br />&nbsp;&nbsp;<INPUT TYPE="TEXT" NAME="form_news_address" VALUE="'.$row_grp['new_news_address'].'" SIZE="40" MAXLENGTH="255" />';
00119 print '<br /><br />';
00120 
00121 # CERN SPECIFIC (at least for now) BEGIN
00122 # As it is CERN specific, it will not be translated, as LCG Savannah is
00123 # in english only.
00124 if ($sys_default_domain == "savannah.cern.ch" || $sys_debug_cerntest)
00125 {
00126   print '<h3>'."Notification Email Content".'</h3>';
00127   print '<p>'."The notification emails include the last change [minimum] (standard of upstream Savane), but can also append the item overview [average] and possibly all the followup comments [maximum] (traditional LCG Savannah).".'</p>';
00128   $mail_content = array("0" => "Minimum (standard of upstream Savane)", "1" => "Medium", "2" => "Maximum (traditional LCG Savannah)");
00129   print '<span class="preinput">'."Email content:".'</span> &nbsp;&nbsp;';
00130   $current_content = group_get_preference($group_id, "notif_content");
00131   if ($current_content == "") 
00132     { $current_content = 2; }
00133   print html_build_select_box_from_array($mail_content,
00134                                          "notif_content",
00135                                          $current_content);
00136   print '<br /><br />';
00137 }
00138 # CERN SPECIFIC (at least for now) END
00139 
00140 print '<h3>'._("Reminders").'</h3>';
00141 print '<p>'._("You can configure the project so that reminder emails get sent to project members who have opened items with priority higher than 5 assigned to them.").'<br/><span class="warn">'._("This will be done regardless of the fact project members have or have not requested to receive such reminders via their personal notification settings!").'</span></p>
00142 ';
00143 $frequency = array("0" => _("None"),
00144                    "1" => _("Daily"),
00145                    "2" => _("Weekly"),
00146                    "3" => _("Monthly"));
00147 
00148 print '<span class="preinput">'._("Frequency of reminders:").'</span> &nbsp;&nbsp;';
00149 print html_build_select_box_from_array($frequency, 
00150                                        "form_frequency", 
00151                                        group_get_preference($group_id, "batch_frequency"));
00152 
00153 
00154 
00155 
00156 print '
00157 <p align="center"><input type="submit" name="update" value="'._("Update").'" />
00158 </form>
00159 ';
00160 
00161 site_project_footer(array());
00162 
00163 ?>

Generated on Sun Feb 26 13:23:03 2006 for Savane PHP Frontend Developer Reference by  doxygen 1.4.4