// Init owncloud
require_once('../../../lib/base.php');
- $id = $_POST['id'];
-
- OC_Log::write('contacts','deletebook.php: '.$id,OC_Log::DEBUG);
-
+$l10n = new OC_L10N('contacts');
-
// Check if we are a user
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('contacts');
- $addressbook = OC_Contacts_Addressbook::find( $id );
- if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){
- OC_JSON::error(array('data' => array( 'message' => $l10n->t('This is not your contact.'))));
- exit();
- }
-$id = $_GET['id'];
++//$id = $_GET['id'];
++$id = $_POST['id'];
+ $addressbook = OC_Contacts_App::getAddressbook( $id );
OC_Contacts_Addressbook::delete($id);
OC_JSON::success(array('data' => array( 'id' => $id )));
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('contacts');
- $adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
- $phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
+ $adr_types = OC_Contacts_App::getTypesOfProperty('ADR');
+ $phone_types = OC_Contacts_App::getTypesOfProperty('TEL');
-$addressbooks = OC_Contacts_Addressbook::all(OC_USER::getUser());
+$addressbooks = OC_Contacts_Addressbook::allAddressbooks(OC_USER::getUser());
$tmpl = new OC_Template('contacts','part.addcardform');
$tmpl->assign('addressbooks',$addressbooks);
$tmpl->assign('adr_types',$adr_types);
$details = OC_Contacts_VCard::structureContact($vcard);
}
++<<<<<<< HEAD
+// Include Style and Script
+OC_Util::addScript('contacts','interface');
+OC_Util::addStyle('contacts','styles');
+OC_Util::addStyle('contacts','formtastic');
+OC_Util::addScript('', 'jquery.multiselect');
+OC_Util::addStyle('', 'jquery.multiselect');
+
+$l10n = new OC_L10N('contacts');
+$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
+$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
++=======
+ $adr_types = OC_Contacts_App::getTypesOfProperty('ADR');
+ $phone_types = OC_Contacts_App::getTypesOfProperty('TEL');
++>>>>>>> eeaf539a4414e3081b6f6652167363a3221a1973
// Process the template
$tmpl = new OC_Template( 'contacts', 'index', 'user' );
</ul>
</div>
<div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>">
- <?php echo $this->inc("part.addcardform"); ?>
+ <?php
+ if ($_['id']){
+ echo $this->inc("part.details");
+ }
+ else{
+ echo $this->inc("part.addcardform");
+ }
+ ?>
</div>
+<!-- Dialogs -->
+<div id="dialog_holder"></div>
+<div id="parsingfail_dialog" title="Parsing Fail">
+ <?php echo $l->t("There was a fail, while parsing the file."); ?>
+</div>
+<!-- End of Dialogs -->