Exemplo n.º 1
0
    //Redirect
}
$smarty->assign('title', TTi18n::gettext($title = 'Edit Currency'));
// See index.php
/*
 * Get FORM variables
 */
extract(FormVariables::GetVariables(array('action', 'id', 'data', 'data_saved')));
$cf = new CurrencyFactory();
$action = Misc::findSubmitButton();
$action = strtolower($action);
switch ($action) {
    case 'submit':
        //Debug::setVerbosity(11);
        Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10);
        $cf->setId($data['id']);
        $cf->setCompany($current_company->getId());
        $cf->setStatus($data['status']);
        $cf->setName($data['name']);
        $cf->setISOCode($data['iso_code']);
        $cf->setConversionRate($data['conversion_rate']);
        if (isset($data['auto_update']) and $data['auto_update'] == 1) {
            $cf->setAutoUpdate(TRUE);
        } else {
            $cf->setAutoUpdate(FALSE);
        }
        if (isset($data['is_base']) and $data['is_base'] == 1) {
            $cf->setBase(TRUE);
        } else {
            $cf->setBase(FALSE);
        }