'bool'
);
+-- 0250.data.org-setting-url.remote_column_settings.sql
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'url.remote_column_settings',
+ oils_i18n_gettext(
+ 'url.remote_column_settings',
+ 'GUI: URL for remote directory containing list column settings.',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'url.remote_column_settings',
+ 'GUI: URL for remote directory containing list column settings. The format and naming convention for the files found in this directory match those in the local settings directory for a given workstation. An administrator could create the desired settings locally and then copy all the tree_columns_for_* files to the remote directory.',
+ 'coust',
+ 'description'),
+ 'string'
+);
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'gui.disable_local_save_columns',
+ oils_i18n_gettext(
+ 'gui.disable_local_save_columns',
+ 'GUI: Disable the ability to save list column configurations locally.',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'gui.disable_local_save_columns',
+ 'GUI: Disable the ability to save list column configurations locally. If set, columns may still be manipulated, however, the changes do not persist. Also, existing local configurations are ignored if this setting is true.',
+ 'coust',
+ 'description'),
+ 'bool'
+);
+
-- Org_unit_setting_type(s) that need an fm_class:
INSERT into config.org_unit_setting_type
( name, label, description, datatype, fm_class ) VALUES
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0250'); -- phasefx
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'url.remote_column_settings',
+ oils_i18n_gettext(
+ 'url.remote_column_settings',
+ 'GUI: URL for remote directory containing list column settings.',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'url.remote_column_settings',
+ 'GUI: URL for remote directory containing list column settings. The format and naming convention for the files found in this directory match those in the local settings directory for a given workstation. An administrator could create the desired settings locally and then copy all the tree_columns_for_* files to the remote directory.',
+ 'coust',
+ 'description'),
+ 'string'
+);
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'gui.disable_local_save_columns',
+ oils_i18n_gettext(
+ 'gui.disable_local_save_columns',
+ 'GUI: Disable the ability to save list column configurations locally.',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'gui.disable_local_save_columns',
+ 'GUI: Disable the ability to save list column configurations locally. If set, columns may still be manipulated, however, the changes do not persist. Also, existing local configurations are ignored if this setting is true.',
+ 'coust',
+ 'description'),
+ 'bool'
+);
+
+
+COMMIT;
JSAN.use('util.error'); this.error = new util.error();
+ JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.stash_retrieve();
+
return this;
};
'save_columns' : function (params) {
var obj = this;
- switch (this.node.nodeName) {
- case 'tree' : this._save_columns_tree(params); break;
- default: throw('NYI: Need .save_columns() for ' + this.node.nodeName); break;
+ if (obj.data.hash.aous['gui.disable_local_save_columns']) {
+ alert(document.getElementById('offlineStrings').getString('list.column_save_disabled'));
+ } else {
+ switch (this.node.nodeName) {
+ case 'tree' : this._save_columns_tree(params); break;
+ default: throw('NYI: Need .save_columns() for ' + this.node.nodeName); break;
+ }
}
},
return;
}
- netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
- JSAN.use('util.file'); var file = new util.file('tree_columns_for_'+window.escape(id));
- if (file._file.exists()) {
- var my_cols = file.get_object(); file.close();
+ var my_cols;
+ if (! obj.data.hash.aous['gui.disable_local_save_columns']) {
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+ JSAN.use('util.file'); var file = new util.file('tree_columns_for_'+window.escape(id));
+ if (file._file.exists()) {
+ my_cols = file.get_object(); file.close();
+ }
+ }
+ /* local file will trump remote file if allowed, so save ourselves an http request if this is the case */
+ if (obj.data.hash.aous['url.remote_column_settings'] && ! my_cols ) {
+ var x = new XMLHttpRequest();
+ var url = obj.data.hash.aous['url.remote_column_settings'] + '/tree_columns_for_' + window.escape(id);
+ x.open("GET", url, false);
+ x.send(null);
+ if (x.status == 200) {
+ my_cols = JSON2js( x.responseText );
+ }
+ }
+
+ if (my_cols) {
var nl = obj.node.getElementsByTagName('treecol');
for (var i = 0; i < nl.length; i++) {
var col = nl[i];
'_print_tree' : function(params) {
var obj = this;
try {
- JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
+ var data = obj.data; data.stash_retrieve();
if (!params.staff && data.list.au && data.list.au[0]) {
params.staff = data.list.au[0];
}
try {
var obj = this;
var dump = obj.dump_selected_with_keys({'skip_hidden_columns':true,'labels_instead_of_ids':true});
- JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
- data.list_clipboard = dump; data.stash('list_clipboard');
+ obj.data.stash_retrieve();
+ obj.data.list_clipboard = dump; obj.data.stash('list_clipboard');
JSAN.use('util.window'); var win = new util.window();
win.open(urls.XUL_LIST_CLIPBOARD,'list_clipboard','chrome,resizable,modal');
window.focus(); // sometimes the main window will lower after a clipboard action
mi.setAttribute('id',obj.node.id + '_save_columns');
mi.setAttribute('label',document.getElementById('offlineStrings').getString('list.actions.save_column_configuration.label'));
mi.setAttribute('accesskey',document.getElementById('offlineStrings').getString('list.actions.save_column_configuration.accesskey'));
+ if (obj.data.hash.aous['gui.disable_local_save_columns']) {
+ mi.setAttribute('disabled','true');
+ }
mp.appendChild(mi);
return btn;
} catch(E) {
if (typeof fieldmapper.IDL.fmclasses == 'undefined') { throw 'fieldmapper.IDL.fmclasses undefined'; }
if (typeof fieldmapper.IDL.fmclasses[hint] == 'undefined') { throw 'fieldmapper.IDL.fmclasses.' + hint + ' undefined'; }
var my_class = fieldmapper.IDL.fmclasses[hint];
- JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
+ var data = obj.data; data.stash_retrieve();
function col_def(my_field) {
var col_id = hint + '_' + my_field.name;