Skip to content
Snippets Groups Projects
Commit 4572b811 authored by Damien's avatar Damien
Browse files

FEAT #5233 Récupération de l'historique du courrier + création filtre date angular

parent 82143ca7
No related branches found
No related tags found
No related merge requests found
<?php
/*
* Copyright 2015 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
require_once 'apps/maarch_entreprise/Models/HistoryModelAbstract.php';
class HistoryModel extends HistoryModelAbstract {
// Do your stuff in this class
}
\ No newline at end of file
<?php
/*
* Copyright 2015 Maarch
*
* This file is part of Maarch Framework.
*
* Maarch Framework is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Maarch Framework is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Maarch Framework. If not, see <http://www.gnu.org/licenses/>.
*/
require_once 'apps/maarch_entreprise/services/Table.php';
class HistoryModelAbstract extends Apps_Table_Service {
public static function getByIdForActions(array $aArgs = []) {
static::checkRequired($aArgs, ['id']);
static::checkNumeric($aArgs, ['id']);
$aReturn = static::select([
'select' => empty($aArgs['select']) ? ['*'] : $aArgs['select'],
'table' => ['history', 'users'],
'left_join' => ['history.user_id = users.user_id'],
'where' => ['history.record_id = ?', 'history.event_type like ?', 'history.event_id ~ ?'],
'data' => [$aArgs['id'], 'ACTION#%', '^[0-9]+$'],
'order_by' => empty($aArgs['orderBy']) ? ['event_date'] : $aArgs['orderBy']
]);
return $aReturn;
}
}
\ No newline at end of file
......@@ -9,3 +9,15 @@ mainApp.config(['$routeProvider', '$locationProvider', function($routeProvider,
$locationProvider.hashPrefix('');
}]);
mainApp.filter('datetimeFormat', function($filter)
{
return function(input)
{
if(input == null) {
return "";
}
return $filter('date')(new Date(input), 'dd/MM/yyyy HH:mm');
};
});
......@@ -7,6 +7,7 @@ use Psr\Http\Message\ResponseInterface;
require_once 'modules/basket/class/class_modules_tools.php';
require_once 'apps/maarch_entreprise/Models/ResModel.php';
require_once 'apps/maarch_entreprise/Models/HistoryModel.php';
class VisaController {
......@@ -95,6 +96,12 @@ class VisaController {
];
}
$history = \HistoryModel::getByIdForActions([
'id' => $resId,
'select' => ['event_date', 'info', 'firstname', 'lastname'],
'orderBy' => ['event_date DESC']
]);
$datas = [];
$datas['actions'] = $actionsData;
......@@ -102,6 +109,7 @@ class VisaController {
$datas['documents'] = $documents;
$datas['currentAction'] = $_SESSION['current_basket']['default_action']; //TODO Aller chercher l'id de la basket sans passer par la session
$datas['linkNotes'] = 'index.php?display=true&module=notes&page=notes&identifier=' .$resId. '&origin=document&coll_id=letterbox_coll&load&size=medium';
$datas['history'] = $history;
return $response->withJson($datas);
}
......
<div class="visaResList">
{{signatureBook.history[0].event_date | datetimeFormat}}
</div>
<div class='visaContent'>
<div class="headerSignatureBook">
<div class="item" ng-class="{'activeTabSignatureBook': signatureBook.headerTab == 1}" ng-click="changeSignatureBookLeftContent(1)">
<i class="fa fa-dashboard fa-2x"></i>
</div>
<div class="item" ng-class="{'activeTabSignatureBook': signatureBook.headerTab == 2}" ng-click="changeSignatureBookLeftContent(2)">
</div>
<div class="item" ng-class="{'activeTabSignatureBook': signatureBook.headerTab == 2}" ng-click="changeSignatureBookLeftContent(2)">
<i class="fa fa-pencil fa-2x"></i>
</div>
<div class="item" ng-class="{'activeTabSignatureBook': signatureBook.headerTab == 3}" ng-click="changeSignatureBookLeftContent(3)">
</div>
<div class="item" ng-class="{'activeTabSignatureBook': signatureBook.headerTab == 3}" ng-click="changeSignatureBookLeftContent(3)">
<i class="fa fa-certificate fa-2x"></i>
</div>
<div class="item" ng-class="{'activeTabSignatureBook': signatureBook.headerTab == 4}" ng-click="changeSignatureBookLeftContent(4)">
</div>
<div class="item" ng-class="{'activeTabSignatureBook': signatureBook.headerTab == 4}" ng-click="changeSignatureBookLeftContent(4)">
<i class="fa fa-line-chart fa-2x"></i>
</div>
<div class="others">
</div>
<div class="others">
</div>
<div class="actions">
</div>
<div class="actions">
<select id="signatureBookActions">
<option ng-repeat="option in signatureBook.actions" value="{{option.value}}">{{option.label}}</option>
</select>
<input name="send" id="send" value="Valider" class="button" type="button" ng-click="validForm()">
</div>
</div>
</div>
<div class="contentSignatureBook">
<div class="contentLeft">
......@@ -49,8 +49,8 @@
<div class="contentRight">
<div class="contentShow">
<div class="pjDetails">
<div class="infoPj"><label>Type : </label><span>Projet de réponse</span></div>
<div class="infoPj"><label>Objet : </label><span>Réponse délicate</span></div>
<div class="infoPj"><label>Type : </label><span>{{signatureBook.attachments[signatureBook.rightSelectedThumbnail].attachment_type}}</span></div>
<div class="infoPj"><label>Objet : </label><span>{{signatureBook.attachments[signatureBook.rightSelectedThumbnail].title}}</span></div>
<div class="infoPj"><label>Contact : </label><span>Laurent GIOVANONNI - 11 boulevard du sud est</span></div>
</div>
<div class="pjDetailsMore">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment