Skip to content

Commit

Permalink
Reporting rate with target visualization TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
MIKEINTOSHSYSTEMS committed Jul 29, 2024
1 parent b64d610 commit 83afc6a
Show file tree
Hide file tree
Showing 53 changed files with 9,492 additions and 4,467 deletions.
2 changes: 2 additions & 0 deletions app/classes/charts.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ protected function isProjectDB()
return true;
if("DHIS2_Reporting_Rate" == $this->chrt_array['tables'][0])
return true;
if("DHIS2_Reporting_Rate" == $this->chrt_array['tables'][0])
return true;
return false;
}

Expand Down
2 changes: 2 additions & 0 deletions app/classes/crosstable_webreport.php
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,8 @@ public function isProjectDB()
$isDB = true;
if("DHIS2_Reporting_Rate" == $this->xml_array['tables'][0])
$isDB = true;
if("DHIS2_Reporting_Rate" == $this->xml_array['tables'][0])
$isDB = true;
return $isDB;
}

Expand Down
2 changes: 2 additions & 0 deletions app/classes/projectsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3598,6 +3598,8 @@ function fillProjectEntites()
$projectEntitiesReverse[ "dhis2_reporting_rate_chart1" ] = "DHIS2_Reporting_Rate_Chart";
$projectEntities[ "DHIS2_Reporting_Rate_Report" ] = array( "url" => "dhis2_reporting_rate_report1", "type" => 10 );
$projectEntitiesReverse[ "dhis2_reporting_rate_report1" ] = "DHIS2_Reporting_Rate_Report";
$projectEntities[ "DHIS2_Reporting_Rates_Chart" ] = array( "url" => "dhis2_reporting_rates_chart", "type" => 11 );
$projectEntitiesReverse[ "dhis2_reporting_rates_chart" ] = "DHIS2_Reporting_Rates_Chart";
}

function findTable( $table ) {
Expand Down
5 changes: 5 additions & 0 deletions app/classes/xtempl_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ function __construct( $hideAddedCharts = false )
"chartName"=>"dhis2_reporting_rate_chart1",
"table"=>"DHIS2_Reporting_Rate_Chart",
"ctype"=>"Combined"));
$this->assign_function("dhis2_reporting_rates_chart_chart","xt_showchart",
array(
"chartName"=>"dhis2_reporting_rates_chart",
"table"=>"DHIS2_Reporting_Rates_Chart",
"ctype"=>"Gauge"));
}


Expand Down
1 change: 1 addition & 0 deletions app/connections/ConnectionManager_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ protected function _setTablesConnectionIds()
$connectionsIds["DHIS2_Reporting_Rate"] = "devdhis2hispmdathispmdmerqcons";
$connectionsIds["DHIS2_Reporting_Rate_Chart"] = "devdhis2hispmdathispmdmerqcons";
$connectionsIds["DHIS2_Reporting_Rate_Report"] = "devdhis2hispmdathispmdmerqcons";
$connectionsIds["DHIS2_Reporting_Rates_Chart"] = "devdhis2hispmdathispmdmerqcons";

$this->_tablesConnectionIds = &$connectionsIds;
}
Expand Down
51 changes: 51 additions & 0 deletions app/dhis2_reporting_rates_chart_chart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");

$requestTable = "DHIS2_Reporting_Rates_Chart";
$requestPage = "list";

require_once("include/dbcommon.php");
require_once('include/xtempl.php');
require_once('classes/chartpage.php');
require_once('classes/searchclause.php');
add_nocache_headers();

require_once("include/dhis2_reporting_rates_chart_variables.php");

if( Security::hasLogin() ) {
if( !Security::processPageSecurity( $strtablename, 'S' ) )
return;
}

$pageMode = ChartPage::readChartModeFromRequest();
$xt = new Xtempl( $pageMode != CHART_SIMPLE );

// set params for a RunnerPage constructor
$params = array();
$params["id"] = postvalue_number("id");
$params["xt"] = &$xt;
$params["mode"] = $pageMode;
$params["tName"] = $strTableName;
$params["pageType"] = PAGE_CHART;
$params["pageName"] = postvalue("page");

$params["masterPageType"] = postvalue("masterpagetype");
$params["masterTable"] = postvalue("mastertable");
if( $params["masterTable"] )
$params["masterKeysReq"] = RunnerPage::readMasterKeysFromRequest();

if( $pageMode = CHART_DASHBOARD )
{
$params["dashElementName"] = postvalue("dashelement");
$params["dashTName"] = postvalue("table");
}

$pageObject = new ChartPage( $params );
$pageObject->init();

if( $pageObject->processSaveSearch() )
exit();

$pageObject->process();
?>
70 changes: 70 additions & 0 deletions app/dhis2_reporting_rates_chart_search.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");

require_once("include/dbcommon.php");
add_nocache_headers();

require_once("classes/searchclause.php");
require_once("include/dhis2_reporting_rates_chart_variables.php");
require_once("classes/searchcontrol.php");
require_once("classes/advancedsearchcontrol.php");
require_once("classes/panelsearchcontrol.php");




require_once('include/xtempl.php');
require_once('classes/searchpage.php');
require_once('classes/searchpage_dash.php');

$xt = new Xtempl();
$pageMode = SearchPage::readSearchModeFromRequest();

if( $pageMode == SEARCH_LOAD_CONTROL )
$layoutVersion = postvalue("layoutVersion");


$params = array();
$params['xt'] = &$xt;
$params['id'] = postvalue_number("id");
$params['mode'] = $pageMode;
$params['tName'] = $strTableName;
$params["pageName"] = postvalue("page");
$params['pageType'] = PAGE_SEARCH;
$params['chartName'] = $cname;
$params['reportName'] = $rname;
$params['templatefile'] = $templatefile;
$params['shortTableName'] = 'dhis2_reporting_rates_chart';
$params['layoutVersion'] = $layoutVersion;

$params['searchControllerId'] = postvalue('searchControllerId') ? postvalue('searchControllerId') : $id;
$params['ctrlField'] = postvalue('ctrlField');

$params['needSettings'] = postvalue('isNeedSettings');

if( $pageMode == SEARCH_DASHBOARD )
{
$params["dashTName"] = postvalue("table");
$params["dashElementName"] = postvalue("dashelement");
}

// e.g. crosstable params
$params["extraPageParams"] = SearchPage::getExtraPageParams();

$params["masterTable"] = postvalue("mastertable");
if( $params["masterTable"] )
$params["masterKeysReq"] = RunnerPage::readMasterKeysFromRequest();


$pageObject = new SearchPage($params);

if( $pageMode == SEARCH_LOAD_CONTROL )
{
$pageObject->displaySearchControl();
return;
}

$pageObject->init();
$pageObject->process();
?>
5 changes: 3 additions & 2 deletions app/include/appsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,9 @@
$strLastSQL = "";
$showCustomMarkerOnPrint = false;

$projectBuildKey = "328_1722087950";
$projectBuildKey = "330_1722087950";
$wizardBuildKey = "39558";
$projectBuildNumber = "328";
$projectBuildNumber = "330";

$mlang_messages = array();
$mlang_charsets = array();
Expand Down Expand Up @@ -793,6 +793,7 @@
$tableCaptions["English"]["DHIS2_Reporting_Rate"] = "DHIS2 Reporting Rate";
$tableCaptions["English"]["DHIS2_Reporting_Rate_Chart"] = "DHIS2 Reporting Rate Chart";
$tableCaptions["English"]["DHIS2_Reporting_Rate_Report"] = "DHIS2 Reporting Rate Report";
$tableCaptions["English"]["DHIS2_Reporting_Rates_Chart"] = "DHIS2 Reporting Rates Chart";


$globalEvents = new class_GlobalEvents;
Expand Down
8 changes: 8 additions & 0 deletions app/include/audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,10 @@ function logValueEnable($table)
{
return false;
}
if($table=="DHIS2_Reporting_Rates_Chart")
{
return false;
}
}

protected function insert($datetime, $ip, $user, $table, $action, $description)
Expand Down Expand Up @@ -1016,6 +1020,10 @@ function logValueEnable($table)
{
return false;
}
if($table=="DHIS2_Reporting_Rates_Chart")
{
return false;
}
}

protected function getMaxLengthSubstr( $value )
Expand Down
20 changes: 20 additions & 0 deletions app/include/commonfunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ function checkTableName($shortTName )
return true;
if ("dhis2_reporting_rate_report1" == $shortTName )
return true;
if ("dhis2_reporting_rates_chart" == $shortTName )
return true;
return false;
}

Expand Down Expand Up @@ -737,6 +739,15 @@ function GetTablesList($pdfMode = false)
if( $tableAvailable ) {
$arr[]="DHIS2_Reporting_Rate_Report";
}
$tableAvailable = true;
if( $checkPermissions ) {
$strPerm = GetUserPermissions("DHIS2_Reporting_Rates_Chart");
$tableAvailable = ( strpos($strPerm, "P") !== false
|| $pdfMode && strpos($strPerm, "S") !== false );
}
if( $tableAvailable ) {
$arr[]="DHIS2_Reporting_Rates_Chart";
}
return $arr;
}

Expand Down Expand Up @@ -790,6 +801,7 @@ function GetTablesListWithoutSecurity()
$arr[]="DHIS2_Reporting_Rate";
$arr[]="DHIS2_Reporting_Rate_Chart";
$arr[]="DHIS2_Reporting_Rate_Report";
$arr[]="DHIS2_Reporting_Rates_Chart";
return $arr;
}

Expand Down Expand Up @@ -847,6 +859,8 @@ function GetChartType($shorttable)
return "Combined";
if($shorttable=="dhis2_reporting_rate_chart1")
return "Combined";
if($shorttable=="dhis2_reporting_rates_chart")
return "Gauge";
return "";
}

Expand Down Expand Up @@ -1685,6 +1699,12 @@ function GetUserPermissionsStatic( $table )
}
if( $table=="DHIS2_Reporting_Rate_Report" )
{
// default permissions
// grant all by default
return "ADESPI".$extraPerm;
}
if( $table=="DHIS2_Reporting_Rates_Chart" )
{
// default permissions
// grant all by default
return "ADESPI".$extraPerm;
Expand Down
Loading

0 comments on commit 83afc6a

Please sign in to comment.