Login or Register

RSS IconRecent posts in this topic

avatar
remi on Jul 7. 2006. 8:33 pm
When I try to delete a client (which is no more linked to a project and which doesn't contain a user) I get this message:

Failed to delete selected client company
avatar Staff
Ilija Studen on Jul 8. 2006. 12:21 am
Fixed. Change will be available in SVN as soon as I commit, but SVN is a bit broken so I'd recommend that you manualy fix this one.

1. Open /application/models/companies/Company.class.php
2. Find delete() function
3. Replace it with this code:

/**
* Delete this company and all related data
*
* @access public
* @param void
* @return boolean
* @throws Error
*/
function delete() {
  if($this->isOwner()) throw new Error(lang('error delete owner company'));
  
  // Users
  $users = $this->getUsers();
  if(is_array($users) && count($users)) {
    foreach($users as $user) $user->delete();
  } // if
  
  // Delete self
  return parent::delete();
} // delete
activeCollab Team Member
Topic is locked. If you have something important to say about issues discussed on this page please write at hi@a51dev.com.

RSS IconRecent posts in this topic