<?php

echo $form->dropDownListRow($model, 'user_language', $model->getLanguageDropdownList(), array(
    'class' => 'span3',
    'data-translation-target' => 'USERS_MODAL_LANGUAGE',
        )
);

echo $form->dropDownListRow($model, 'user_timezone', $model->getTimeZoneDropdownList(), array(
    'class' => 'span3',
    'data-translation-target' => 'USERS_MODAL_TIMEZONE',
        )
);

echo $form->dropDownListRow($model, 'user_time_format', $model->getTimeFormatDropdownList(), array(
    'class' => 'span3',
    'data-translation-target' => 'USERS_MODAL_TIME_FORMAT',
        )
);

echo $form->dropDownListRow($model, 'user_date_format', $model->getDateFormatDropdownList(), array(
    'class' => 'span3',
    'data-translation-target' => 'USERS_MODAL_DATE_FORMAT',
        )
);

if (PhonalisaLicenseManager::provisioningProfileMax() !== 0) {
    echo $form->dropDownListRow($model, 'provisioningProfile', $model->getProvisioningProfileDropdownList(), array(
        'class' => 'span3',
        'data-translation-id' => 'USER_MODEL_PROVISIONING_PROFILE',
            )
    );
}

if (PhonalisaLicenseManager::provisioningKeyProfileMax() !== 0) {
    echo $form->dropDownListRow($model, 'keyProfile', $model->getKeyProfileDropdownList(), array(
        'class' => 'span3',
        'data-translation-id' => 'USER_MODEL_KEY_PROFILE',
            )
    );
}

echo $form->dropDownListRow($model, 'internMessageBeforeAnswer', $availableAudiofiles, array(
    'class' => 'span3',
    'data-translation-id' => 'USER_MODEL_INTERN_MESSAGE_BEFORE_ANSWER',
        )
);

echo $form->dropDownListRow($model, 'externMessageBeforeAnswer', $availableAudiofiles, array(
    'class' => 'span3',
    'data-translation-id' => 'USER_MODEL_EXTERN_MESSAGE_BEFORE_ANSWER',
        )
);

if (PhonalisaLicenseManager::routingScriptExtensionMax() !== 0) {
    echo $form->dropDownListRow($model, 'scriptExtension', ScriptExtension::model()->listData, array(
        'class' => 'span3',
        'data-translation-id' => 'USER_MODEL_SCRIPT_EXTENSION',
            )
    );
}

echo $form->checkboxRow($model, 'zrtp', array(
    'data-translation-id' => 'USERS_MODEL_ZRTP'
        )
);
echo $form->checkboxRow($model, 'isDedicatedFaxUser', array(
    'data-translation-id' => 'USER_MODEL_IS_DEDICATED_FAX_USER'
        )
);

if (PhonalisaLicenseManager::faxGUIEnabled()) {

    echo $form->dropDownListRow($model, 'faxSendAllowed', User::getFaxSendAllowedDropdownList(), array(
        'class' => 'span3',
        'data-translation-target' => 'FAX_SENDING_ALLOWED_TRANSLATION',
    ));

    echo $form->textFieldRow($model, 'fax_header_text', array(
        'class' => 'span3',
        'data-translation-id' => 'USERS_MODEL_FAX_HEADER_TEXT',
            )
    );

    echo $form->textFieldRow($model, 'fax_header_number', array(
        'class' => 'span3',
        'data-translation-id' => 'USERS_MODEL_FAX_HEADER_NUMBER',
            )
    );
}

echo $form->textFieldRow($model, 'droptarget', array(
    'class' => 'span3',
    'data-translation-id' => 'USERS_MODEL_DROPTARGET',
        )
);

$userModel = app()->user->realUserInstance;

if ($userModel->isSystemAdmin) {
    echo $form->checkboxRow($model, 'isSystemAdmin', array(
        'disabled' => $userModel->id == $model->id,
        'data-translation-id' => 'USER_IS_SYSTEM_ADMIN',
        'checked' => $model->isSystemAdmin
            )
    );
}
