|
Lines 568-574
sub _UpdateCourseItem {
Link Here
|
| 568 |
$mod_params{$_} = $params{$_}; |
568 |
$mod_params{$_} = $params{$_}; |
| 569 |
} |
569 |
} |
| 570 |
} |
570 |
} |
| 571 |
ModItem( \%mod_params, undef, $course_item->{'itemnumber'} ); |
571 |
ModItem( \%mod_params, undef, $course_item->{'itemnumber'} ) if %mod_params; |
| 572 |
|
572 |
|
| 573 |
## Update fields that didn't have an original value, but now do |
573 |
## Update fields that didn't have an original value, but now do |
| 574 |
## We must save the original value in course_items, and also |
574 |
## We must save the original value in course_items, and also |
|
Lines 583-589
sub _UpdateCourseItem {
Link Here
|
| 583 |
} |
583 |
} |
| 584 |
} |
584 |
} |
| 585 |
_ModStoredFields( 'ci_id' => $params{'ci_id'}, %mod_params_old ); |
585 |
_ModStoredFields( 'ci_id' => $params{'ci_id'}, %mod_params_old ); |
| 586 |
ModItem( \%mod_params_new, undef, $course_item->{'itemnumber'} ); |
586 |
ModItem( \%mod_params_new, undef, $course_item->{'itemnumber'} ) if %mod_params_new; |
| 587 |
|
587 |
|
| 588 |
} |
588 |
} |
| 589 |
|
589 |
|
|
Lines 648-654
sub _RevertFields {
Link Here
|
| 648 |
} |
648 |
} |
| 649 |
} |
649 |
} |
| 650 |
} |
650 |
} |
| 651 |
ModItem( $mod_item_params, undef, $course_item->{'itemnumber'} ); |
651 |
ModItem( $mod_item_params, undef, $course_item->{'itemnumber'} ) if $mod_item_params && %$mod_item_params; |
| 652 |
|
652 |
|
| 653 |
my $query = "UPDATE course_items SET " . join( ',', map { "$_=NULL" } @fields_to_null ) . " WHERE ci_id = ?"; |
653 |
my $query = "UPDATE course_items SET " . join( ',', map { "$_=NULL" } @fields_to_null ) . " WHERE ci_id = ?"; |
| 654 |
|
654 |
|
|
Lines 677-683
sub _SwapAllFields {
Link Here
|
| 677 |
} |
677 |
} |
| 678 |
} |
678 |
} |
| 679 |
|
679 |
|
| 680 |
ModItem( \%course_item_fields, undef, $course_item->{'itemnumber'} ); |
680 |
ModItem( \%course_item_fields, undef, $course_item->{'itemnumber'} ) if %course_item_fields; |
| 681 |
_ModStoredFields( %item_fields, ci_id => $ci_id ); |
681 |
_ModStoredFields( %item_fields, ci_id => $ci_id ); |
| 682 |
} |
682 |
} |
| 683 |
|
683 |
|
| 684 |
- |
|
|