[rt-commit] [svn] r638 - in rtfm/trunk: . etc html/RTFM/Article
html/RTFM/Article/Elements lib/RT/FM
jesse at fsck.com
jesse at fsck.com
Tue Mar 30 18:53:57 EST 2004
Author: jesse
Date: Tue Mar 30 18:53:57 2004
New Revision: 638
Modified:
rtfm/trunk/ (props changed)
rtfm/trunk/etc/acl.Oracle
rtfm/trunk/html/RTFM/Article/Edit.html
rtfm/trunk/html/RTFM/Article/Elements/EditCustomField
rtfm/trunk/lib/RT/FM/CustomField_Overlay.pm
rtfm/trunk/lib/RT/FM/Transaction_Overlay.pm
rtfm/trunk/releng.cnf
Log:
----------------------------------------------------------------------
r1246 at tinbook: jesse | 2004-03-30T23:53:23.339284Z
Fixes for article editing on oracle
----------------------------------------------------------------------
Modified: rtfm/trunk/etc/acl.Oracle
==============================================================================
--- rtfm/trunk/etc/acl.Oracle (original)
+++ rtfm/trunk/etc/acl.Oracle Tue Mar 30 18:53:57 2004
@@ -1,6 +1,6 @@
# mysql doesn't need new acls
sub acl {
- return ('select sysdate from DUAL;');
+ return ('select id from Users where id = 1');
}
1;
Modified: rtfm/trunk/html/RTFM/Article/Edit.html
==============================================================================
--- rtfm/trunk/html/RTFM/Article/Edit.html (original)
+++ rtfm/trunk/html/RTFM/Article/Edit.html Tue Mar 30 18:53:57 2004
@@ -201,15 +201,11 @@
}
}
+ $cf_values = $Article->CustomFieldValues($cf);
while ( my $cf_value = $cf_values->Next ) {
unless ( $values_hash{ $cf_value->Content } == 1 ) {
- my ( $val, $msg ) =
- $Article->DeleteCustomFieldValue(
- Field => $cf,
- Content => $cf_value->Content
- );
+ my ( $val, $msg ) = $Article->DeleteCustomFieldValue( Field => $cf, Content => $cf_value->Content);
push ( @results, $msg );
-
}
}
Modified: rtfm/trunk/html/RTFM/Article/Elements/EditCustomField
==============================================================================
--- rtfm/trunk/html/RTFM/Article/Elements/EditCustomField (original)
+++ rtfm/trunk/html/RTFM/Article/Elements/EditCustomField Tue Mar 30 18:53:57 2004
@@ -1,5 +1,5 @@
% if ($CustomFieldObj->Type eq 'FreeformSingle') {
-<input name="Article-<%$id%>-CustomField-<%$CustomFieldObj->Id%>-Value"
+<input name="Article-<%$id%>-CustomField-<%$CustomFieldObj->Id%>-Values"
value="<%$Values->First && $Values->First->Content%>">
% }
% elsif ($CustomFieldObj->Type eq 'FreeformMultiple') {
@@ -10,7 +10,7 @@
</textarea>
% }
% elsif ($CustomFieldObj->Type =~ /(?:Text)/) {
-% my $name = "Article-$id-CustomField-".$CustomFieldObj->Id."-Value";
+% my $name = "Article-$id-CustomField-".$CustomFieldObj->Id."-Values";
<textarea rows="25" cols="70" name="<%$name%>">
% my $content;
%while (my $value = $Values->Next ) {
Modified: rtfm/trunk/lib/RT/FM/CustomField_Overlay.pm
==============================================================================
--- rtfm/trunk/lib/RT/FM/CustomField_Overlay.pm (original)
+++ rtfm/trunk/lib/RT/FM/CustomField_Overlay.pm Tue Mar 30 18:53:57 2004
@@ -448,25 +448,17 @@
Content => undef,
@_ );
- my $oldval = RT::FM::ArticleCFValue->new( $self->CurrentUser );
- $oldval->LoadByCols( Article => $args{'Article'},
- Content => $args{'Content'},
- CustomField => $self->Id );
- # check ot make sure we found it
- unless ( $oldval->Id ) {
- return (
- 0,
- $self->loc(
- "Custom field value [_1] could not be found for custom field [_2]", $args{'Content'}, $self->Name ) );
- }
- # delete it
- my $ret = $oldval->Delete();
- unless ($ret) {
- return ( 0, $self->loc("Custom field value could not be found") );
+ my $article_values = $self->ValuesForArticle($args{'Article'});
+
+ # get the actual values for the custom field as an array and see if it has this entry
+ my @values = grep { $_->Content eq $args{'Content'}} @{$article_values->ItemsArrayRef};
+ foreach my $val (@values) {
+ $val->Delete();
}
+
return ( 1, $self->loc("Custom field value deleted") );
}
Modified: rtfm/trunk/lib/RT/FM/Transaction_Overlay.pm
==============================================================================
--- rtfm/trunk/lib/RT/FM/Transaction_Overlay.pm (original)
+++ rtfm/trunk/lib/RT/FM/Transaction_Overlay.pm Tue Mar 30 18:53:57 2004
@@ -31,7 +31,7 @@
@_);
- foreach my $field qw(ChangeLog Type OldContent NewContent) {
+ foreach my $field qw(ChangeLog Type OldContent NewContent Field) {
$args{$field} = '' unless ($args{$field});
}
Modified: rtfm/trunk/releng.cnf
==============================================================================
--- rtfm/trunk/releng.cnf (original)
+++ rtfm/trunk/releng.cnf Tue Mar 30 18:53:57 2004
@@ -1,5 +1,5 @@
PRODUCT = RTFM
-TAG = 2.0.3
+TAG = 2.0.4pre1
CANONICAL_REPO = svn+ssh://svn.bestpractical.com/svn/bps-public/rtfm/
TAGS = tags/
TRUNK = trunk/
More information about the Rt-commit
mailing list