mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-01 13:24:10 +01:00
ported the oc_app calls
This commit is contained in:
parent
fe55806527
commit
b2f19f3a7f
@ -34,7 +34,7 @@ function debug($msg) {
|
||||
OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::DEBUG);
|
||||
}
|
||||
|
||||
$view = OC_App::getStorage('contacts');
|
||||
$view = OCP\App::getStorage('contacts');
|
||||
$tmpfile = md5(rand());
|
||||
|
||||
// If it is a Drag'n'Drop transfer it's handled here.
|
||||
|
@ -9,12 +9,12 @@ OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Contacts_Hooks', 'deleteUser'
|
||||
OC_HOOK::connect('OC_Calendar', 'getEvents', 'OC_Contacts_Hooks', 'getBirthdayEvents');
|
||||
OC_HOOK::connect('OC_Calendar', 'getSources', 'OC_Contacts_Hooks', 'getCalenderSources');
|
||||
|
||||
OC_App::register( array(
|
||||
OCP\App::register( array(
|
||||
'order' => 10,
|
||||
'id' => 'contacts',
|
||||
'name' => 'Contacts' ));
|
||||
|
||||
OC_App::addNavigationEntry( array(
|
||||
OCP\App::addNavigationEntry( array(
|
||||
'id' => 'contacts_index',
|
||||
'order' => 10,
|
||||
'href' => OCP\Util::linkTo( 'contacts', 'index.php' ),
|
||||
@ -22,6 +22,6 @@ OC_App::addNavigationEntry( array(
|
||||
'name' => OC_L10N::get('contact')->t('Contacts') ));
|
||||
|
||||
|
||||
OC_APP::registerPersonal('contacts','settings');
|
||||
OCP\App::registerPersonal('contacts','settings');
|
||||
OCP\Util::addscript('contacts', 'loader');
|
||||
OC_Search::registerProvider('OC_Search_Provider_Contacts');
|
||||
|
@ -19,7 +19,7 @@ if(is_writable('import_tmp/')){
|
||||
}
|
||||
$view = $file = null;
|
||||
if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') {
|
||||
$view = OC_App::getStorage('contacts');
|
||||
$view = OCP\App::getStorage('contacts');
|
||||
$file = $view->file_get_contents('/' . $_POST['file']);
|
||||
} else {
|
||||
$file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']);
|
||||
|
@ -19,7 +19,7 @@ $contacts = OC_Contacts_VCard::all($ids);
|
||||
$addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser());
|
||||
|
||||
// Load the files we need
|
||||
OC_App::setActiveNavigationEntry( 'contacts_index' );
|
||||
OCP\App::setActiveNavigationEntry( 'contacts_index' );
|
||||
|
||||
// Load a specific user?
|
||||
$id = isset( $_GET['id'] ) ? $_GET['id'] : null;
|
||||
|
@ -53,7 +53,7 @@ class OC_Contacts_App {
|
||||
$vcard = OC_VObject::parse($card['carddata']);
|
||||
// Try to fix cards with missing 'N' field from pre ownCloud 4. Hot damn, this is ugly...
|
||||
if(!is_null($vcard) && !$vcard->__isset('N')) {
|
||||
$appinfo = OC_App::getAppInfo('contacts');
|
||||
$appinfo = OCP\App::getAppInfo('contacts');
|
||||
if($appinfo['version'] >= 5) {
|
||||
OCP\Util::writeLog('contacts','OC_Contacts_App::getContactVCard. Deprecated check for missing N field', OCP\Util::DEBUG);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
class OC_Search_Provider_Contacts extends OC_Search_Provider{
|
||||
function search($query){
|
||||
$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser(), 1);
|
||||
// if(count($calendars)==0 || !OC_App::isEnabled('contacts')){
|
||||
// if(count($calendars)==0 || !OCP\App::isEnabled('contacts')){
|
||||
// //return false;
|
||||
// }
|
||||
// NOTE: Does the following do anything
|
||||
|
@ -245,8 +245,8 @@ class OC_Contacts_VCard{
|
||||
// Add product ID is missing.
|
||||
$prodid = trim($vcard->getAsString('PRODID'));
|
||||
if(!$prodid) {
|
||||
$appinfo = OC_App::getAppInfo('contacts');
|
||||
$appversion = OC_App::getAppVersion('contacts');
|
||||
$appinfo = OCP\App::getAppInfo('contacts');
|
||||
$appversion = OCP\App::getAppVersion('contacts');
|
||||
$prodid = '-//ownCloud//NONSGML '.$appinfo['name'].' '.$appversion.'//EN';
|
||||
$vcard->setString('PRODID', $prodid);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user