Revision f50ddd66
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
62 | 62 |
use SL::Menu; |
63 | 63 |
use SL::MoreCommon qw(uri_encode uri_decode); |
64 | 64 |
use SL::OE; |
65 |
use SL::PrefixedNumber; |
|
65 | 66 |
use SL::Request; |
66 | 67 |
use SL::Template; |
67 | 68 |
use SL::User; |
... | ... | |
3189 | 3190 |
my ($var) = $sth->fetchrow_array; |
3190 | 3191 |
$sth->finish; |
3191 | 3192 |
|
3192 |
if ($var =~ m/\d+$/) { |
|
3193 |
my $new_var = (substr $var, $-[0]) * 1 + 1; |
|
3194 |
my $len_diff = length($var) - $-[0] - length($new_var); |
|
3195 |
$var = substr($var, 0, $-[0]) . ($len_diff > 0 ? '0' x $len_diff : '') . $new_var; |
|
3196 |
|
|
3197 |
} else { |
|
3198 |
$var = $var . '1'; |
|
3199 |
} |
|
3200 |
|
|
3193 |
$var = SL::PrefixedNumber->new(number => $var)->get_next; |
|
3201 | 3194 |
$query = qq|UPDATE defaults SET $fld = ?|; |
3202 | 3195 |
do_query($self, $dbh, $query, $var); |
3203 | 3196 |
|
Auch abrufbar als: Unified diff
SL::PrefixedNumber -- Nummernkreisartige Nummer erhöhen ohne Datenbank