do not trim int, use cast

This commit is contained in:
Frédéric FRANCE 2019-01-27 14:30:23 +01:00 committed by GitHub
parent a9da6a2d51
commit ac63a7b6b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,8 +105,8 @@ if ($cancel) {
if ($action == 'add' && $user->rights->adherent->configurer) if ($action == 'add' && $user->rights->adherent->configurer)
{ {
$object->label = trim($label); $object->label = trim($label);
$object->statut = trim($statut); $object->statut = (int) $statut;
$object->subscription = (int) trim($subscription); $object->subscription = (int) $subscription;
$object->note = trim($comment); $object->note = trim($comment);
$object->mail_valid = trim($mail_valid); $object->mail_valid = trim($mail_valid);
$object->vote = (boolean) trim($vote); $object->vote = (boolean) trim($vote);
@ -159,8 +159,8 @@ if ($action == 'update' && $user->rights->adherent->configurer)
$object->oldcopy = clone $object; $object->oldcopy = clone $object;
$object->label = trim($label); $object->label = trim($label);
$object->statut = trim($statut); $object->statut = (int) $statut;
$object->subscription = (int) trim($subscription); $object->subscription = (int) $subscription;
$object->note = trim($comment); $object->note = trim($comment);
$object->mail_valid = trim($mail_valid); $object->mail_valid = trim($mail_valid);
$object->vote = (boolean) trim($vote); $object->vote = (boolean) trim($vote);
@ -283,8 +283,11 @@ if (! $rowid && $action != 'create' && $action != 'edit')
print '<td align="center">'.yn($objp->subscription).'</td>'; print '<td align="center">'.yn($objp->subscription).'</td>';
print '<td align="center">'.yn($objp->vote).'</td>'; print '<td align="center">'.yn($objp->vote).'</td>';
print '<td align="center">'; print '<td align="center">';
if ( !empty($objp->statut) ) print img_picto($langs->trans("InActivity"),'statut4'); if ( !empty($objp->statut) ) {
else print img_picto($langs->trans("ActivityCeased"),'statut5'); print img_picto($langs->trans("InActivity"),'statut4');
} else {
print img_picto($langs->trans("ActivityCeased"),'statut5');
}
print '</td>'; print '</td>';
if ($user->rights->adherent->configurer) if ($user->rights->adherent->configurer)
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>'; print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
@ -405,8 +408,11 @@ if ($rowid > 0)
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td class="titlefield">'.$langs->trans("Status").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("Status").'</td><td>';
if ( !empty($object->statut) ) print img_picto($langs->trans('TypeStatusActive'),'statut4').' '.$langs->trans("InActivity"); if ( !empty($object->statut) ) {
else print img_picto($langs->trans('TypeStatusInactive'),'statut5').' '.$langs->trans("ActivityCeased"); print img_picto($langs->trans('TypeStatusActive'),'statut4').' '.$langs->trans("InActivity");
} else {
print img_picto($langs->trans('TypeStatusInactive'),'statut5').' '.$langs->trans("ActivityCeased");
}
print '</tr>'; print '</tr>';
print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>';