From: Nik Okuntseff Date: Sun, 30 Jun 2019 12:57:20 +0000 (+0000) Subject: Added custom field controls on user_add.php. X-Git-Tag: timetracker_1.19-1~5 X-Git-Url: http://wagnertech.de/git?p=timetracker.git;a=commitdiff_plain;h=e5129e06ab4547945e1ad3097e4193930465f93f Added custom field controls on user_add.php. --- diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 46167ca4..ab50afe5 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- {/if} +{if $custom_fields && $custom_fields->userFields} + {foreach $custom_fields->userFields as $userField} + + + {assign var="control_name" value='user_field_'|cat:$userField['id']} + + + {/foreach} +{/if} + + diff --git a/user_add.php b/user_add.php index 56bd69b3..a3d956ea 100644 --- a/user_add.php +++ b/user_add.php @@ -100,7 +100,17 @@ if ($user->isPluginEnabled('cl')) // If we have custom fields - add controls for them. if ($custom_fields && $custom_fields->userFields) { - // Coding in progress... + foreach ($custom_fields->userFields as $userField) { + $field_name = 'user_field_'.$userField['id']; + if ($userField['type'] == CustomFields::TYPE_TEXT) { + $form->addInput(array('type'=>'text','name'=>$field_name)); + } elseif ($userField['type'] == CustomFields::TYPE_DROPDOWN) { + $form->addInput(array('type'=>'combobox','name'=>$field_name, + 'style'=>'width: 250px;', + 'data'=>CustomFields::getOptions($userField['id']), + 'empty'=>array(''=>$i18n->get('dropdown.select')))); + } + } } $form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'rate','format'=>'.2','value'=>$cl_rate));
 Anuko Time Tracker 1.19.7.5024 | Copyright © Anuko | +  Anuko Time Tracker 1.19.7.5025 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/user_add.tpl b/WEB-INF/templates/user_add.tpl index 155bf11c..3f00c359 100644 --- a/WEB-INF/templates/user_add.tpl +++ b/WEB-INF/templates/user_add.tpl @@ -100,6 +100,17 @@ function handleClientControl() { {$forms.userForm.quota_percent.control} {$i18n.label.what_is_it}
{$userField['label']|escape}{if $userField['required']} (*){/if}:{$forms.userForm.$control_name.control}
{$i18n.form.users.default_rate} (0{$user->getDecimalMark()}00): {$forms.userForm.rate.control}