Contacts: Disable in-app import if encryption is enabled, and make an attempt of supporting IE uploads too. Can't test it though...

This commit is contained in:
Thomas Tanghus 2012-05-17 14:29:20 +02:00
parent bfdb374a2c
commit 2f1e601809
3 changed files with 24 additions and 16 deletions

View File

@ -91,7 +91,8 @@ dl.addresscard .action { float: right; }
#file_upload_form { width: 0; height: 0; }
#file_upload_target, #import_upload_target, #crop_target { display:none; }
#file_upload_start, #import_upload_start { opacity:0; filter:alpha(opacity=0); z-index:1; /*position:absolute; left:0; top:0;*/ width:0; height:0;}
#file_upload_start, #import_upload_start { opacity:0; filter:alpha(opacity=0); z-index:1001; /*position:absolute; left:0; top:0;*/ width:0; height:0;}
#import_upload_start { width: 16px; height: 16px; margin: 0 0 0 0; }
input[type="checkbox"] { width: 20px; height: 20px; vertical-align: bottom; }
.big { font-weight:bold; font-size:1.2em; }
.huge { font-weight:bold; font-size:1.5em; }

View File

@ -1287,7 +1287,7 @@ Contacts={
close : function(event, ui) {
$(this).dialog('destroy').remove();
}
});
}).css('overflow','visible');
} else {
alert(jsondata.data.message);
}
@ -1338,7 +1338,8 @@ Contacts={
$('#importaddressbook_dialog').find('.upload').click(function() {
Contacts.UI.Addressbooks.droptarget.html(t('contacts', 'Uploading...'));
Contacts.UI.loading(Contacts.UI.Addressbooks.droptarget, true);
$('#import_upload_start').trigger('click');
//$('#import_upload_start').trigger('click');
//return false;
});
$('#importaddressbook_dialog').find('.upload').tipsy();
this.droptarget = $('#import_drop_target');

View File

@ -6,11 +6,16 @@
* See the COPYING-README file.
*/
?>
<td id="importaddressbook_dialog" title="<?php echo $l->t("Import Addressbook"); ?>" colspan="6">
<td id="importaddressbook_dialog" colspan="6">
<?php
if(OCP\App::isEnabled('files_encryption')) {
echo '<strong>'.$l->t('Currently this import function doesn\'t work while encryption is enabled.<br />Please upload your VCF file with the file manager and click on it to import.').'</strong>';
} else { ?>
<table>
<tr>
<th><?php echo $l->t('Select address book to import to:') ?></th>
<td>
<form id="import_upload_form" action="<?php echo OCP\Util::linkTo('contacts', 'ajax/uploadimport.php'); ?>" method="post" enctype="multipart/form-data" target="import_upload_target">
<select id="book" name="book" class="float">
<?php
$contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser());
@ -18,16 +23,17 @@
?>
</select>
<span id="import_drop_target" class="droptarget float"><?php echo $l->t("Drop a VCF file to import contacts."); ?> (Max. <?php echo $_['uploadMaxHumanFilesize']; ?>)</span>
<a class="svg upload float" title="<?php echo $l->t('Select from HD'); ?>"></a>
<a class="svg upload float" title="<?php echo $l->t('Select from HD'); ?>">
<input class="float" id="import_upload_start" type="file" accept="text/*" name="importfile" /></a>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
</form>
</td>
</tr>
</table>
<form id="import_upload_form" action="<?php echo OCP\Util::linkTo('contacts', 'ajax/uploadimport.php'); ?>" method="post" enctype="multipart/form-data" target="import_upload_target">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<input id="import_upload_start" type="file" accept="text/*" name="importfile" />
<input id="close_button" style="float: left;" type="button" onclick="Contacts.UI.Addressbooks.cancel(this);" value="<?php echo $l->t("Cancel"); ?>">
<iframe name="import_upload_target" id='import_upload_target' src=""></iframe>
</form>
<?php } ?>
</td>
<script type="text/javascript">
Contacts.UI.Addressbooks.loadImportHandlers();