import('ttTeamHelper');
import('ttInvoiceHelper');
-// Access check.
-if (!ttAccessAllowed('manage_invoices') || !$user->isPluginEnabled('iv')) {
+// Access checks.
+if (!ttAccessAllowed('manage_invoices')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('iv')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
+// End of access checks.
if ($request->isPost()) {
$cl_date = $request->getParameter('date');
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
- $clients = ttTeamHelper::getActiveClients($user->team_id);
+ $clients = ttTeamHelper::getActiveClients($user->group_id);
$form->addInput(array('type'=>'combobox','name'=>'client','style'=>'width: 250px;','data'=>$clients,'datakeys'=>array('id','name'),'value'=>$cl_client,'empty'=>array(''=>$i18n->get('dropdown.select'))));
}
// Dropdown for projects.
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- $projects = ttTeamHelper::getActiveProjects($user->team_id);
+ $projects = ttTeamHelper::getActiveProjects($user->group_id);
$form->addInput(array('type'=>'combobox','name'=>'project','style'=>'width: 250px;','data'=>$projects,'datakeys'=>array('id','name'),'value'=>$cl_project,'empty'=>array(''=>$i18n->get('dropdown.all'))));
}
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'number','style'=>'width: 250px;','value'=>$cl_number));