Revision fd8bde53
Von Kivitendo Admin vor fast 10 Jahren hinzugefügt
bin/mozilla/common.pl | ||
---|---|---|
385 | 385 |
|
386 | 386 |
$form->{title} = $locale->text("History"); |
387 | 387 |
$form->header(no_layout => 1); |
388 |
|
|
389 |
my $restriction; |
|
390 |
if ( $form->{trans_id_type} eq 'glid' ) { |
|
391 |
$restriction = "AND ( snumbers LIKE 'invnumber%' OR what_done LIKE '%Buchungsnummer%' OR snumbers LIKE 'gltransaction%' ) "; |
|
392 |
} elsif ( $form->{trans_id_type} eq 'id' ) { |
|
393 |
$restriction = " AND ( snumbers NOT LIKE 'invnumber_%' AND snumbers NOT LIKE 'gltransaction%' AND (what_done NOT LIKE '%Buchungsnummer%' OR what_done IS null))"; |
|
394 |
} else { |
|
395 |
$restriction = ''; |
|
396 |
}; |
|
397 |
|
|
388 | 398 |
print $form->parse_html_template( "common/show_history", { |
389 |
"DATEN" => $form->get_history($dbh,$form->{input_name},"",$form->{order}),
|
|
399 |
"DATEN" => $form->get_history($dbh,$form->{input_name},$restriction,$form->{order}),
|
|
390 | 400 |
"SUCCESS" => ($form->get_history($dbh,$form->{input_name}) ne "0"), |
391 | 401 |
uc($sort) => 1, |
392 | 402 |
uc($sort)."BY" => $sortby, |
js/show_history.js | ||
---|---|---|
10 | 10 |
return string; |
11 | 11 |
} |
12 | 12 |
|
13 |
function set_history_window(id) { |
|
13 |
function set_history_window(id,trans_id_type) {
|
|
14 | 14 |
var parm = centerParms(800,500) + ",width=800,height=500,status=yes,scrollbars=yes"; |
15 | 15 |
var name = "History"; |
16 | 16 |
url = "common.pl?" + |
17 | 17 |
"INPUT_ENCODING=UTF-8&" + |
18 | 18 |
"action=show_history&" + |
19 | 19 |
"longdescription=" + "&" + |
20 |
"trans_id_type=" + encodeURIComponent(trans_id_type) + "&" + |
|
20 | 21 |
"input_name=" + encodeURIComponent(id) + "&" |
21 | 22 |
window.open(url, "_new_generic", parm); |
22 | 23 |
} |
templates/webpages/ap/form_footer.html | ||
---|---|---|
41 | 41 |
[%- END %] |
42 | 42 |
|
43 | 43 |
[%- IF id %] |
44 |
<input type=button class=submit onclick="set_history_window([% id %]);" name="history" id="history" value="[% 'history' | $T8 %]"> |
|
44 |
<input type=button class=submit onclick="set_history_window([% id %], 'glid');" name="history" id="history" value="[% 'history' | $T8 %]">
|
|
45 | 45 |
[% IF INSTANCE_CONF.get_ap_show_mark_as_paid %] |
46 | 46 |
<input type="submit" name="action" value="[% 'mark as paid' | $T8 %]"> |
47 | 47 |
[% END %] |
templates/webpages/ar/form_footer.html | ||
---|---|---|
37 | 37 |
|
38 | 38 |
<input class="submit" type="submit" name="action" value="[% 'Post Payment' | $T8 %]"> |
39 | 39 |
<input type="button" class="submit" onclick="follow_up_window()" value="[% 'Follow-Up' | $T8 %]"> |
40 |
<input type="button" class="submit" onclick="set_history_window([% id %]);" name="history" id="history" value="[% 'history' | $T8 %]"> |
|
40 |
<input type="button" class="submit" onclick="set_history_window([% id %], 'glid');" name="history" id="history" value="[% 'history' | $T8 %]">
|
|
41 | 41 |
[% ELSE %] |
42 | 42 |
[% IF ( !is_closed ) %] |
43 | 43 |
<input class="submit" type="submit" name="action" value="[% 'Post' | $T8 %]"> |
templates/webpages/do/form_footer.html | ||
---|---|---|
89 | 89 |
[%- UNLESS closed %] |
90 | 90 |
<input class="submit" type="submit" name="action_mark_closed" value="[% 'Mark closed' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]"> |
91 | 91 |
[%- END %] |
92 |
<input type="button" class="submit" onclick="set_history_window([% id %]);" name="history" id="history" value="[% 'history' | $T8 %]"> |
|
92 |
<input type="button" class="submit" onclick="set_history_window([% id %], 'id');" name="history" id="history" value="[% 'history' | $T8 %]">
|
|
93 | 93 |
[%- END %] |
94 | 94 |
</p> |
95 | 95 |
|
templates/webpages/ic/form_footer.html | ||
---|---|---|
93 | 93 |
[%- END %] |
94 | 94 |
|
95 | 95 |
[%- IF id != "" %] |
96 |
<input type="button" class="submit" onclick="set_history_window([% id %]);" name="history" id="history" value="[% 'history' | $T8 %]"> |
|
96 |
<input type="button" class="submit" onclick="set_history_window([% id %], 'id');" name="history" id="history" value="[% 'history' | $T8 %]">
|
|
97 | 97 |
[%- END %] |
98 | 98 |
|
99 | 99 |
</form> |
templates/webpages/ir/form_footer.html | ||
---|---|---|
143 | 143 |
|
144 | 144 |
[% IF id %] |
145 | 145 |
[%#- button for saving history %] |
146 |
<input type="button" class="submit" onclick="set_history_window([% id | html %]);" name="history" id="history" value="[% 'history' | $T8 %]"> |
|
146 |
<input type="button" class="submit" onclick="set_history_window([% id | html %], 'glid');" name="history" id="history" value="[% 'history' | $T8 %]">
|
|
147 | 147 |
|
148 | 148 |
[% IF INSTANCE_CONF.get_ir_show_mark_as_paid %] |
149 | 149 |
<input type="submit" class="submit" name="action" value="[% 'mark as paid' | $T8 %]"> |
templates/webpages/is/form_footer.html | ||
---|---|---|
185 | 185 |
|
186 | 186 |
[% IF id %] |
187 | 187 |
[%#- button for saving history %] |
188 |
<input type="button" class="submit" onclick="set_history_window([% id | html %]);" name="history" id="history" value="[% 'history' | $T8 %]"> |
|
188 |
<input type="button" class="submit" onclick="set_history_window([% id | html %], 'glid');" name="history" id="history" value="[% 'history' | $T8 %]">
|
|
189 | 189 |
[% IF INSTANCE_CONF.get_is_show_mark_as_paid %] |
190 | 190 |
<input type="submit" class="submit" name="action" value="[% 'mark as paid' | $T8 %]"> |
191 | 191 |
[% END %] |
templates/webpages/oe/form_footer.html | ||
---|---|---|
152 | 152 |
|
153 | 153 |
[%- IF id %] |
154 | 154 |
<input type="button" class="submit" onclick="follow_up_window()" value="[% 'Follow-Up' | $T8 %]"> |
155 |
<input type="button" class="submit" onclick="set_history_window([% HTML.escape(id) %])" name="history" id="history" value="[% 'history' | $T8 %]"> |
|
155 |
<input type="button" class="submit" onclick="set_history_window([% HTML.escape(id) %], 'id')" name="history" id="history" value="[% 'history' | $T8 %]">
|
|
156 | 156 |
|
157 | 157 |
<br>[% label_workflow %]<br> |
158 | 158 |
<input class="submit" type="submit" name="action_save_as_new" value="[% 'Save as new' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]"> |
templates/webpages/pe/partsgroup_form.html | ||
---|---|---|
34 | 34 |
[%- END %] |
35 | 35 |
|
36 | 36 |
[%- IF ( id ) %] |
37 |
<input type=button onclick="set_history_window([% id %]);" name=history id=history value="[% 'history' | $T8 %]"> |
|
37 |
<input type=button onclick="set_history_window([% id %], 'id');" name=history id=history value="[% 'history' | $T8 %]">
|
|
38 | 38 |
[%- END %] |
39 | 39 |
|
40 | 40 |
</form> |
templates/webpages/pe/pricegroup_form.html | ||
---|---|---|
34 | 34 |
[%- END %] |
35 | 35 |
|
36 | 36 |
[%- IF ( id ) %] |
37 |
<input type=button onclick="set_history_window([% id %]);" name=history id=history value="[% 'history' | $T8 %]"> |
|
37 |
<input type=button onclick="set_history_window([% id %], 'id');" name=history id=history value="[% 'history' | $T8 %]">
|
|
38 | 38 |
[%- END %] |
39 | 39 |
|
40 | 40 |
</form> |
Auch abrufbar als: Unified diff
history_erp : Unterscheidung von id und glid
behebt #2493
Es gibt in der Datenbank zwei Sequenzen, mit der die ids von
Datenbankeinträgen gespeichert werden, und die die Historiensuche
betreffen:
glid: ar,ap,gl
id: delivery_orders parts oe customer vendor
In der history_erp gibt es allerdings nur eine Datenbankspalte für
trans_id, wo sowohl ids als auch glids gespeichert werden.
(Wahrscheinlich wurde glid irgendwann mal neu eingeführt, damit man bei
den Buchungen einen durchgängigen Buchungsnummernkreis hat, ohne dies
für die Historie zu berücksichtigen.)
Da das Historienfenster nur eine id als Parameter übergibt kann es also
vorkommen, daß z.B. in einer Artikelhistorie eine Eintrag aus einer
Buchungshistorie erscheint, wenn es eine Buchungs-glid gibt, die gleich
der Artikel-id ist.
Mit diesem Patch wird nun schon im Template festgelegt, ob es sich bei
der Historie um eine Buchung (trans_id_type = glid) oder nicht
(trans_id_type = id) handelt, und die Datenbankabfrage entsprechend
modifiziert. Dies sollte nur die Historie von einzelnen Seiten betreffen
(z.B. Artikel, Kunde, Verkaufsrechnung), nicht die Historiensuchmaschine
unter dem Menüpunkt "System".
Die Modifizierung des SQL-Statements ist allerdings noch recht unschön,
da diese eventuell angepasst werden muß, wenn sich etwas an der
Beschreibung der history_erp Zeilen ändert (wie beispielsweise in Commit
01b4e844b89 ).
Wenn die Historie mal überarbeitet wird sollte besser direkt schon
gespeichert werden, ob es sich um eine Buchung oder nicht handelt, bzw.
den Typ des Objekts, um das es gerade geht.
Und dann wäre es auch noch schön, die Historie in einen Tab zu
verlagern, statt eines Knopfs im Workflow.