sub draft_list {
my ($self) = @_;
- my $result = selectall_hashref_query($::form, $::form->get_standard_dbh, <<SQL, $self->module, $self->submodule);
- SELECT d.*, date(d.itime) AS date, e.name AS employee_name
+ my $result = selectall_hashref_query($::form, $::form->get_standard_dbh, <<SQL, $self->module, $self->submodule, SL::DB::Manager::Employee->current->id);
+ SELECT d.*, date(d.itime) AS date
FROM drafts d
- LEFT JOIN employee e ON d.employee_id = e.id
- WHERE (d.module = ?) AND (d.submodule = ?)
+ WHERE (d.module = ?)
+ AND (d.submodule = ?)
+ AND (d.employee_id = ?)
ORDER BY d.itime
SQL
}
<tr class="listheading">
<th>[% 'Date' | $T8 %]</th>
<th>[% 'Description' | $T8 %]</th>
- <th>[% 'Employee' | $T8 %]</th>
</tr>
[% FOREACH row = drafts_list %]
[% L.link(SELF.url_for(action='load',id=row.id), row.description) %]
[%- END %]
</td>
- <td>[% row.employee_name | html %]</td>
<td>[% L.html_tag('span', LxERP.t8('Delete'), class='cursor-pointer interact', onclick="kivi.Draft.delete('" _ row.id _ "')") %]</a></td>
</tr>
[% END %]
</table>
[%- END %]
-