X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=invoice_add.php;h=f68753fca4b337fa02372aa8eef692f984408d0b;hb=ff71ab051012b2ac0664f08603b8c6455feba5db;hp=347f6b43abee3e5e3de287b65625498d0aeaad31;hpb=9e82b53fc5d8cb1e54b5fde774fa68a916f28b4c;p=timetracker.git diff --git a/invoice_add.php b/invoice_add.php index 347f6b43..f68753fc 100644 --- a/invoice_add.php +++ b/invoice_add.php @@ -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,10 +86,11 @@ if ($request->isPost()) { if (ttInvoiceHelper::createInvoice($fields)) { header('Location: invoices.php'); exit(); - } + } else { $err->add($i18n->getKey('error.db')); + } } -} // POST +} // isPost $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.invoiceForm.number.focus()"');