X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=work_add.php;h=452e515b3ae27b76ad91d8e9e018ddc13bbb4648;hb=HEAD;hp=20d0ac01fab4b6d262f22e13d2e221bc3a91ef33;hpb=8dade986970598d2c58e2484342e413bf30be4db;p=timetracker.git diff --git a/work_add.php b/work_add.php index 20d0ac01..452e515b 100644 --- a/work_add.php +++ b/work_add.php @@ -31,6 +31,7 @@ import('form.Form'); import('ttProjectHelper'); import('ttGroupHelper'); import('ttFileHelper'); +import('ttWorkHelper'); // Access checks. if (!ttAccessAllowed('manage_work')) { @@ -48,24 +49,27 @@ $showFiles = $user->isPluginEnabled('at'); if ($request->isPost()) { $cl_name = trim($request->getParameter('work_name')); $cl_description = trim($request->getParameter('description')); + $cl_currency = $request->getParameter('currency'); } $form = new Form('workForm'); - - - - $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'work_name','style'=>'width: 250px;','value'=>$cl_name)); $form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description)); if ($showFiles) $form->addInput(array('type'=>'upload','name'=>'newfile','value'=>$i18n->get('button.submit'))); +// Add a dropdown for currency. +$currencies = ttWorkHelper::getCurrencies(); +$form->addInput(array('type'=>'combobox','name'=>'currency','data'=>$currencies,'datakeys'=>array('id','name'),'value'=>$cl_currency)); -// Should not we get it from server? -// $CURRENCY_OPTIONS = array(array('id'=>'.','name'=>'.'),array('id'=>',','name'=>',')); -// $form->addInput(array('type'=>'combobox','name'=>'decimal_mark','style'=>'width: 150px','data'=>$DECIMAL_MARK_OPTIONS,'datakeys'=>array('id','name'),'value'=>$cl_decimal_mark, -// 'onchange'=>'adjustDecimalPreview()')); +// TODO: design how to handle one-time vs ongoing work. Apparently, with a conditional display of relevant controls. +// Ongoing work - rate per hour control. +// One-time work - budget dropdown control. +// When selection changes, we hide and show required controls. +// TODO: design how to handle categories and sub-categories. +// One major complication is localization of names. +// Coding and design are currently ongoing. if ($request->isPost()) {