mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-08 15:48:45 +01:00
Merge branch 'master' of https://github.com/devcode-it/openstamanager
This commit is contained in:
commit
7ca8c70b26
@ -46,14 +46,18 @@ class Autofill
|
||||
$this->max_rows_first_page = $first_page ?? $this->max_rows_first_page;
|
||||
}
|
||||
|
||||
public function count($text, $small = false)
|
||||
public function count($text, $small = null)
|
||||
{
|
||||
$count = ceil(strlen((string) $text) / $this->char_number);
|
||||
|
||||
// Ricerca dei caratteri a capo
|
||||
preg_match_all("/(\r\n|\r|\n)/", (string) $text, $matches);
|
||||
$count += count($matches[0]);
|
||||
$count = ($count == 1 ? $count : $count / 1.538461538 );
|
||||
if ($small) {
|
||||
$count *= 1.5;
|
||||
} elseif ($count != 1) {
|
||||
$count /= 1.538461538;
|
||||
}
|
||||
|
||||
$this->set($count);
|
||||
}
|
||||
|
@ -253,6 +253,7 @@ if (!empty($record['note'])) {
|
||||
echo '
|
||||
<p class="small-bold text-muted">'.tr('Note', [], ['upper' => true]).':</p>
|
||||
<p>'.nl2br((string) $record['note']).'</p>';
|
||||
$autofill->count($record['note'], true);
|
||||
}
|
||||
|
||||
echo '
|
||||
|
Loading…
x
Reference in New Issue
Block a user