summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark <mark>2011-10-28 06:44:52 +0000
committermark <mark>2011-10-28 06:44:52 +0000
commitd93123f3620fe0f1e48c453e292e335050532043 (patch)
tree2536de08d78d3d91b1464a3f08fa430dabe9d9e6
parente5e3f6ec09be93b0d00d1f84e4c7cade6e18a802 (diff)
run exports in weight order, #14924
-rw-r--r--FS/FS/part_export.pm12
-rw-r--r--FS/FS/part_svc.pm1
2 files changed, 13 insertions, 0 deletions
diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm
index 890c522f6..9a479b7c8 100644
--- a/FS/FS/part_export.pm
+++ b/FS/FS/part_export.pm
@@ -401,6 +401,18 @@ or hidden by default).
=cut
+=item weight
+
+Returns the 'weight' element from the export's %info hash, or 0 if there is
+no weight defined.
+
+=cut
+
+sub weight {
+ my $self = shift;
+ export_info()->{$self->exporttype}->{'weight'} || 0;
+}
+
=back
=head1 SUBROUTINES
diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm
index 3ae79a6df..4a1b30877 100644
--- a/FS/FS/part_svc.pm
+++ b/FS/FS/part_svc.pm
@@ -434,6 +434,7 @@ sub part_export {
my $self = shift;
my %search;
$search{'exporttype'} = shift if @_;
+ sort { $a->weight <=> $b->weight }
map { qsearchs('part_export', { 'exportnum' => $_->exportnum, %search } ) }
qsearch('export_svc', { 'svcpart' => $self->svcpart } );
}