rsanchez
2017-03-14 38b0782c887f046426c31766901906c614d73140
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<h3 md-dialog-title>{{form_title}}</h3>
<form #packForm="ngForm" (keyup.enter)="save()">
<md-dialog-content>
   <div layout="column" layout-align="start center">
       <div layout="row" layout-align="start center" layout-margin>
           <md-input-container flex>
               <input mdInput maxLength="50" type="text" [(ngModel)]="data.code" name="code" required />
               <md-placeholder>
                      <span i18n>Code</span>
                </md-placeholder>
           </md-input-container>
   <!-- TODO: <div class="alert inline-alert alert-warning" ng-show="packForm.code.$invalid">
       <span class="glyphicon glyphicon-warning-sign"></span> 
       <span ng-show="packForm.code.$error.maxlength" ng-bind="maxLengthErrorMsg('Code', maxlength.code)" 
       class="ng-binding ng-hide">Code length is too long (max: 50).</span> 
       <span ng-show="packForm.code.$error.required" ng-bind="mandatoryFieldErrorMsg('Code')" class="ng-binding">'Code' is required.</span>
   </div> -->
           <md-input-container flex>
               <input mdInput type="number" type="text" [(ngModel)]="data.num_licenses" name="num_licenses" required />
               <md-placeholder>
                      <span i18n>Num. licenses</span>
                </md-placeholder>
           </md-input-container>
       </div>
       <div layout="row" layout-align="start center" layout-margin>
           <md-input-container flex>
               <input mdInput type="date" type="text" [(ngModel)]="data.init_valid_date" name="init_valid_date" required />
               <md-placeholder>
                      <span i18n>Initial date</span>
                </md-placeholder>
           </md-input-container>
           <md-input-container flex>
               <input mdInput type="date" type="text" [(ngModel)]="data.end_valid_date" name="end_valid_date" required />
               <md-placeholder>
                      <span i18n>End date</span>
                </md-placeholder>
           </md-input-container>
       </div>
       <div layout="row" layout-align="start center" layout-margin>
           <md-select flex placeholder="Organization" [(ngModel)]="data.organization_id" name="organization_id">
               <md-option *ngFor="let org of organizations" [value]="org.id">
                   {{org.label}}
               </md-option>
           </md-select>
           <md-select flex placeholder="License type" [(ngModel)]="data.license_type_id" name="license_type_id">
               <md-option *ngFor="let lt of lictypes" [value]="lt.id">
                   {{lt.label}}
               </md-option>
           </md-select>
       </div>
   </div>
</md-dialog-content>
<md-dialog-actions layout="row" layout-align="end center">
   <button flex [disabled]="!packForm.form.valid" md-raised-button color="primary" (click)="save()">Save</button>
   <button flex md-button (click)="close()">Cancel</button>
</md-dialog-actions>
</form>    
<!-- **************************************************************************************************
     **************************************************************************************************
    **************************************************************************************************
-->
<div class="form-group">
<label class="col-md-3 control-label" for="license_type_id" i18n="">License
   type</label>
<div class="col-md-8">
   <!-- ngIf: isNew -->
   <select ng-if="isNew" class="form-control ng-pristine ng-untouched ng-scope ng-invalid ng-invalid-required" id="license_type_id" 
   ng-change="updateMetadata()" 
   ng-required="mandatory.license_type_id" 
   ng-model="pack.license_type_id" 
   ng-options="o.id as o.label for o in refs.license_type_id" required="required">
   <option value="" selected="selected" label=""></option><option value="0" label="CI ConfigServer ext">CI ConfigServer ext</option><option value="1" label="Analytic2">Analytic2</option><option value="2" label="Doxr L2">Doxr L2</option><option value="3" label="Doxr L3">Doxr L3</option><option value="4" label="CurisIntegrity - Desktop">CurisIntegrity - Desktop</option><option value="5" label="CurisIntegrity SA">CurisIntegrity SA</option><option value="6" label="Analytic1">Analytic1</option><option value="7" label="CurisIntegrity - List of modes">CurisIntegrity - List of modes</option><option value="8" label="CurisIntegrity for Curistec">CurisIntegrity for Curistec</option><option value="9" label="CurisIntegrity for BP">CurisIntegrity for BP</option><option value="10" label="CD_AllMod_AllCemtest_Custom_0U">CD_AllMod_AllCemtest_Custom_0U</option><option value="11" label="CurisIntegrity StandAlone - A1CPC">CurisIntegrity StandAlone - A1CPC</option><option value="12" label="CD_AllMod_AllCemtest_MIDtest_Custom_0U">CD_AllMod_AllCemtest_MIDtest_Custom_0U</option><option value="13" label="CI SA Complete">CI SA Complete</option><option value="14" label="CI for Dev Complete">CI for Dev Complete</option><option value="15" label="CD_RockMod_MIDtest_MIDSynth_Express_50U">CD_RockMod_MIDtest_MIDSynth_Express_50U</option><option value="16" label="CurisData for Sonatrach">CurisData for Sonatrach</option><option value="17" label="CD_AllMod_Alltest_Full_100_L_0S_0U">CD_AllMod_Alltest_Full_100_L_0S_0U</option><option value="18" label="CD_CementAdvMod_AllCemtest_Custom_100L_0S_0U">CD_CementAdvMod_AllCemtest_Custom_100L_0S_0U</option><option value="19" label="CD_CementAdvMod_AllCemtest_Custom_30U">CD_CementAdvMod_AllCemtest_Custom_30U</option><option value="20" label="CD_CementAdvMod_30U_10L_Express">CD_CementAdvMod_30U_10L_Express</option><option value="21" label="CD_CementAdv_Monolab">CD_CementAdv_Monolab</option><option value="22" label="Stand alone - MultiComputation">Stand alone - MultiComputation</option><option value="23" label="MultiCement">MultiCement</option><option value="24" label="CD_CementAdvMod_AllCemtest_Custom_100U">CD_CementAdvMod_AllCemtest_Custom_100U</option><option value="25" label="CI StandAlone A1">CI StandAlone A1</option><option value="26" label="CI StandAlone A1 A2 QL CementProperties">CI StandAlone A1 A2 QL CementProperties</option><option value="27" label="CI Corporate A1">CI Corporate A1</option><option value="28" label="CI Demo version">CI Demo version</option><option value="29" label="CD Complete">CD Complete</option></select>
   <!-- end ngIf: isNew -->
   <!-- ngIf: !isNew -->
   <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.license_type_id.$invalid">
       <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.license_type_id.$error.required" ng-bind="mandatoryFieldErrorMsg('License type')" class="ng-binding ng-hide">'License type' is required.</span>
   </div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="organization_id" i18n="">Organization</label>
<div class="col-md-8">
   <!-- ngIf: isNew --><select ng-if="isNew" class="form-control ng-pristine ng-untouched ng-scope ng-invalid ng-invalid-required" ng-model="pack.organization_id" ng-required="mandatory.organization_id" ng-options="o.id as o.label for o in refs.organization_id" required="required"><option value="" selected="selected" label=""></option><option value="0" label="British Petroleum">British Petroleum</option><option value="1" label="CurisTec">CurisTec</option><option value="2" label="KindSoft">KindSoft</option><option value="3" label="CurisIT">CurisIT</option><option value="4" label="Trican">Trican</option><option value="5" label="Schlumberger">Schlumberger</option><option value="6" label="Sonatrach">Sonatrach</option><option value="7" label="Sanjel-Taqa">Sanjel-Taqa</option><option value="8" label="National Petroleum Services Saudi Arabia Int.">National Petroleum Services Saudi Arabia Int.</option></select><!-- end ngIf: isNew -->
   <!-- ngIf: !isNew -->
   <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.organization_id.$invalid">
       <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.organization_id.$error.required" ng-bind="mandatoryFieldErrorMsg('Organization')" class="ng-binding ng-hide">'Organization' is required.</span>
   </div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="license_preactivation" i18n="">License preactivation</label>
<div class="col-md-8">
   <input type="checkbox" class="form-control ng-pristine ng-untouched ng-valid" ng-model="pack.license_preactivation">
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="preactivation_valid_period" i18n="">Preactivation valid period (days)</label>
<div class="col-md-8">
   <input type="number" id="preactivation_valid_period" name="preactivation_valid_period" min="1" class="form-control ng-pristine ng-untouched ng-valid ng-valid-min ng-valid-required" ng-model="pack.preactivation_valid_period" ng-required="pack.license_preactivation" required="required">
   <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.preactivation_valid_period.$invalid">
       <span class="glyphicon glyphicon-warning-sign"></span> 
       <span ng-show="packForm.preactivation_valid_period.$error.required" ng-bind="mandatoryFieldErrorMsg('Preactivation valid period')" class="ng-binding ng-hide">'Preactivation valid period' is required.</span>
       <span ng-show="packForm.preactivation_valid_period.$error.min" ng-bind="field1ShouldBeGreaterThanField2('The preactivation valid period', '0')" class="ng-binding ng-hide">The preactivation valid period should be greater than 0</span>
   </div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="renew_valid_period" i18n="">Period for renew (days)</label>
<div class="col-md-8">
   <input type="number" id="renew_valid_period" name="renew_valid_period" min="0" class="form-control ng-pristine ng-untouched ng-valid-min ng-valid ng-valid-required" ng-model="pack.renew_valid_period" ng-required="true" required="required">
   <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.renew_valid_period.$invalid">
       <span class="glyphicon glyphicon-warning-sign"></span> 
       <span ng-show="packForm.renew_valid_period.$error.required" ng-bind="mandatoryFieldErrorMsg('Period for renew')" class="ng-binding ng-hide">'Period for renew' is required.</span>
       <span ng-show="packForm.renew_valid_period.$error.min" ng-bind="field1ShouldBeGreaterThanField2('The period for renew valid period', '0')" class="ng-binding ng-hide">The period for renew valid period should be greater than 0</span>
   </div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="comments" i18n="">Comments</label>
<div class="col-md-8">
   <textarea type="string" id="comments" name="comments" placeholder="" class="form-control ng-pristine ng-untouched ng-valid ng-valid-maxlength ng-valid-required" ng-model="pack.comments" rows="2" ng-required="mandatory.comments" ng-maxlength="1024"></textarea>
   <div class="alert inline-alert alert-warning ng-hide" ng-show="packForm.comments.$invalid">
       <span class="glyphicon glyphicon-warning-sign"></span> <span ng-show="packForm.comments.$error.maxlength" ng-bind="maxLengthErrorMsg('Comments', maxlength.comments)" class="ng-binding ng-hide">Comments length is too long (max: 1024).</span>
       <span ng-show="packForm.comments.$error.required" ng-bind="mandatoryFieldErrorMsg('comments')" class="ng-binding ng-hide">'comments' is required.</span>
   </div>
</div>
</div>
<!-- ngIf: !isNew -->
<!-- ngIf: !isNew -->
<div class="form-group">
<label class="col-md-3 control-label" i18n="">Metadata</label>
<div class="col-md-8">
   <table class="table table-hover table-condensed">
       <thead>
           <tr>
               <th i18n="">Key</th>
               <th i18n="">Value</th>
           </tr>
       </thead>
       <tbody>
           <!-- ngRepeat: row_md in pack.metadata -->
       </tbody>
   </table>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-3 col-md-10">
   <button id="save" type="submit" class="btn btn-primary">
       <span i18n="" class="glyphicon glyphicon-floppy-disk"></span> Save
   </button>
   <!-- ngIf: !isNew -->
   <ul class="dropdown-menu" role="menu">
       <li><!-- ngIf: Packs.isActionAvailable('activate', pack) --><a ng-click="execute('activate')" ng-if="Packs.isActionAvailable('activate', pack)" href="#" class="ng-scope">Activate</a><!-- end ngIf: Packs.isActionAvailable('activate', pack) --></li>
       <li><!-- ngIf: Packs.isActionAvailable('putonhold', pack) --></li>
       <li class="divider"></li>
       <li><!-- ngIf: Packs.isActionAvailable('cancel', pack) --></li>
       <li><!-- ngIf: Packs.isActionAvailable('delete', pack) --><a ng-click="execute('delete')" ng-if="Packs.isActionAvailable('delete', pack)" href="#" class="ng-scope">Delete</a><!-- end ngIf: Packs.isActionAvailable('delete', pack) --></li>
       </ul>
</div>
</div>
</form>