X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=expense_edit.php;h=0c7cee5cd175bd4edf017c9319dac8cdb3318540;hb=9e55571e568f9653c94860ab308cd781e20d13eb;hp=3e8b18e9ba110c6793694c2293f7a41b8ff64c0c;hpb=45c855269d952873285f7a835e82fc2b3eff3971;p=timetracker.git diff --git a/expense_edit.php b/expense_edit.php index 3e8b18e9..0c7cee5c 100644 --- a/expense_edit.php +++ b/expense_edit.php @@ -141,7 +141,7 @@ if ($predefined_expenses) { } $form->addInput(array('type'=>'textarea','maxlength'=>'800','name'=>'item_name','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_item_name)); $form->addInput(array('type'=>'text','maxlength'=>'40','name'=>'cost','style'=>'width: 100px;','value'=>$cl_cost)); -if ($user->canManageTeam() && $user->isPluginEnabled('ps')) +if ($user->can('manage_invoices') && $user->isPluginEnabled('ps')) $form->addInput(array('type'=>'checkbox','name'=>'paid','value'=>$cl_paid)); $form->addInput(array('type'=>'datefield','name'=>'date','maxlength'=>'20','value'=>$cl_date)); // Hidden control for record id. @@ -205,8 +205,8 @@ if ($request->isPost()) { // Now, a new insert. if ($err->no()) { - if (ttExpenseHelper::insert(array('date'=>$new_date->toString(DB_DATEFORMAT),'user_id'=>$user->getActiveUser(), - 'client_id'=>$cl_client,'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'status'=>1))) { + if (ttExpenseHelper::insert(array('date'=>$new_date->toString(DB_DATEFORMAT),'client_id'=>$cl_client, + 'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'status'=>1))) { header('Location: expenses.php?date='.$new_date->toString(DB_DATEFORMAT)); exit(); } else