Revision: 1926
http://mrbs.svn.sourceforge.net/mrbs/?rev=1926&view=rev
Author: cimorrison
Date: 2011-09-06 10:51:48 +0000 (Tue, 06 Sep 2011)
Log Message:
-----------
Merged in latest changes from trunk
Modified Paths:
--------------
mrbs/branches/datatables/web/edit_entry.php
mrbs/branches/datatables/web/edit_entry_handler.php
mrbs/branches/datatables/web/functions_ical.inc
mrbs/branches/datatables/web/functions_mail.inc
mrbs/branches/datatables/web/lang.en
mrbs/branches/datatables/web/mrbs-ielte6.css
mrbs/branches/datatables/web/mrbs.css.php
mrbs/branches/datatables/web/mrbs_sql.inc
Property Changed:
----------------
mrbs/branches/datatables/
mrbs/branches/datatables/web/upgrade/5/pgsql.sql
Property changes on: mrbs/branches/datatables
___________________________________________________________________
Modified: svn:mergeinfo
- /mrbs/branches/custom_entry_fields:1374-1396
/mrbs/branches/datepicker:1409-1416
/mrbs/branches/disabled_rooms:1601-1634
/mrbs/branches/from_to_bookings:1491-1587
/mrbs/branches/ics_attachments:1652-1741
/mrbs/branches/improve_css_2008_06:804-872
/mrbs/branches/only_unicode:1747-1749
/mrbs/branches/provisional_bookings:1242-1280
/mrbs/branches/provisional_bookings_new_style:1407-1570
/mrbs/trunk:1863-1921
+ /mrbs/branches/custom_entry_fields:1374-1396
/mrbs/branches/datepicker:1409-1416
/mrbs/branches/disabled_rooms:1601-1634
/mrbs/branches/from_to_bookings:1491-1587
/mrbs/branches/ics_attachments:1652-1741
/mrbs/branches/improve_css_2008_06:804-872
/mrbs/branches/only_unicode:1747-1749
/mrbs/branches/provisional_bookings:1242-1280
/mrbs/branches/provisional_bookings_new_style:1407-1570
/mrbs/trunk:1863-1925
Modified: mrbs/branches/datatables/web/edit_entry.php
===================================================================
--- mrbs/branches/datatables/web/edit_entry.php 2011-09-05 18:12:46 UTC (rev
1925)
+++ mrbs/branches/datatables/web/edit_entry.php 2011-09-06 10:51:48 UTC (rev
1926)
@@ -515,7 +515,7 @@
?>
// do a little form verifying
-function validate(form)
+function validate(form_id)
{
<?php
// First of all check that a name (brief description) has been entered.
@@ -523,6 +523,7 @@
// being entered via a SELECT box there's no need to do this because there's
// bound to be a value and the test below will fail on some browsers (eg IE)
?>
+ var form = document.getElementById(form_id);
if (form.name.tagName.toLowerCase() == 'input')
{
// null strings and spaces only strings not allowed
@@ -727,7 +728,7 @@
?>
-<form class="form_general" id="main" action="edit_entry_handler.php"
method="post" onsubmit="return validate(this)">
+<form class="form_general" id="main" action="edit_entry_handler.php"
method="post">
<fieldset>
<legend><?php echo get_vocab($token); ?></legend>
@@ -1231,11 +1232,20 @@
echo "<input type=\"hidden\" name=\"id\" value=\"$id\">\n";
}
+ // Buttons
+ echo "<fieldset class=\"submit_buttons\">\n";
+ echo "<legend></legend>\n";
+ // The Back button
+ echo "<div id=\"edit_entry_submit_back\">\n";
+ echo "<input class=\"submit\" type=\"submit\" name=\"back_button\"
value=\"" . get_vocab("back") . "\">\n";
+ echo "</div>\n";
+
// The Submit button
- echo "<div id=\"edit_entry_submit\">\n";
- echo "<input class=\"submit\" type=\"submit\" name=\"save_button\"
value=\"".
- get_vocab("save") . "\">\n";
+ echo "<div id=\"edit_entry_submit_save\">\n";
+ echo "<input class=\"submit\" type=\"submit\" name=\"save_button\"
value=\"" .
+ get_vocab("save") . "\" onclick=\"return validate('main')\">\n";
echo "</div>\n";
+ echo "</fieldset>";
?>
</fieldset>
</form>
Modified: mrbs/branches/datatables/web/edit_entry_handler.php
===================================================================
--- mrbs/branches/datatables/web/edit_entry_handler.php 2011-09-05 18:12:46 UTC
(rev 1925)
+++ mrbs/branches/datatables/web/edit_entry_handler.php 2011-09-06 10:51:48 UTC
(rev 1926)
@@ -50,7 +50,8 @@
'start_year' => 'int',
'end_day' => 'int',
'end_month' => 'int',
- 'end_year' => 'int');
+ 'end_year' => 'int',
+ 'back_button' => 'string');
foreach($formvars as $var => $var_type)
{
@@ -155,6 +156,13 @@
$returl = $returl_base[0];
}
+// BACK: we didn't really want to be here - send them to the returl
+if (!empty($back_button))
+{
+ header("Location: $returl");
+ exit();
+}
+
// If we haven't been given a sensible date then get out of here and don't
trey and make a booking
if (!isset($day) || !isset($month) || !isset($year) || !checkdate($month,
$day, $year))
{
@@ -429,8 +437,8 @@
{
$reps = mrbsGetRepeatEntryList($starttime,
isset($end_date) ? $end_date : 0,
- $rep_type, $rep_opt, $max_rep_entrys,
- $rep_num_weeks);
+ $rep_type, $rep_opt, $rep_num_weeks,
+ $max_rep_entrys);
}
// When checking for overlaps, for Edit (not New), ignore this entry and
series:
@@ -796,14 +804,14 @@
if (array_key_exists($field['name'], $custom_fields))
{
echo "<input type=\"hidden\"" .
- "name=\"" . VAR_PREFIX . $field['name'] . "\"" .
- "value=\"" .
htmlspecialchars($custom_fields[$field['name']]) . "\">\n";
+ " name=\"" . VAR_PREFIX . $field['name'] . "\"" .
+ " value=\"" .
htmlspecialchars($custom_fields[$field['name']]) . "\">\n";
}
}
// Submit button
echo "<input type=\"submit\"" .
- "value=\"" . get_vocab("skip_and_book") . "\"" .
- "title=\"" . get_vocab("skip_and_book_note") . "\">\n";
+ " value=\"" . get_vocab("skip_and_book") . "\"" .
+ " title=\"" . get_vocab("skip_and_book_note") . "\">\n";
echo "</fieldset>\n";
echo "</form>\n";
}
Modified: mrbs/branches/datatables/web/functions_ical.inc
===================================================================
--- mrbs/branches/datatables/web/functions_ical.inc 2011-09-05 18:12:46 UTC
(rev 1925)
+++ mrbs/branches/datatables/web/functions_ical.inc 2011-09-06 10:51:48 UTC
(rev 1926)
@@ -771,8 +771,8 @@
$start_row['end_date'],
$start_row['rep_type'],
$start_row['rep_opt'],
- PHP_INT_MAX,
-
$start_row['rep_num_weeks']);
+ $start_row['rep_num_weeks'],
+ PHP_INT_MAX);
// And keep an array of all the entries we actually see
$actual_entries = array();
// Create the series event
Modified: mrbs/branches/datatables/web/functions_mail.inc
===================================================================
--- mrbs/branches/datatables/web/functions_mail.inc 2011-09-05 18:12:46 UTC
(rev 1925)
+++ mrbs/branches/datatables/web/functions_mail.inc 2011-09-06 10:51:48 UTC
(rev 1926)
@@ -382,23 +382,65 @@
}
-// Generate the list of bookings that could not be made due to conflicts
-function create_body_exceptions($skip_list, $as_html)
+// Generate a list of dates from an array of start times
+//
+// $dates an array of start times
+// $as_html (boolean) whether the list should be HTML or plain text
+function create_date_list($dates, $as_html)
{
- // The introductory text
- $result = ($as_html) ? "<p>" : "\n\n";
- $result .= get_vocab("mail_body_exceptions");
- $result .= ($as_html) ? "</p>\n" : "\n\n";
- // Now the list of conflicts
- $result .= ($as_html) ? "<ul>\n" : "";
- foreach ($skip_list as $date)
+ $result = ($as_html) ? "<ul>\n" : "";
+ foreach ($dates as $date)
{
$result .= ($as_html) ? "<li>" : "";
$result .= getMailDateString($date);
$result .= ($as_html) ? "</li>" : "\n";
}
$result .= ($as_html) ? "</ul>\n" : "";
+ return $result;
+}
+
+
+// Generate a list of repeat dates for a series
+function create_repeat_list($data, $as_html)
+{
+ global $max_rep_entrys;
+ if ($data['rep_type'] == REP_NONE)
+ {
+ return;
+ }
+
+ // The introductory text
+ $result = ($as_html) ? "<p>" : "\n\n";
+ $result .= get_vocab("mail_body_repeats");
+ $result .= ($as_html) ? "</p>\n" : "\n\n";
+
+ $reps = mrbsGetRepeatEntryList($data['start_time'],
+ $data['end_date'],
+ $data['rep_type'],
+ $data['rep_opt'],
+ $data['rep_num_weeks'],
+ $max_rep_entrys);
+
+ // Remove any dates that could not be booked due to conflicts
+ if (!empty($data['skip_list']))
+ {
+ $reps = array_diff($reps, $data['skip_list']);
+ }
+
+ $result .= create_date_list($reps, $as_html);
+
+ // Now add in the list of repeat bookings that could not be booked
+ if (!empty($data['skip_list']))
+ {
+ // The introductory text
+ $result .= ($as_html) ? "<p>" : "\n\n";
+ $result .= get_vocab("mail_body_exceptions");
+ $result .= ($as_html) ? "</p>\n" : "\n\n";
+ // Now the list of conflicts
+ $result .= create_date_list($data['skip_list'], $as_html);
+ }
+
return $result;
}
@@ -693,10 +735,13 @@
$body .= "</table>\n";
}
- // Now add in the list of repeat bookings that could not be booked
- if (!empty($data['skip_list']))
+ // Add in a list of repeat dates. Although we've given them the repeat
charateristics
+ // above, it's often helpful to have this expanded out into a list of actual
dates to
+ // avoid any confusion. The repeat list also gives a list of dates that
could not
+ // be booked due to conflicts.
+ if ($data['rep_type'] != REP_NONE)
{
- $body .= create_body_exceptions($data['skip_list'], $as_html);
+ $body .= create_repeat_list($data, $as_html);
}
if ($as_html)
Modified: mrbs/branches/datatables/web/lang.en
===================================================================
--- mrbs/branches/datatables/web/lang.en 2011-09-05 18:12:46 UTC (rev
1925)
+++ mrbs/branches/datatables/web/lang.en 2011-09-06 10:51:48 UTC (rev
1926)
@@ -160,7 +160,8 @@
$vocab["mail_body_rej_entry"] = "An entry has been rejected by the
administrators, here are the details:";
$vocab["mail_body_more_info"] = "The administrators require more
information about an entry; here are the details:";
$vocab["mail_body_reminder"] = "Reminder - an entry is awaiting approval;
here are the details:";
-$vocab["mail_body_exceptions"] = "The following bookings could not be made
due to conflicts:";
+$vocab["mail_body_repeats"] = "The following dates were booked:";
+$vocab["mail_body_exceptions"] = "The following dates could not be booked
due to conflicts:";
$vocab["mail_subject_new_entry"] = "Entry added for $mrbs_company MRBS";
$vocab["mail_subject_changed_entry"] = "Entry changed for $mrbs_company MRBS";
$vocab["mail_subject_delete"] = "Entry deleted for $mrbs_company MRBS";
Modified: mrbs/branches/datatables/web/mrbs-ielte6.css
===================================================================
--- mrbs/branches/datatables/web/mrbs-ielte6.css 2011-09-05 18:12:46 UTC
(rev 1925)
+++ mrbs/branches/datatables/web/mrbs-ielte6.css 2011-09-06 10:51:48 UTC
(rev 1926)
@@ -31,6 +31,7 @@
/* ------------ FORM_GENERAL ------------------------*/
.form_general input {display: inline} /* stops IE6 "double margin float
bug" appearing */
.form_general input.submit {display: inline} /* stops IE6 "double margin float
bug" appearing */
+#edit_room fieldset.submit_buttons, #main fieldset.submit_buttons {width: auto}
/* ------------ TRAILER.INC ---------------------*/
#trailer div.trailer_label {text-align: right} /* max-width does not work in
IE6, so this keeps it looking OK */
Modified: mrbs/branches/datatables/web/mrbs.css.php
===================================================================
--- mrbs/branches/datatables/web/mrbs.css.php 2011-09-05 18:12:46 UTC (rev
1925)
+++ mrbs/branches/datatables/web/mrbs.css.php 2011-09-06 10:51:48 UTC (rev
1926)
@@ -577,16 +577,18 @@
.edit_area_room .form_general #booking_policies input.text {width: 2.0em}
.form_general input.submit {display: block; width: auto; float: left; clear:
left; margin-top: 1.0em}
-div#edit_entry_submit {width: <?php echo $general_left_col_width ?>%;
max-width: <?php echo $edit_entry_left_col_max_width ?>em}
div#report_submit {width: <?php echo $general_left_col_width ?>%;
max-width: <?php echo $report_left_col_max_width ?>em}
div#search_submit {width: <?php echo $general_left_col_width ?>%;
max-width: <?php echo $search_left_col_max_width ?>em}
div#logon_submit {width: <?php echo $general_left_col_width ?>%;
max-width: <?php echo $logon_left_col_max_width ?>em}
div#db_logon_submit {width: <?php echo $general_left_col_width ?>%;
max-width: <?php echo $db_logon_left_col_max_width ?>em}
-#edit_entry_submit input, #report_submit input, #search_submit input,
#logon_submit input, #db_logon_submit input
+#report_submit input, #search_submit input, #logon_submit input,
#db_logon_submit input
{position: relative; left: 100%; width: auto}
div#edit_area_room_submit_back {float: left; width: <?php echo
$edit_area_room_left_col_width ?>em; max-width: <?php echo
$edit_area_room_left_col_max_width ?>em}
div#edit_area_room_submit_save {float: left; clear: none; width: auto}
#edit_area_room_submit_back input {float: right}
+div#edit_entry_submit_back {float: left; width: <?php echo
$general_left_col_width ?>em; max-width: <?php echo
$edit_entry_left_col_max_width ?>em}
+div#edit_entry_submit_save {float: left; clear: none; width: auto}
+#edit_entry_submit_back input {float: right}
.form_general .div_dur_mins input{width: 4.0em}
.form_general .div_time input {width: 2.0em}
Modified: mrbs/branches/datatables/web/mrbs_sql.inc
===================================================================
--- mrbs/branches/datatables/web/mrbs_sql.inc 2011-09-05 18:12:46 UTC (rev
1925)
+++ mrbs/branches/datatables/web/mrbs_sql.inc 2011-09-06 10:51:48 UTC (rev
1926)
@@ -512,8 +512,8 @@
* empty - The entry does not repeat
* an array - This is a list of start times of each of the repeat entrys
*/
-function mrbsGetRepeatEntryList($time, $enddate, $rep_type, $rep_opt,
- $max_ittr, $rep_num_weeks)
+function mrbsGetRepeatEntryList($time, $enddate, $rep_type, $rep_opt,
$rep_num_weeks,
+ $max_ittr)
{
$sec = date("s", $time);
$min = date("i", $time);
@@ -645,7 +645,7 @@
$reps = mrbsGetRepeatEntryList($data['start_time'], $data['end_date'],
$data['rep_type'], $data['rep_opt'],
- $max_rep_entrys, $data['rep_num_weeks']);
+ $data['rep_num_weeks'], $max_rep_entrys);
// Don't make any bookings if we've been asked to book up
// more entries than we are allowed in a single repeat.
Property changes on: mrbs/branches/datatables/web/upgrade/5/pgsql.sql
___________________________________________________________________
Modified: svn:mergeinfo
- /mrbs/branches/custom_entry_fields/web/upgrade/5/pgsql.sql:1374-1396
/mrbs/branches/datepicker/web/upgrade/5/pgsql.sql:1409-1416
/mrbs/branches/disabled_rooms/web/upgrade/5/pgsql.sql:1601-1634
/mrbs/branches/from_to_bookings/web/upgrade/5/pgsql.sql:1491-1587
/mrbs/branches/ics_attachments/web/upgrade/5/pgsql.sql:1652-1741
/mrbs/branches/only_unicode/web/upgrade/5/pgsql.sql:1747-1749
/mrbs/branches/provisional_bookings/web/upgrade/5/pgsql.sql:1242-1280
/mrbs/branches/provisional_bookings_new_style/web/upgrade/5/pgsql.sql:1407-1570
/mrbs/trunk/web/upgrade/5/pgsql.sql:1863-1921
+ /mrbs/branches/custom_entry_fields/web/upgrade/5/pgsql.sql:1374-1396
/mrbs/branches/datepicker/web/upgrade/5/pgsql.sql:1409-1416
/mrbs/branches/disabled_rooms/web/upgrade/5/pgsql.sql:1601-1634
/mrbs/branches/from_to_bookings/web/upgrade/5/pgsql.sql:1491-1587
/mrbs/branches/ics_attachments/web/upgrade/5/pgsql.sql:1652-1741
/mrbs/branches/only_unicode/web/upgrade/5/pgsql.sql:1747-1749
/mrbs/branches/provisional_bookings/web/upgrade/5/pgsql.sql:1242-1280
/mrbs/branches/provisional_bookings_new_style/web/upgrade/5/pgsql.sql:1407-1570
/mrbs/trunk/web/upgrade/5/pgsql.sql:1863-1925
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits