Permalink
Browse files

Usability/readability imporvement foor items grid

  • Loading branch information...
flack committed Aug 24, 2018
1 parent 5ccfde9 commit 7cb73f678498ec67d4a3f2cead6db3cbd4045f9a
@@ -35,19 +35,28 @@ public function _handler_items($handler_id, array $args, array &$data)
$data['entries'] = [];
$sales_url = org_openpsa_core_siteconfig::get_instance()->get_node_full_url('org.openpsa.sales');
$projects_url = org_openpsa_core_siteconfig::get_instance()->get_node_full_url('org.openpsa.projects');
$invoice_sum = 0;
foreach ($this->_object->get_invoice_items() as $item) {
$entry = [];
$entry['id'] = $item->id;
try {
$deliverable = org_openpsa_sales_salesproject_deliverable_dba::get_cached($item->deliverable);
$entry['deliverable'] = $deliverable->title;
$entry['deliverable'] = '<i class="fa fa-money" title="' . $deliverable->title . '"></i>';
if ($sales_url) {
$entry['deliverable'] = '<a href="' . $sales_url . 'deliverable/' . $deliverable->guid . '/">' . $entry['deliverable'] . '</a>';
}
} catch (midcom_error $e) {
$entry['deliverable'] = '';
}
try {
$task = org_openpsa_projects_task_dba::get_cached($item->task);
$entry['task'] = $task->title;
$entry['task'] = '<i class="fa fa-calendar-check-o" title="' . $task->title . '"></i>';
if ($projects_url) {
$entry['task'] = '<a href="' . $projects_url . 'task/' . $task->guid . '/">' . $entry['task'] . '</a>';
}
} catch (midcom_error $e) {
$entry['task'] = '';
}
@@ -6,8 +6,8 @@
$grid->set_option('pager', '#p_' . $grid->get_identifier());
$grid->set_column('position', $data['l10n']->get('position'), 'hidden: true');
$grid->set_column('deliverable', midcom::get()->i18n->get_string('agreement', 'org.openpsa.projects'), 'width: 80, sortable: false');
$grid->set_column('task', midcom::get()->i18n->get_string('task', 'org.openpsa.projects'), 'width: 80, sortable: false');
$grid->set_column('deliverable', midcom::get()->i18n->get_string('agreement', 'org.openpsa.projects'), 'fixed: true, align: "center", width: 40, sortable: false');
$grid->set_column('task', midcom::get()->i18n->get_string('task', 'org.openpsa.projects'), 'fixed: true, align: "center", width: 40, sortable: false');
$grid->set_column('description', $data['l10n_midcom']->get('description'), 'editable: true, edittype: "textarea", sortable: false');
$grid->set_column('price', $data['l10n']->get('price'), 'align: "right", width: 40, formatter: "number", sortable: false, editable: true');
$grid->set_column('quantity', $data['l10n']->get('quantity'), 'align: "right", width: 30, formatter: "number", sortable: false, editable: true');

0 comments on commit 7cb73f6

Please sign in to comment.