</div>
<div class="modal-footer">
<button type="button" class="btn btn-success"
- (click)="delete()" i18n>Delete Setting</button>
- <button type="button" class="btn btn-warning"
(click)="update()" i18n>Update Setting</button>
+ <button type="button" class="btn btn-warning"
+ (click)="delete()" i18n>Delete Setting</button>
</div>
</ng-template>
<ng-template #fmClassLabel let-r="result" i18n>
{{r.label}}
-</ng-template>
\ No newline at end of file
+</ng-template>
if (log) {
const intTypes = ['integer', 'currency', 'link'];
if (intTypes.includes(this.entry.dataType)) {
- log.new_value = Number(log.new_value);
+ log.original_value = Number(log.original_value);
} else {
- log.new_value = log.new_value.replace(/^"(.*)"$/, '$1');
+ log.original_value = log.original_value.replace(/^"(.*)"$/, '$1');
}
+
+ if (this.entry.dataType === 'bool') {
+ if (log.original_value.match(/^t/)) {
+ log.original_value = true;
+ } else {
+ log.original_value = false;
+ }
+ }
+
this.close({
- setting: {[this.entry.name]: log.new_value},
+ setting: {[this.entry.name]: log.original_value},
context: this.org.get(log.org),
revert: true
});
<!-- Org Unit Settings Grid -->
<div class='w-11 mt-3'>
<eg-grid #orgUnitSettingsGrid [dataSource]="gridDataSource"
- [disableSelect]="true"
- [sortable]="false" [showDeclaredFieldsOnly]="true"
+ [disableSelect]="true" [useLocalSort]="true" [multiSortable]="true"
+ [sortable]="true" [showDeclaredFieldsOnly]="true"
persistKey="admin.actor.org_unit_settings">
- <eg-grid-column i18n-label label="Edit" name="edit" [flex]="1"
+ <eg-grid-column i18n-label label="Edit" name="edit" [flex]="1" [sortable]="false" [multiSortable]="false"
[disableTooltip]="true" [cellTemplate]="editCellTemplate"></eg-grid-column>
- <eg-grid-column i18n-label label="History" name="history" [flex]="1"
+ <eg-grid-column i18n-label label="History" name="history" [flex]="1" [sortable]="false" [multiSortable]="false"
[disableTooltip]="true" [cellTemplate]="historyCellTemplate"></eg-grid-column>
<eg-grid-column path="name" label="Name" i18n-label [hidden]="true" [flex]="3"></eg-grid-column>
<eg-grid-column path="grp" label="Group" i18n-label [flex]="1"></eg-grid-column>
<eg-grid-column path="label" label="Setting" [index]="true" i18n-label [flex]="4"></eg-grid-column>
+ <eg-grid-column path="description" label="Description" [hidden]="true" i18n-label [flex]="6"></eg-grid-column>
<eg-grid-column path="context.shortname()" label="Context" i18n-label [flex]="1"></eg-grid-column>
<eg-grid-column path="value_str" label="Value" i18n-label [flex]="1"></eg-grid-column>