]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: Disable in-app import if encryption is enabled, and make an attempt of...
authorThomas Tanghus <thomas@tanghus.net>
Thu, 17 May 2012 12:29:20 +0000 (14:29 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Thu, 17 May 2012 12:31:04 +0000 (14:31 +0200)
apps/contacts/css/contacts.css
apps/contacts/js/contacts.js
apps/contacts/templates/part.importaddressbook.php

index 79274c2dd95c27ed1d6ce34b5d7fc0615ddc35d3..94a0db4f77e5bdb825e9eade6bb7240028b6a369 100644 (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; }
index 94e3e350d71d7da379bb7a23d9105150ef18c33e..d60d523542e8e9d0b39d2b258525f9f10189f448 100644 (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');
index a055dd6035603ecacc04dc2e25bc201e667ce9fa..6702262f231625e39e4ff61bebbf9cea917e4f8e 100644 (file)
@@ -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();