Beispiel #1
0
      $subTemplate['card'] = new OBM_Template('card');
    } else {
      header('HTTP', true, 403);
      //FIXME : Not compatible with the HTML/Ajax implemetation
      OBM_Error::getInstance()->addError('rights', __('Permission denied'));
      echo OBM_Error::getInstance()->toJson();
      exit();
    } 
  } elseif ($action == 'moveContact') {
  ///////////////////////////////////////////////////////////////////////////////
    $contact = OBM_Contact::get($params['id']);
    $addressbooks = OBM_AddressBook::search();
    $source = $addressbooks[$contact->addressbook_id];
    $destination = $addressbooks[$params['addressbook']];
    if ($source && $source->read && $source->write && $destination && $destination->write) {
      OBM_Contact::move($contact, $destination);
      $subTemplate['card'] = new OBM_Template('card');
    } else {
      header('HTTP', true, 403);
      //FIXME : Not compatible with the HTML/Ajax implemetation
      OBM_Error::getInstance()->addError('rights', __('Permission denied'));
      echo OBM_Error::getInstance()->toJson();
      exit();
    }

  } elseif ($action == 'deleteContact') {
  ///////////////////////////////////////////////////////////////////////////////
    $addressbooks = OBM_AddressBook::search();
    $params['contact_id'] = $params['id'];
    $contact = OBM_Contact::get($params['id']);
    $current['addressbook'] = $addressbook->id;