@@ -680,6 +680,7 @@ function Session() {
680680 this . area = "noarea" ;
681681 this . special_request = "" ;
682682 this . conflicted = false ;
683+ this . conflicted_direction = { } ;
683684 this . theirconflicted = false ;
684685 this . double_wide = false ;
685686 this . attendees = undefined ;
@@ -886,36 +887,31 @@ Session.prototype.mark_conflict = function(value) {
886887 this . conflicted = value ;
887888} ;
888889Session . prototype . add_conflict = function ( conflict ) {
889- if ( conflict . direction === 'ours' ) {
890- this . conflicted = true ;
891- if ( this . highest_conflict == undefined ) {
892- this . highest_conflict = conflict ;
893- } else {
894- var oldhighest = this . highest_conflict ;
895- this . highest_conflict = this . highest_conflict . conflict_compare ( conflict ) ;
896- if ( _conflict_debug ) {
897- console . log ( "add conflict for" , this . title ,
898- oldhighest . conflict_type , ">?" , conflict . conflict_type ,
899- "=" , this . highest_conflict . conflict_type ) ;
900- }
901- }
902- this . conflict_level = this . highest_conflict . conflict_type ;
890+ this . conflicted = true ;
891+ if ( this . conflicted_direction == undefined ) {
892+ this . conflicted_direction = { } ;
893+ }
894+ this . conflicted_direction [ conflict . direction ] = true ;
895+ if ( this . highest_conflict == undefined ) {
896+ this . highest_conflict = { } ;
897+ }
898+ if ( this . highest_conflict [ conflict . direction ] == undefined ) {
899+ this . highest_conflict [ conflict . direction ] = conflict ;
903900 } else {
904- this . theirconflicted = true ;
905- if ( this . highest_theirconflict == undefined ) {
906- this . highest_theirconflict = conflict ;
907- } else {
908- var oldhighest = this . highest_theirconflict ;
909- this . highest_theirconflict = this . highest_theirconflict . conflict_compare ( conflict ) ;
910- if ( _conflict_debug ) {
911- console . log ( "add conflict for" , this . title ,
912- oldhighest . conflict_type , ">?" , conflict . conflict_type ,
913- "=" , this . highest_theirconflict . conflict_type ) ;
914- }
901+ var oldhighest = this . highest_conflict [ conflict . direction ] ;
902+ this . highest_conflict [ conflict . direction ] = this . highest_conflict [ conflict . direction ] . conflict_compare ( conflict ) ;
903+ if ( _conflict_debug ) {
904+ console . log ( "add conflict for" , this . title ,
905+ oldhighest . conflict_type , ">?" , conflict . conflict_type ,
906+ "=" , this . highest_conflict [ conflict . direction ] . conflict_type ) ;
915907 }
916- this . theirconflict_level = this . highest_theirconflict . conflict_type ;
917908 }
909+ if ( this . conflict_level == undefined ) {
910+ this . conflict_level = { } ;
911+ }
912+ this . conflict_level [ conflict . direction ] = this . highest_conflict [ conflict . direction ] . conflict_type ;
918913} ;
914+
919915Session . prototype . clear_conflict = function ( ) {
920916 this . conflicted = false ;
921917} ;
@@ -936,45 +932,48 @@ Session.prototype.clear_all_conflicts = function(old_column_classes) {
936932
937933Session . prototype . show_conflict = function ( ) {
938934 if ( _conflict_debug ) {
939- console . log ( "showing conflict for" , this . title , this . conflict_level ) ;
935+ console . log ( "showing conflict for" , this . title , this . conflict_level [ 'ours' ] , this . conflict_level [ 'theirs' ] ) ;
940936 }
941- // this.element().find('.ourconflicts').addClass("actual_" + this.conflict_level);
942- // this.element().find('.theirconflicts').addClass("actual_" + this.conflict_level);
943937 var display = { 'conflict' :'1' , 'conflic2' :'2' , 'conflic3' :'3' } ;
944938 if ( this . conflicted ) {
945- this . element ( ) . find ( '.ourconflicts' ) . text ( '->' + display [ this . conflict_level ] ) ;
946- }
947- if ( this . theirconflicted ) {
948- this . element ( ) . find ( '.theirconflicts' ) . text ( display [ this . theirconflict_level ] + '->' ) ;
939+ if ( 'ours' in this . conflict_level ) {
940+ this . element ( ) . find ( '.ourconflicts' ) . text ( '->' + display [ this . conflict_level . ours ] ) ;
941+ }
942+ if ( 'theirs' in this . conflict_level ) {
943+ this . element ( ) . find ( '.theirconflicts' ) . text ( display [ this . conflict_level . theirs ] + '->' ) ;
944+ }
949945 }
950946} ;
947+
951948Session . prototype . hide_conflict = function ( ) {
952949 if ( _conflict_debug ) {
953950 console . log ( "removing conflict for" , this . title ) ;
954951 }
955- // this.element().removeClass("actual_conflict");
956952 this . element ( ) . find ( '.ourconflicts' ) . text ( '' ) ;
957953 this . element ( ) . find ( '.theirconflicts' ) . text ( '' ) ;
958954} ;
955+
959956Session . prototype . display_conflict = function ( ) {
960957 if ( this . conflicted || this . theirconflicted ) {
961958 this . show_conflict ( ) ;
962959 } else {
963960 this . hide_conflict ( ) ;
964961 }
965962} ;
963+
966964Session . prototype . reset_conflicts = function ( ) {
967965 this . conflict_level = undefined ;
968966 this . highest_conflict = undefined ;
969967 this . conflicted = false ;
968+ this . conflicted_direction = undefined ;
970969 this . theirconflict_level = undefined ;
971970 this . highest_theirconflict = undefined ;
972971 this . theirconflicted = false ;
973972} ;
974973
975974Session . prototype . show_personconflict = function ( ) {
976975 if ( _conflict_debug ) {
977- console . log ( "showing person conflict for" , this . title , this . conflict_level ) ;
976+ console . log ( "showing person conflict for" , this . title , this . conflict_level . ours ) ;
978977 }
979978 this . personconflict_element ( ) . removeClass ( "hidepersonconflict" ) ;
980979 this . personconflict_element ( ) . addClass ( "showpersonconflict" ) ;
@@ -1294,6 +1293,21 @@ Session.prototype.fill_in_constraints = function(constraint_list) {
12941293 session_obj . conflicts . push ( session_obj . constraints [ "conflic3" ] [ index ] ) ;
12951294 } ) ;
12961295 }
1296+ if ( "conflict" in this . theirconstraints ) {
1297+ $ . each ( this . theirconstraints [ "conflict" ] , function ( index ) {
1298+ session_obj . conflicts . push ( session_obj . theirconstraints [ "conflict" ] [ index ] ) ;
1299+ } ) ;
1300+ }
1301+ if ( "conflic2" in this . theirconstraints ) {
1302+ $ . each ( this . theirconstraints [ "conflic2" ] , function ( index ) {
1303+ session_obj . conflicts . push ( session_obj . theirconstraints [ "conflic2" ] [ index ] ) ;
1304+ } ) ;
1305+ }
1306+ if ( "conflic3" in this . theirconstraints ) {
1307+ $ . each ( this . theirconstraints [ "conflic3" ] , function ( index ) {
1308+ session_obj . conflicts . push ( session_obj . theirconstraints [ "conflic3" ] [ index ] ) ;
1309+ } ) ;
1310+ }
12971311 this . calculate_bethere ( ) ;
12981312 this . conflicts = sort_conflict_list ( this . conflicts )
12991313} ;
@@ -1573,17 +1587,35 @@ Constraint.prototype.show_conflict_view = function() {
15731587 //console.log("viewed", this.thisgroup.href);
15741588} ;
15751589
1576- Constraint . prototype . build_group_conflict_view = function ( ) {
1577-
1590+ Constraint . prototype . populate_conflict_classes = function ( ) {
15781591 // this is used for the red square highlighting.
15791592 var checkbox_id = "conflict_" + this . dom_id ;
15801593 conflict_classes [ checkbox_id ] = this ;
1581-
1582- return "<div class='conflict our-" + this . conflict_type + "' id='" + this . dom_id +
1583- "'>" + this . othergroup_name + "</div>" ;
1584-
15851594} ;
15861595
1596+ // Made dead by change to how the group view is built out
1597+ //Constraint.prototype.build_group_conflict_view = function() {
1598+ //
1599+ // var display = { 'conflict':'1' , 'conflic2':'2' , 'conflic3':'3' };
1600+ //
1601+ // // this is used for the red square highlighting.
1602+ // var checkbox_id = "conflict_"+this.dom_id;
1603+ // conflict_classes[checkbox_id] = this;
1604+ //
1605+ // build = "<div id='"+this.dom_id+"'>";
1606+ // if (this.direction=='theirs') {
1607+ // build += display[this.conflict_type]+"->";
1608+ // }
1609+ // build += this.othergroup_name;
1610+ // if (this.direction=='ours') {
1611+ // build += "->"+display[this.conflict_type];
1612+ // }
1613+ // build += "</div>";
1614+ //
1615+ // return build
1616+ //
1617+ //};
1618+
15871619Constraint . prototype . build_people_conflict_view = function ( ) {
15881620 var area_mark = "" ;
15891621 if ( this . person != undefined && this . person . area_mark_basic != undefined ) {
@@ -1612,9 +1644,10 @@ Constraint.prototype.conflict_view = function() {
16121644 return this . build_people_conflict_view ( ) ;
16131645 }
16141646 else {
1615- //console.log("conflict_view for", this.href);
1616- this . build_othername ( ) ;
1617- return this . build_group_conflict_view ( ) ;
1647+ // This function is currently never called for this case
1648+ console . log ( "!! unexpected conflict_view for" , this . href ) ;
1649+ //this.build_othername();
1650+ //return this.build_group_conflict_view();
16181651 }
16191652} ;
16201653
0 commit comments