1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

More @£#¤ conflicts

Merge branch 'temp' into tanghus_contacts
This commit is contained in:
Thomas Tanghus 2012-02-08 09:36:16 +01:00
commit 1e4f4f7cfd
2 changed files with 4 additions and 19 deletions

View File

@ -17,13 +17,10 @@ function bailOut($msg) {
function debug($msg) { function debug($msg) {
OC_Log::write('contacts','ajax/editname.php: '.$msg, OC_Log::DEBUG); OC_Log::write('contacts','ajax/editname.php: '.$msg, OC_Log::DEBUG);
} }
foreach ($_GET as $key=>$element) {
debug('_GET: '.$key.'=>'.$element);
}
$tmpl = new OC_TEMPLATE("contacts", "part.edit_name_dialog"); $tmpl = new OC_TEMPLATE("contacts", "part.edit_name_dialog");
$id = $_GET['id']; $id = isset($_GET['id'])?$_GET['id']:'';
if($id) { if($id) {
$vcard = OC_Contacts_App::getContactVCard($id); $vcard = OC_Contacts_App::getContactVCard($id);
$name = array('', '', '', '', ''); $name = array('', '', '', '', '');

View File

@ -363,8 +363,6 @@ Contacts={
//Contacts.UI.notImplemented(); //Contacts.UI.notImplemented();
//return false; //return false;
this.id = ''; this.fn = ''; this.fullname = ''; this.givname = ''; this.famname = ''; this.addname = ''; this.honpre = ''; this.honsuf = ''; this.id = ''; this.fn = ''; this.fullname = ''; this.givname = ''; this.famname = ''; this.addname = ''; this.honpre = ''; this.honsuf = '';
$.getJSON('ajax/newcontact.php',{},function(jsondata){ $.getJSON('ajax/newcontact.php',{},function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
id = ''; id = '';
@ -379,6 +377,7 @@ Contacts={
}); });
}, },
add:function(n, fn, aid){ // add a new contact add:function(n, fn, aid){ // add a new contact
console.log('Add contact: ' + n + ', ' + fn + ' ' + aid);
$.post(OC.filePath('contacts', 'ajax', 'addcontact.php'), { n: n, fn: fn, aid: aid }, $.post(OC.filePath('contacts', 'ajax', 'addcontact.php'), { n: n, fn: fn, aid: aid },
function(jsondata) { function(jsondata) {
if (jsondata.status == 'success'){ if (jsondata.status == 'success'){
@ -554,6 +553,7 @@ Contacts={
}, },
editName:function(){ editName:function(){
var isnew = (this.id == ''); var isnew = (this.id == '');
/* Initialize the name edit dialog */
if($('#edit_name_dialog').dialog('isOpen') == true){ if($('#edit_name_dialog').dialog('isOpen') == true){
$('#edit_name_dialog').dialog('moveToTop'); $('#edit_name_dialog').dialog('moveToTop');
}else{ // TODO: If id=='' call addcontact.php (or whatever name) instead and reload view with id. }else{ // TODO: If id=='' call addcontact.php (or whatever name) instead and reload view with id.
@ -1035,18 +1035,6 @@ $(document).ready(function(){
*/ */
$('#contacts_newcontact').click(function(){ $('#contacts_newcontact').click(function(){
Contacts.UI.Card.editNew(); Contacts.UI.Card.editNew();
// $.getJSON('ajax/addcontact.php',{},function(jsondata){
// if(jsondata.status == 'success'){
// $('#rightcontent').data('id','');
// $('#rightcontent').html(jsondata.data.page)
// .find('select').chosen();
// }
// else{
// Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message);
// //alert(jsondata.data.message);
// }
// });
// return false;
}); });
/** /**
@ -1071,7 +1059,7 @@ $(document).ready(function(){
}); });
/** /**
* Delete currently selected contact and TODO: clear page * Delete currently selected contact TODO: and clear page
*/ */
$('#contacts_deletecard').live('click',function(){ $('#contacts_deletecard').live('click',function(){
Contacts.UI.Card.delete(); Contacts.UI.Card.delete();