X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=invoice_add.php;h=0e752dca35d6d236329cd4a8be217659ee6ea17b;hb=16cbd33bec16854f1b6a4caf4ac24ededc8326f3;hp=4a1c4834a1fb9ed18d5d3899c76da7e527db0669;hpb=eb55e2f8ca3859482a389795e03b45283e14ef36;p=timetracker.git diff --git a/invoice_add.php b/invoice_add.php index 4a1c4834..0e752dca 100644 --- a/invoice_add.php +++ b/invoice_add.php @@ -32,7 +32,7 @@ import('ttTeamHelper'); import('ttInvoiceHelper'); // Access check. -if (!ttAccessCheck(right_manage_team)) { +if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('iv')) { header('Location: access_denied.php'); exit(); } @@ -50,7 +50,7 @@ $form = new Form('invoiceForm'); $form->addInput(array('type'=>'datefield','name'=>'date','size'=>'20','value'=>$cl_date)); // Dropdown for clients if the clients plugin is enabled. -if (in_array('cl', explode(',', $user->plugins))) { +if ($user->isPluginEnabled('cl')) { $clients = ttTeamHelper::getActiveClients($user->team_id); $form->addInput(array('type'=>'combobox','name'=>'client','style'=>'width: 250px;','data'=>$clients,'datakeys'=>array('id','name'),'value'=>$cl_client,'empty'=>array(''=>$i18n->getKey('dropdown.select')))); } @@ -86,8 +86,9 @@ if ($request->isPost()) { if (ttInvoiceHelper::createInvoice($fields)) { header('Location: invoices.php'); exit(); - } + } else { $err->add($i18n->getKey('error.db')); + } } } // isPost