Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7dd95f35

Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt

  • ID 7dd95f35ee3adf728460ea79d940cf6ae556d3b8
  • Vorgänger a325f1b7
  • Nachfolger 651e8d51

Die Historiensuchmaske nicht mehr per JavaScript abschicken und dem <form>-Element den Action-Parameter mitgeben. Damit funktioniert nun auch das Abschicken per Enter-Taste, und der Request wird vom Browser nicht mehr zwei mal geschickt.

Unterschiede anzeigen:

SL/Form.pm
3168 3168
      qq|SELECT h.employee_id, h.itime::timestamp(0) AS itime, h.addition, h.what_done, emp.name, h.snumbers, h.trans_id AS id | .
3169 3169
      qq|FROM history_erp h | .
3170 3170
      qq|LEFT JOIN employee emp ON (emp.id = h.employee_id) | .
3171
      qq|WHERE trans_id = | . $trans_id
3172
      . $restriction . qq| |
3173
      . $order;
3171
      qq|WHERE (trans_id = | . $trans_id . qq|) $restriction | .
3172
      $order;
3174 3173

  
3175 3174
    my $sth = $dbh->prepare($query) || $self->dberror($query);
3176 3175

  
js/show_am_history.js
1
function set_history_uri() {
2
  document.location.href = "am.pl?" +
3
    "action=show_am_history&" +
4
    "longdescription=" + "&" +
5
    "einschraenkungen=" + document.getElementById("einschraenkungen").value + "&" +
6
    "fromdate=" + document.getElementById("fromdate_hidden").value + "&" +
7
    "todate=" + document.getElementById("todate_hidden").value + "&" +
8
    "what2search=" + document.getElementById("what2search").value + "&" +
9
    "searchid=" + document.getElementById("searchid").value + "&" +
10
    "mitarbeiter=" + document.getElementById("mitarbeiter_hidden").value + "&";
11
}
locale/de/am
474 474
  'neue_ware'                   => 'new_part',
475 475
  'speichern'                   => 'save',
476 476
  'als_neu_speichern'           => 'save_as_new',
477
  'abschicken'                  => 'submit',
477 478
};
478 479

  
479 480
1;
templates/webpages/common/search_history_de.html
2 2
<script type="text/javascript" src="js/jscalendar/calendar.js"></script>
3 3
<script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
4 4
<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
5
<script type="text/javascript" src="js/show_am_history.js"></script>
6 5

  
7
<form method="post" onSubmit="javascript:set_history_uri();">
6
<form method="post" action="am.pl">
8 7

  
9 8
<input type="hidden" name="action" value="show_am_history">
10 9

  
......
55 54
					var jscalender = "<table valign=\"top\">"
56 55
									+ "<tr><td colspan=\"2\"><b>Zeitraum:&nbsp;</b></td></tr>"
57 56
									+ "<tr><td>von:&nbsp;"
58
									+ "<input name=\"fromdate\" id=\"fromdate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(fromdate) %]\" onChange=\"document.getElementById(\'fromdate_hidden\').value=this.value;\">"
57
									+ "<input name=\"fromdate\" id=\"fromdate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(fromdate) %]\">"
59 58
									+ "<input type=\"button\" name=\"fromdate\" id=\"trigger1\" value=\"?\">"
60 59
									+ "&nbsp;</td><td>bis:&nbsp;"
61
									+ "<input name=\"todate\" id=\"todate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(todate) %]\" onChange=\"document.getElementById(\'todate_hidden\').value=this.value;\">"
60
									+ "<input name=\"todate\" id=\"todate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(todate) %]\">"
62 61
									+ "<input type=\"button\" name=\"todate\" id=\"trigger2\" value=\"?\"></td></tr></table>";
63 62
					var mitarbeiter = "<table valign=\"top\">"
64 63
									+ "<tr><td><b>Mitarbeiter:</b>&nbsp;</td>"
65
									+ "<td><input type='text' name='mitarbeiter' id='mitarbeiter' onChange=\"document.getElementById(\'mitarbeiter_hidden\').value=this.value;\"></td>"
64
									+ "<td><input type='text' name='mitarbeiter' id='mitarbeiter'></td>"
66 65
									+ "</tr></table>";
67 66

  
68 67
					var tempString = "";
......
172 171
					</tr>
173 172
					<tr>
174 173
						<td colspan="6">
175
              <input type="hidden" value="" id="fromdate_hidden">
176
              <input type="hidden" value="" id="todate_hidden">
177
              <input type="hidden" value="" id="mitarbeiter_hidden">
178
							<input type="button" value="abschicken" onClick="javascript:set_history_uri();">
179
							<input type="reset" value="zur?cksetzen" onClick="javascript:resetAll();">
174
							<input type="submit" class="submit" value="abschicken">
175
							<input type="reset" class="submit" value="zur?cksetzen" onClick="javascript:resetAll();">
180 176
						</td>
181 177
						<td>
182 178
						</td>
templates/webpages/common/search_history_master.html
2 2
<script type="text/javascript" src="js/jscalendar/calendar.js"></script>
3 3
<script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
4 4
<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
5
<script type="text/javascript" src="js/show_am_history.js"></script>
6 5

  
7
<form method="post" onSubmit="javascript:set_history_uri();">
6
<form method="post" action="am.pl">
8 7

  
9 8
<input type="hidden" name="action" value="show_am_history">
10 9

  
......
55 54
					var jscalender = "<table valign=\"top\">"
56 55
									+ "<tr><td colspan=\"2\"><b><translate>Period</translate>:&nbsp;</b></td></tr>"
57 56
									+ "<tr><td><translate>from (time)</translate>:&nbsp;"
58
									+ "<input name=\"fromdate\" id=\"fromdate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(fromdate) %]\" onChange=\"document.getElementById(\'fromdate_hidden\').value=this.value;\">"
57
									+ "<input name=\"fromdate\" id=\"fromdate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(fromdate) %]\">"
59 58
									+ "<input type=\"button\" name=\"fromdate\" id=\"trigger1\" value=\"?\">"
60 59
									+ "&nbsp;</td><td><translate>to (time)</translate>:&nbsp;"
61
									+ "<input name=\"todate\" id=\"todate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(todate) %]\" onChange=\"document.getElementById(\'todate_hidden\').value=this.value;\">"
60
									+ "<input name=\"todate\" id=\"todate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(todate) %]\">"
62 61
									+ "<input type=\"button\" name=\"todate\" id=\"trigger2\" value=\"?\"></td></tr></table>";
63 62
					var mitarbeiter = "<table valign=\"top\">"
64 63
									+ "<tr><td><b>Mitarbeiter:</b>&nbsp;</td>"
65
									+ "<td><input type='text' name='mitarbeiter' id='mitarbeiter' onChange=\"document.getElementById(\'mitarbeiter_hidden\').value=this.value;\"></td>"
64
									+ "<td><input type='text' name='mitarbeiter' id='mitarbeiter'></td>"
66 65
									+ "</tr></table>";
67 66

  
68 67
					var tempString = "";
......
172 171
					</tr>
173 172
					<tr>
174 173
						<td colspan="6">
175
              <input type="hidden" value="" id="fromdate_hidden">
176
              <input type="hidden" value="" id="todate_hidden">
177
              <input type="hidden" value="" id="mitarbeiter_hidden">
178
							<input type="button" value="<translate>submit</translate>" onClick="javascript:set_history_uri();">
179
							<input type="reset" value="<translate>reset</translate>" onClick="javascript:resetAll();">
174
							<input type="submit" class="submit" value="<translate>submit</translate>">
175
							<input type="reset" class="submit" value="<translate>reset</translate>" onClick="javascript:resetAll();">
180 176
						</td>
181 177
						<td>
182 178
						</td>

Auch abrufbar als: Unified diff