mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-07-12 07:56:34 -04:00
Fix incorrect function calls
- Corrected URI segment calls to CI4 - Corrected session variable references in views - Fix logout function name in Home Controller
This commit is contained in:
committed by
Steve Ireland
parent
cd96e42a93
commit
6e3af9184b
@@ -15,7 +15,7 @@ class Home extends Secure_Controller
|
||||
echo view('home/home');
|
||||
}
|
||||
|
||||
public function logout(): void
|
||||
public function getLogout(): void
|
||||
{
|
||||
$this->employee->logout();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ use App\Models\Reports\Summary_sales_taxes;
|
||||
use App\Models\Reports\Summary_suppliers;
|
||||
use App\Models\Reports\Summary_taxes;
|
||||
use CodeIgniter\HTTP\Uri;
|
||||
use Config\Services;
|
||||
|
||||
/**
|
||||
* @property attribute attribute
|
||||
@@ -51,16 +52,14 @@ use CodeIgniter\HTTP\Uri;
|
||||
* @property summary_sales_taxes summary_sales_taxes
|
||||
* @property summary_suppliers summary_suppliers
|
||||
* @property summary_taxes summary_taxes
|
||||
* @property URI uri
|
||||
*/
|
||||
class Reports extends Secure_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('reports');
|
||||
|
||||
$this->uri->setURI(uri_string());
|
||||
$method_name = $this->uri->getSegment(2);
|
||||
$request = Services::request();
|
||||
$method_name = $request->getUri()->getSegment(2);
|
||||
$exploder = explode('_', $method_name);
|
||||
|
||||
if(sizeof($exploder) > 1)
|
||||
@@ -1921,4 +1920,4 @@ class Reports extends Secure_Controller
|
||||
|
||||
return $subtitle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
* @var CodeIgniter\HTTP\IncomingRequest $request
|
||||
*/
|
||||
|
||||
$request = \Config\Services::request();
|
||||
use Config\Services;
|
||||
|
||||
$request = Services::request();
|
||||
helper('cookie');
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
@@ -118,7 +120,7 @@ helper('cookie');
|
||||
|
||||
<div class="navbar-right" style="margin:0">
|
||||
<?= anchor(esc("home/change_password/$user_info->person_id", 'url'), esc("$user_info->first_name $user_info->last_name", 'attr'), ['class' => 'modal-dlg', 'data-btn-submit' => lang('Common.submit'), 'title' => lang('Employees.change_password')]) ?>
|
||||
<?= ' | ' . ($request->getGet('debug') == 'true' ? $this->session->get('session_sha1') . ' | ' : '') ?>
|
||||
<?= ' | ' . ($request->getGet('debug') == 'true' ? session('session_sha1') . ' | ' : '') ?>
|
||||
<?= anchor('home/logout', lang('Login.logout')) ?>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -64,21 +64,22 @@ if(isset($error))
|
||||
<h3 class="panel-title"><span class="glyphicon glyphicon-list-alt"> </span><?php echo lang('Reports.detailed_reports') ?></h3>
|
||||
</div>
|
||||
<div class="list-group">
|
||||
<?php
|
||||
$person_id = $this->session->get('person_id');
|
||||
show_report_if_allowed('detailed', 'sales', $person_id);
|
||||
show_report_if_allowed('detailed', 'receivings', $person_id);
|
||||
show_report_if_allowed('specific', 'customer', $person_id, 'reports_customers');
|
||||
show_report_if_allowed('specific', 'discount', $person_id, 'reports_discounts');
|
||||
show_report_if_allowed('specific', 'employee', $person_id, 'reports_employees');
|
||||
show_report_if_allowed('specific', 'supplier', $person_id, 'reports_suppliers');
|
||||
<?php
|
||||
$person_id = session('person_id');
|
||||
|
||||
show_report_if_allowed('detailed', 'sales', $person_id);
|
||||
show_report_if_allowed('detailed', 'receivings', $person_id);
|
||||
show_report_if_allowed('specific', 'customer', $person_id, 'reports_customers');
|
||||
show_report_if_allowed('specific', 'discount', $person_id, 'reports_discounts');
|
||||
show_report_if_allowed('specific', 'employee', $person_id, 'reports_employees');
|
||||
show_report_if_allowed('specific', 'supplier', $person_id, 'reports_suppliers');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$employee = model(Employee::class);
|
||||
if ($employee->has_grant('reports_inventory', $this->session->get('person_id')))
|
||||
if ($employee->has_grant('reports_inventory', session('person_id')))
|
||||
{
|
||||
?>
|
||||
<div class="panel panel-primary">
|
||||
|
||||
@@ -50,7 +50,7 @@ if (isset($error_message))
|
||||
<?php echo anchor('sales', '<span class="glyphicon glyphicon-shopping-cart"> </span>' . lang('Sales.register'), ['class' => 'btn btn-info btn-sm', 'id' => 'show_sales_button']) ?>
|
||||
<?php
|
||||
$employee = model(Employee::class);
|
||||
if($employee->has_grant('reports_sales', $this->session->get('person_id'))): ?>
|
||||
if($employee->has_grant('reports_sales', session('person_id'))): ?>
|
||||
<?php echo anchor('sales/manage', '<span class=\'glyphicon glyphicon-list-alt\'> </span>' . lang('Sales.takings'), ['class' => 'btn btn-info btn-sm', 'id' => 'show_takings_button']) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -106,7 +106,7 @@ if(isset($success))
|
||||
|
||||
<?php
|
||||
$employee = model(Employee::class);
|
||||
if($employee->has_grant('reports_sales', $this->session->get('person_id')))
|
||||
if($employee->has_grant('reports_sales', session('person_id')))
|
||||
{
|
||||
?>
|
||||
<li class="pull-right">
|
||||
|
||||
Reference in New Issue
Block a user