Pārlūkot izejas kodu

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

refactoring
keun pirms 6 gadiem
vecāks
revīzija
56c2f7dcf5
4 mainītis faili ar 13 papildinājumiem un 2 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

@@ -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;

Notiek ielāde…
Atcelt
Saglabāt