diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-05-17 14:29:20 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-05-17 14:31:04 +0200 |
commit | 2f1e60180962d77752ed2b630f4945ee676b2125 (patch) | |
tree | fb6f9014f24cc17345ac973db02c8c13bb14b31e /apps/contacts | |
parent | bfdb374a2c8287b4dea80696928d27aef96fa343 (diff) | |
download | nextcloud-server-2f1e60180962d77752ed2b630f4945ee676b2125.tar.gz nextcloud-server-2f1e60180962d77752ed2b630f4945ee676b2125.zip |
Contacts: Disable in-app import if encryption is enabled, and make an attempt of supporting IE uploads too. Can't test it though...
Diffstat (limited to 'apps/contacts')
-rw-r--r-- | apps/contacts/css/contacts.css | 3 | ||||
-rw-r--r-- | apps/contacts/js/contacts.js | 5 | ||||
-rw-r--r-- | apps/contacts/templates/part.importaddressbook.php | 32 |
3 files changed, 24 insertions, 16 deletions
diff --git a/apps/contacts/css/contacts.css b/apps/contacts/css/contacts.css index 79274c2dd95..94a0db4f77e 100644 --- a/apps/contacts/css/contacts.css +++ b/apps/contacts/css/contacts.css @@ -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; } diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index 94e3e350d71..d60d523542e 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -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'); diff --git a/apps/contacts/templates/part.importaddressbook.php b/apps/contacts/templates/part.importaddressbook.php index a055dd60356..6702262f231 100644 --- a/apps/contacts/templates/part.importaddressbook.php +++ b/apps/contacts/templates/part.importaddressbook.php @@ -6,28 +6,34 @@ * 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> - <select id="book" name="book" class="float"> - <?php - $contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser()); - echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); - ?> - </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> + <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()); + echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); + ?> + </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'); ?>"> + <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(); |