Exemplo n.º 1
0
     CurrencyFactory::updateCurrencyRates($current_company->getId());
     Redirect::Page(URLBuilder::getURL(NULL, 'CurrencyList.php'));
     break;
 case 'add':
     Redirect::Page(URLBuilder::getURL(NULL, 'EditCurrency.php'));
     break;
 case 'delete' or 'undelete':
     if (strtolower($action) == 'delete') {
         $delete = TRUE;
     } else {
         $delete = FALSE;
     }
     $clf = new CurrencyListFactory();
     if (isset($ids) and is_array($ids)) {
         foreach ($ids as $id) {
             $clf->getByIdAndCompanyId($id, $current_company->getId());
             foreach ($clf as $c_obj) {
                 $c_obj->setDeleted($delete);
                 if ($c_obj->isValid()) {
                     $c_obj->Save();
                 }
             }
         }
     }
     Redirect::Page(URLBuilder::getURL(NULL, 'CurrencyList.php'));
     break;
 default:
     BreadCrumb::setCrumb($title);
     $clf = new CurrencyListFactory();
     $clf->getByCompanyId($current_company->getId(), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
     $pager = new Pager($clf);