be careful with identity values
[Evergreen.git] / Open-ILS / web / js / dojo / openils / widget / TranslatorPopup.js
index d9292d7..f946ee2 100644 (file)
@@ -52,7 +52,7 @@ if(!dojo._hasResource["openils.widget.TranslatorPopup"]) {
 
                        postCreate : function () {
 
-                               dojo.connect(this.tooltipDialog, 'onFocus', this, 'renderTranslatorPopup');
+                               dojo.connect(this.tooltipDialog, 'onOpen', this, 'renderTranslatorPopup');
 
                                this.nls = dojo.i18n.getLocalization("openils.widget", "TranslatorPopup");
 
@@ -183,7 +183,7 @@ if(!dojo._hasResource["openils.widget.TranslatorPopup"]) {
                                        isdeleted : method == 'delete' ? 1 : 0,
                                        id : trans_id,
                                        fq_field : this._targetObject.classname + '.' + this.field,
-                                       identity_value : this._targetObject.id(),
+                                       identity_value : this._targetObject[fieldmapper[this._targetObject.classname].Identifier](),
                                        translation : dijit.byId('locale_' + trans_id).getValue(),
                                        string : dijit.byId('translation_' + trans_id).getValue()
                                });
@@ -197,7 +197,7 @@ if(!dojo._hasResource["openils.widget.TranslatorPopup"]) {
                                var trans_obj = new i18n().fromHash({
                                        isnew : 1,
                                        fq_field : this._targetObject.classname + '.' + this.field,
-                                       identity_value : this._targetObject.id(),
+                                       identity_value : this._targetObject[fieldmapper[this._targetObject.classname].Identifier](),
                                        translation : dijit.byId('i18n_new_locale_' + this._targetObject.classname + '.' + this.field + this.unique).getValue(),
                                        string : dijit.byId('i18n_new_translation_' + this._targetObject.classname + '.' + this.field + this.unique).getValue()
                                });