Bläddra i källkod

Refactoring affichage de l'utilisateur à l'origine d'un CreditHistorique

dev
keun 6 år sedan
förälder
incheckning
56c2f7dcf5
4 ändrade filer med 13 tillägg och 2 borttagningar
  1. +1
    -1
      backend/controllers/CommandeController.php
  2. +1
    -1
      backend/views/user/credit.php
  3. +9
    -0
      common/models/CreditHistorique.php
  4. +2
    -0
      common/models/User.php

+ 1
- 1
backend/controllers/CommandeController.php Visa fil

@@ -1191,7 +1191,7 @@ class CommandeController extends BackendController {
foreach ($historique as $h) {
$html .= '<tr>'
. '<td>' . date('d/m/Y H:i:s', strtotime($h->date)) . '</td>'
. '<td>' . Html::encode($h->userAction->nom . ' ' . $h->userAction->prenom) . '</td>'
. '<td>' . Html::encode($h->strUserAction()) . '</td>'
. '<td>' . $h->getStrLibelle() . '</td>'
. '<td>' . ($h->isTypeDebit() ? '- '.$h->getMontant(true) : '') . '</td>'
. '<td>' . ($h->isTypeCredit() ? '+ '.$h->getMontant(true) : '') . '</td>'

+ 1
- 1
backend/views/user/credit.php Visa fil

@@ -67,7 +67,7 @@ $this->params['breadcrumbs'][] = 'Créditer';
<?php foreach($historique as $ch): ?>
<tr>
<td><?= $ch->getDate(true) ; ?></td>
<td><?php if(isset($ch->userAction)): echo Html::encode($ch->userAction->nom. ' '.$ch->userAction->prenom) ; else: echo 'Administrateur' ;endif; ?></td>
<td><?= Html::encode($ch->strUserAction()); ?></td>
<td><?= $ch->getStrLibelle(); ?></td>
<td>
<?php if($ch->isTypeDebit()): ?>

+ 9
- 0
common/models/CreditHistorique.php Visa fil

@@ -207,5 +207,14 @@ class CreditHistorique extends ActiveRecord {
default: return 'Crédit pain' ;
}
}
public function strUserAction() {
if($this->userAction) {
return $this->userAction->nom . ' ' . $this->userAction->prenom ;
}
else {
return 'Système' ;
}
}

}

+ 2
- 0
common/models/User.php Visa fil

@@ -26,6 +26,8 @@ class User extends ActiveRecord implements IdentityInterface {
const STATUS_BOULANGER = 11;
const STATUS_ADMIN = 13;

const ID_USER_SYSTEM = 0 ;
var $password_old;
var $password_new;
var $password_new_confirm;

Laddar…
Avbryt
Spara