[SASHA-Code] SF.net SVN: sasha:[86] trunk/SASHA
Brought to you by:
gphemsley
|
From: <gph...@us...> - 2010-02-06 04:51:51
|
Revision: 86
http://sasha.svn.sourceforge.net/sasha/?rev=86&view=rev
Author: gphemsley
Date: 2010-02-06 04:51:45 +0000 (Sat, 06 Feb 2010)
Log Message:
-----------
Revert "fix" from r80 that actually broke days when editing schedule items.
Add user ID to 'assignments' table.
Update SQL schema to synchronize format of 'user_id' fields.
Fix minor style bug that occurred with multiple adjacent message boxes.
Modified Paths:
--------------
trunk/SASHA/inc/lib/lib.assignments.php
trunk/SASHA/inc/lib/lib.schedule.php
trunk/SASHA/install/schema/mysql.sql
trunk/SASHA/style/default/screen.css
Modified: trunk/SASHA/inc/lib/lib.assignments.php
===================================================================
--- trunk/SASHA/inc/lib/lib.assignments.php 2010-01-26 18:16:09 UTC (rev 85)
+++ trunk/SASHA/inc/lib/lib.assignments.php 2010-02-06 04:51:45 UTC (rev 86)
@@ -53,8 +53,8 @@
}
else
{
- $sql = "INSERT INTO assignments ( schedule_id, assignment_name, description, assigned_date, due_date )
- VALUES ( $schedule_id, '" . $Database->escape( $assignment_name ) . "', '" . $Database->escape( $description ) . "', $assigned_date, $due_date )";
+ $sql = "INSERT INTO assignments ( user_id, schedule_id, assignment_name, description, assigned_date, due_date )
+ VALUES ( {$User->user_info['id']}, $schedule_id, '" . $Database->escape( $assignment_name ) . "', '" . $Database->escape( $description ) . "', $assigned_date, $due_date )";
$result = $Database->query( $sql );
Modified: trunk/SASHA/inc/lib/lib.schedule.php
===================================================================
--- trunk/SASHA/inc/lib/lib.schedule.php 2010-01-26 18:16:09 UTC (rev 85)
+++ trunk/SASHA/inc/lib/lib.schedule.php 2010-02-06 04:51:45 UTC (rev 86)
@@ -483,7 +483,7 @@
{
case 3:
$sql = "UPDATE schedules
- SET institution = '$institution', semester = '$semester', subject = '" . $Database->escape( $this->subject ) . "', course = {$this->course}, section = '" . $Database->escape( $this->section ) . "', section_title = '" . $Database->escape( $this->section_title ) . "', schedule_type = {$this->schedule_type}, days = b'" . $this->format_days( $this->schedule_days, NULL, 'binary' ) . "', start_time = {$this->start_time}, end_time = {$this->end_time}, instructors = '" . $this->prepare_instructors( $this->instructors ) . "', parent_schedule_id = {$this->parent_schedule_id}
+ SET institution = '$institution', semester = '$semester', subject = '" . $Database->escape( $this->subject ) . "', course = {$this->course}, section = '" . $Database->escape( $this->section ) . "', section_title = '" . $Database->escape( $this->section_title ) . "', schedule_type = {$this->schedule_type}, days = b'" . $this->format_days( $this->schedule_days, 'decimal', 'binary' ) . "', start_time = {$this->start_time}, end_time = {$this->end_time}, instructors = '" . $this->prepare_instructors( $this->instructors ) . "', parent_schedule_id = {$this->parent_schedule_id}
WHERE schedule_id = $schedule_id";
$sql = str_replace( array( "= '',", "= '' ", '= ,', '= ', "= \n" ), array( '= NULL,', '= NULL ', '= NULL,', '= NULL ', "= NULL\n" ), $sql );
@@ -491,7 +491,7 @@
if( $result )
{
- print_message( 'good', 'Schedule for ' . $this->format_course( $this->subject, $this->course, $institution, ' ' ) . ' ' . $this->section . ' at ' . $this->format_institution( $institution ) . ' (' . $this->format_instructors( $this->instructors, '; ' ) . ' — ' . $this->format_schedule_type( $this->schedule_type ) . ': ' . $this->format_days( $this->schedule_days, NULL, 'html' ) . ') updated successfully.', 'Update successful.' );
+ print_message( 'good', 'Schedule for ' . $this->format_course( $this->subject, $this->course, $institution, ' ' ) . ' ' . $this->section . ' at ' . $this->format_institution( $institution ) . ' (' . $this->format_instructors( $this->instructors, '; ' ) . ' — ' . $this->format_schedule_type( $this->schedule_type ) . ': ' . $this->format_days( $this->schedule_days, 'decimal', 'html' ) . ') updated successfully.', 'Update successful.' );
$this->list_schedule();
Modified: trunk/SASHA/install/schema/mysql.sql
===================================================================
--- trunk/SASHA/install/schema/mysql.sql 2010-01-26 18:16:09 UTC (rev 85)
+++ trunk/SASHA/install/schema/mysql.sql 2010-02-06 04:51:45 UTC (rev 86)
@@ -14,6 +14,7 @@
CREATE TABLE assignments (
assignment_id int(10) unsigned NOT NULL auto_increment,
+ user_id bigint(10) NOT NULL,
schedule_id int(10) unsigned NOT NULL,
assignment_name varchar(255) NOT NULL,
description text NOT NULL,
@@ -21,7 +22,7 @@
due_date int(10) unsigned NOT NULL,
`status` int(4) NOT NULL default '0',
PRIMARY KEY (assignment_id),
- KEY schedule_id (schedule_id),
+ KEY user_id (user_id,schedule_id),
KEY assigned_date (assigned_date),
KEY due_date (due_date),
KEY `status` (`status`)
@@ -150,7 +151,7 @@
CREATE TABLE tests (
test_id int(10) unsigned NOT NULL auto_increment,
- user_id int(10) unsigned NOT NULL,
+ user_id bigint(10) NOT NULL,
schedule_id int(10) unsigned NOT NULL,
test_type int(3) NOT NULL,
test_name varchar(255) NOT NULL,
Modified: trunk/SASHA/style/default/screen.css
===================================================================
--- trunk/SASHA/style/default/screen.css 2010-01-26 18:16:09 UTC (rev 85)
+++ trunk/SASHA/style/default/screen.css 2010-02-06 04:51:45 UTC (rev 86)
@@ -284,7 +284,7 @@
margin-top: 0em;
}
-#global-msg + #page-content > * > *:first-child {
+#global-msg + #page-content > * > #sub-nav {
margin-top: 2em;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|