Skip to content
Permalink
Browse files

New functionality: Possible to block lending to blocked people.

  • Loading branch information...
fmfurtado committed Jan 4, 2019
1 parent cf49f65 commit 6821eafda97ff93266fd6914db95728ebe0b9bde
BIN +464 Bytes (100%) database/database.mwb
Binary file not shown.
BIN -136 Bytes (99%) database/database.mwb.bak
Binary file not shown.
@@ -114,6 +114,7 @@ CREATE TABLE `tb_person` (
`phone2` varchar(45) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`notes` longtext,
`active` BOOLEAN DEFAULT false,
`date_creation` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
@@ -6,6 +6,7 @@ ALTER TABLE TB_BOOK ADD `lost` TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE TB_BOOK ADD `lost_by_username` VARCHAR(30) NULL;
ALTER TABLE TB_BOOK ADD `lost_timestamp` DATETIME NULL;
ALTER TABLE TB_ABOUT ADD `site_max_lent_books` TINYINT(1) NOT NULL DEFAULT 2;
ALTER TABLE TB_PERSON ADD `active` BOOLEAN DEFAULT false;

---
--- Table 'tb_audit'
@@ -68,7 +68,7 @@ function backup_tables($host,$user,$pass,$name,$tables = '*')
// Create backup
$files_to_backup = "tb_about,tb_category,tb_language,tb_person,tb_type,tb_book,tb_lend";
$files_to_backup = "tb_about,tb_category,tb_language,tb_person,tb_type,tb_book,tb_lend,tb_audit";
$db_backup = backup_tables($fmw->config->server, $fmw->config->username, $fmw->config->password, $fmw->config->database_name, $files_to_backup);
// Fixing problem with date_return
@@ -90,15 +90,24 @@ function confirmation() {
if (isset($row['qtt'])) {
if ($row['qtt'] >= $fmw->maxLentBooks()) {
$personCanLend = false;
$message_personCanLend = $t->__('bookLend.tooltip.maxNumberLent', $fmw->maxLentBooks());
}
}
// Check if this person is active
if (isset($row['active'])) {
if (!$row['active']) {
$personCanLend = false;
$message_personCanLend = $t->__('bookLend.tooltip.person_not_active');
}
}
echo "<tr>";
echo "<td>";
if ($personCanLend) {
echo "<input type='radio' name='person_id' onchange='javascript:_personSelected(\"". $row['id'] . "\")'/>";
} else {
echo "<input type='radio' data-toggle='tooltip' title='", $t->__('bookLend.tooltip.maxNumberLent', $fmw->maxLentBooks()), "' disabled/>";
echo "<input type='radio' data-toggle='tooltip' title='", $fmw->escapeHtml($message_personCanLend), "' disabled/>";
}
echo "</td>";
echo "<td>";
@@ -47,6 +47,8 @@ db.person.phone1=Phone&nbsp;1
db.person.phone2=Phone&nbsp;2
db.person.email=E-mail
db.person.notes=Notes
db.person.active=Active?
db.person.active_explanation=Active person when he/she aggres with the new regulations of 2019.
db.person.date_creation=Creation&nbsp;Date

db.lend=Loan data
@@ -128,7 +130,8 @@ bookLend.title=Lending of a book
bookLendConfirmation.title=Confirmation for lending a book
bookLend.label.question=Do you confirm the lending of this book?

bookLend.tooltip.maxNumberLent=A person can lent maximum %1 book(s).
bookLend.tooltip.maxNumberLent=A person can lend maximum %1 book(s).
bookLend.tooltip.person_not_active=Person is not active, the acceptance of the new library rules of 2019 is necessary.

bookLendSave.message.bookNotFound=Book was not found. Please try again.
bookLendSave.message.personNotFound=Person was not found. Please try again.
@@ -47,6 +47,8 @@ db.person.phone1=Phone&nbsp;1
db.person.phone2=Phone&nbsp;2
db.person.email=E-mail
db.person.notes=Notes
db.person.active=Active?
db.person.active_explanation=Activer quand la personne est d'accord avec le nouveau reglement de 2019.
db.person.date_creation=Date&nbsp;de&nbsp;Création

db.lend=Données de l'emprunt
@@ -128,7 +130,8 @@ bookLend.title=Emprunter des livres
bookLendConfirmation.title=Confirmation d'emprunt de livre
bookLend.label.question=Est-ce que vous confirmez l'emprunt de ce livre?

bookLend.tooltip.maxNumberLent=Chaque personnne peut emprunter maximum %1 livre(s).
bookLend.tooltip.maxNumberLent=Chaque personnne peut emprunter maximum %1 livre(s).
bookLend.tooltip.person_not_active=Personne n'est pas active, cars elle doit accepter les nouveaux reglements de 2019.

bookLendSave.message.bookNotFound=Livre n'as pas été trouvé. Essayer à nouveau.
bookLendSave.message.personNotFound=Personne n'as pas été trouvé. Essayer à nouveau.
@@ -47,6 +47,8 @@ db.person.phone1=Fone&nbsp;1
db.person.phone2=Fone&nbsp;2
db.person.email=E-mail
db.person.notes=Notas
db.person.active=Ativa?
db.person.active_explanation=Ativar quando a pessoa concorda com os novos regulamentos de 2019.
db.person.date_creation=Data&nbsp;de&nbsp;Criação

db.lend=Dados&nbsp;do&nbsp;Empréstimo
@@ -128,7 +130,8 @@ bookLend.title=Empréstimo de um livro
bookLendConfirmation.title=Confirmação do empréstimo do livro
bookLend.label.question=Você confirma o empréstimo deste livro?

bookLend.tooltip.maxNumberLent=Cada pessoa pode emprestar no máximo %1 livro(s).
bookLend.tooltip.maxNumberLent=Cada pessoa pode emprestar no máximo %1 livro(s).
bookLend.tooltip.person_not_active=Pessoa não esta ativa, ela precisa aceitar as novas regras da biblioteca de 2019.

bookLendSave.message.bookNotFound=Livro não encontrado. Tente novamente.
bookLendSave.message.personNotFound=Pessoa não encontrada. Tente novamente.
@@ -74,6 +74,14 @@
</div>
</div>

<div class="form-group">
<label class="control-label col-sm-2"><?= $t->__('db.person.active') ?></label>
<div class="col-sm-1">
<input type="checkbox" name="active" class="form-control" value='1' <?= $fmw->getPostOrArray($columns, 'active') == '1' ? 'checked' : '' ?> >
</div>
<p class="form-control-static"><?= $t->__('db.person.active_explanation') ?></p>
</div>

<?php if ($id != '') { ?>
<div class="form-group">
<label class="control-label col-sm-2"><?= $t->__('db.person.date_creation') ?>:</label>
@@ -17,6 +17,7 @@
"phone1" => $_POST['phone1'],
"phone2" => $_POST['phone2'],
"email" => $_POST['email'],
"active" => $_POST['active'],
"notes" => $_POST['notes']
);

1 comment on commit 6821eaf

@patricksan

This comment has been minimized.

Copy link
Member

commented on 6821eaf Jan 9, 2019

Legal que voltou a codificar para o easybiblio!

Please sign in to comment.
You can’t perform that action at this time.