Revision 47f12397
Added by Renato Botelho almost 15 years ago
etc/inc/voucher.inc | ||
---|---|---|
89 | 89 |
list($timestamp,$minutes) = explode(",", $line); |
90 | 90 |
// we have an already active voucher here. |
91 | 91 |
$remaining = intval((($timestamp + 60*$minutes) - time())/60); |
92 |
$test_result[] = sprintf(gettext("%s (%s/%s) active and good for %d Minutes"), $voucher, $roll, $nr, $remaining);
|
|
92 |
$test_result[] = sprintf(gettext("%1$s (%2$s/%3$s) active and good for %4$d Minutes"), $voucher, $roll, $nr, $remaining);
|
|
93 | 93 |
$total_minutes += $remaining; |
94 | 94 |
} else { |
95 | 95 |
// voucher not used. Check if ticket Id is on the roll (not too high) |
... | ... | |
100 | 100 |
$pos = $nr >> 3; // divide by 8 -> octet |
101 | 101 |
$mask = 1 << ($nr % 8); |
102 | 102 |
if (ord($bitstring[$roll][$pos]) & $mask) { |
103 |
$test_result[] = sprintf(gettext("%s (%s/%s) already used and expired"), $voucher, $roll, $nr);
|
|
103 |
$test_result[] = sprintf(gettext("%1$s (%2$s/%3$s) already used and expired"), $voucher, $roll, $nr);
|
|
104 | 104 |
$total_minutes = -1; // voucher expired |
105 | 105 |
$error++; |
106 | 106 |
} else { |
107 | 107 |
// mark bit for this voucher as used |
108 | 108 |
$bitstring[$roll][$pos] = chr(ord($bitstring[$roll][$pos]) | $mask); |
109 |
$test_result[] = sprintf(gettext("%s (%s/%s) good for %d Minutes"), $voucher, $roll, $nr, $minutes_per_roll[$roll]);
|
|
109 |
$test_result[] = sprintf(gettext("%1$s (%2$s/%3$) good for %4$d Minutes"), $voucher, $roll, $nr, $minutes_per_roll[$roll]);
|
|
110 | 110 |
$total_minutes += $minutes_per_roll[$roll]; |
111 | 111 |
} |
112 | 112 |
} |
113 | 113 |
} else { |
114 |
$test_result[] = sprintf(gettext("%s (%s/%s): not found on any registererd Roll"), $voucher, $roll, $nr);
|
|
114 |
$test_result[] = sprintf(gettext("%1$s (%2$s/%3$s): not found on any registererd Roll"), $voucher, $roll, $nr);
|
|
115 | 115 |
} |
116 | 116 |
} else { |
117 | 117 |
// hmm, thats weird ... not what I expected |
... | ... | |
330 | 330 |
fwrite($fd, $vdb . "\n"); |
331 | 331 |
fclose($fd); |
332 | 332 |
} else { |
333 |
voucher_log(LOG_ERR, sprintf(gettext("cant write %s/voucher_used_%s.db"), $g['vardb_path'], $roll));
|
|
333 |
voucher_log(LOG_ERR, sprintf(gettext("cant write %1$s/voucher_used_%2$s.db"), $g['vardb_path'], $roll));
|
|
334 | 334 |
} |
335 | 335 |
} |
336 | 336 |
|
... | ... | |
409 | 409 |
$vdb = trim(fgets($fd)); |
410 | 410 |
fclose($fd); |
411 | 411 |
} else { |
412 |
voucher_log(LOG_ERR, sprintf(gettext("cant read %s/voucher_used_%s.db"), $g['vardb_path'], $roll));
|
|
412 |
voucher_log(LOG_ERR, sprintf(gettext("cant read %1$s/voucher_used_%2$s.db"), $g['vardb_path'], $roll));
|
|
413 | 413 |
} |
414 | 414 |
} |
415 | 415 |
return base64_decode($vdb); |
Also available in: Unified diff
Fix gettext calls with printf to permit change strings order