瀏覽代碼

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

dev
keun 6 年之前
父節點
當前提交
56c2f7dcf5
共有 4 個文件被更改,包括 13 次插入2 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

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

Loading…
取消
儲存