URLBuilder::setURL($_SERVER['SCRIPT_NAME'], array('sort_column' => $sort_column, 'sort_order' => $sort_order, 'page' => $page)); Debug::Arr($ids, 'Selected Objects', __FILE__, __LINE__, __METHOD__, 10); $action = Misc::findSubmitButton(); switch ($action) { case 'add': Redirect::Page(URLBuilder::getURL(NULL, 'EditUserTitle.php')); break; case 'delete' or 'undelete': if (strtolower($action) == 'delete') { $delete = TRUE; } else { $delete = FALSE; } $utlf = new UserTitleListFactory(); foreach ($ids as $id) { $utlf->GetByIdAndCompanyId($id, $current_company->getId()); foreach ($utlf as $title_obj) { $title_obj->setDeleted($delete); $title_obj->Save(); } } Redirect::Page(URLBuilder::getURL(NULL, 'UserTitleList.php')); break; default: $sort_array = NULL; if ($sort_column != '') { $sort_array = array(Misc::trimSortPrefix($sort_column) => $sort_order); } $utlf = new UserTitleListFactory(); $utlf->getByCompanyId($current_company->getId(), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array); $pager = new Pager($utlf);