securis/src/main/resources/META-INF/persistence.xml
.. .. @@ -5,7 +5,8 @@ 5 5 <persistence-unit name="localdb" transaction-type="RESOURCE_LOCAL"> 6 6 <description>SeCuris LocalDB</description> 7 7 <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> 8 -8 + <shared-cache-mode>NONE</shared-cache-mode>9 +9 10 <!-- <jta-data-source>java:comp/env/jdbc/SeCurisDS</jta-data-source> 10 11 --> 11 12 <!-- <class>net.curisit.securis.db.UserSettingsUnits</class> --> securis/src/main/webapp/header.html
.. .. @@ -2,10 +2,11 @@ 2 2 <div class="navbar navbar-inverse navbar-fixed-top"> 3 3 <div class="container"> 4 4 <div class="navbar-header"> 5 +5 6 <ul class="nav navbar-nav navbar-left"> 6 - <li i18n style="color: white; padding-top: 15px;">SeCuris</li>7 - <li><a i18n href="licenses">Licenses</a></li>8 - <li><a i18n href="admin">Admin</a></li>7 + <li><h3 style="color: #eeeeee; margin-right: 20px;margin-top: 10px;">SeCuris</h2></li>8 + <li ng-class="{active: $location.path() === '/licenses'}" ><a i18n ng-class="" href="licenses">Licenses</a></li>9 + <li ng-class="{active: $location.path() === '/admin'}"><a i18n href="admin">Admin</a></li>9 10 </ul> 10 11 </div> 11 12 <div class="navbar-collapse collapse"> securis/src/main/webapp/index.jsp
.. .. @@ -58,7 +58,7 @@ 58 58 <script type="text/javascript" src="js/licenses.js"></script> 59 59 <script type="text/javascript" src="js/admin.js"></script> 60 60 61 - <toaster-container toaster-options="{'time-out': 3000}"></toaster-container>61 + <toaster-container toaster-options="{'time-out': 5000}"></toaster-container>62 62 </div> 63 63 </body> 64 64 </html> securis/src/main/webapp/js/catalogs.js
.. .. @@ -87,11 +87,12 @@ 87 87 * number it find it by position 88 88 */ 89 89 this.getMetadata = function(index) { 90 - if (!_metadata)91 - throw new Error(92 - 'There is no catalog metadata info');93 - if (index === undefined)90 + if (!_metadata) {91 + throw new Error('There is no catalog metadata info');92 + }93 + if (index === undefined) {94 94 return _current; 95 + }95 96 if (typeof index === 'string') { 96 97 for (var i = _metadata.length - 1; i >= 0 97 98 && _metadata[i].resource !== index; i--) .. .. @@ -217,13 +218,14 @@ 217 218 } 218 219 this.loadRefs = function(callback, refsFields) { 219 220 if (!refsFields || refsFields.length === 0) { 220 - if (!_current)221 + if (!_current) {221 222 throw new Error('There is no current catalog selected'); 223 + }222 224 refsFields = []; 223 225 _current.fields.forEach(function(f) { 224 - if (f.resource)225 - refsFields.push(f)226 -226 + if (f.resource) {227 + refsFields.push(f);228 + }227 229 }); 228 230 } 229 231 .. .. @@ -248,6 +250,7 @@ 248 250 refs[rf.name].forEach(function(row) { 249 251 comboData.push({ 250 252 id : row[pk], 253 + code : row.code,251 254 label : row.label 252 255 || row.name 253 256 || row.code securis/src/main/webapp/js/licenses.js
.. .. @@ -427,6 +427,10 @@ 427 427 var refFields = [{resource: 'organization', name: 'organization_id'},{resource: 'licensetype', name: 'license_type_id'}]; 428 428 Catalogs.loadRefs(function(refs) { 429 429 $scope.refs = refs; 430 + angular.forEach($scope.packs, function(elem) {431 + elem.organization_code = $scope.getOrganizationCode(elem.organization_id);432 + elem.license_type_code = $scope.getLicenseTypeCode(elem.license_type_id);433 + });430 434 }, refFields); 431 435 }); 432 436 .. .. @@ -440,7 +444,12 @@ 440 444 // the new pack 441 445 $scope.pack = null; 442 446 443 - $scope.packs = Packs.getPacksList();447 + $scope.packs = Packs.getPacksList(function(list) {448 + angular.forEach(list, function(elem) {449 + elem.organization_code = $scope.getOrganizationCode(elem.organization_id);450 + elem.license_type_code = $scope.getLicenseTypeCode(elem.license_type_id);451 + });452 + });444 453 445 454 $scope.save = function() { 446 455 Packs.savePackData($scope.pack, $scope.isNew, function() { .. .. @@ -609,6 +618,28 @@ 609 618 return label; 610 619 } 611 620 621 + $scope.getOrganizationCode = function(orgId) {622 + return $scope._getCodeFromId('organization_id', orgId);623 + }624 +625 + $scope.getLicenseTypeCode = function(ltId) {626 + return $scope._getCodeFromId('license_type_id', ltId);627 + }628 +629 + $scope._getCodeFromId = function(field, myid) {630 + if (!myid) {631 + return null;632 + }633 + var list = $scope.refs[field];634 + for(var i = 0; list && i < list.length; i++) {635 + var elem = list[i];636 + if (elem.id === myid) {637 + return elem.code;638 + }639 + }640 + return null;641 + }642 +612 643 $scope.createMetadataRow = function() { 613 644 if (!$scope.formu.metadata) { 614 645 $scope.formu.metadata = []; securis/src/main/webapp/js/main.js
.. .. @@ -84,9 +84,8 @@ 84 84 m.controller('MainCtrl', ['$scope', '$http', '$location', '$L', '$store', 85 85 function($scope, $http, $location, $L, $store) { 86 86 87 - $scope.currentRoute = null;88 - console.log('Current location: ' + $location);89 - console.log($location);87 + $scope.$location = $location;88 +90 89 $location.path('/login'); 91 90 if ($store.get('token') != null) { 92 91 securis/src/main/webapp/licenses.html
.. .. @@ -275,9 +275,10 @@ 275 275 <thead> 276 276 <tr> 277 277 <th i18n>Code</th> 278 - <th i18n>Organization</th>279 278 <th i18n>Application</th> 280 - <th i18n>Licenses</th>279 + <th i18n>Lic. type</th>280 + <th i18n>Organization</th>281 + <th i18n>Lics.</th>281 282 <th></th> 282 283 </tr> 283 284 </thead> .. .. @@ -287,9 +288,10 @@ 287 288 ng-class="{success: currentPack.id === p.id}" 288 289 ng-click="selectPack(p)"> 289 290 <td style="white-space: nowrap;" ng-bind="p.code"></td> 290 - <td ng-bind="ellipsis(p.organization_name, 20)"291 - title="{{pack.organization_name}}"></td>292 291 <td ng-bind="p.application_name"></td> 292 + <td ng-bind="p.license_type_code"></td>293 + <td ng-bind="ellipsis(p.organization_code + ' - ' + p.organization_name, 25)"294 + title="{{p.organization_code + ' - ' + pack.organization_name}}"></td>293 295 <td 294 296 title="Total: {{p.num_licenses}}, available: {{p.num_available}}">{{p.num_licenses}} 295 297 ({{p.num_available}})</td> .. .. @@ -448,16 +450,17 @@ 448 450 <div class="form-group" > 449 451 <label class="col-md-3 control-label" for="request_data" i18n>Request 450 452 data</label> 451 - <div class="col-md-7">453 + <div class="col-md-{{(isNew || Licenses.isActionAvailable('add_request', license)) ? 7 : 8}}">452 454 <textarea id="request_data" name="request_data" placeholder="" 453 455 class="form-control" ng-model="license.request_data" rows="2" 454 456 ng-required="mandatory.request_data" 457 + ng-readonly="!isNew && !Licenses.isActionAvailable('add_request', license)"455 458 ng-maxlength="{{maxlength.request_data}}"></textarea> 456 459 <div class="alert inline-alert alert-warning" 457 460 ng-show="licenseForm.request_data.$invalid"> 458 - <!-- Invalid ? {{licenseForm.request_data.$invalid}}461 + <!-- Invalid ? {{licenseForm.request_data.$invalid}}459 462 Error ? {{licenseForm.request_data.$error | json}} 460 - Error ? {{licenseForm.request_data.$error.maxlength}} -->463 + Error ? {{licenseForm.request_data.$error.maxlength}} -->461 464 <span class="glyphicon glyphicon-warning-sign"> 462 465 <span 463 466 ng-show="licenseForm.request_data.$error.maxlength"