mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-19 08:52:22 +01:00
Revert "a little code cleaning, removed {count} value during the import process"
This reverts commit 2a435622292e5b5c57710d890b3ce84eacbe29fe.
This commit is contained in:
parent
2a43562229
commit
c85b284208
@ -378,8 +378,8 @@ OC.Contacts = OC.Contacts || {};
|
||||
.then(function(response) {
|
||||
if(!response.error) {
|
||||
self.$importProgress.progressbar('value', Number(response.data.progress));
|
||||
self.$importStatusText.text(t('contacts', 'Processed {count} contacts',
|
||||
{count:response.data.progress}));
|
||||
self.$importStatusText.text(t('contacts', 'Imported {count} of {total} contacts',
|
||||
{count:response.data.progress, total: self.importCount}));
|
||||
} else {
|
||||
console.warn('Error', response.message);
|
||||
self.$importStatusText.text(response.message);
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php $TRANSLATIONS = array(
|
||||
"Contacts" => "Contacts",
|
||||
"Save" => "Sauvegarder",
|
||||
"Uploading..." => "Téléversement en cours...",
|
||||
"Importing..." => "Import en cours...",
|
||||
"Uploading..." => "Téléversement en cours…",
|
||||
"Importing..." => "Import en cours…",
|
||||
"Preparing..." => "En préparation...",
|
||||
"Processed {count} contacts" => "{count} contacts ont été traités",
|
||||
"Imported {count} of {total} contacts" => "{count} contacts sur {total} ont été importés",
|
||||
"Imported {imported} contacts. {failed} failed." => "{imported} contacts importés. {failed} échoués.",
|
||||
"An address book called {name} already exists" => "Un carnet d'adresse appelé {name} existe déjà",
|
||||
"Failed adding address book: {error}" => "Échec de l'ajout du carnet d'adresses : {error}",
|
||||
|
@ -28,8 +28,8 @@ class ImportController extends Controller {
|
||||
public function upload() {
|
||||
$request = $this->request;
|
||||
$params = $this->request->urlParams;
|
||||
$addressBookId = $params['addressBookId'];
|
||||
$format = $params['importType'];
|
||||
$addressBookId = $params['addressBookId'];
|
||||
$format = $params['importType'];
|
||||
$response = new JSONResponse();
|
||||
|
||||
$view = \OCP\Files::getStorage('contacts');
|
||||
@ -81,10 +81,12 @@ class ImportController extends Controller {
|
||||
\OC_FileProxy::$enabled = false;
|
||||
if($view->file_put_contents('/imports/'.$filename, $content)) {
|
||||
\OC_FileProxy::$enabled = $proxyStatus;
|
||||
$count = substr_count($content, 'BEGIN:');
|
||||
$progresskey = 'contacts-import-' . rand();
|
||||
$response->setParams(
|
||||
array(
|
||||
'filename'=>$filename,
|
||||
'count' => $count,
|
||||
'progresskey' => $progresskey,
|
||||
'backend' => $params['backend'],
|
||||
'addressBookId' => $params['addressBookId']
|
||||
@ -126,10 +128,12 @@ class ImportController extends Controller {
|
||||
//$content = file_get_contents('oc://' . $path . '/' . $filename);
|
||||
if($view->file_put_contents('/imports/' . $filename, $content)) {
|
||||
\OC_FileProxy::$enabled = $proxyStatus;
|
||||
$count = substr_count($content, 'BEGIN:');
|
||||
$progresskey = 'contacts-import-' . rand();
|
||||
$response->setParams(
|
||||
array(
|
||||
'filename'=>$filename,
|
||||
'count' => $count,
|
||||
'progresskey' => $progresskey,
|
||||
'backend' => $params['backend'],
|
||||
'addressBookId' => $params['addressBookId'],
|
||||
@ -279,6 +283,8 @@ class ImportController extends Controller {
|
||||
'addressBookId' => $params['addressBookId'],
|
||||
'importType' => $params['importType'],
|
||||
'imported' => $imported,
|
||||
'count' => $processed,
|
||||
'total' => $total,
|
||||
'failed' => $failed,
|
||||
)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user