Exemplo n.º 1
0
    $permission->Redirect(FALSE);
    //Redirect
}
$smarty->assign('title', TTi18n::gettext($title = 'Edit Branch'));
// See index.php
/*
 * Get FORM variables
 */
extract(FormVariables::GetVariables(array('action', 'id', 'branch_data')));
$bf = new BranchFactory();
$action = Misc::findSubmitButton();
$action = strtolower($action);
switch ($action) {
    case 'submit':
        Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10);
        $bf->setId($branch_data['id']);
        $bf->setCompany($current_company->getId());
        $bf->setStatus($branch_data['status']);
        $bf->setName($branch_data['name']);
        $bf->setManualId($branch_data['manual_id']);
        if ($branch_data['address1'] != '') {
            $bf->setAddress1($branch_data['address1']);
        }
        if ($branch_data['address2'] != '') {
            $bf->setAddress2($branch_data['address2']);
        }
        $bf->setCity($branch_data['city']);
        $bf->setCountry($branch_data['country']);
        $bf->setProvince($branch_data['province']);
        if ($branch_data['postal_code'] != '') {
            $bf->setPostalCode($branch_data['postal_code']);