X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=mobile%2Fexpense_edit.php;fp=mobile%2Fexpense_edit.php;h=a4b1f2d0147634080c5c28e3a70b03d1a7e5c0c3;hb=ad98b13400fdc2fa2299a22c9bd54c4cd27960c3;hp=69c13eccaa7369708b3eaae75683094c6bf8ed38;hpb=dacd62b3065d38ddbec624d5b7d7306f0b61dd3a;p=timetracker.git diff --git a/mobile/expense_edit.php b/mobile/expense_edit.php index 69c13ecc..a4b1f2d0 100644 --- a/mobile/expense_edit.php +++ b/mobile/expense_edit.php @@ -119,6 +119,19 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); } } +// If predefined expenses are configured, add controls to select an expense and quantity. +$predefined_expenses = ttTeamHelper::getPredefinedExpenses($user->team_id); +if ($predefined_expenses) { + $form->addInput(array('type'=>'combobox', + 'onchange'=>'recalculateCost();', + 'name'=>'predefined_expense', + 'style'=>'width: 250px;', + 'value'=>$cl_predefined_expense, + 'data'=>$predefined_expenses, + 'datakeys'=>array('id', 'name'), + 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); + $form->addInput(array('type'=>'text','onchange'=>'recalculateCost();','maxlength'=>'40','name'=>'quantity','style'=>'width: 100px;','value'=>$cl_quantity)); +} $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'item_name','style'=>'width: 250px;','value'=>$cl_item_name)); $form->addInput(array('type'=>'text','maxlength'=>'40','name'=>'cost','style'=>'width: 100px;','value'=>$cl_cost)); $form->addInput(array('type'=>'datefield','name'=>'date','maxlength'=>'20','value'=>$cl_date)); @@ -198,6 +211,7 @@ if ($request->isPost()) { } } // isPost +$smarty->assign('predefined_expenses', $predefined_expenses); $smarty->assign('client_list', $client_list); $smarty->assign('project_list', $project_list); $smarty->assign('task_list', $task_list);