diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-05-07 11:47:14 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-05-07 11:47:14 +0200 |
commit | 46fe2e3e2a3d194d8ab17540ec991c5c8cc178e3 (patch) | |
tree | 78896053233f385afbdc6006eade163626048bf6 /apps/contacts | |
parent | 7d2a68fc314bcefa69413d85e69ffd10dc34ddc5 (diff) | |
parent | 3a184e2e1d7ae49d596e06b724ffc36382d02596 (diff) | |
download | nextcloud-server-46fe2e3e2a3d194d8ab17540ec991c5c8cc178e3.tar.gz nextcloud-server-46fe2e3e2a3d194d8ab17540ec991c5c8cc178e3.zip |
fix merge conflicts
Diffstat (limited to 'apps/contacts')
29 files changed, 77 insertions, 92 deletions
diff --git a/apps/contacts/ajax/addbook.php b/apps/contacts/ajax/addbook.php index 254af1c3f50..70f47cc8123 100755 --- a/apps/contacts/ajax/addbook.php +++ b/apps/contacts/ajax/addbook.php @@ -13,7 +13,7 @@ $book = array( 'id' => 'new', 'displayname' => '', ); -$tmpl = new OC_Template('contacts', 'part.editaddressbook'); +$tmpl = new OCP\Template('contacts', 'part.editaddressbook'); $tmpl->assign('new', true); $tmpl->assign('addressbook', $book); $tmpl->printPage(); diff --git a/apps/contacts/ajax/chooseaddressbook.php b/apps/contacts/ajax/chooseaddressbook.php index 2fe55606d1d..9088a4e9d7d 100755 --- a/apps/contacts/ajax/chooseaddressbook.php +++ b/apps/contacts/ajax/chooseaddressbook.php @@ -10,5 +10,5 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); -$output = new OC_TEMPLATE("contacts", "part.chooseaddressbook"); +$output = new OCP\Template("contacts", "part.chooseaddressbook"); $output -> printpage(); diff --git a/apps/contacts/ajax/contacts.php b/apps/contacts/ajax/contacts.php index 93e618a0800..37d396cd83a 100755 --- a/apps/contacts/ajax/contacts.php +++ b/apps/contacts/ajax/contacts.php @@ -12,7 +12,7 @@ OCP\JSON::checkAppEnabled('contacts'); $ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser()); $contacts = OC_Contacts_VCard::all($ids); -$tmpl = new OC_TEMPLATE("contacts", "part.contacts"); +$tmpl = new OCP\Template("contacts", "part.contacts"); $tmpl->assign('contacts', $contacts); $page = $tmpl->fetchPage(); diff --git a/apps/contacts/ajax/createaddressbook.php b/apps/contacts/ajax/createaddressbook.php index 772232b67d7..af7c19eef51 100755 --- a/apps/contacts/ajax/createaddressbook.php +++ b/apps/contacts/ajax/createaddressbook.php @@ -32,7 +32,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, 1)) { //exit(); } $addressbook = OC_Contacts_App::getAddressbook($bookid); -$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); +$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), diff --git a/apps/contacts/ajax/cropphoto.php b/apps/contacts/ajax/cropphoto.php index 125dd107602..7b286dbdb52 100755 --- a/apps/contacts/ajax/cropphoto.php +++ b/apps/contacts/ajax/cropphoto.php @@ -30,7 +30,7 @@ OCP\JSON::checkAppEnabled('contacts'); $tmp_path = $_GET['tmp_path']; $id = $_GET['id']; OCP\Util::writeLog('contacts','ajax/cropphoto.php: tmp_path: '.$tmp_path.', exists: '.file_exists($tmp_path), OCP\Util::DEBUG); -$tmpl = new OC_TEMPLATE("contacts", "part.cropphoto"); +$tmpl = new OCP\Template("contacts", "part.cropphoto"); $tmpl->assign('tmp_path', $tmp_path); $tmpl->assign('id', $id); $page = $tmpl->fetchPage(); diff --git a/apps/contacts/ajax/editaddress.php b/apps/contacts/ajax/editaddress.php index 4044eb5a359..9fb35a0b5f7 100755 --- a/apps/contacts/ajax/editaddress.php +++ b/apps/contacts/ajax/editaddress.php @@ -15,7 +15,7 @@ $checksum = isset($_GET['checksum'])?$_GET['checksum']:''; $vcard = OC_Contacts_App::getContactVCard($id); $adr_types = OC_Contacts_App::getTypesOfProperty('ADR'); -$tmpl = new OC_TEMPLATE("contacts", "part.edit_address_dialog"); +$tmpl = new OCP\Template("contacts", "part.edit_address_dialog"); if($checksum) { $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); $element = $vcard->children[$line]; diff --git a/apps/contacts/ajax/editaddressbook.php b/apps/contacts/ajax/editaddressbook.php index fe1806a7b8a..7a9b757ae0d 100755 --- a/apps/contacts/ajax/editaddressbook.php +++ b/apps/contacts/ajax/editaddressbook.php @@ -10,7 +10,7 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); $addressbook = OC_Contacts_App::getAddressbook($_GET['bookid']); -$tmpl = new OC_Template("contacts", "part.editaddressbook"); +$tmpl = new OCP\Template("contacts", "part.editaddressbook"); $tmpl->assign('new', false); $tmpl->assign('addressbook', $addressbook); $tmpl->printPage(); diff --git a/apps/contacts/ajax/editname.php b/apps/contacts/ajax/editname.php index 155bee70a7f..dc64eeb5101 100755 --- a/apps/contacts/ajax/editname.php +++ b/apps/contacts/ajax/editname.php @@ -18,7 +18,7 @@ function debug($msg) { OCP\Util::writeLog('contacts','ajax/editname.php: '.$msg, OCP\Util::DEBUG); } -$tmpl = new OC_TEMPLATE("contacts", "part.edit_name_dialog"); +$tmpl = new OCP\Template("contacts", "part.edit_name_dialog"); $id = isset($_GET['id'])?$_GET['id']:''; debug('id: '.$id); diff --git a/apps/contacts/ajax/importaddressbook.php b/apps/contacts/ajax/importaddressbook.php index 66cfa4f8af4..f93bbfa4d9d 100755 --- a/apps/contacts/ajax/importaddressbook.php +++ b/apps/contacts/ajax/importaddressbook.php @@ -16,7 +16,7 @@ $freeSpace=OC_Filesystem::free_space('/'); $freeSpace=max($freeSpace,0); $maxUploadFilesize = min($maxUploadFilesize ,$freeSpace); -$tmpl = new OC_Template('contacts', 'part.importaddressbook'); +$tmpl = new OCP\Template('contacts', 'part.importaddressbook'); $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $tmpl->printpage(); diff --git a/apps/contacts/ajax/importdialog.php b/apps/contacts/ajax/importdialog.php index 7a564ccec83..5f8805a6106 100755 --- a/apps/contacts/ajax/importdialog.php +++ b/apps/contacts/ajax/importdialog.php @@ -9,7 +9,7 @@ OCP\JSON::checkLoggedIn(); OCP\App::checkAppEnabled('contacts'); -$tmpl = new OC_Template('contacts', 'part.import'); +$tmpl = new OCP\Template('contacts', 'part.import'); $tmpl->assign('path', $_POST['path']); $tmpl->assign('filename', $_POST['filename']); $tmpl->printpage(); diff --git a/apps/contacts/ajax/loadcard.php b/apps/contacts/ajax/loadcard.php index 047db4d940c..4e6f2206fef 100755 --- a/apps/contacts/ajax/loadcard.php +++ b/apps/contacts/ajax/loadcard.php @@ -49,7 +49,7 @@ $adr_types = OC_Contacts_App::getTypesOfProperty('ADR'); $phone_types = OC_Contacts_App::getTypesOfProperty('TEL'); $email_types = OC_Contacts_App::getTypesOfProperty('EMAIL'); -$tmpl = new OC_Template('contacts','part.contact'); +$tmpl = new OCP\Template('contacts','part.contact'); $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $tmpl->assign('adr_types',$adr_types); diff --git a/apps/contacts/ajax/loadintro.php b/apps/contacts/ajax/loadintro.php index 8ad828ebba3..6e8fcc4b049 100755 --- a/apps/contacts/ajax/loadintro.php +++ b/apps/contacts/ajax/loadintro.php @@ -25,7 +25,7 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); -$tmpl = new OC_Template('contacts','part.no_contacts'); +$tmpl = new OCP\Template('contacts','part.no_contacts'); $page = $tmpl->fetchPage(); OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/loadphoto.php b/apps/contacts/ajax/loadphoto.php index 9913fe13e11..ef429e82891 100755 --- a/apps/contacts/ajax/loadphoto.php +++ b/apps/contacts/ajax/loadphoto.php @@ -53,7 +53,7 @@ foreach($vcard->children as $property){ } } -$tmpl = new OC_TEMPLATE("contacts", "part.contactphoto"); +$tmpl = new OCP\Template("contacts", "part.contactphoto"); $tmpl->assign('id', $id); if($refresh) { $tmpl->assign('refresh', 1); diff --git a/apps/contacts/ajax/savecrop.php b/apps/contacts/ajax/savecrop.php index 5418e26cd10..cd470307125 100755 --- a/apps/contacts/ajax/savecrop.php +++ b/apps/contacts/ajax/savecrop.php @@ -101,7 +101,7 @@ if(file_exists($tmp_path)) { } unlink($tmpfname); //$result=array( "status" => "success", 'mime'=>$image->mimeType(), 'tmp'=>$tmp_path); - $tmpl = new OC_TEMPLATE("contacts", "part.contactphoto"); + $tmpl = new OCP\Template("contacts", "part.contactphoto"); $tmpl->assign('tmp_path', $tmpfname); $tmpl->assign('mime', $image->mimeType()); $tmpl->assign('id', $id); diff --git a/apps/contacts/ajax/updateaddressbook.php b/apps/contacts/ajax/updateaddressbook.php index 13f1c15ac23..19b5b3bddce 100755 --- a/apps/contacts/ajax/updateaddressbook.php +++ b/apps/contacts/ajax/updateaddressbook.php @@ -35,7 +35,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { } $addressbook = OC_Contacts_App::getAddressbook($bookid); -$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); +$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); OCP\JSON::success(array( 'page' => $tmpl->fetchPage(), diff --git a/apps/contacts/appinfo/info.xml b/apps/contacts/appinfo/info.xml index 55ddf42ccc1..4d2fe383723 100644 --- a/apps/contacts/appinfo/info.xml +++ b/apps/contacts/appinfo/info.xml @@ -6,5 +6,6 @@ <author>Jakob Sack</author> <require>2</require> <description>Address book with CardDAV support.</description> + <standalone/> <default_enable/> </info> diff --git a/apps/contacts/css/contacts.css b/apps/contacts/css/contacts.css index 04afe44b2cc..c247ecf5680 100644 --- a/apps/contacts/css/contacts.css +++ b/apps/contacts/css/contacts.css @@ -1,9 +1,9 @@ /*dl > dt { font-weight: bold; }*/ -#leftcontent { top: 3.5em !important; } +#leftcontent { top: 3.5em !important; padding: 0; margin: 0; } #rightcontent { top: 3.5em !important; padding-top: 5px; } -#contacts { background: #fff; width: 20em; top: 3.7em; bottom:3em; position: fixed; overflow: auto; } +#contacts { background: #fff; width: 20em; left: 12.5em; top: 3.7em; bottom:3em; position: fixed; overflow: auto; padding: 0; margin: 0; } #bottomcontrols { padding: 0; bottom:0px; height:2.8em; width: 20em; margin:0; background:#eee; border-top:1px solid #ccc; position:fixed; -moz-box-shadow: 0 0 0 #000, -3px 0 7px #000; -webkit-box-shadow: 0 0 0 #000, -3px 0 7px #000; box-shadow: 0 0 0 #000, -3px 0 7px #000;} #contacts_newcontact { float: left; margin: 0.2em 0 0 1em; } #chooseaddressbook { float: right; margin: 0.2em 1em 0 0; } @@ -25,10 +25,7 @@ #card input[type="text"].contacts_property,input[type="email"].contacts_property { width: 14em; float: left; font-weight: bold; } .categories { float: left; width: 16em; } #card input[type="text"],input[type="email"],input[type="tel"],input[type="date"], select, textarea { background-color: #fefefe; border: 0 !important; -webkit-appearance:none !important; -moz-appearance:none !important; -webkit-box-sizing:none !important; -moz-box-sizing:none !important; box-sizing:none !important; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; -moz-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; float: left; } -#card input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active,input[type="email"]:hover,input[type="tel"]:hover,input[type="date"]:hover,input[type="date"],input[type="date"]:hover,input[type="date"]:active,input[type="date"]:active,input[type="date"]:active,input[type="email"]:active,input[type="tel"]:active, select:hover, select:focus, select:active { border: 0 !important; -webkit-appearance:textfield; -moz-appearance:textfield; -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #ddd, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; float: left; } - -textarea:focus, textarea:hover { background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #ddd, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; float: left; } -input[type="text"]:invalid,input[type="email"]:invalid,input[type="tel"]:invalid,input[type="date"]:invalid, textarea:invalid { color: #bbb !important; } +#card input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active,input[type="email"]:hover,input[type="tel"]:hover,input[type="date"]:hover,input[type="date"],input[type="date"]:hover,input[type="date"]:active,input[type="date"]:active,input[type="date"]:active,input[type="email"]:active,input[type="tel"]:active, select:hover, select:focus, select:active, textarea:focus, textarea:hover { border: 0 !important; -webkit-appearance:textfield; -moz-appearance:textfield; -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #ddd, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; float: left; } textarea { width: 80%; min-height: 5em; min-width: 30em; margin: 0 !important; padding: 0 !important; outline: 0 !important;} dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; } .form dt { display: table-cell; clear: left; float: left; width: 7em; margin: 0; padding: 0.8em 0.5em 0 0; text-align:right; text-overflow:ellipsis; o-text-overflow: ellipsis; vertical-align: text-bottom; color: #bbb;/* white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap;*/ } @@ -101,7 +98,8 @@ input[type="checkbox"] { width: 20px; height: 20px; vertical-align: bottom; } .propertycontainer dd { float: left; width: 25em; } .propertylist { clear: none; max-width: 28em; } .propertylist li.propertycontainer { white-space: nowrap; min-width: 35em; /*max-width: 30em;*/ display: block; clear: right; } -.propertylist li > input[type="text"],input[type="email"],input[type="tel"] { float: left; max-width: 15em; } +.propertycontainer[data-element="EMAIL"] > input[type="email"] { min-width: 19em !important; float: left; } +.propertycontainer[data-element="TEL"] > input[type="text"] { width: 10em !important; float: left; } .propertylist li > input[type="checkbox"],input[type="radio"] { float: left; clear: left; width: 20px; height: 20px; vertical-align: middle; } .propertylist li > select { float: left; max-width: 8em; } .typelist { float: left; max-width: 10em; border: 0; background-color: #fff; } /* for multiselect */ diff --git a/apps/contacts/img/contact-new.png b/apps/contacts/img/contact-new.png Binary files differindex 3d0970ddd4c..087ad9ab2d3 100644 --- a/apps/contacts/img/contact-new.png +++ b/apps/contacts/img/contact-new.png diff --git a/apps/contacts/img/contact-new.svg b/apps/contacts/img/contact-new.svg index f4ab2981674..8322414dac3 100644 --- a/apps/contacts/img/contact-new.svg +++ b/apps/contacts/img/contact-new.svg @@ -7,10 +7,34 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" - width="16" - height="16" - id="svg3796"> + width="20" + height="20" + id="svg3796" + inkscape:version="0.48.2 r9819" + sodipodi:docname="contact-new.svg"> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="640" + inkscape:window-height="480" + id="namedview18" + showgrid="false" + inkscape:zoom="11.8" + inkscape:cx="10" + inkscape:cy="10" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="0" + inkscape:current-layer="svg3796" /> <defs id="defs3798"> <linearGradient @@ -29,12 +53,13 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> <g - id="layer1"> + id="layer1" + transform="matrix(1.2460746,0,0,1.2420314,-0.12303732,-0.51608095)"> <g transform="matrix(1.0633871,0,0,1.0633871,-0.03169354,-0.53733376)" id="g4344"> @@ -97,7 +122,8 @@ <path d="m 10.823783,8.4435567 1.999999,0 0,1.9999993 2,0 0,2 -2,0 0,2 -1.999999,0 0,-2 -2.0000004,0 0,-2 2.0000004,0 z" id="path4336" - style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> + style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> </g> </g> </svg> diff --git a/apps/contacts/index.php b/apps/contacts/index.php index 69e7d57309f..74b7c43c556 100755 --- a/apps/contacts/index.php +++ b/apps/contacts/index.php @@ -58,7 +58,7 @@ OCP\Util::addStyle('contacts','jquery.combobox'); OCP\Util::addStyle('contacts','jquery.Jcrop'); OCP\Util::addStyle('contacts','contacts'); -$tmpl = new OC_Template( "contacts", "index", "user" ); +$tmpl = new OCP\Template( "contacts", "index", "user" ); $tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $tmpl->assign('property_types', $property_types); diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index 68a01174d83..44b29792206 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -168,14 +168,14 @@ Contacts={ honsuf:'', data:undefined, update:function(id) { - // Make sure proper DOM is loaded. var newid; if(id == undefined) { newid = $('#contacts li:first-child').data('id'); } else { newid = id; } - if(!$('n')) { + // Make sure proper DOM is loaded. + if(!$('#card')) { $.getJSON(OC.filePath('contacts', 'ajax', 'loadcard.php'),{},function(jsondata){ if(jsondata.status == 'success'){ $('#rightcontent').html(jsondata.data.page); @@ -185,8 +185,6 @@ Contacts={ }); } if($('#contacts li').length > 0) { - //var newid = $('#contacts li:first-child').data('id'); - //$('#contacts li:first-child').addClass('active'); $('#leftcontent li[data-id="'+newid+'"]').addClass('active'); $.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':newid},function(jsondata){ if(jsondata.status == 'success'){ @@ -210,8 +208,6 @@ Contacts={ }, doExport:function() { document.location.href = OC.linkTo('contacts', 'export.php') + '?contactid=' + this.id; - //$.get(OC.linkTo('contacts', 'export.php'),{'contactid':this.id},function(jsondata){ - //}); }, doImport:function(){ Contacts.UI.notImplemented(); @@ -249,7 +245,7 @@ Contacts={ if(!added) { $('#leftcontent ul').append(item); } - if(isnew) { + if(isnew) { // add some default properties Contacts.UI.Card.addProperty('EMAIL'); Contacts.UI.Card.addProperty('TEL'); Contacts.UI.Card.addProperty('NICKNAME'); @@ -261,7 +257,6 @@ Contacts={ } else{ OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); - //alert(jsondata.data.message); } }); $('#contact_identity').show(); @@ -291,11 +286,10 @@ Contacts={ newid = newlistitem.data('id'); } $('#rightcontent').data('id',newid); - //$('#rightcontent').empty(); this.id = this.fn = this.fullname = this.shortname = this.famname = this.givname = this.addname = this.honpre = this.honsuf = ''; this.data = undefined; - // Load first in list. - if($('#contacts li').length > 0) { + + if($('#contacts li').length > 0) { // Load first in list. Contacts.UI.Card.update(newid); } else { // load intro page @@ -313,7 +307,6 @@ Contacts={ } else{ OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); - //alert(jsondata.data.message); } }); } @@ -321,7 +314,6 @@ Contacts={ return false; }, loadContact:function(jsondata){ - //$('#contact_communication').hide(); this.data = jsondata; this.id = this.data.id; $('#rightcontent').data('id',this.id); @@ -508,7 +500,6 @@ Contacts={ } }, saveProperty:function(obj){ - // I couldn't get the selector to filter on 'contacts_property' so I filter by hand here :-/ if(!$(obj).hasClass('contacts_property')) { return false; } @@ -569,7 +560,6 @@ Contacts={ } }, addProperty:function(type){ - //console.log('addProperty:' + type); switch (type) { case 'PHOTO': this.loadPhoto(true); @@ -617,7 +607,6 @@ Contacts={ deleteProperty:function(obj, type){ Contacts.UI.loading(obj, true); var checksum = Contacts.UI.checksumFor(obj); - //console.log('deleteProperty, id: ' + this.id + ', checksum: ' + checksum); if(checksum) { $.getJSON(OC.filePath('contacts', 'ajax', 'deleteproperty.php'),{'id': this.id, 'checksum': checksum },function(jsondata){ if(jsondata.status == 'success'){ @@ -822,16 +811,13 @@ Contacts={ if(isnew) { container.remove(); } - //Contacts.UI.showHideContactInfo(); } }, close : function(event, ui) { - //alert('close'); $(this).dialog('destroy').remove(); if(isnew) { container.remove(); } - //Contacts.UI.showHideContactInfo(); }, open : function(event, ui) { $( "#adr_city" ).autocomplete({ @@ -848,9 +834,6 @@ Contacts={ }, success: function( data ) { response( $.map( data.geonames, function( item ) { - /*for(var key in item) { - console.log(key + ': ' + item[key]); - }*/ return { label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName, value: item.name, @@ -865,9 +848,6 @@ Contacts={ if(ui.item && $('#adr_country').val().trim().length == 0) { $('#adr_country').val(ui.item.country); } - /*log( ui.item ? - "Selected: " + ui.item.label : - "Nothing selected, input was " + this.value);*/ }, open: function() { $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" ); @@ -892,9 +872,6 @@ Contacts={ }, success: function( data ) { response( $.map( data.geonames, function( item ) { - //for(var key in item) { - // console.log(key + ': ' + item[key]); - //} return { label: item.name, value: item.name @@ -1245,12 +1222,9 @@ Contacts={ function(jsondata) { if (jsondata.status == 'success'){ $(obj).closest('tr').remove(); - //$('#chooseaddressbook_dialog').dialog('destroy').remove(); Contacts.UI.Contacts.update(); - //Contacts.UI.Addressbooks.overview(); } else { OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); - //alert('Error: ' + data.message); } }); } @@ -1480,7 +1454,6 @@ $(document).ready(function(){ } else{ OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); - //alert(jsondata.data.message); } }); return false; @@ -1507,9 +1480,6 @@ $(document).ready(function(){ } }); - // NOTE: For some reason the selector doesn't work when I select by '.contacts_property' too... - // I do the filtering in the event handler instead. - //$('input[type="text"],input[type="checkbox"],input[type="email"],input[type="tel"],input[type="date"], select').live('change', function(){ $('.contacts_property').live('change', function(){ Contacts.UI.Card.saveProperty(this); }); @@ -1523,7 +1493,7 @@ $(document).ready(function(){ }); // Name has changed. Update it and reorder. - $('#fn').live('change',function(){ + $('#fn').change(function(){ var name = $('#fn').val(); var item = $('#contacts [data-id="'+Contacts.UI.Card.id+'"]').clone(); $('#contacts [data-id="'+Contacts.UI.Card.id+'"]').remove(); @@ -1541,9 +1511,7 @@ $(document).ready(function(){ } }); - /** - * Profile picture upload handling - */ + // Profile picture upload handling // New profile picture selected $('#file_upload_start').change(function(){ Contacts.UI.Card.uploadPhoto(this.files); @@ -1594,30 +1562,22 @@ $(document).ready(function(){ OC.dialogs.alert(xhr.status + ': ' + xhr.responseText, t('contacts', 'Error')); } } else { - //alert(xhr.responseText); OC.dialogs.alert(response.data.message, t('contacts', 'Error')); } - // stop loading indicator - //$('#contacts_details_photo_progress').hide(); } }; fileUpload.onprogress = function(e){ if (e.lengthComputable){ var _progress = Math.round((e.loaded * 100) / e.total); - if (_progress != 100){ - //$('#contacts_details_photo_progress').text(_progress + '%'); - //$('#contacts_details_photo_progress').val(_progress); - } + //if (_progress != 100){ + //} } }; - // Start loading indicator. - //$('#contacts_details_photo_progress').show()(); xhr.open('POST', OC.filePath('contacts', 'ajax', 'uploadphoto.php')+'?id='+Contacts.UI.Card.id+'&imagefile='+encodeURIComponent(file.name), true); xhr.setRequestHeader('Cache-Control', 'no-cache'); xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.setRequestHeader('X_FILE_NAME', encodeURIComponent(file.name)); - //xhr.setRequestHeader("X_FILENAME", file.name); xhr.setRequestHeader('X-File-Size', file.size); xhr.setRequestHeader('Content-Type', file.type); xhr.send(file); diff --git a/apps/contacts/settings.php b/apps/contacts/settings.php index b88128823a7..c88fed0b4d6 100644..100755 --- a/apps/contacts/settings.php +++ b/apps/contacts/settings.php @@ -1,6 +1,6 @@ <?php -$tmpl = new OC_Template( 'contacts', 'settings'); +$tmpl = new OCP\Template( 'contacts', 'settings'); return $tmpl->fetchPage(); ?> diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index 79825067d82..c28b47e7c28 100755 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -8,12 +8,12 @@ <?php echo $this->inc("part.contacts"); ?> </ul> </div> - <div id="bottomcontrols"> - <form> - <button class="svg" id="contacts_newcontact" title="<?php echo $l->t('Add Contact'); ?>"><img class="svg" src="<?php echo OCP\Util::linkTo('contacts', 'img/contact-new.svg'); ?>" alt="<?php echo $l->t('Add Contact'); ?>" /></button> - <button class="svg" id="chooseaddressbook" title="<?php echo $l->t('Addressbooks'); ?>"><img class="svg" src="core/img/actions/settings.svg" alt="<?php echo $l->t('Addressbooks'); ?>" /></button> - </form> - </div> +<div id="bottomcontrols"> + <form> + <button class="svg" id="contacts_newcontact" title="<?php echo $l->t('Add Contact'); ?>"><img class="svg" src="<?php echo OCP\Util::linkTo('contacts', 'img/contact-new.svg'); ?>" alt="<?php echo $l->t('Add Contact'); ?>" /></button> + <button class="svg" id="chooseaddressbook" title="<?php echo $l->t('Addressbooks'); ?>"><img class="svg" src="core/img/actions/settings.svg" alt="<?php echo $l->t('Addressbooks'); ?>" /></button> + </form> +</div> <div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>"> <?php if ($_['id']){ diff --git a/apps/contacts/templates/part.chooseaddressbook.php b/apps/contacts/templates/part.chooseaddressbook.php index 91b2f51c3b4..a0ec053ab91 100755 --- a/apps/contacts/templates/part.chooseaddressbook.php +++ b/apps/contacts/templates/part.chooseaddressbook.php @@ -4,7 +4,7 @@ $option_addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser()); for($i = 0; $i < count($option_addressbooks); $i++){ echo "<tr>"; - $tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); + $tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $option_addressbooks[$i]); $tmpl->assign('active', OC_Contacts_Addressbook::isActive($option_addressbooks[$i]['id'])); $tmpl->printpage(); diff --git a/apps/contacts/templates/part.contact.php b/apps/contacts/templates/part.contact.php index 4c23dac783b..74522be37c4 100755 --- a/apps/contacts/templates/part.contact.php +++ b/apps/contacts/templates/part.contact.php @@ -55,7 +55,7 @@ $id = isset($_['id']) ? $_['id'] : ''; <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" /> <input type="email" required="required" class="nonempty contacts_property" name="value" value="" x-moz-errormessage="<?php echo $l->t('Please specify a valid email address.'); ?>" placeholder="<?php echo $l->t('Enter email address'); ?>" /> <select class="hidden" multiple="multiple" name="parameters[TYPE][]"> - <?php echo html_select_options($_['email_types'], array()) ?> + <?php echo OCP\html_select_options($_['email_types'], array()) ?> </select> <span class="listactions"><a class="action mail" title="<?php echo $l->t('Mail to address'); ?>"></a> <a role="button" class="action delete" title="<?php echo $l->t('Delete email address'); ?>"></a></span></li> @@ -69,7 +69,7 @@ $id = isset($_['id']) ? $_['id'] : ''; <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" /> <input type="text" required="required" class="nonempty contacts_property" name="value" value="" placeholder="<?php echo $l->t('Enter phone number'); ?>" /> <select multiple="multiple" name="parameters[TYPE][]"> - <?php echo html_select_options($_['phone_types'], array()) ?> + <?php echo OCP\html_select_options($_['phone_types'], array()) ?> </select> <a role="button" class="action delete" title="<?php echo $l->t('Delete phone number'); ?>"></a></li> </ul> diff --git a/apps/contacts/templates/part.edit_address_dialog.php b/apps/contacts/templates/part.edit_address_dialog.php index 507a3acaa0c..8b3425033cc 100644..100755 --- a/apps/contacts/templates/part.edit_address_dialog.php +++ b/apps/contacts/templates/part.edit_address_dialog.php @@ -15,7 +15,7 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra </dt> <dd> <select id="adr_type" name="parameters[ADR][TYPE]" size="1"> - <?php echo html_select_options($_['adr_types'], $types) ?> + <?php echo OCP\html_select_options($_['adr_types'], $types) ?> </select> </dd> <dt> diff --git a/apps/contacts/templates/part.edit_name_dialog.php b/apps/contacts/templates/part.edit_name_dialog.php index bb774b62bd7..be45f9a5b06 100644..100755 --- a/apps/contacts/templates/part.edit_name_dialog.php +++ b/apps/contacts/templates/part.edit_name_dialog.php @@ -16,7 +16,7 @@ $addressbooks = isset($_['addressbooks'])?$_['addressbooks']:null; <dt><label for="addressbook"><?php echo $l->t('Addressbook'); ?></label></dt> <dd> <select id="aid" name="aid" size="1"> - <?php echo html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?> + <?php echo OCP\html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?> </select> </dd> <?php }} ?> diff --git a/apps/contacts/templates/part.import.php b/apps/contacts/templates/part.import.php index a2f8aefa6f4..2dac7dd0ca1 100755 --- a/apps/contacts/templates/part.import.php +++ b/apps/contacts/templates/part.import.php @@ -8,7 +8,7 @@ <?php $contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser()); $contacts_options[] = array('id'=>'newaddressbook', 'displayname'=>$l->t('create a new addressbook')); -echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); +echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); ?> </select> <div id="newaddressbookform" style="display: none;"> diff --git a/apps/contacts/templates/part.importaddressbook.php b/apps/contacts/templates/part.importaddressbook.php index 9a13ba1b0cd..a055dd60356 100755 --- a/apps/contacts/templates/part.importaddressbook.php +++ b/apps/contacts/templates/part.importaddressbook.php @@ -14,7 +14,7 @@ <select id="book" name="book" class="float"> <?php $contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser()); - echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname')); + 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> |