<table border="0">
{if $user->isPluginEnabled('cl')}
<tr>
- <td align="right">{$i18n.label.client} {if in_array('cm', explode(',', $user->plugins))}(*){/if}:</td>
+ <td align="right">{$i18n.label.client} {if $user->isPluginEnabled('cm')}(*){/if}:</td>
<td>{$forms.expenseItemForm.client.control}</td>
</tr>
{/if}
{/if}
{if $user->isPluginEnabled('cl')}
<tr>
- <td align="right">{$i18n.label.client}{if in_array('cm', explode(',', $user->plugins))} (*){/if}:</td>
+ <td align="right">{$i18n.label.client}{if $user->isPluginEnabled('cm')} (*){/if}:</td>
<td>{$forms.expensesForm.client.control}</td>
</tr>
{/if}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.9.20.3460 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.9.20.3461 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
· <a class="mainMenu" href="expenses.php">{$i18n.menu.expenses}</a>
{/if}
{if !$user->isClient()}· {/if}<a class="mainMenu" href="reports.php">{$i18n.menu.reports}</a>
- {if ($user->canManageTeam() || $user->isClient()) && in_array('iv', explode(',', $user->plugins))}
+ {if ($user->canManageTeam() || $user->isClient()) && $user->isPluginEnabled('iv')}
· <a class="mainMenu" href="invoices.php">{$i18n.title.invoices}</a>
{/if}
- {if (in_array('ch', explode(',', $user->plugins)) && !$user->isClient()) && ($smarty.const.MODE_PROJECTS == $user->tracking_mode
- || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode
- || in_array('cl', explode(',', $user->plugins)))}
+ {if ($user->isPluginEnabled('ch') && !$user->isClient()) && ($smarty.const.MODE_PROJECTS == $user->tracking_mode
+ || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode || $user->isPluginEnabled('cl'))}
· <a class="mainMenu" href="charts.php">{$i18n.menu.charts}</a>
{/if}
{if !$user->isClient() && ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
{if !$user->isClient()}
· <a class="mainMenu" href="users.php">{$i18n.menu.users}</a>
{/if}
- {if $user->canManageTeam() && in_array('cl', explode(',', $user->plugins))}
+ {if $user->canManageTeam() && $user->isPluginEnabled('cl')}
· <a class="mainMenu" href="clients.php">{$i18n.menu.clients}</a>
{/if}
{if $user->isManager()}
<tr><td>{$i18n.label.client}:</td></tr>
<tr><td>{$forms.timeRecordForm.client.control}</td></tr>
{/if}
-{if in_array('iv', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('iv')}
<tr><td><label>{$forms.timeRecordForm.billable.control}{$i18n.form.time.billable}</label></td></tr>
{/if}
{if ($custom_fields && $custom_fields->fields[0])}
<tr><td>{$i18n.label.client}:</td></tr>
<tr><td>{$forms.timeRecordForm.client.control}</td></tr>
{/if}
-{if in_array('iv', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('iv')}
<tr><td><label>{$forms.timeRecordForm.billable.control}{$i18n.form.time.billable}</label></td></tr>
{/if}
{if ($custom_fields && $custom_fields->fields[0])}
<tr><td>{$i18n.label.client}:</td></tr>
<tr><td>{$forms.timerRecordForm.client.control}</td></tr>
{/if}
-{if in_array('iv', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('iv')}
<tr><td><label>{$forms.timerRecordForm.billable.control}{$i18n.form.time.billable}</label></td></tr>
{/if}
{if ($custom_fields && $custom_fields->fields[0])}
{/if}
</tr>
{/if}
-{if in_array('iv', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('iv')}
<tr>
<td><b>{$i18n.form.time.billable}</b></td>
<td> </td>
<tr>
<td colspan="3">
<table border="0" width="100%">
-{if $user->isPluginEnabled('cl') || in_array('iv', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl') || $user->isPluginEnabled('iv')}
<tr>
{if $user->isPluginEnabled('cl')}
<td width="25%"><label>{$forms.reportForm.chclient.control} {$i18n.label.client}</label></td>
{/if}
- {if ($user->canManageTeam() || $user->isClient()) && in_array('iv', explode(',', $user->plugins))}
+ {if ($user->canManageTeam() || $user->isClient()) && $user->isPluginEnabled('iv')}
<td width="25%"><label>{$forms.reportForm.chinvoice.control} {$i18n.label.invoice}</label></td>
{/if}
</tr>
<td>{$forms.timeRecordForm.onBehalfUser.control}</td>
</tr>
{/if}
-{if in_array('cl', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl')}
<tr>
- <td align="right">{$i18n.label.client}{if in_array('cm', explode(',', $user->plugins))} (*){/if}:</td>
+ <td align="right">{$i18n.label.client}{if $user->isPluginEnabled('cm')} (*){/if}:</td>
<td>{$forms.timeRecordForm.client.control}</td>
</tr>
{/if}
-{if in_array('iv', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('iv')}
<tr>
<td align="right"> </td>
<td><label>{$forms.timeRecordForm.billable.control}{$i18n.form.time.billable}</label></td>
{if $time_records}
<table border='0' cellpadding='3' cellspacing='1' width="100%">
<tr>
- {if in_array('cl', explode(',', $user->plugins))}
+ {if $user->isPluginEnabled('cl')}
<td width="20%" class="tableHeader">{$i18n.label.client}</td>
{/if}
{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
</tr>
{foreach $time_records as $record}
<tr bgcolor="{cycle values="#f5f5f5,#ccccce"}" {if !$record.billable} class="not_billable" {/if}>
- {if in_array('cl', explode(',', $user->plugins))}
+ {if $user->isPluginEnabled('cl')}
<td valign='top'>{$record.client|escape:'html'}</td>
{/if}
{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
<tr>
<td valign="top">
<table border="0">
-{if in_array('cl', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('cl')}
<tr>
- <td align="right">{$i18n.label.client}{if in_array('cm', explode(',', $user->plugins))} (*){/if}:</td>
+ <td align="right">{$i18n.label.client}{if $user->isPluginEnabled('cm')} (*){/if}:</td>
<td>{$forms.timeRecordForm.client.control}</td>
</tr>
{/if}
-{if in_array('iv', explode(',', $user->plugins))}
+{if $user->isPluginEnabled('iv')}
<tr>
<td align="right"> </td>
<td><label>{$forms.timeRecordForm.billable.control}{$i18n.form.time.billable}</label></td>
$cl_type = $sc->getValue(SYSC_CHART_TYPE);
}
if (MODE_TIME == $user->tracking_mode) {
- if (in_array('cl', explode(',', $user->plugins)))
+ if ($user->isPluginEnabled('cl'))
$cl_type = CHART_CLIENTS;
} else {
if ($cl_type == CHART_CLIENTS) {
- if (!in_array('cl', explode(',', $user->plugins)))
+ if (!$user->isPluginEnabled('cl'))
$cl_type = CHART_PROJECTS;
} elseif ($cl_type == CHART_TASKS) {
if (MODE_PROJECTS_AND_TASKS != $user->tracking_mode)
));
// Chart type options.
-$chart_selector = (MODE_PROJECTS_AND_TASKS == $user->tracking_mode
- || in_array('cl', explode(',', $user->plugins)));
+$chart_selector = (MODE_PROJECTS_AND_TASKS == $user->tracking_mode || $user->isPluginEnabled('cl'));
if ($chart_selector) {
$types = array();
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$types[CHART_PROJECTS] = $i18n->getKey('dropdown.projects');
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$types[CHART_TASKS] = $i18n->getKey('dropdown.tasks');
- if (in_array('cl', explode(',', $user->plugins)))
+ if ($user->isPluginEnabled('cl'))
$types[CHART_CLIENTS] = $i18n->getKey('dropdown.clients');
// Add chart type dropdown.
$form = new Form('expenseItemForm');
// Dropdown for clients in MODE_TIME. Use all active clients.
-if (MODE_TIME == $user->tracking_mode && in_array('cl', explode(',', $user->plugins))) {
+if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
- if (in_array('cl', explode(',', $user->plugins))) {
+ if ($user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
if ($request->isPost()) {
// Validate user input.
- if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
+ if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
$err->add($i18n->getKey('error.client'));
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
if (!$cl_project) $err->add($i18n->getKey('error.project'));
}
// Dropdown for clients in MODE_TIME. Use all active clients.
-if (MODE_TIME == $user->tracking_mode && in_array('cl', explode(',', $user->plugins))) {
+if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
- if (in_array('cl', explode(',', $user->plugins))) {
+ if ($user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
if ($request->isPost()) {
if ($request->getParameter('btn_submit')) {
// Validate user input.
- if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
+ if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
$err->add($i18n->getKey('error.client'));
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
if (!$cl_project) $err->add($i18n->getKey('error.project'));
$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'))));
}
$cl_cf_1 = trim($request->getParameter('cf_1', ($request->getMethod()=='POST'? null : @$_SESSION['cf_1'])));
$_SESSION['cf_1'] = $cl_cf_1;
$cl_billable = 1;
-if (in_array('iv', explode(',', $user->plugins))) {
+if ($user->isPluginEnabled('iv')) {
if ($request->isPost()) {
$cl_billable = $request->getParameter('billable');
$_SESSION['billable'] = (int) $cl_billable;
$form = new Form('timeRecordForm');
// Dropdown for clients in MODE_TIME. Use all active clients.
-if (MODE_TIME == $user->tracking_mode && in_array('cl', explode(',', $user->plugins))) {
+if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
- if (in_array('cl', explode(',', $user->plugins))) {
+ if ($user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type))
$form->addInput(array('type'=>'text','name'=>'duration','value'=>$cl_duration,'onchange'=>"formDisable('duration');"));
$form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 250px; height: 60px;','value'=>$cl_note));
-if (in_array('iv', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','data'=>1,'value'=>$cl_billable));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_submit click.
$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.submit')));
if ($request->getParameter('btn_submit')) {
// Validate user input.
- if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
+ if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
$err->add($i18n->getKey('error.client'));
if ($custom_fields) {
if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
$cl_project = $request->getParameter('project');
$cl_task = $request->getParameter('task');
$cl_billable = 1;
- if (in_array('iv', explode(',', $user->plugins)))
+ if ($user->isPluginEnabled('iv'))
$cl_billable = $request->getParameter('billable');
} else {
$cl_client = $time_rec['client_id'];
$form = new Form('timeRecordForm');
// Dropdown for clients in MODE_TIME. Use all active clients.
-if (MODE_TIME == $user->tracking_mode && in_array('cl', explode(',', $user->plugins))) {
+if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
- if (in_array('cl', explode(',', $user->plugins))) {
+ if ($user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
}
// Hidden control for record id.
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
-if (in_array('iv', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','data'=>1,'value'=>$cl_billable));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_save click.
$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.save')));
if ($request->isPost()) {
// Validate user input.
- if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
+ if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
$err->add($i18n->getKey('error.client'));
if ($custom_fields) {
if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
$cl_cf_1 = trim($request->getParameter('cf_1', ($request->getMethod()=='POST'? null : @$_SESSION['cf_1'])));
$_SESSION['cf_1'] = $cl_cf_1;
$cl_billable = 1;
-if (in_array('iv', explode(',', $user->plugins))) {
+if ($user->isPluginEnabled('iv')) {
if ($request->isPost()) {
$cl_billable = $request->getParameter('billable');
$_SESSION['billable'] = (int) $cl_billable;
$form = new Form('timerRecordForm');
// Dropdown for clients in MODE_TIME. Use all active clients.
-if (MODE_TIME == $user->tracking_mode && in_array('cl', explode(',', $user->plugins))) {
+if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
- if (in_array('cl', explode(',', $user->plugins))) {
+ if ($user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
'datakeys'=>array('id','name'),
'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
}
-if (in_array('iv', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','data'=>1,'value'=>$cl_billable,'enable'=>$enable_controls));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on button click.
$form->addInput(array('type'=>'hidden','name'=>'browser_time','value'=>'')); // User current time, which gets filled in on button click.
$cl_finish = null;
// Validate user input.
- if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
+ if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
$err->add($i18n->getKey('error.client'));
if ($custom_fields) {
if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete'),'onclick'=>"return confirm('".$i18n->getKey('form.reports.confirm_delete')."')"));
// Dropdown for clients if the clients plugin is enabled.
-if (in_array('cl', explode(',', $user->plugins)) && !($user->isClient() && $user->client_id)) {
+if ($user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id)) {
if ($user->canManageTeam() || ($user->isClient() && !$user->client_id))
$client_list = ttClientHelper::getClients($user->team_id);
else
$form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'end_date'));
// Add checkboxes for fields.
-if (in_array('cl', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('cl'))
$form->addInput(array('type'=>'checkbox','name'=>'chclient','data'=>1));
-if (($user->canManageTeam() || $user->isClient()) && in_array('iv', explode(',', $user->plugins)))
+if (($user->canManageTeam() || $user->isClient()) && $user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'chinvoice','data'=>1));
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$form->addInput(array('type'=>'checkbox','name'=>'chproject','data'=>1));
$group_by_options['date'] = $i18n->getKey('form.reports.group_by_date');
if ($user->canManageTeam() || $user->isClient())
$group_by_options['user'] = $i18n->getKey('form.reports.group_by_user');
-if (in_array('cl', explode(',', $user->plugins)) && !($user->isClient() && $user->client_id))
+if ($user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id))
$group_by_options['client'] = $i18n->getKey('form.reports.group_by_client');
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$group_by_options['project'] = $i18n->getKey('form.reports.group_by_project');
$cl_cf_1 = trim($request->getParameter('cf_1', ($request->getMethod()=='POST'? null : @$_SESSION['cf_1'])));
$_SESSION['cf_1'] = $cl_cf_1;
$cl_billable = 1;
-if (in_array('iv', explode(',', $user->plugins))) {
+if ($user->isPluginEnabled('iv')) {
if ($request->isPost()) {
$cl_billable = $request->getParameter('billable');
$_SESSION['billable'] = (int) $cl_billable;
}
// Dropdown for clients in MODE_TIME. Use all active clients.
-if (MODE_TIME == $user->tracking_mode && in_array('cl', explode(',', $user->plugins))) {
+if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
- if (in_array('cl', explode(',', $user->plugins))) {
+ if ($user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
$form->addInput(array('type'=>'text','name'=>'duration','value'=>$cl_duration,'onchange'=>"formDisable('duration');"));
$form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 600px; height: 40px;','value'=>$cl_note));
$form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // calendar
-if (in_array('iv', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','data'=>1,'value'=>$cl_billable));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_submit click.
$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.submit')));
if ($request->getParameter('btn_submit')) {
// Validate user input.
- if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
+ if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
$err->add($i18n->getKey('error.client'));
if ($custom_fields) {
if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
$cl_project = $request->getParameter('project');
$cl_task = $request->getParameter('task');
$cl_billable = 1;
- if (in_array('iv', explode(',', $user->plugins)))
+ if ($user->isPluginEnabled('iv'))
$cl_billable = $request->getParameter('billable');
} else {
$cl_client = $time_rec['client_id'];
$form = new Form('timeRecordForm');
// Dropdown for clients in MODE_TIME. Use all active clients.
-if (MODE_TIME == $user->tracking_mode && in_array('cl', explode(',', $user->plugins))) {
+if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
// Dropdown for clients if the clients plugin is enabled.
- if (in_array('cl', explode(',', $user->plugins))) {
+ if ($user->isPluginEnabled('cl')) {
$active_clients = ttTeamHelper::getActiveClients($user->team_id, true);
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
}
// Hidden control for record id.
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
-if (in_array('iv', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('iv'))
$form->addInput(array('type'=>'checkbox','name'=>'billable','data'=>1,'value'=>$cl_billable));
$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_save or btn_copy click.
$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.save')));
if ($request->isPost()) {
// Validate user input.
- if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
+ if ($user->isPluginEnabled('cl') && $user->isPluginEnabled('cm') && !$cl_client)
$err->add($i18n->getKey('error.client'));
if ($custom_fields) {
if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->getKey('error.field'), $custom_fields->fields[0]['label']);
// The "limit" plugin is not required for normal operation of the Time Tracker.
@include('plugins/limit/user_add.php');
-if (in_array('cl', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('cl'))
$clients = ttTeamHelper::getActiveClients($user->team_id);
$assigned_projects = array();
$roles[ROLE_USER] = $i18n->getKey('label.user');
$roles[ROLE_COMANAGER] = $i18n->getKey('form.users.comanager');
-if (in_array('cl', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('cl'))
$roles[ROLE_CLIENT] = $i18n->getKey('label.client');
$form->addInput(array('type'=>'combobox','onchange'=>'handleClientControl()','name'=>'role','value'=>$cl_role,'data'=>$roles));
-if (in_array('cl', explode(',', $user->plugins)))
+if ($user->isPluginEnabled('cl'))
$form->addInput(array('type'=>'combobox','name'=>'client','value'=>$cl_client_id,'data'=>$clients,'datakeys'=>array('id', 'name'),'empty'=>array(''=>$i18n->getKey('dropdown.select'))));
$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'rate','format'=>'.2','value'=>$cl_rate));