Add notification for editing search / replace

This commit is contained in:
Romain Neutron
2012-02-16 18:59:08 +01:00
parent 65e98b0478
commit 400db81f28
3 changed files with 90 additions and 85 deletions

View File

@@ -95,6 +95,7 @@ class Language implements ControllerProviderInterface
$out['FeedBackDuration'] = _('Time for feedback (days)');
$out['send'] = _('Send');
$out['Recept'] = _('Accuse de reception');
$out['nFieldsChanged'] = _('%d fields have been updated');
$out['FeedBackNoUsersSelected'] = _('No users selected');
$Serializer = $app['Core']['Serializer'];

View File

@@ -446,9 +446,11 @@
console.error('Unable to set a value to a readonly field');
}
return;
return 0;
}
var n = 0;
for(d in this.datas)
{
if(this.datas[d].getVocabularyId() !== null)
@@ -463,6 +465,9 @@
{
continue;
}
n++;
this.removeValue(value);
if(!this.hasValue(replacedValue))
@@ -473,11 +478,7 @@
this.options.dirty = true;
}
/**
* cleanup and remove duplicates
*/
return this;
return n;
},
exportDatas : function() {

View File

@@ -1454,7 +1454,7 @@ function replace()
search = new RegExp(r_search, commut);
var r, f;
var r, f, n = 0;
for(r in p4.edit.T_records)
{
if(!p4.edit.T_records[r]._selected)
@@ -1463,10 +1463,13 @@ function replace()
{
if(field == '' || field==f)
{
p4.edit.T_records[r].fields[f].replaceValue(search, replace);
n += p4.edit.T_records[r].fields[f].replaceValue(search, replace);
}
}
}
humane.info($.sprintf(language.nFieldsChanged, n));
updateEditSelectedRecords(null);
}