24 |
function => 'distinct', |
function => 'distinct', |
25 |
); |
); |
26 |
$authors->unlimit; |
$authors->unlimit; |
27 |
|
$authors->order_by({ column => 'author', order => 'ASC' }); |
28 |
|
warn "authors ", $authors->build_select_query; |
29 |
[{ |
[{ |
30 |
display_from => 'author', |
display_from => 'author', |
31 |
value_from => 'author', |
value_from => 'author', |
33 |
}]; |
}]; |
34 |
}; |
}; |
35 |
|
|
36 |
|
param branch => |
37 |
|
label is 'In branch', |
38 |
|
render as 'combobox', |
39 |
|
available are defer { |
40 |
|
my $branches = SVNBrowser::Model::BranchCollection->new; |
41 |
|
$branches->column( |
42 |
|
column => 'path', |
43 |
|
function => 'distinct', |
44 |
|
); |
45 |
|
$branches->unlimit; |
46 |
|
$branches->order_by({ column => 'path', order => 'ASC' }); |
47 |
|
warn "branches ", $branches->build_select_query; |
48 |
|
[{ |
49 |
|
display_from => 'path', |
50 |
|
value_from => 'path', |
51 |
|
collection => $branches, |
52 |
|
}]; |
53 |
|
}; |
54 |
|
|
55 |
|
param rel_path => |
56 |
|
label is 'File path', |
57 |
|
hint is 'enter beggining of file path to filter using it'; |
58 |
|
|
59 |
param show_actions => |
param show_actions => |
60 |
label is 'Show file actions', |
label is 'Show file actions', |
61 |
render as 'checkbox'; |
render as 'checkbox'; |
68 |
render as 'Select', |
render as 'Select', |
69 |
available are qw( 10 20 30 50 100 ); |
available are qw( 10 20 30 50 100 ); |
70 |
|
|
71 |
|
param from_date => |
72 |
|
label is 'From date', |
73 |
|
render as 'Date'; |
74 |
|
|
75 |
|
param to_date => |
76 |
|
label is 'To date', |
77 |
|
render as 'Date'; |
78 |
|
|
79 |
|
param search => |
80 |
|
label is 'Search in messages'; |
81 |
|
|
82 |
}; |
}; |
83 |
|
|
84 |
sub sticky_on_success { 1; } |
sub sticky_on_success { 1; } |
90 |
sub take_action { |
sub take_action { |
91 |
my $self = shift; |
my $self = shift; |
92 |
|
|
93 |
my $author = $self->argument_value('author'); |
my $revisions = SVNBrowser::Model::RevisionCollection->new(); |
94 |
|
$revisions->unlimit(); |
95 |
|
|
96 |
|
if ( my $author = $self->argument_value('author') ) { |
97 |
|
$revisions->limit( column => 'author', value => $author, entry_aggregator => 'AND' ); |
98 |
|
} |
99 |
|
|
100 |
|
if ( my $from_date = $self->argument_value('from_date') ) { |
101 |
|
$revisions->limit( column => 'commit_date', operator => '>=', value => $from_date, entry_aggregator => 'AND', case_sensitive => 1 ); |
102 |
|
} |
103 |
|
|
104 |
|
if ( my $to_date = $self->argument_value('to_date') ) { |
105 |
|
$revisions->limit( column => 'commit_date', operator => '<=', value => $to_date, entry_aggregator => 'AND', case_sensitive => 1 ); |
106 |
|
} |
107 |
|
|
108 |
|
if ( my $search = $self->argument_value('search') ) { |
109 |
|
$revisions->limit( column => 'message', operator => 'LIKE', value => '%' . $search . '%' ); |
110 |
|
} |
111 |
|
|
112 |
|
if ( my $branch = $self->argument_value('branch') ) { |
113 |
|
my $b = SVNBrowser::Model::Branch->new(); |
114 |
|
$b->load_by_cols( path => $branch ); |
115 |
|
|
116 |
|
my $rev_branches = $revisions->join( |
117 |
|
alias1 => 'main', column1 => 'revision', |
118 |
|
table2 => 'revision_branches', column2 => 'revision' |
119 |
|
); |
120 |
|
$revisions->limit( alias => $rev_branches, column => 'branch', value => $b->id ); |
121 |
|
} |
122 |
|
|
123 |
|
if ( my $rel_path = $self->argument_value('rel_path') ) { |
124 |
|
my $rev_actions = $revisions->join( |
125 |
|
alias1 => 'main', column1 => 'revision', |
126 |
|
table2 => 'actions', column2 => 'revision' |
127 |
|
); |
128 |
|
$revisions->limit( alias => $rev_actions, column => 'rel_path', value => $rel_path, operator => 'STARTSWITH' ); |
129 |
|
} |
130 |
|
|
131 |
|
$revisions->order_by({ column => 'commit_date', order => 'desc' }); |
132 |
|
$revisions->set_page_info( |
133 |
|
current_page => $self->argument_value('page'), |
134 |
|
per_page => $self->argument_value('per_page'), |
135 |
|
); |
136 |
|
|
137 |
|
warn "take_action SQL: ", $revisions->build_select_query; |
138 |
|
|
139 |
|
$revisions->goto_first_item; |
140 |
|
|
141 |
my $msg = ''; |
my $msg = ''; |
142 |
$msg .= "Showing only commits for $author" if ($author); |
if (my $nr = $revisions->pager->total_entries) { |
143 |
$msg .= ( $msg ? ' and file actions' : ' File actions' ) if ( $self->argument_value('show_actions') ); |
$msg .= "Found $nr revisions"; |
144 |
$self->result->message($msg) if ($msg); |
} else { |
145 |
|
$msg .= "No revisions found"; |
146 |
|
} |
147 |
|
|
148 |
|
$self->result->message($msg); |
149 |
|
|
150 |
|
$self->result->content( revisions => $revisions ); |
151 |
|
|
152 |
return 1; |
return 1; |
153 |
} |
} |
154 |
|
|