From c0a088dd008a0b77a15f32c86a09258c895d45e2 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 4 Apr 2019 13:51:37 +0200 Subject: [PATCH] Updated with JCB v2.9.14 --- README.md | 10 +- admin/README.txt | 10 +- admin/access.xml | 2 +- admin/assets/css/admin.css | 4 +- admin/assets/css/causerisk.css | 6 +- admin/assets/css/causesrisks.css | 6 +- admin/assets/css/combinedresults.css | 6 +- admin/assets/css/companies.css | 6 +- admin/assets/css/company.css | 6 +- admin/assets/css/companyresults.css | 6 +- admin/assets/css/countries.css | 6 +- admin/assets/css/country.css | 6 +- admin/assets/css/currencies.css | 6 +- admin/assets/css/currency.css | 6 +- admin/assets/css/dashboard.css | 4 +- admin/assets/css/health_data.css | 6 +- admin/assets/css/health_data_sets.css | 6 +- admin/assets/css/help_document.css | 6 +- admin/assets/css/help_documents.css | 6 +- admin/assets/css/intervention.css | 6 +- admin/assets/css/interventions.css | 6 +- admin/assets/css/scaling_factor.css | 6 +- admin/assets/css/scaling_factors.css | 6 +- admin/assets/css/service_provider.css | 6 +- admin/assets/css/service_providers.css | 6 +- admin/assets/js/admin.js | 4 +- admin/config.xml | 136 +- admin/controller.php | 7 +- admin/controllers/ajax.json.php | 7 +- admin/controllers/causerisk.php | 159 +- admin/controllers/causesrisks.php | 37 +- admin/controllers/combinedresults.php | 9 +- admin/controllers/companies.php | 39 +- admin/controllers/company.php | 159 +- admin/controllers/companyresults.php | 9 +- admin/controllers/costbenefitprojection.php | 7 +- admin/controllers/countries.php | 37 +- admin/controllers/country.php | 159 +- admin/controllers/currencies.php | 37 +- admin/controllers/currency.php | 159 +- admin/controllers/health_data.php | 159 +- admin/controllers/health_data_sets.php | 37 +- admin/controllers/help.php | 7 +- admin/controllers/help_document.php | 159 +- admin/controllers/help_documents.php | 37 +- admin/controllers/import.php | 4 +- admin/controllers/import_health_data_sets.php | 4 +- admin/controllers/intervention.php | 159 +- admin/controllers/interventions.php | 37 +- admin/controllers/scaling_factor.php | 159 +- admin/controllers/scaling_factors.php | 37 +- admin/controllers/service_provider.php | 159 +- admin/controllers/service_providers.php | 37 +- admin/costbenefitprojection.php | 19 +- admin/helpers/costbenefitprojection.php | 650 +- admin/helpers/headercheck.php | 4 +- admin/helpers/html/batch_.php | 4 +- admin/helpers/sum.php | 4 +- admin/helpers/sumcombine.php | 6 +- .../en-GB/en-GB.com_costbenefitprojection.ini | 90 +- .../en-GB.com_costbenefitprojection.sys.ini | 82 +- admin/layouts/batchselection.php | 8 +- admin/layouts/causerisk/details_above.php | 18 +- admin/layouts/causerisk/details_fullwidth.php | 23 +- admin/layouts/causerisk/details_left.php | 29 +- admin/layouts/causerisk/details_right.php | 29 +- admin/layouts/causerisk/publishing.php | 30 +- admin/layouts/causerisk/publlshing.php | 30 +- .../age_groups_percentages_fullwidth.php | 23 +- .../company/age_groups_percentages_left.php | 29 +- .../company/age_groups_percentages_right.php | 29 +- .../company/causerisk_selection_fullwidth.php | 23 +- admin/layouts/company/details_above.php | 18 +- admin/layouts/company/details_left.php | 29 +- admin/layouts/company/details_right.php | 29 +- admin/layouts/company/details_under.php | 18 +- .../company/interventions_fullwidth.php | 47 +- admin/layouts/company/publishing.php | 30 +- admin/layouts/company/publlshing.php | 30 +- .../company/scaling_factors_fullwidth.php | 44 +- .../country/age_groups_percentages_left.php | 29 +- .../country/age_groups_percentages_right.php | 29 +- .../country/causerisk_selection_fullwidth.php | 23 +- admin/layouts/country/companies_fullwidth.php | 62 +- admin/layouts/country/details_above.php | 18 +- admin/layouts/country/details_left.php | 29 +- admin/layouts/country/details_right.php | 29 +- .../country/health_data_totals_left.php | 29 +- .../country/health_data_totals_right.php | 29 +- .../country/interventions_fullwidth.php | 53 +- .../country/public_details_fullwidth.php | 23 +- admin/layouts/country/publishing.php | 30 +- admin/layouts/country/publlshing.php | 30 +- .../country/service_providers_fullwidth.php | 47 +- admin/layouts/currency/details_above.php | 18 +- admin/layouts/currency/details_left.php | 29 +- admin/layouts/currency/details_right.php | 29 +- admin/layouts/currency/publishing.php | 30 +- admin/layouts/currency/publlshing.php | 30 +- admin/layouts/databreakdownmalefemale.php | 5 +- admin/layouts/health_data/details_above.php | 18 +- admin/layouts/health_data/details_left.php | 29 +- admin/layouts/health_data/details_right.php | 29 +- .../layouts/health_data/details_rightside.php | 29 +- admin/layouts/health_data/publishing.php | 30 +- admin/layouts/health_data/publlshing.php | 30 +- admin/layouts/help_document/details_above.php | 18 +- .../help_document/details_fullwidth.php | 23 +- admin/layouts/help_document/details_left.php | 29 +- admin/layouts/help_document/details_right.php | 29 +- admin/layouts/help_document/details_under.php | 18 +- admin/layouts/help_document/publishing.php | 30 +- admin/layouts/help_document/publlshing.php | 30 +- admin/layouts/intervention/details_above.php | 18 +- .../intervention/details_fullwidth.php | 23 +- admin/layouts/intervention/details_under.php | 18 +- admin/layouts/intervention/publishing.php | 30 +- admin/layouts/intervention/publlshing.php | 30 +- .../intervention/settings_fullwidth.php | 23 +- admin/layouts/intervention/settings_left.php | 29 +- .../layouts/scaling_factor/details_above.php | 18 +- admin/layouts/scaling_factor/details_left.php | 29 +- .../layouts/scaling_factor/details_right.php | 29 +- admin/layouts/scaling_factor/publishing.php | 30 +- admin/layouts/scaling_factor/publlshing.php | 30 +- .../service_provider/companies_fullwidth.php | 62 +- .../service_provider/details_above.php | 18 +- .../layouts/service_provider/details_left.php | 29 +- .../service_provider/details_right.php | 29 +- admin/layouts/service_provider/publishing.php | 30 +- admin/layouts/service_provider/publlshing.php | 30 +- admin/models/ajax.php | 6 +- admin/models/causerisk.php | 66 +- admin/models/causesrisks.php | 43 +- admin/models/combinedresults.php | 257 +- admin/models/companies.php | 87 +- admin/models/company.php | 238 +- admin/models/companyresults.php | 242 +- admin/models/costbenefitprojection.php | 8 +- admin/models/countries.php | 43 +- admin/models/country.php | 118 +- admin/models/currencies.php | 43 +- admin/models/currency.php | 66 +- admin/models/fields/adminviewfolderlist.php | 8 +- admin/models/fields/articles.php | 8 +- admin/models/fields/causesrisks.php | 8 +- admin/models/fields/causesriskscheck.php | 8 +- admin/models/fields/company.php | 16 +- admin/models/fields/companycheck.php | 8 +- admin/models/fields/countries.php | 8 +- admin/models/fields/countryuser.php | 4 +- admin/models/fields/currency.php | 8 +- admin/models/fields/datayear.php | 8 +- admin/models/fields/interventions.php | 8 +- admin/models/fields/memberuser.php | 4 +- admin/models/fields/serviceprovider.php | 16 +- admin/models/fields/serviceprovideruser.php | 4 +- admin/models/fields/siteviewfolderlist.php | 8 +- admin/models/forms/causerisk.js | 6 +- admin/models/forms/causerisk.xml | 2 + admin/models/forms/company.js | 27 +- admin/models/forms/company.xml | 419 +- admin/models/forms/country.js | 6 +- admin/models/forms/country.xml | 58 +- admin/models/forms/currency.js | 6 +- admin/models/forms/currency.xml | 6 + admin/models/forms/health_data.js | 6 +- admin/models/forms/health_data.xml | 23 +- admin/models/forms/help_document.js | 24 +- admin/models/forms/help_document.xml | 8 +- admin/models/forms/intervention.js | 12 +- admin/models/forms/intervention.xml | 7 + admin/models/forms/scaling_factor.js | 9 +- admin/models/forms/scaling_factor.xml | 1 + admin/models/forms/service_provider.js | 6 +- admin/models/forms/service_provider.xml | 6 +- admin/models/health_data.php | 71 +- admin/models/health_data_sets.php | 53 +- admin/models/help_document.php | 90 +- admin/models/help_documents.php | 53 +- admin/models/import.php | 4 +- admin/models/import_health_data_sets.php | 4 +- admin/models/intervention.php | 88 +- admin/models/interventions.php | 53 +- admin/models/scaling_factor.php | 88 +- admin/models/scaling_factors.php | 43 +- admin/models/service_provider.php | 84 +- admin/models/service_providers.php | 43 +- admin/sql/install.mysql.utf8.sql | 8121 +---------------- admin/sql/updates/mysql/3.4.3.sql | 3 + admin/tables/causerisk.php | 23 +- admin/tables/company.php | 21 +- admin/tables/country.php | 23 +- admin/tables/currency.php | 23 +- admin/tables/health_data.php | 21 +- admin/tables/help_document.php | 23 +- admin/tables/intervention.php | 21 +- admin/tables/scaling_factor.php | 21 +- admin/tables/service_provider.php | 21 +- admin/views/causerisk/submitbutton.js | 20 +- admin/views/causerisk/tmpl/edit.php | 14 +- admin/views/causerisk/view.html.php | 35 +- admin/views/causesrisks/tmpl/default.php | 6 +- .../causesrisks/tmpl/default_batch_body.php | 6 +- .../causesrisks/tmpl/default_batch_footer.php | 6 +- admin/views/causesrisks/tmpl/default_body.php | 18 +- admin/views/causesrisks/tmpl/default_foot.php | 8 +- admin/views/causesrisks/tmpl/default_head.php | 8 +- .../causesrisks/tmpl/default_toolbar.php | 6 +- admin/views/causesrisks/view.html.php | 17 +- admin/views/combinedresults/tmpl/default.php | 8 +- .../tmpl/default_chart_cost.php | 8 +- .../tmpl/default_chart_cost_percent.php | 8 +- ...efault_chart_intervention_cost_benefit.php | 8 +- .../tmpl/default_chart_work_days_lost.php | 8 +- .../default_chart_work_days_lost_percent.php | 8 +- .../combinedresults/tmpl/default_main.php | 8 +- ...efault_table_calculated_cost_in_detail.php | 8 +- .../tmpl/default_table_cost_summary.php | 8 +- ...default_table_intervention_net_benefit.php | 8 +- .../default_table_work_days_lost_summary.php | 8 +- admin/views/combinedresults/view.html.php | 19 +- admin/views/companies/tmpl/default.php | 6 +- .../companies/tmpl/default_batch_body.php | 6 +- .../companies/tmpl/default_batch_footer.php | 6 +- admin/views/companies/tmpl/default_body.php | 59 +- admin/views/companies/tmpl/default_foot.php | 8 +- admin/views/companies/tmpl/default_head.php | 8 +- .../views/companies/tmpl/default_toolbar.php | 6 +- admin/views/companies/view.html.php | 21 +- admin/views/company/submitbutton.js | 20 +- admin/views/company/tmpl/edit.php | 14 +- admin/views/company/view.html.php | 35 +- admin/views/companyresults/tmpl/default.php | 8 +- .../tmpl/default_chart_cost.php | 8 +- .../tmpl/default_chart_cost_percent.php | 8 +- ...efault_chart_intervention_cost_benefit.php | 8 +- .../tmpl/default_chart_work_days_lost.php | 8 +- .../default_chart_work_days_lost_percent.php | 8 +- .../companyresults/tmpl/default_main.php | 8 +- ...efault_table_calculated_cost_in_detail.php | 8 +- .../tmpl/default_table_cost_summary.php | 8 +- ...default_table_intervention_net_benefit.php | 8 +- .../default_table_work_days_lost_summary.php | 8 +- .../companyresults/tmpl/default_variables.php | 8 +- admin/views/companyresults/view.html.php | 21 +- .../costbenefitprojection/tmpl/default.php | 4 +- ...sed_issues_the_closed_issues_on_github.php | 6 +- .../tmpl/default_main.php | 4 +- ..._open_issues_the_open_issues_on_github.php | 6 +- .../tmpl/default_readme_information.php | 6 +- .../tmpl/default_usage_statistics_table.php | 6 +- ...t_vast_development_method_notice_board.php | 6 +- .../tmpl/default_vdm.php | 4 +- .../views/costbenefitprojection/view.html.php | 7 +- admin/views/countries/tmpl/default.php | 6 +- .../countries/tmpl/default_batch_body.php | 6 +- .../countries/tmpl/default_batch_footer.php | 6 +- admin/views/countries/tmpl/default_body.php | 31 +- admin/views/countries/tmpl/default_foot.php | 8 +- admin/views/countries/tmpl/default_head.php | 8 +- .../views/countries/tmpl/default_toolbar.php | 6 +- admin/views/countries/view.html.php | 19 +- admin/views/country/submitbutton.js | 20 +- admin/views/country/tmpl/edit.php | 14 +- admin/views/country/view.html.php | 35 +- admin/views/currencies/tmpl/default.php | 6 +- .../currencies/tmpl/default_batch_body.php | 6 +- .../currencies/tmpl/default_batch_footer.php | 6 +- admin/views/currencies/tmpl/default_body.php | 18 +- admin/views/currencies/tmpl/default_foot.php | 8 +- admin/views/currencies/tmpl/default_head.php | 8 +- .../views/currencies/tmpl/default_toolbar.php | 6 +- admin/views/currencies/view.html.php | 17 +- admin/views/currency/submitbutton.js | 20 +- admin/views/currency/tmpl/edit.php | 14 +- admin/views/currency/view.html.php | 35 +- admin/views/health_data/submitbutton.js | 20 +- admin/views/health_data/tmpl/edit.php | 14 +- admin/views/health_data/view.html.php | 35 +- admin/views/health_data_sets/tmpl/default.php | 6 +- .../tmpl/default_batch_body.php | 6 +- .../tmpl/default_batch_footer.php | 6 +- .../health_data_sets/tmpl/default_body.php | 32 +- .../health_data_sets/tmpl/default_foot.php | 8 +- .../health_data_sets/tmpl/default_head.php | 8 +- .../health_data_sets/tmpl/default_toolbar.php | 6 +- admin/views/health_data_sets/view.html.php | 21 +- admin/views/help_document/submitbutton.js | 20 +- admin/views/help_document/tmpl/edit.php | 14 +- admin/views/help_document/view.html.php | 35 +- admin/views/help_documents/tmpl/default.php | 6 +- .../tmpl/default_batch_body.php | 6 +- .../tmpl/default_batch_footer.php | 6 +- .../help_documents/tmpl/default_body.php | 18 +- .../help_documents/tmpl/default_foot.php | 8 +- .../help_documents/tmpl/default_head.php | 8 +- .../help_documents/tmpl/default_toolbar.php | 6 +- admin/views/help_documents/view.html.php | 21 +- admin/views/import/tmpl/default.php | 4 +- admin/views/import/view.html.php | 7 +- .../import_health_data_sets/tmpl/default.php | 4 +- .../import_health_data_sets/view.html.php | 7 +- admin/views/intervention/submitbutton.js | 20 +- admin/views/intervention/tmpl/edit.php | 14 +- admin/views/intervention/view.html.php | 35 +- admin/views/interventions/tmpl/default.php | 6 +- .../interventions/tmpl/default_batch_body.php | 6 +- .../tmpl/default_batch_footer.php | 6 +- .../views/interventions/tmpl/default_body.php | 32 +- .../views/interventions/tmpl/default_foot.php | 8 +- .../views/interventions/tmpl/default_head.php | 8 +- .../interventions/tmpl/default_toolbar.php | 6 +- admin/views/interventions/view.html.php | 19 +- admin/views/scaling_factor/submitbutton.js | 20 +- admin/views/scaling_factor/tmpl/edit.php | 14 +- admin/views/scaling_factor/view.html.php | 35 +- admin/views/scaling_factors/tmpl/default.php | 6 +- .../tmpl/default_batch_body.php | 6 +- .../tmpl/default_batch_footer.php | 6 +- .../scaling_factors/tmpl/default_body.php | 32 +- .../scaling_factors/tmpl/default_foot.php | 8 +- .../scaling_factors/tmpl/default_head.php | 8 +- .../scaling_factors/tmpl/default_toolbar.php | 6 +- admin/views/scaling_factors/view.html.php | 21 +- admin/views/service_provider/submitbutton.js | 20 +- admin/views/service_provider/tmpl/edit.php | 14 +- admin/views/service_provider/view.html.php | 35 +- .../views/service_providers/tmpl/default.php | 6 +- .../tmpl/default_batch_body.php | 6 +- .../tmpl/default_batch_footer.php | 6 +- .../service_providers/tmpl/default_body.php | 34 +- .../service_providers/tmpl/default_foot.php | 8 +- .../service_providers/tmpl/default_head.php | 8 +- .../tmpl/default_toolbar.php | 6 +- admin/views/service_providers/view.html.php | 19 +- admin/whmcs.php | 9 +- costbenefitprojection.xml | 16 +- costbenefitprojection_update_server.xml | 17 + media/js/table2excel.js | 4 +- script.php | 74 +- site/assets/css/combinedresults.css | 6 +- site/assets/css/company.css | 6 +- site/assets/css/companyresults.css | 6 +- site/assets/css/cpanel.css | 6 +- site/assets/css/createaccount.css | 6 +- site/assets/css/intervention.css | 6 +- site/assets/css/publicresults.css | 6 +- site/assets/css/scaling_factor.css | 6 +- site/assets/css/site.css | 4 +- site/assets/js/site.js | 4 +- site/controller.php | 7 +- site/controllers/ajax.json.php | 7 +- site/controllers/company.php | 161 +- site/controllers/help.php | 7 +- site/controllers/intervention.php | 161 +- site/controllers/scaling_factor.php | 161 +- site/costbenefitprojection.php | 15 +- site/helpers/category.php | 4 +- site/helpers/costbenefitprojection.php | 602 +- site/helpers/headercheck.php | 4 +- site/helpers/route.php | 81 +- site/layouts/appnotice.php | 5 +- .../age_groups_percentages_fullwidth.php | 23 +- .../company/age_groups_percentages_left.php | 29 +- .../company/age_groups_percentages_right.php | 29 +- .../company/causerisk_selection_fullwidth.php | 23 +- site/layouts/company/details_above.php | 18 +- site/layouts/company/details_left.php | 29 +- site/layouts/company/details_right.php | 29 +- site/layouts/company/details_under.php | 18 +- .../company/interventions_fullwidth.php | 47 +- site/layouts/company/publishing.php | 30 +- site/layouts/company/publlshing.php | 30 +- .../company/scaling_factors_fullwidth.php | 44 +- site/layouts/companydetails.php | 5 +- site/layouts/databreakdownmalefemale.php | 5 +- site/layouts/intervention/details_above.php | 18 +- .../intervention/details_fullwidth.php | 23 +- site/layouts/intervention/details_under.php | 18 +- site/layouts/intervention/publishing.php | 30 +- site/layouts/intervention/publlshing.php | 30 +- .../intervention/settings_fullwidth.php | 23 +- site/layouts/intervention/settings_left.php | 29 +- site/layouts/scaling_factor/details_above.php | 18 +- site/layouts/scaling_factor/details_left.php | 29 +- site/layouts/scaling_factor/details_right.php | 29 +- site/layouts/scaling_factor/publishing.php | 30 +- site/layouts/scaling_factor/publlshing.php | 30 +- site/models/ajax.php | 4 +- site/models/combinedresults.php | 255 +- site/models/company.php | 238 +- site/models/companyresults.php | 246 +- site/models/cpanel.php | 163 +- site/models/createaccount.php | 59 +- site/models/forms/company.js | 27 +- site/models/forms/company.xml | 419 +- site/models/forms/intervention.js | 12 +- site/models/forms/intervention.xml | 7 + site/models/forms/scaling_factor.js | 9 +- site/models/forms/scaling_factor.xml | 1 + site/models/intervention.php | 88 +- site/models/publicresults.php | 153 +- site/models/scaling_factor.php | 88 +- site/router.php | 4 +- site/views/combinedresults/tmpl/default.php | 12 +- .../tmpl/default_chart_cost.php | 8 +- .../tmpl/default_chart_cost_percent.php | 8 +- ...efault_chart_intervention_cost_benefit.php | 8 +- ...t_chart_intervention_cost_benefit_save.php | 8 +- .../tmpl/default_chart_work_days_lost.php | 8 +- .../default_chart_work_days_lost_percent.php | 8 +- ...efault_table_calculated_cost_in_detail.php | 8 +- .../tmpl/default_table_cost_summary.php | 8 +- ...default_table_intervention_net_benefit.php | 8 +- .../default_table_work_days_lost_summary.php | 8 +- site/views/combinedresults/view.html.php | 19 +- site/views/company/submitbutton.js | 20 +- site/views/company/tmpl/edit.php | 14 +- site/views/company/view.html.php | 66 +- site/views/companyresults/tmpl/default.php | 12 +- .../tmpl/default_chart_cost.php | 8 +- .../tmpl/default_chart_cost_percent.php | 8 +- ...efault_chart_intervention_cost_benefit.php | 8 +- ...t_chart_intervention_cost_benefit_save.php | 8 +- .../tmpl/default_chart_work_days_lost.php | 8 +- .../default_chart_work_days_lost_percent.php | 8 +- ...efault_table_calculated_cost_in_detail.php | 8 +- .../tmpl/default_table_cost_summary.php | 8 +- ...default_table_intervention_net_benefit.php | 8 +- .../default_table_work_days_lost_summary.php | 8 +- site/views/companyresults/view.html.php | 19 +- site/views/cpanel/tmpl/default.php | 12 +- site/views/cpanel/view.html.php | 23 +- site/views/createaccount/tmpl/default.php | 12 +- .../tmpl/default_cbpmenumodule.php | 8 +- site/views/createaccount/view.html.php | 17 +- site/views/intervention/submitbutton.js | 20 +- site/views/intervention/tmpl/edit.php | 14 +- site/views/intervention/view.html.php | 66 +- site/views/publicresults/tmpl/default.php | 12 +- .../tmpl/default_cbpmenumodule.php | 8 +- .../tmpl/default_chart_cost_public.php | 8 +- ...chart_intervention_cost_benefit_public.php | 8 +- .../tmpl/default_contact_form_public.php | 8 +- site/views/publicresults/view.html.php | 19 +- site/views/scaling_factor/submitbutton.js | 20 +- site/views/scaling_factor/tmpl/edit.php | 14 +- site/views/scaling_factor/view.html.php | 66 +- 449 files changed, 6800 insertions(+), 15313 deletions(-) create mode 100644 admin/sql/updates/mysql/3.4.3.sql diff --git a/README.md b/README.md index e4f44682..0600563a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Cost Benefit Projection (3.4.3) +# Cost Benefit Projection (3.4.x) This is a [Joomla 3.x](http://www.joomla.org/) component. @@ -22,12 +22,12 @@ max_input_vars = 5000 + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Cost Benefit Projection](https://www.staffhealthcbp.com/) + *First Build*: 15th June, 2012 -+ *Last Build*: 17th May, 2018 -+ *Version*: 3.4.3 ++ *Last Build*: 4th April, 2019 ++ *Version*: 3.4.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **91317** -+ *File count*: **584** ++ *Line count*: **82804** ++ *File count*: **585** + *Folder count*: **103** > This **component** was build with a Joomla [Automated Component Builder](https://www.vdm.io/joomla-component-builder). diff --git a/admin/README.txt b/admin/README.txt index e4f44682..0600563a 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,4 @@ -# Cost Benefit Projection (3.4.3) +# Cost Benefit Projection (3.4.x) This is a [Joomla 3.x](http://www.joomla.org/) component. @@ -22,12 +22,12 @@ max_input_vars = 5000 + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Cost Benefit Projection](https://www.staffhealthcbp.com/) + *First Build*: 15th June, 2012 -+ *Last Build*: 17th May, 2018 -+ *Version*: 3.4.3 ++ *Last Build*: 4th April, 2019 ++ *Version*: 3.4.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **91317** -+ *File count*: **584** ++ *Line count*: **82804** ++ *File count*: **585** + *Folder count*: **103** > This **component** was build with a Joomla [Automated Component Builder](https://www.vdm.io/joomla-component-builder). diff --git a/admin/access.xml b/admin/access.xml index 55c4427e..787b9954 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -173,9 +173,9 @@ + - diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index f904a2a5..9e0b7800 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -2,8 +2,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage admin.css diff --git a/admin/assets/css/causerisk.css b/admin/assets/css/causerisk.css index 95ee727f..8443c5e8 100644 --- a/admin/assets/css/causerisk.css +++ b/admin/assets/css/causerisk.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 24 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/causesrisks.css b/admin/assets/css/causesrisks.css index 12b9ed8a..4b47250d 100644 --- a/admin/assets/css/causesrisks.css +++ b/admin/assets/css/causesrisks.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 24 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesrisks.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/combinedresults.css b/admin/assets/css/combinedresults.css index bb546951..74c7821d 100644 --- a/admin/assets/css/combinedresults.css +++ b/admin/assets/css/combinedresults.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 22 of this MVC - @build 14th October, 2017 - @created 3rd October, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage combinedresults.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/companies.css b/admin/assets/css/companies.css index 57e751ea..14ef8154 100644 --- a/admin/assets/css/companies.css +++ b/admin/assets/css/companies.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 101 of this MVC - @build 29th June, 2016 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/company.css b/admin/assets/css/company.css index 7242db84..7b03c2c9 100644 --- a/admin/assets/css/company.css +++ b/admin/assets/css/company.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 101 of this MVC - @build 29th June, 2016 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/companyresults.css b/admin/assets/css/companyresults.css index 2a330afd..3e3d2e4d 100644 --- a/admin/assets/css/companyresults.css +++ b/admin/assets/css/companyresults.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 60 of this MVC - @build 14th October, 2017 - @created 13th August, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage companyresults.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/countries.css b/admin/assets/css/countries.css index 28ff21f4..b8bfbadf 100644 --- a/admin/assets/css/countries.css +++ b/admin/assets/css/countries.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 54 of this MVC - @build 17th May, 2018 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage countries.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/country.css b/admin/assets/css/country.css index dd8a9683..e25c8576 100644 --- a/admin/assets/css/country.css +++ b/admin/assets/css/country.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 54 of this MVC - @build 17th May, 2018 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage country.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/currencies.css b/admin/assets/css/currencies.css index 12cca374..200e86bd 100644 --- a/admin/assets/css/currencies.css +++ b/admin/assets/css/currencies.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage currencies.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/currency.css b/admin/assets/css/currency.css index 2d4e4044..bc673453 100644 --- a/admin/assets/css/currency.css +++ b/admin/assets/css/currency.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 3d4cdac2..81a2533f 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -2,8 +2,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage dashboard.css diff --git a/admin/assets/css/health_data.css b/admin/assets/css/health_data.css index 83ac8669..504c7627 100644 --- a/admin/assets/css/health_data.css +++ b/admin/assets/css/health_data.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 110 of this MVC - @build 17th May, 2018 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/health_data_sets.css b/admin/assets/css/health_data_sets.css index 0bb3f12d..1c1336ad 100644 --- a/admin/assets/css/health_data_sets.css +++ b/admin/assets/css/health_data_sets.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 110 of this MVC - @build 17th May, 2018 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data_sets.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/help_document.css b/admin/assets/css/help_document.css index 72b1e085..69b766f8 100644 --- a/admin/assets/css/help_document.css +++ b/admin/assets/css/help_document.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 13th April, 2018 - @created 13th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_document.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/help_documents.css b/admin/assets/css/help_documents.css index 0e3ee30c..a87a7a5e 100644 --- a/admin/assets/css/help_documents.css +++ b/admin/assets/css/help_documents.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 13th April, 2018 - @created 13th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_documents.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/intervention.css b/admin/assets/css/intervention.css index 3e0249a6..2d4936c4 100644 --- a/admin/assets/css/intervention.css +++ b/admin/assets/css/intervention.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 71 of this MVC - @build 12th November, 2016 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage intervention.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/interventions.css b/admin/assets/css/interventions.css index 0ca279be..e98e9b5c 100644 --- a/admin/assets/css/interventions.css +++ b/admin/assets/css/interventions.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 71 of this MVC - @build 12th November, 2016 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/scaling_factor.css b/admin/assets/css/scaling_factor.css index 916b18b8..9aa56ffa 100644 --- a/admin/assets/css/scaling_factor.css +++ b/admin/assets/css/scaling_factor.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 21 of this MVC - @build 16th August, 2016 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factor.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/scaling_factors.css b/admin/assets/css/scaling_factors.css index 20d1844c..c4684310 100644 --- a/admin/assets/css/scaling_factors.css +++ b/admin/assets/css/scaling_factors.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 21 of this MVC - @build 16th August, 2016 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factors.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/service_provider.css b/admin/assets/css/service_provider.css index 9367deb1..332cda7c 100644 --- a/admin/assets/css/service_provider.css +++ b/admin/assets/css/service_provider.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 22nd March, 2016 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_provider.css @author Llewellyn van der Merwe diff --git a/admin/assets/css/service_providers.css b/admin/assets/css/service_providers.css index 3d38cbe5..f9c24a2e 100644 --- a/admin/assets/css/service_providers.css +++ b/admin/assets/css/service_providers.css @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 22nd March, 2016 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_providers.css @author Llewellyn van der Merwe diff --git a/admin/assets/js/admin.js b/admin/assets/js/admin.js index 66d32d01..74e4dd40 100644 --- a/admin/assets/js/admin.js +++ b/admin/assets/js/admin.js @@ -2,8 +2,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage admin.js diff --git a/admin/config.xml b/admin/config.xml index 6ccdc394..38b90b7e 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -100,7 +100,7 @@ label="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_LABEL" description="COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_LINK_DESC" size="60" - default="https://www.swisstph.ch/en/staff/profile/people/patrick-hanlon/" + default="http://www.swisstph.ch/about-us/staff/detailview.html?tx_x4epersdb_pi1[showUid]=2267&cHash=1b1c5db0808e04d3f1afe0f3a3f67998" /> @@ -272,7 +272,7 @@ @@ -333,59 +333,6 @@ - - - - - - - - - - - - - - - - -
+ /> + /> - + + /> + /> + /> - + + /> + /> - + + /> - + + /> + /> + /> - + + /> + /> + /> - + + /> + /> - + + /> - + + /> - @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controllerform'); - /** * Causerisk Controller */ @@ -37,6 +34,13 @@ class CostbenefitprojectionControllerCauserisk extends JControllerForm */ protected $task; + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ public function __construct($config = array()) { $this->view_list = 'Causesrisks'; // safeguard for setting the return view listing to the main view. @@ -54,14 +58,17 @@ class CostbenefitprojectionControllerCauserisk extends JControllerForm */ protected function allowAdd($data = array()) { + // Get user object. + $user = JFactory::getUser(); // Access check. - $access = JFactory::getUser()->authorise('causerisk.access', 'com_costbenefitprojection'); + $access = $user->authorise('causerisk.access', 'com_costbenefitprojection'); if (!$access) { return false; } + // In the absense of better information, revert to the component permissions. - return JFactory::getUser()->authorise('causerisk.create', $this->option); + return $user->authorise('causerisk.create', $this->option); } /** @@ -77,9 +84,9 @@ class CostbenefitprojectionControllerCauserisk extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. @@ -135,42 +142,25 @@ class CostbenefitprojectionControllerCauserisk extends JControllerForm * * @return string The arguments to append to the redirect URL. * - * @since 12.2 + * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { - $tmpl = $this->input->get('tmpl'); - $layout = $this->input->get('layout', 'edit', 'string'); + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); - $ref = $this->input->get('ref', 0, 'string'); - $refid = $this->input->get('refid', 0, 'int'); + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); - // Setup redirect info. - - $append = ''; - - if ($refid) + // set the referral options + if ($refid && $ref) { - $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; } elseif ($ref) { - $append .= '&ref='.(string)$ref; - } - - if ($tmpl) - { - $append .= '&tmpl=' . $tmpl; - } - - if ($layout) - { - $append .= '&layout=' . $layout; - } - - if ($recordId) - { - $append .= '&' . $urlVar . '=' . $recordId; + $append = '&ref='. (string)$ref . $append; } return $append; @@ -209,43 +199,45 @@ class CostbenefitprojectionControllerCauserisk extends JControllerForm */ public function cancel($key = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); $cancel = parent::cancel($key); - if ($cancel) + if (!is_null($return) && JUri::isInternal(base64_decode($return))) { - if ($this->refid) - { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); - // Redirect to the item screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - elseif ($this->ref) - { - $redirect = '&view='.(string)$this->ref; - - // Redirect to the list screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - } - else - { - // Redirect to the items screen. + // Redirect to the return value. $this->setRedirect( JRoute::_( - 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false ) ); } @@ -264,11 +256,15 @@ class CostbenefitprojectionControllerCauserisk extends JControllerForm */ public function save($key = null, $urlVar = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) { // to make sure the item is checkedin on redirect $this->task = 'save'; @@ -276,9 +272,22 @@ class CostbenefitprojectionControllerCauserisk extends JControllerForm $saved = parent::save($key, $urlVar); - if ($this->refid && $saved) + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; // Redirect to the item screen. $this->setRedirect( @@ -287,9 +296,9 @@ class CostbenefitprojectionControllerCauserisk extends JControllerForm ) ); } - elseif ($this->ref && $saved) + elseif ($this->ref) { - $redirect = '&view='.(string)$this->ref; + $redirect = '&view=' . (string)$this->ref; // Redirect to the list screen. $this->setRedirect( diff --git a/admin/controllers/causesrisks.php b/admin/controllers/causesrisks.php index fbd063c9..927d5ae9 100644 --- a/admin/controllers/causesrisks.php +++ b/admin/controllers/causesrisks.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 24 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesrisks.php @author Llewellyn van der Merwe @@ -20,24 +20,33 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Causesrisks Controller */ class CostbenefitprojectionControllerCausesrisks extends JControllerAdmin { - protected $text_prefix = 'COM_COSTBENEFITPROJECTION_CAUSESRISKS'; /** - * Proxy for getModel. - * @since 2.5 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ - public function getModel($name = 'Causerisk', $prefix = 'CostbenefitprojectionModel', $config = array()) + protected $text_prefix = 'COM_COSTBENEFITPROJECTION_CAUSESRISKS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Causerisk', $prefix = 'CostbenefitprojectionModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, $config); } public function exportData() @@ -101,5 +110,5 @@ class CostbenefitprojectionControllerCausesrisks extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=causesrisks', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/combinedresults.php b/admin/controllers/combinedresults.php index 9661f5eb..9f81ec6e 100644 --- a/admin/controllers/combinedresults.php +++ b/admin/controllers/combinedresults.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 22 of this MVC - @build 14th October, 2017 - @created 3rd October, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage combinedresults.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Combinedresults Controller */ diff --git a/admin/controllers/companies.php b/admin/controllers/companies.php index ad2e8079..beaa3eea 100644 --- a/admin/controllers/companies.php +++ b/admin/controllers/companies.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 101 of this MVC - @build 29th June, 2016 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies.php @author Llewellyn van der Merwe @@ -20,24 +20,33 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Companies Controller */ class CostbenefitprojectionControllerCompanies extends JControllerAdmin { - protected $text_prefix = 'COM_COSTBENEFITPROJECTION_COMPANIES'; /** - * Proxy for getModel. - * @since 2.5 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ - public function getModel($name = 'Company', $prefix = 'CostbenefitprojectionModel', $config = array()) + protected $text_prefix = 'COM_COSTBENEFITPROJECTION_COMPANIES'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Company', $prefix = 'CostbenefitprojectionModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, $config); } public function exportData() @@ -101,7 +110,7 @@ class CostbenefitprojectionControllerCompanies extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=companies', false), $message, 'error'); return; - } + } public function redirectToCombinedresults() { @@ -125,5 +134,5 @@ class CostbenefitprojectionControllerCompanies extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_ACCESS_TO_COMBINEDRESULTS_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=companies', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/company.php b/admin/controllers/company.php index 25e3f92f..be09f06e 100644 --- a/admin/controllers/company.php +++ b/admin/controllers/company.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 101 of this MVC - @build 29th June, 2016 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controllerform'); - /** * Company Controller */ @@ -37,6 +34,13 @@ class CostbenefitprojectionControllerCompany extends JControllerForm */ protected $task; + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ public function __construct($config = array()) { $this->view_list = 'Companies'; // safeguard for setting the return view listing to the main view. @@ -54,14 +58,17 @@ class CostbenefitprojectionControllerCompany extends JControllerForm */ protected function allowAdd($data = array()) { + // Get user object. + $user = JFactory::getUser(); // Access check. - $access = JFactory::getUser()->authorise('company.access', 'com_costbenefitprojection'); + $access = $user->authorise('company.access', 'com_costbenefitprojection'); if (!$access) { return false; } + // In the absense of better information, revert to the component permissions. - return JFactory::getUser()->authorise('company.create', $this->option); + return $user->authorise('company.create', $this->option); } /** @@ -77,9 +84,9 @@ class CostbenefitprojectionControllerCompany extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; if (!$user->authorise('core.options', 'com_costbenefitprojection')) { // make absolutely sure that this company can be edited @@ -150,42 +157,25 @@ class CostbenefitprojectionControllerCompany extends JControllerForm * * @return string The arguments to append to the redirect URL. * - * @since 12.2 + * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { - $tmpl = $this->input->get('tmpl'); - $layout = $this->input->get('layout', 'edit', 'string'); + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); - $ref = $this->input->get('ref', 0, 'string'); - $refid = $this->input->get('refid', 0, 'int'); + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); - // Setup redirect info. - - $append = ''; - - if ($refid) + // set the referral options + if ($refid && $ref) { - $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; } elseif ($ref) { - $append .= '&ref='.(string)$ref; - } - - if ($tmpl) - { - $append .= '&tmpl=' . $tmpl; - } - - if ($layout) - { - $append .= '&layout=' . $layout; - } - - if ($recordId) - { - $append .= '&' . $urlVar . '=' . $recordId; + $append = '&ref='. (string)$ref . $append; } return $append; @@ -224,43 +214,45 @@ class CostbenefitprojectionControllerCompany extends JControllerForm */ public function cancel($key = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); $cancel = parent::cancel($key); - if ($cancel) + if (!is_null($return) && JUri::isInternal(base64_decode($return))) { - if ($this->refid) - { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); - // Redirect to the item screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - elseif ($this->ref) - { - $redirect = '&view='.(string)$this->ref; - - // Redirect to the list screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - } - else - { - // Redirect to the items screen. + // Redirect to the return value. $this->setRedirect( JRoute::_( - 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false ) ); } @@ -279,11 +271,15 @@ class CostbenefitprojectionControllerCompany extends JControllerForm */ public function save($key = null, $urlVar = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) { // to make sure the item is checkedin on redirect $this->task = 'save'; @@ -291,9 +287,22 @@ class CostbenefitprojectionControllerCompany extends JControllerForm $saved = parent::save($key, $urlVar); - if ($this->refid && $saved) + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; // Redirect to the item screen. $this->setRedirect( @@ -302,9 +311,9 @@ class CostbenefitprojectionControllerCompany extends JControllerForm ) ); } - elseif ($this->ref && $saved) + elseif ($this->ref) { - $redirect = '&view='.(string)$this->ref; + $redirect = '&view=' . (string)$this->ref; // Redirect to the list screen. $this->setRedirect( diff --git a/admin/controllers/companyresults.php b/admin/controllers/companyresults.php index 24914299..f3a7677e 100644 --- a/admin/controllers/companyresults.php +++ b/admin/controllers/companyresults.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 60 of this MVC - @build 14th October, 2017 - @created 13th August, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage companyresults.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controller'); - /** * Costbenefitprojection Companyresults Controller */ diff --git a/admin/controllers/costbenefitprojection.php b/admin/controllers/costbenefitprojection.php index 7822d3e8..db5bf7c7 100644 --- a/admin/controllers/costbenefitprojection.php +++ b/admin/controllers/costbenefitprojection.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Costbenefitprojection Controller */ diff --git a/admin/controllers/countries.php b/admin/controllers/countries.php index 78dd5f3d..2581bd65 100644 --- a/admin/controllers/countries.php +++ b/admin/controllers/countries.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 54 of this MVC - @build 17th May, 2018 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage countries.php @author Llewellyn van der Merwe @@ -20,24 +20,33 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Countries Controller */ class CostbenefitprojectionControllerCountries extends JControllerAdmin { - protected $text_prefix = 'COM_COSTBENEFITPROJECTION_COUNTRIES'; /** - * Proxy for getModel. - * @since 2.5 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ - public function getModel($name = 'Country', $prefix = 'CostbenefitprojectionModel', $config = array()) + protected $text_prefix = 'COM_COSTBENEFITPROJECTION_COUNTRIES'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Country', $prefix = 'CostbenefitprojectionModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, $config); } public function exportData() @@ -101,5 +110,5 @@ class CostbenefitprojectionControllerCountries extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=countries', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/country.php b/admin/controllers/country.php index 7a17daa1..c83de180 100644 --- a/admin/controllers/country.php +++ b/admin/controllers/country.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 54 of this MVC - @build 17th May, 2018 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage country.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controllerform'); - /** * Country Controller */ @@ -37,6 +34,13 @@ class CostbenefitprojectionControllerCountry extends JControllerForm */ protected $task; + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ public function __construct($config = array()) { $this->view_list = 'Countries'; // safeguard for setting the return view listing to the main view. @@ -54,14 +58,17 @@ class CostbenefitprojectionControllerCountry extends JControllerForm */ protected function allowAdd($data = array()) { + // Get user object. + $user = JFactory::getUser(); // Access check. - $access = JFactory::getUser()->authorise('country.access', 'com_costbenefitprojection'); + $access = $user->authorise('country.access', 'com_costbenefitprojection'); if (!$access) { return false; } + // In the absense of better information, revert to the component permissions. - return JFactory::getUser()->authorise('country.create', $this->option); + return $user->authorise('country.create', $this->option); } /** @@ -77,9 +84,9 @@ class CostbenefitprojectionControllerCountry extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; if (!$user->authorise('core.options', 'com_costbenefitprojection')) { // make absolutely sure that this country can be edited @@ -144,42 +151,25 @@ class CostbenefitprojectionControllerCountry extends JControllerForm * * @return string The arguments to append to the redirect URL. * - * @since 12.2 + * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { - $tmpl = $this->input->get('tmpl'); - $layout = $this->input->get('layout', 'edit', 'string'); + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); - $ref = $this->input->get('ref', 0, 'string'); - $refid = $this->input->get('refid', 0, 'int'); + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); - // Setup redirect info. - - $append = ''; - - if ($refid) + // set the referral options + if ($refid && $ref) { - $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; } elseif ($ref) { - $append .= '&ref='.(string)$ref; - } - - if ($tmpl) - { - $append .= '&tmpl=' . $tmpl; - } - - if ($layout) - { - $append .= '&layout=' . $layout; - } - - if ($recordId) - { - $append .= '&' . $urlVar . '=' . $recordId; + $append = '&ref='. (string)$ref . $append; } return $append; @@ -218,43 +208,45 @@ class CostbenefitprojectionControllerCountry extends JControllerForm */ public function cancel($key = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); $cancel = parent::cancel($key); - if ($cancel) + if (!is_null($return) && JUri::isInternal(base64_decode($return))) { - if ($this->refid) - { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); - // Redirect to the item screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - elseif ($this->ref) - { - $redirect = '&view='.(string)$this->ref; - - // Redirect to the list screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - } - else - { - // Redirect to the items screen. + // Redirect to the return value. $this->setRedirect( JRoute::_( - 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false ) ); } @@ -273,11 +265,15 @@ class CostbenefitprojectionControllerCountry extends JControllerForm */ public function save($key = null, $urlVar = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) { // to make sure the item is checkedin on redirect $this->task = 'save'; @@ -285,9 +281,22 @@ class CostbenefitprojectionControllerCountry extends JControllerForm $saved = parent::save($key, $urlVar); - if ($this->refid && $saved) + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; // Redirect to the item screen. $this->setRedirect( @@ -296,9 +305,9 @@ class CostbenefitprojectionControllerCountry extends JControllerForm ) ); } - elseif ($this->ref && $saved) + elseif ($this->ref) { - $redirect = '&view='.(string)$this->ref; + $redirect = '&view=' . (string)$this->ref; // Redirect to the list screen. $this->setRedirect( diff --git a/admin/controllers/currencies.php b/admin/controllers/currencies.php index 8de45423..896372fc 100644 --- a/admin/controllers/currencies.php +++ b/admin/controllers/currencies.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage currencies.php @author Llewellyn van der Merwe @@ -20,24 +20,33 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Currencies Controller */ class CostbenefitprojectionControllerCurrencies extends JControllerAdmin { - protected $text_prefix = 'COM_COSTBENEFITPROJECTION_CURRENCIES'; /** - * Proxy for getModel. - * @since 2.5 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ - public function getModel($name = 'Currency', $prefix = 'CostbenefitprojectionModel', $config = array()) + protected $text_prefix = 'COM_COSTBENEFITPROJECTION_CURRENCIES'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Currency', $prefix = 'CostbenefitprojectionModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, $config); } public function exportData() @@ -101,5 +110,5 @@ class CostbenefitprojectionControllerCurrencies extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=currencies', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/currency.php b/admin/controllers/currency.php index 7365b2d2..2834f55e 100644 --- a/admin/controllers/currency.php +++ b/admin/controllers/currency.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controllerform'); - /** * Currency Controller */ @@ -37,6 +34,13 @@ class CostbenefitprojectionControllerCurrency extends JControllerForm */ protected $task; + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ public function __construct($config = array()) { $this->view_list = 'Currencies'; // safeguard for setting the return view listing to the main view. @@ -54,14 +58,17 @@ class CostbenefitprojectionControllerCurrency extends JControllerForm */ protected function allowAdd($data = array()) { + // Get user object. + $user = JFactory::getUser(); // Access check. - $access = JFactory::getUser()->authorise('currency.access', 'com_costbenefitprojection'); + $access = $user->authorise('currency.access', 'com_costbenefitprojection'); if (!$access) { return false; } + // In the absense of better information, revert to the component permissions. - return JFactory::getUser()->authorise('currency.create', $this->option); + return $user->authorise('currency.create', $this->option); } /** @@ -77,9 +84,9 @@ class CostbenefitprojectionControllerCurrency extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. @@ -135,42 +142,25 @@ class CostbenefitprojectionControllerCurrency extends JControllerForm * * @return string The arguments to append to the redirect URL. * - * @since 12.2 + * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { - $tmpl = $this->input->get('tmpl'); - $layout = $this->input->get('layout', 'edit', 'string'); + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); - $ref = $this->input->get('ref', 0, 'string'); - $refid = $this->input->get('refid', 0, 'int'); + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); - // Setup redirect info. - - $append = ''; - - if ($refid) + // set the referral options + if ($refid && $ref) { - $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; } elseif ($ref) { - $append .= '&ref='.(string)$ref; - } - - if ($tmpl) - { - $append .= '&tmpl=' . $tmpl; - } - - if ($layout) - { - $append .= '&layout=' . $layout; - } - - if ($recordId) - { - $append .= '&' . $urlVar . '=' . $recordId; + $append = '&ref='. (string)$ref . $append; } return $append; @@ -209,43 +199,45 @@ class CostbenefitprojectionControllerCurrency extends JControllerForm */ public function cancel($key = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); $cancel = parent::cancel($key); - if ($cancel) + if (!is_null($return) && JUri::isInternal(base64_decode($return))) { - if ($this->refid) - { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); - // Redirect to the item screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - elseif ($this->ref) - { - $redirect = '&view='.(string)$this->ref; - - // Redirect to the list screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - } - else - { - // Redirect to the items screen. + // Redirect to the return value. $this->setRedirect( JRoute::_( - 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false ) ); } @@ -264,11 +256,15 @@ class CostbenefitprojectionControllerCurrency extends JControllerForm */ public function save($key = null, $urlVar = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) { // to make sure the item is checkedin on redirect $this->task = 'save'; @@ -276,9 +272,22 @@ class CostbenefitprojectionControllerCurrency extends JControllerForm $saved = parent::save($key, $urlVar); - if ($this->refid && $saved) + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; // Redirect to the item screen. $this->setRedirect( @@ -287,9 +296,9 @@ class CostbenefitprojectionControllerCurrency extends JControllerForm ) ); } - elseif ($this->ref && $saved) + elseif ($this->ref) { - $redirect = '&view='.(string)$this->ref; + $redirect = '&view=' . (string)$this->ref; // Redirect to the list screen. $this->setRedirect( diff --git a/admin/controllers/health_data.php b/admin/controllers/health_data.php index 64f2c417..457b8e4b 100644 --- a/admin/controllers/health_data.php +++ b/admin/controllers/health_data.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 110 of this MVC - @build 17th May, 2018 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controllerform'); - /** * Health_data Controller */ @@ -37,6 +34,13 @@ class CostbenefitprojectionControllerHealth_data extends JControllerForm */ protected $task; + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ public function __construct($config = array()) { $this->view_list = 'Health_data_sets'; // safeguard for setting the return view listing to the main view. @@ -54,14 +58,17 @@ class CostbenefitprojectionControllerHealth_data extends JControllerForm */ protected function allowAdd($data = array()) { + // Get user object. + $user = JFactory::getUser(); // Access check. - $access = JFactory::getUser()->authorise('health_data.access', 'com_costbenefitprojection'); + $access = $user->authorise('health_data.access', 'com_costbenefitprojection'); if (!$access) { return false; } + // In the absense of better information, revert to the component permissions. - return JFactory::getUser()->authorise('health_data.create', $this->option); + return $user->authorise('health_data.create', $this->option); } /** @@ -77,9 +84,9 @@ class CostbenefitprojectionControllerHealth_data extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; if (!$user->authorise('core.options', 'com_costbenefitprojection')) { // make absolutely sure that this health data can be edited @@ -145,42 +152,25 @@ class CostbenefitprojectionControllerHealth_data extends JControllerForm * * @return string The arguments to append to the redirect URL. * - * @since 12.2 + * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { - $tmpl = $this->input->get('tmpl'); - $layout = $this->input->get('layout', 'edit', 'string'); + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); - $ref = $this->input->get('ref', 0, 'string'); - $refid = $this->input->get('refid', 0, 'int'); + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); - // Setup redirect info. - - $append = ''; - - if ($refid) + // set the referral options + if ($refid && $ref) { - $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; } elseif ($ref) { - $append .= '&ref='.(string)$ref; - } - - if ($tmpl) - { - $append .= '&tmpl=' . $tmpl; - } - - if ($layout) - { - $append .= '&layout=' . $layout; - } - - if ($recordId) - { - $append .= '&' . $urlVar . '=' . $recordId; + $append = '&ref='. (string)$ref . $append; } return $append; @@ -219,43 +209,45 @@ class CostbenefitprojectionControllerHealth_data extends JControllerForm */ public function cancel($key = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); $cancel = parent::cancel($key); - if ($cancel) + if (!is_null($return) && JUri::isInternal(base64_decode($return))) { - if ($this->refid) - { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); - // Redirect to the item screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - elseif ($this->ref) - { - $redirect = '&view='.(string)$this->ref; - - // Redirect to the list screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - } - else - { - // Redirect to the items screen. + // Redirect to the return value. $this->setRedirect( JRoute::_( - 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false ) ); } @@ -274,11 +266,15 @@ class CostbenefitprojectionControllerHealth_data extends JControllerForm */ public function save($key = null, $urlVar = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) { // to make sure the item is checkedin on redirect $this->task = 'save'; @@ -286,9 +282,22 @@ class CostbenefitprojectionControllerHealth_data extends JControllerForm $saved = parent::save($key, $urlVar); - if ($this->refid && $saved) + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; // Redirect to the item screen. $this->setRedirect( @@ -297,9 +306,9 @@ class CostbenefitprojectionControllerHealth_data extends JControllerForm ) ); } - elseif ($this->ref && $saved) + elseif ($this->ref) { - $redirect = '&view='.(string)$this->ref; + $redirect = '&view=' . (string)$this->ref; // Redirect to the list screen. $this->setRedirect( diff --git a/admin/controllers/health_data_sets.php b/admin/controllers/health_data_sets.php index d26574d7..415dc4f1 100644 --- a/admin/controllers/health_data_sets.php +++ b/admin/controllers/health_data_sets.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 110 of this MVC - @build 17th May, 2018 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data_sets.php @author Llewellyn van der Merwe @@ -20,24 +20,33 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Health_data_sets Controller */ class CostbenefitprojectionControllerHealth_data_sets extends JControllerAdmin { - protected $text_prefix = 'COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS'; /** - * Proxy for getModel. - * @since 2.5 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ - public function getModel($name = 'Health_data', $prefix = 'CostbenefitprojectionModel', $config = array()) + protected $text_prefix = 'COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Health_data', $prefix = 'CostbenefitprojectionModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, $config); } public function exportData() @@ -101,5 +110,5 @@ class CostbenefitprojectionControllerHealth_data_sets extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=health_data_sets', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/help.php b/admin/controllers/help.php index df8aa332..bfe212cf 100644 --- a/admin/controllers/help.php +++ b/admin/controllers/help.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help.php @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controller'); - /** * Costbenefitprojection Help Controller */ diff --git a/admin/controllers/help_document.php b/admin/controllers/help_document.php index ad1cee93..04a37f61 100644 --- a/admin/controllers/help_document.php +++ b/admin/controllers/help_document.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 13th April, 2018 - @created 13th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_document.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controllerform'); - /** * Help_document Controller */ @@ -37,6 +34,13 @@ class CostbenefitprojectionControllerHelp_document extends JControllerForm */ protected $task; + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ public function __construct($config = array()) { $this->view_list = 'Help_documents'; // safeguard for setting the return view listing to the main view. @@ -54,14 +58,17 @@ class CostbenefitprojectionControllerHelp_document extends JControllerForm */ protected function allowAdd($data = array()) { + // Get user object. + $user = JFactory::getUser(); // Access check. - $access = JFactory::getUser()->authorise('help_document.access', 'com_costbenefitprojection'); + $access = $user->authorise('help_document.access', 'com_costbenefitprojection'); if (!$access) { return false; } + // In the absense of better information, revert to the component permissions. - return JFactory::getUser()->authorise('help_document.create', $this->option); + return $user->authorise('help_document.create', $this->option); } /** @@ -77,9 +84,9 @@ class CostbenefitprojectionControllerHelp_document extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // Access check. @@ -135,42 +142,25 @@ class CostbenefitprojectionControllerHelp_document extends JControllerForm * * @return string The arguments to append to the redirect URL. * - * @since 12.2 + * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { - $tmpl = $this->input->get('tmpl'); - $layout = $this->input->get('layout', 'edit', 'string'); + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); - $ref = $this->input->get('ref', 0, 'string'); - $refid = $this->input->get('refid', 0, 'int'); + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); - // Setup redirect info. - - $append = ''; - - if ($refid) + // set the referral options + if ($refid && $ref) { - $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; } elseif ($ref) { - $append .= '&ref='.(string)$ref; - } - - if ($tmpl) - { - $append .= '&tmpl=' . $tmpl; - } - - if ($layout) - { - $append .= '&layout=' . $layout; - } - - if ($recordId) - { - $append .= '&' . $urlVar . '=' . $recordId; + $append = '&ref='. (string)$ref . $append; } return $append; @@ -209,43 +199,45 @@ class CostbenefitprojectionControllerHelp_document extends JControllerForm */ public function cancel($key = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); $cancel = parent::cancel($key); - if ($cancel) + if (!is_null($return) && JUri::isInternal(base64_decode($return))) { - if ($this->refid) - { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); - // Redirect to the item screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - elseif ($this->ref) - { - $redirect = '&view='.(string)$this->ref; - - // Redirect to the list screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - } - else - { - // Redirect to the items screen. + // Redirect to the return value. $this->setRedirect( JRoute::_( - 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false ) ); } @@ -264,11 +256,15 @@ class CostbenefitprojectionControllerHelp_document extends JControllerForm */ public function save($key = null, $urlVar = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) { // to make sure the item is checkedin on redirect $this->task = 'save'; @@ -276,9 +272,22 @@ class CostbenefitprojectionControllerHelp_document extends JControllerForm $saved = parent::save($key, $urlVar); - if ($this->refid && $saved) + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; // Redirect to the item screen. $this->setRedirect( @@ -287,9 +296,9 @@ class CostbenefitprojectionControllerHelp_document extends JControllerForm ) ); } - elseif ($this->ref && $saved) + elseif ($this->ref) { - $redirect = '&view='.(string)$this->ref; + $redirect = '&view=' . (string)$this->ref; // Redirect to the list screen. $this->setRedirect( diff --git a/admin/controllers/help_documents.php b/admin/controllers/help_documents.php index e5bc38df..8da3127d 100644 --- a/admin/controllers/help_documents.php +++ b/admin/controllers/help_documents.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 13th April, 2018 - @created 13th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_documents.php @author Llewellyn van der Merwe @@ -20,24 +20,33 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Help_documents Controller */ class CostbenefitprojectionControllerHelp_documents extends JControllerAdmin { - protected $text_prefix = 'COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS'; /** - * Proxy for getModel. - * @since 2.5 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ - public function getModel($name = 'Help_document', $prefix = 'CostbenefitprojectionModel', $config = array()) + protected $text_prefix = 'COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Help_document', $prefix = 'CostbenefitprojectionModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, $config); } public function exportData() @@ -101,5 +110,5 @@ class CostbenefitprojectionControllerHelp_documents extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=help_documents', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 0354a053..2c6ed8c5 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage import.php diff --git a/admin/controllers/import_health_data_sets.php b/admin/controllers/import_health_data_sets.php index 27a74a2f..0eccbab1 100644 --- a/admin/controllers/import_health_data_sets.php +++ b/admin/controllers/import_health_data_sets.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage import_health_data_sets.php diff --git a/admin/controllers/intervention.php b/admin/controllers/intervention.php index 6b013fdb..9602ad3d 100644 --- a/admin/controllers/intervention.php +++ b/admin/controllers/intervention.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 71 of this MVC - @build 12th November, 2016 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage intervention.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controllerform'); - /** * Intervention Controller */ @@ -37,6 +34,13 @@ class CostbenefitprojectionControllerIntervention extends JControllerForm */ protected $task; + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ public function __construct($config = array()) { $this->view_list = 'Interventions'; // safeguard for setting the return view listing to the main view. @@ -54,14 +58,17 @@ class CostbenefitprojectionControllerIntervention extends JControllerForm */ protected function allowAdd($data = array()) { + // Get user object. + $user = JFactory::getUser(); // Access check. - $access = JFactory::getUser()->authorise('intervention.access', 'com_costbenefitprojection'); + $access = $user->authorise('intervention.access', 'com_costbenefitprojection'); if (!$access) { return false; } + // In the absense of better information, revert to the component permissions. - return JFactory::getUser()->authorise('intervention.create', $this->option); + return $user->authorise('intervention.create', $this->option); } /** @@ -77,9 +84,9 @@ class CostbenefitprojectionControllerIntervention extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; // get company id $company = CostbenefitprojectionHelper::getId('intervention',$recordId,'id','company'); if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -150,42 +157,25 @@ class CostbenefitprojectionControllerIntervention extends JControllerForm * * @return string The arguments to append to the redirect URL. * - * @since 12.2 + * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { - $tmpl = $this->input->get('tmpl'); - $layout = $this->input->get('layout', 'edit', 'string'); + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); - $ref = $this->input->get('ref', 0, 'string'); - $refid = $this->input->get('refid', 0, 'int'); + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); - // Setup redirect info. - - $append = ''; - - if ($refid) + // set the referral options + if ($refid && $ref) { - $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; } elseif ($ref) { - $append .= '&ref='.(string)$ref; - } - - if ($tmpl) - { - $append .= '&tmpl=' . $tmpl; - } - - if ($layout) - { - $append .= '&layout=' . $layout; - } - - if ($recordId) - { - $append .= '&' . $urlVar . '=' . $recordId; + $append = '&ref='. (string)$ref . $append; } return $append; @@ -224,43 +214,45 @@ class CostbenefitprojectionControllerIntervention extends JControllerForm */ public function cancel($key = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); $cancel = parent::cancel($key); - if ($cancel) + if (!is_null($return) && JUri::isInternal(base64_decode($return))) { - if ($this->refid) - { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); - // Redirect to the item screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - elseif ($this->ref) - { - $redirect = '&view='.(string)$this->ref; - - // Redirect to the list screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - } - else - { - // Redirect to the items screen. + // Redirect to the return value. $this->setRedirect( JRoute::_( - 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false ) ); } @@ -279,11 +271,15 @@ class CostbenefitprojectionControllerIntervention extends JControllerForm */ public function save($key = null, $urlVar = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) { // to make sure the item is checkedin on redirect $this->task = 'save'; @@ -291,9 +287,22 @@ class CostbenefitprojectionControllerIntervention extends JControllerForm $saved = parent::save($key, $urlVar); - if ($this->refid && $saved) + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; // Redirect to the item screen. $this->setRedirect( @@ -302,9 +311,9 @@ class CostbenefitprojectionControllerIntervention extends JControllerForm ) ); } - elseif ($this->ref && $saved) + elseif ($this->ref) { - $redirect = '&view='.(string)$this->ref; + $redirect = '&view=' . (string)$this->ref; // Redirect to the list screen. $this->setRedirect( diff --git a/admin/controllers/interventions.php b/admin/controllers/interventions.php index 7df78972..cb497016 100644 --- a/admin/controllers/interventions.php +++ b/admin/controllers/interventions.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 71 of this MVC - @build 12th November, 2016 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions.php @author Llewellyn van der Merwe @@ -20,24 +20,33 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Interventions Controller */ class CostbenefitprojectionControllerInterventions extends JControllerAdmin { - protected $text_prefix = 'COM_COSTBENEFITPROJECTION_INTERVENTIONS'; /** - * Proxy for getModel. - * @since 2.5 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ - public function getModel($name = 'Intervention', $prefix = 'CostbenefitprojectionModel', $config = array()) + protected $text_prefix = 'COM_COSTBENEFITPROJECTION_INTERVENTIONS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Intervention', $prefix = 'CostbenefitprojectionModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, $config); } public function exportData() @@ -101,5 +110,5 @@ class CostbenefitprojectionControllerInterventions extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=interventions', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/scaling_factor.php b/admin/controllers/scaling_factor.php index d039aebf..c8b8dbf1 100644 --- a/admin/controllers/scaling_factor.php +++ b/admin/controllers/scaling_factor.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 21 of this MVC - @build 16th August, 2016 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factor.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controllerform'); - /** * Scaling_factor Controller */ @@ -37,6 +34,13 @@ class CostbenefitprojectionControllerScaling_factor extends JControllerForm */ protected $task; + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ public function __construct($config = array()) { $this->view_list = 'Scaling_factors'; // safeguard for setting the return view listing to the main view. @@ -54,14 +58,17 @@ class CostbenefitprojectionControllerScaling_factor extends JControllerForm */ protected function allowAdd($data = array()) { + // Get user object. + $user = JFactory::getUser(); // Access check. - $access = JFactory::getUser()->authorise('scaling_factor.access', 'com_costbenefitprojection'); + $access = $user->authorise('scaling_factor.access', 'com_costbenefitprojection'); if (!$access) { return false; } + // In the absense of better information, revert to the component permissions. - return JFactory::getUser()->authorise('scaling_factor.create', $this->option); + return $user->authorise('scaling_factor.create', $this->option); } /** @@ -77,9 +84,9 @@ class CostbenefitprojectionControllerScaling_factor extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; if (!$user->authorise('core.options', 'com_costbenefitprojection')) { // make absolutely sure that this scaling factor can be edited @@ -144,42 +151,25 @@ class CostbenefitprojectionControllerScaling_factor extends JControllerForm * * @return string The arguments to append to the redirect URL. * - * @since 12.2 + * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { - $tmpl = $this->input->get('tmpl'); - $layout = $this->input->get('layout', 'edit', 'string'); + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); - $ref = $this->input->get('ref', 0, 'string'); - $refid = $this->input->get('refid', 0, 'int'); + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); - // Setup redirect info. - - $append = ''; - - if ($refid) + // set the referral options + if ($refid && $ref) { - $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; } elseif ($ref) { - $append .= '&ref='.(string)$ref; - } - - if ($tmpl) - { - $append .= '&tmpl=' . $tmpl; - } - - if ($layout) - { - $append .= '&layout=' . $layout; - } - - if ($recordId) - { - $append .= '&' . $urlVar . '=' . $recordId; + $append = '&ref='. (string)$ref . $append; } return $append; @@ -218,43 +208,45 @@ class CostbenefitprojectionControllerScaling_factor extends JControllerForm */ public function cancel($key = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); $cancel = parent::cancel($key); - if ($cancel) + if (!is_null($return) && JUri::isInternal(base64_decode($return))) { - if ($this->refid) - { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); - // Redirect to the item screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - elseif ($this->ref) - { - $redirect = '&view='.(string)$this->ref; - - // Redirect to the list screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - } - else - { - // Redirect to the items screen. + // Redirect to the return value. $this->setRedirect( JRoute::_( - 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false ) ); } @@ -273,11 +265,15 @@ class CostbenefitprojectionControllerScaling_factor extends JControllerForm */ public function save($key = null, $urlVar = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) { // to make sure the item is checkedin on redirect $this->task = 'save'; @@ -285,9 +281,22 @@ class CostbenefitprojectionControllerScaling_factor extends JControllerForm $saved = parent::save($key, $urlVar); - if ($this->refid && $saved) + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; // Redirect to the item screen. $this->setRedirect( @@ -296,9 +305,9 @@ class CostbenefitprojectionControllerScaling_factor extends JControllerForm ) ); } - elseif ($this->ref && $saved) + elseif ($this->ref) { - $redirect = '&view='.(string)$this->ref; + $redirect = '&view=' . (string)$this->ref; // Redirect to the list screen. $this->setRedirect( diff --git a/admin/controllers/scaling_factors.php b/admin/controllers/scaling_factors.php index 6fb1899e..8d9a1f3c 100644 --- a/admin/controllers/scaling_factors.php +++ b/admin/controllers/scaling_factors.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 21 of this MVC - @build 16th August, 2016 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factors.php @author Llewellyn van der Merwe @@ -20,24 +20,33 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Scaling_factors Controller */ class CostbenefitprojectionControllerScaling_factors extends JControllerAdmin { - protected $text_prefix = 'COM_COSTBENEFITPROJECTION_SCALING_FACTORS'; /** - * Proxy for getModel. - * @since 2.5 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ - public function getModel($name = 'Scaling_factor', $prefix = 'CostbenefitprojectionModel', $config = array()) + protected $text_prefix = 'COM_COSTBENEFITPROJECTION_SCALING_FACTORS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Scaling_factor', $prefix = 'CostbenefitprojectionModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, $config); } public function exportData() @@ -101,5 +110,5 @@ class CostbenefitprojectionControllerScaling_factors extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=scaling_factors', false), $message, 'error'); return; - } + } } diff --git a/admin/controllers/service_provider.php b/admin/controllers/service_provider.php index 73ef90db..22f50244 100644 --- a/admin/controllers/service_provider.php +++ b/admin/controllers/service_provider.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 22nd March, 2016 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_provider.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controllerform library -jimport('joomla.application.component.controllerform'); - /** * Service_provider Controller */ @@ -37,6 +34,13 @@ class CostbenefitprojectionControllerService_provider extends JControllerForm */ protected $task; + /** + * Class constructor. + * + * @param array $config A named array of configuration variables. + * + * @since 1.6 + */ public function __construct($config = array()) { $this->view_list = 'Service_providers'; // safeguard for setting the return view listing to the main view. @@ -54,14 +58,17 @@ class CostbenefitprojectionControllerService_provider extends JControllerForm */ protected function allowAdd($data = array()) { + // Get user object. + $user = JFactory::getUser(); // Access check. - $access = JFactory::getUser()->authorise('service_provider.access', 'com_costbenefitprojection'); + $access = $user->authorise('service_provider.access', 'com_costbenefitprojection'); if (!$access) { return false; } + // In the absense of better information, revert to the component permissions. - return JFactory::getUser()->authorise('service_provider.create', $this->option); + return $user->authorise('service_provider.create', $this->option); } /** @@ -77,9 +84,9 @@ class CostbenefitprojectionControllerService_provider extends JControllerForm protected function allowEdit($data = array(), $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = JFactory::getUser(); // get record id. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; if (!$user->authorise('core.options', 'com_costbenefitprojection')) { // make absolutely sure that this Service Providers can be edited @@ -143,42 +150,25 @@ class CostbenefitprojectionControllerService_provider extends JControllerForm * * @return string The arguments to append to the redirect URL. * - * @since 12.2 + * @since 1.6 */ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') { - $tmpl = $this->input->get('tmpl'); - $layout = $this->input->get('layout', 'edit', 'string'); + // get the referral options (old method use return instead see parent) + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); - $ref = $this->input->get('ref', 0, 'string'); - $refid = $this->input->get('refid', 0, 'int'); + // get redirect info. + $append = parent::getRedirectToItemAppend($recordId, $urlVar); - // Setup redirect info. - - $append = ''; - - if ($refid) + // set the referral options + if ($refid && $ref) { - $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; } elseif ($ref) { - $append .= '&ref='.(string)$ref; - } - - if ($tmpl) - { - $append .= '&tmpl=' . $tmpl; - } - - if ($layout) - { - $append .= '&layout=' . $layout; - } - - if ($recordId) - { - $append .= '&' . $urlVar . '=' . $recordId; + $append = '&ref='. (string)$ref . $append; } return $append; @@ -217,43 +207,45 @@ class CostbenefitprojectionControllerService_provider extends JControllerForm */ public function cancel($key = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); $cancel = parent::cancel($key); - if ($cancel) + if (!is_null($return) && JUri::isInternal(base64_decode($return))) { - if ($this->refid) - { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); - // Redirect to the item screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - elseif ($this->ref) - { - $redirect = '&view='.(string)$this->ref; - - // Redirect to the list screen. - $this->setRedirect( - JRoute::_( - 'index.php?option=' . $this->option . $redirect, false - ) - ); - } - } - else - { - // Redirect to the items screen. + // Redirect to the return value. $this->setRedirect( JRoute::_( - 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false ) ); } @@ -272,11 +264,15 @@ class CostbenefitprojectionControllerService_provider extends JControllerForm */ public function save($key = null, $urlVar = null) { - // get the referal details - $this->ref = $this->input->get('ref', 0, 'word'); - $this->refid = $this->input->get('refid', 0, 'int'); + // get the referral options + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); - if ($this->ref || $this->refid) + // Check if there is a return value + $return = $this->input->get('return', null, 'base64'); + $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + + if ($this->ref || $this->refid || $canReturn) { // to make sure the item is checkedin on redirect $this->task = 'save'; @@ -284,9 +280,22 @@ class CostbenefitprojectionControllerService_provider extends JControllerForm $saved = parent::save($key, $urlVar); - if ($this->refid && $saved) + // This is not needed since parent save already does this + // Due to the ref and refid implementation we need to add this + if ($canReturn) { - $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + JRoute::_( + $redirect, false + ) + ); + } + elseif ($this->refid && $this->ref) + { + $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; // Redirect to the item screen. $this->setRedirect( @@ -295,9 +304,9 @@ class CostbenefitprojectionControllerService_provider extends JControllerForm ) ); } - elseif ($this->ref && $saved) + elseif ($this->ref) { - $redirect = '&view='.(string)$this->ref; + $redirect = '&view=' . (string)$this->ref; // Redirect to the list screen. $this->setRedirect( diff --git a/admin/controllers/service_providers.php b/admin/controllers/service_providers.php index fe340446..16f366fb 100644 --- a/admin/controllers/service_providers.php +++ b/admin/controllers/service_providers.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 35 of this MVC - @build 22nd March, 2016 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_providers.php @author Llewellyn van der Merwe @@ -20,24 +20,33 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla controlleradmin library -jimport('joomla.application.component.controlleradmin'); - /** * Service_providers Controller */ class CostbenefitprojectionControllerService_providers extends JControllerAdmin { - protected $text_prefix = 'COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS'; /** - * Proxy for getModel. - * @since 2.5 + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 */ - public function getModel($name = 'Service_provider', $prefix = 'CostbenefitprojectionModel', $config = array()) + protected $text_prefix = 'COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS'; + + /** + * Method to get a model object, loading it if required. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JModelLegacy The model. + * + * @since 1.6 + */ + public function getModel($name = 'Service_provider', $prefix = 'CostbenefitprojectionModel', $config = array('ignore_request' => true)) { - $model = parent::getModel($name, $prefix, array('ignore_request' => true)); - - return $model; + return parent::getModel($name, $prefix, $config); } public function exportData() @@ -101,5 +110,5 @@ class CostbenefitprojectionControllerService_providers extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=service_providers', false), $message, 'error'); return; - } + } } diff --git a/admin/costbenefitprojection.php b/admin/costbenefitprojection.php index cfaaf455..2f8309dc 100644 --- a/admin/costbenefitprojection.php +++ b/admin/costbenefitprojection.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php @@ -19,29 +19,22 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +JHtml::_('behavior.tabstate'); // Access check. if (!JFactory::getUser()->authorise('core.manage', 'com_costbenefitprojection')) { - return JError::raiseWaring(404, JText::_('JERROR_ALERTNOAUTHOR')); + throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); }; -// Load cms libraries -JLoader::registerPrefix('J', JPATH_PLATFORM . '/cms'); -// Load joomla libraries without overwrite -JLoader::registerPrefix('J', JPATH_PLATFORM . '/joomla',false); - // Add CSS file for all pages $document = JFactory::getDocument(); $document->addStyleSheet('components/com_costbenefitprojection/assets/css/admin.css'); $document->addScript('components/com_costbenefitprojection/assets/js/admin.js'); // require helper files -JLoader::register('CostbenefitprojectionHelper', dirname(__FILE__) . '/helpers/costbenefitprojection.php'); -JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php'); - -// import joomla controller library -jimport('joomla.application.component.controller'); +JLoader::register('CostbenefitprojectionHelper', __DIR__ . '/helpers/costbenefitprojection.php'); +JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php'); // Get an instance of the controller prefixed by Costbenefitprojection $controller = JControllerLegacy::getInstance('Costbenefitprojection'); diff --git a/admin/helpers/costbenefitprojection.php b/admin/helpers/costbenefitprojection.php index a9dc142e..3b303fe3 100644 --- a/admin/helpers/costbenefitprojection.php +++ b/admin/helpers/costbenefitprojection.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); * Costbenefitprojection component helper. */ abstract class CostbenefitprojectionHelper -{ +{ public static function userIs($id = null) { @@ -754,9 +754,9 @@ abstract class CostbenefitprojectionHelper self::$localkey = md5(JComponentHelper::getParams('com_costbenefitprojection')->get('basic', 'localKey34fdWEkl')); } return self::$localkey; - } + } /** - * Load the Component xml manifest. + * Load the Component xml manifest. **/ public static function manifest() { @@ -765,12 +765,12 @@ abstract class CostbenefitprojectionHelper } /** - * Joomla version object + * Joomla version object **/ protected static $JVersion; /** - * set/get Joomla version + * set/get Joomla version **/ public static function jVersion() { @@ -783,7 +783,7 @@ abstract class CostbenefitprojectionHelper } /** - * Load the Contributors details. + * Load the Contributors details. **/ public static function getContributors() { @@ -821,8 +821,8 @@ abstract class CostbenefitprojectionHelper } /** - * Load the Component Help URLs. - **/ + * Load the Component Help URLs. + **/ public static function getHelpUrl($view) { $user = JFactory::getUser(); @@ -859,15 +859,15 @@ abstract class CostbenefitprojectionHelper // set joomla article case 1: return self::loadArticleLink($help->article); - break; + break; // set help text case 2: return self::loadHelpTextLink($help->id); - break; + break; // set Link case 3: return $help->url; - break; + break; } } } @@ -876,16 +876,16 @@ abstract class CostbenefitprojectionHelper } /** - * Get the Article Link. - **/ + * Get the Article Link. + **/ protected static function loadArticleLink($id) { return JURI::root().'index.php?option=com_content&view=article&id='.$id.'&tmpl=component&layout=modal'; } /** - * Get the Help Text Link. - **/ + * Get the Help Text Link. + **/ protected static function loadHelpTextLink($id) { $token = JSession::getFormToken(); @@ -893,7 +893,7 @@ abstract class CostbenefitprojectionHelper } /** - * Configure the Linkbar. + * Configure the Linkbar. **/ public static function addSubmenu($submenu) { @@ -940,8 +940,8 @@ abstract class CostbenefitprojectionHelper } /** - * Greate user and update given table - */ + * Greate user and update given table + */ public static function createUser($new) { // load the user component language files if there is an error. @@ -1021,8 +1021,8 @@ abstract class CostbenefitprojectionHelper } /** - * Update user values - */ + * Update user values + */ public static function updateUser($new) { // load the user component language files if there is an error. @@ -1048,7 +1048,7 @@ abstract class CostbenefitprojectionHelper } else { - $new['username'] = self::safeString($new['name']); + $new['username'] = self::safeString($new['name']); } // linup update user data $data = array( @@ -1059,6 +1059,11 @@ abstract class CostbenefitprojectionHelper 'password1' => $password, // First password field 'password2' => $password2, // Confirm password field 'block' => 0 ); + // set groups if found + if (isset($new['groups']) && self::checkArray($new['groups'])) + { + $data['groups'] = $new['groups']; + } // register the new user $done = $model->save($data); // if user is updated @@ -1067,11 +1072,11 @@ abstract class CostbenefitprojectionHelper return $new['id']; } return $model->getError(); - } + } /** - * UIKIT Component Classes - **/ + * UIKIT Component Classes + **/ public static $uk_components = array( 'data-uk-grid' => array( 'grid' ), @@ -1125,15 +1130,15 @@ abstract class CostbenefitprojectionHelper 'upload-drop' => array( 'upload', 'form-file' ) ); - + /** - * Add UIKIT Components - **/ + * Add UIKIT Components + **/ public static $uikit = false; /** - * Get UIKIT Components - **/ + * Get UIKIT Components + **/ public static function getUikitComp($content,$classes = array()) { if (strpos($content,'class="uk-') !== false) @@ -1163,13 +1168,13 @@ abstract class CostbenefitprojectionHelper } return $temp; } - } + } if (self::checkArray($classes)) { return $classes; } return false; - } + } /** * Prepares the xml document @@ -1199,19 +1204,19 @@ abstract class CostbenefitprojectionHelper { $subjectTab = 'Sheet1'; } - - // make sure the file is loaded + + // make sure the file is loaded JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); - + // Create new PHPExcel object $objPHPExcel = new PHPExcel(); - + // Set document properties $objPHPExcel->getProperties()->setCreator($creator) - ->setCompany('Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb') - ->setLastModifiedBy($modified) - ->setTitle($title) - ->setSubject($subjectTab); + ->setCompany('Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb') + ->setLastModifiedBy($modified) + ->setTitle($title) + ->setSubject($subjectTab); if (!$description) { $objPHPExcel->getProperties()->setDescription($description); @@ -1224,7 +1229,7 @@ abstract class CostbenefitprojectionHelper { $objPHPExcel->getProperties()->setCategory($category); } - + // Some styles $headerStyles = array( 'font' => array( @@ -1246,7 +1251,7 @@ abstract class CostbenefitprojectionHelper 'size' => 11, 'name' => 'Verdana' )); - + // Add some data if (self::checkArray($rows)) { @@ -1273,43 +1278,43 @@ abstract class CostbenefitprojectionHelper { return false; } - + // Rename worksheet $objPHPExcel->getActiveSheet()->setTitle($subjectTab); - + // Set active sheet index to the first sheet, so Excel opens this as the first sheet $objPHPExcel->setActiveSheetIndex(0); - + // Redirect output to a client's web browser (Excel5) header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="'.$fileName.'.xls"'); header('Cache-Control: max-age=0'); // If you're serving to IE 9, then the following may be needed header('Cache-Control: max-age=1'); - + // If you're serving to IE over SSL, then the following may be needed header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header ('Pragma: public'); // HTTP/1.0 - + $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); jexit(); } - + /** - * Get CSV Headers - */ + * Get CSV Headers + */ public static function getFileHeaders($dataType) - { - // make sure these files are loaded + { + // make sure these files are loaded JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); JLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader'); // get session object - $session = JFactory::getSession(); - $package = $session->get('package', null); - $package = json_decode($package, true); + $session = JFactory::getSession(); + $package = $session->get('package', null); + $package = json_decode($package, true); // set the headers if(isset($package['dir'])) { @@ -1487,16 +1492,16 @@ abstract class CostbenefitprojectionHelper { if ($external) { - if ($name = self::getVar(null, $val, $id, $name, '=', $table)) + if ($_name = self::getVar(null, $val, $id, $name, '=', $table)) { - $names[] = $name; + $names[] = $_name; } } else { - if ($name = self::getVar($table, $val, $id, $name)) + if ($_name = self::getVar($table, $val, $id, $name)) { - $names[] = $name; + $names[] = $_name; } } } @@ -1552,183 +1557,149 @@ abstract class CostbenefitprojectionHelper } /** - * Get the actions permissions + * Get the action permissions + * + * @param string $view The related view name + * @param int $record The item to act upon + * @param string $views The related list view name + * @param mixed $target Only get this permission (like edit, create, delete) + * @param string $component The target component + * + * @return object The JObject of permission/authorised actions + * **/ - public static function getActions($view,&$record = null,$views = null) + public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'costbenefitprojection') { - jimport('joomla.access.access'); - - $user = JFactory::getUser(); - $result = new JObject; - $view = self::safeString($view); + // get the user object + $user = JFactory::getUser(); + // load the JObject + $result = new JObject; + // make view name safe (just incase) + $view = self::safeString($view); if (self::checkString($views)) { $views = self::safeString($views); } // get all actions from component - $actions = JAccess::getActions('com_costbenefitprojection', 'component'); - // set acctions only set in component settiongs - $componentActions = array('core.admin','core.manage','core.options','core.export'); + $actions = JAccess::getActionsFromFile( + JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', + "/access/section[@name='component']/" + ); + // if non found then return empty JObject + if (empty($actions)) + { + return $result; + } + // get created by if not found + if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + { + $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + } + // set actions only set in component settings + $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); + // check if we have a target + $checkTarget = false; + if ($target) + { + // convert to an array + if (self::checkString($target)) + { + $target = array($target); + } + // check if we are good to go + if (self::checkArray($target)) + { + $checkTarget = true; + } + } // loop the actions and set the permissions foreach ($actions as $action) { - // set to use component default - $fallback= true; - if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name,$componentActions)) + // check target action filter + if ($checkTarget && self::filterActions($view, $action->name, $target)) { + continue; + } + // set to use component default + $fallback = true; + // reset permission per/action + $permission = false; + $catpermission = false; + // set area + $area = 'comp'; + // check if the record has an ID and the action is item related (not a component action) + if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) + { + // we are in item + $area = 'item'; // The record has been set. Check the record permissions. - $permission = $user->authorise($action->name, 'com_costbenefitprojection.'.$view.'.' . (int) $record->id); - if (!$permission) // TODO removed && !is_null($permission) + $permission = $user->authorise($action->name, 'com_' . $component . '.' . $view . '.' . (int) $record->id); + // if no permission found, check edit own + if (!$permission) { - if ($action->name == 'core.edit' || $action->name == $view.'.edit') + // With edit, if the created_by matches current user then dig deeper. + if (($action->name === 'core.edit' || $action->name === $view . '.edit') && $record->created_by > 0 && ($record->created_by == $user->id)) { - if ($user->authorise('core.edit.own', 'com_costbenefitprojection.'.$view.'.' . (int) $record->id)) + // the correct target + $coreCheck = (array) explode('.', $action->name); + // check that we have both local and global access + if ($user->authorise($coreCheck[0] . '.edit.own', 'com_' . $component . '.' . $view . '.' . (int) $record->id) && + $user->authorise($coreCheck[0] . '.edit.own', 'com_' . $component)) { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } + // allow edit + $result->set($action->name, true); + // set not to use global default + // because we already validated it + $fallback = false; } - elseif ($user->authorise($view.'edit.own', 'com_costbenefitprojection.'.$view.'.' . (int) $record->id)) + else { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } - } - elseif ($user->authorise('core.edit.own', 'com_costbenefitprojection')) - { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } - } - elseif ($user->authorise($view.'edit.own', 'com_costbenefitprojection')) - { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } + // do not allow edit + $result->set($action->name, false); + $fallback = false; } } } elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) { + // we are in item + $area = 'category'; + // set the core check + $coreCheck = explode('.', $action->name); + $core = $coreCheck[0]; // make sure we use the core. action check for the categories - if (strpos($action->name,$view) !== false && strpos($action->name,'core.') === false ) { - $coreCheck = explode('.',$action->name); - $coreCheck[0] = 'core'; - $categoryCheck = implode('.',$coreCheck); + if (strpos($action->name, $view) !== false && strpos($action->name, 'core.') === false ) + { + $coreCheck[0] = 'core'; + $categoryCheck = implode('.', $coreCheck); } else { $categoryCheck = $action->name; } // The record has a category. Check the category permissions. - $catpermission = $user->authorise($categoryCheck, 'com_costbenefitprojection.'.$views.'.category.' . (int) $record->catid); + $catpermission = $user->authorise($categoryCheck, 'com_' . $component . '.' . $views . '.category.' . (int) $record->catid); if (!$catpermission && !is_null($catpermission)) { - if ($action->name == 'core.edit' || $action->name == $view.'.edit') + // With edit, if the created_by matches current user then dig deeper. + if (($action->name === 'core.edit' || $action->name === $view . '.edit') && $record->created_by > 0 && ($record->created_by == $user->id)) { - if ($user->authorise('core.edit.own', 'com_costbenefitprojection.'.$views.'.category.' . (int) $record->catid)) + // check that we have both local and global access + if ($user->authorise('core.edit.own', 'com_' . $component . '.' . $views . '.category.' . (int) $record->catid) && + $user->authorise($core . '.edit.own', 'com_' . $component)) { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } + // allow edit + $result->set($action->name, true); + // set not to use global default + // because we already validated it + $fallback = false; } - elseif ($user->authorise($view.'edit.own', 'com_costbenefitprojection.'.$views.'.category.' . (int) $record->catid)) + else { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } - } - elseif ($user->authorise('core.edit.own', 'com_costbenefitprojection')) - { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } - } - elseif ($user->authorise($view.'edit.own', 'com_costbenefitprojection')) - { - // If the owner matches 'me' then allow. - if (isset($record->created_by) && $record->created_by > 0 && ($record->created_by == $user->id)) - { - $result->set($action->name, true); - // set not to use component default - $fallback= false; - } - else - { - $result->set($action->name, false); - // set not to use component default - $fallback= false; - } + // do not allow edit + $result->set($action->name, false); + $fallback = false; } } } @@ -1737,14 +1708,49 @@ abstract class CostbenefitprojectionHelper // if allowed then fallback on component global settings if ($fallback) { - $result->set($action->name, $user->authorise($action->name, 'com_costbenefitprojection')); + // if item/category blocks access then don't fall back on global + if ((($area === 'item') && !$permission) || (($area === 'category') && !$catpermission)) + { + // do not allow + $result->set($action->name, false); + } + // Finally remember the global settings have the final say. (even if item allow) + // The local item permissions can block, but it can't open and override of global permissions. + // Since items are created by users and global permissions is set by system admin. + else + { + $result->set($action->name, $user->authorise($action->name, 'com_' . $component)); + } } } return $result; } /** - * Get any component's model + * Filter the action permissions + * + * @param string $action The action to check + * @param array $targets The array of target actions + * + * @return boolean true if action should be filtered out + * + **/ + protected static function filterActions(&$view, &$action, &$targets) + { + foreach ($targets as $target) + { + if (strpos($action, $view . '.' . $target) !== false || + strpos($action, 'core.' . $target) !== false) + { + return false; + break; + } + } + return true; + } + + /** + * Get any component's model **/ public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $component = 'Costbenefitprojection', $config = array()) { @@ -1788,9 +1794,9 @@ abstract class CostbenefitprojectionHelper } /** - * Add to asset Table + * Add to asset Table */ - public static function setAsset($id,$table) + public static function setAsset($id, $table, $inherit = true) { $parent = JTable::getInstance('Asset'); $parent->loadByName('com_costbenefitprojection'); @@ -1822,7 +1828,7 @@ abstract class CostbenefitprojectionHelper $asset->name = $name; $asset->title = $title; // get the default asset rules - $rules = self::getDefaultAssetRules('com_costbenefitprojection',$table); + $rules = self::getDefaultAssetRules('com_costbenefitprojection', $table, $inherit); if ($rules instanceof JAccessRules) { $asset->rules = (string) $rules; @@ -1850,55 +1856,62 @@ abstract class CostbenefitprojectionHelper } /** - * Gets the default asset Rules for a component/view. + * Gets the default asset Rules for a component/view. */ - protected static function getDefaultAssetRules($component,$view) + protected static function getDefaultAssetRules($component, $view, $inherit = true) { - // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); - $query = $db->getQuery(true) - ->select($db->quoteName('id')) - ->from($db->quoteName('#__assets')) - ->where($db->quoteName('name') . ' = ' . $db->quote($component)); - $db->setQuery($query); - $db->execute(); - if ($db->loadRowList()) + // if new or inherited + $assetId = 0; + // Only get the actual item rules if not inheriting + if (!$inherit) { - // asset alread set so use saved rules - $assetId = (int) $db->loadResult(); - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + // check that there is a value + if ($db->getNumRows()) { - $_result = (string) $result; - $_result = json_decode($_result); - foreach ($_result as $name => &$rule) - { - $v = explode('.', $name); - if ($view !== $v[0]) - { - // remove since it is not part of this view - unset($_result->$name); - } - else - { - // clear the value since we inherit - $rule = array(); - } - } - // check if there are any view values remaining - if (count($_result)) - { - $_result = json_encode($_result); - $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); - - return $rules; - } - return $result; + // asset already set so use saved rules + $assetId = (int) $db->loadResult(); } } - return JAccess::getAssetRules(0); + // get asset rules + $result = JAccess::getAssetRules($assetId); + if ($result instanceof JAccessRules) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($view !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + elseif ($inherit) + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count($_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules($_result); + // return filtered rules + return $rules; + } + } + return $result; } /** @@ -1992,6 +2005,46 @@ abstract class CostbenefitprojectionHelper } } + /** + * get the field object + * + * @param array $attributes The array of attributes + * @param string $default The default of the field + * @param array $options The options to apply to the XML element + * + * @return object + * + */ + public static function getFieldObject(&$attributes, $default = '', $options = null) + { + // make sure we have attributes and a type value + if (self::checkArray($attributes) && isset($attributes['type'])) + { + // make sure the form helper class is loaded + if (!method_exists('JFormHelper', 'loadFieldType')) + { + jimport('joomla.form.form'); + } + // get field type + $field = JFormHelper::loadFieldType($attributes['type'],true); + // start field xml + $XML = new SimpleXMLElement(''); + // load the attributes + self::xmlAddAttributes($XML, $attributes); + // check if we have options + if (self::checkArray($options)) + { + // load the options + self::xmlAddOptions($XML, $options); + } + // setup the field + $field->setup($XML, $default); + // return the field object + return $field; + } + return false; + } + /** * Render Bool Button * @@ -2010,8 +2063,6 @@ abstract class CostbenefitprojectionHelper $args = func_get_args(); // check if there is additional button class $additional = isset($args[1]) ? (string) $args[1] : ''; // not used at this time - // start the xml - $buttonXML = new SimpleXMLElement(''); // button attributes $buttonAttributes = array( 'type' => 'radio', @@ -2020,30 +2071,20 @@ abstract class CostbenefitprojectionHelper 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); - // load the haskey attributes - self::xmlAddAttributes($buttonXML, $buttonAttributes); // set the button options $buttonOptions = array( '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); - // load the button options - self::xmlAddOptions($buttonXML, $buttonOptions); - - // get the radio element - $button = JFormHelper::loadFieldType('radio'); - - // run - $button->setup($buttonXML, $buttonAttributes['default']); - - return $button->input; + // return the input + return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; } /** - * Check if have an json string + * Check if have an json string * - * @input string The json string to check + * @input string The json string to check * - * @returns bool true on success + * @returns bool true on success **/ public static function checkJson($string) { @@ -2056,11 +2097,11 @@ abstract class CostbenefitprojectionHelper } /** - * Check if have an object with a length + * Check if have an object with a length * - * @input object The object to check + * @input object The object to check * - * @returns bool true on success + * @returns bool true on success **/ public static function checkObject($object) { @@ -2072,15 +2113,15 @@ abstract class CostbenefitprojectionHelper } /** - * Check if have an array with a length + * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * - * @returns bool true on success + * @returns bool/int number of items in array on success **/ public static function checkArray($array, $removeEmptyString = false) { - if (isset($array) && is_array($array) && count($array) > 0) + if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0) { // also make sure the empty strings are removed if ($removeEmptyString) @@ -2094,17 +2135,17 @@ abstract class CostbenefitprojectionHelper } return self::checkArray($array, false); } - return true; + return $nr; } return false; } /** - * Check if have a string with a length + * Check if have a string with a length * - * @input string The string to check + * @input string The string to check * - * @returns bool true on success + * @returns bool true on success **/ public static function checkString($string) { @@ -2116,10 +2157,10 @@ abstract class CostbenefitprojectionHelper } /** - * Check if we are connected - * Thanks https://stackoverflow.com/a/4860432/1429677 + * Check if we are connected + * Thanks https://stackoverflow.com/a/4860432/1429677 * - * @returns bool true on success + * @returns bool true on success **/ public static function isConnected() { @@ -2141,11 +2182,11 @@ abstract class CostbenefitprojectionHelper } /** - * Merge an array of array's + * Merge an array of array's * - * @input array The arrays you would like to merge + * @input array The arrays you would like to merge * - * @returns array on success + * @returns array on success **/ public static function mergeArrays($arrays) { @@ -2171,11 +2212,11 @@ abstract class CostbenefitprojectionHelper } /** - * Shorten a string + * Shorten a string * - * @input string The you would like to shorten + * @input string The you would like to shorten * - * @returns string on success + * @returns string on success **/ public static function shorten($string, $length = 40, $addTip = true) { @@ -2183,7 +2224,7 @@ abstract class CostbenefitprojectionHelper { $initial = strlen($string); $words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE); - $words_count = count($words); + $words_count = count((array)$words); $word_length = 0; $last_word = 0; @@ -2212,13 +2253,13 @@ abstract class CostbenefitprojectionHelper } /** - * Making strings safe (various ways) + * Making strings safe (various ways) * - * @input string The you would like to make safe + * @input string The you would like to make safe * - * @returns string on success + * @returns string on success **/ - public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true) + public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) { if ($replaceNumbers === true) { @@ -2247,7 +2288,16 @@ abstract class CostbenefitprojectionHelper $string = trim($string); $string = preg_replace('/'.$spacer.'+/', ' ', $string); $string = preg_replace('/\s+/', ' ', $string); - $string = preg_replace("/[^A-Za-z ]/", '', $string); + // remove all and keep only characters + if ($keepOnlyCharacters) + { + $string = preg_replace("/[^A-Za-z ]/", '', $string); + } + // keep both numbers and characters + else + { + $string = preg_replace("/[^A-Za-z0-9 ]/", '', $string); + } // select final adaptations if ($type === 'L' || $type === 'strtolower') { @@ -2347,11 +2397,11 @@ abstract class CostbenefitprojectionHelper } /** - * Convert an integer into an English word string - * Thanks to Tom Nicholson + * Convert an integer into an English word string + * Thanks to Tom Nicholson * - * @input an int - * @returns a string + * @input an int + * @returns a string **/ public static function numberToString($x) { @@ -2438,9 +2488,9 @@ abstract class CostbenefitprojectionHelper } /** - * Random Key + * Random Key * - * @returns a string + * @returns a string **/ public static function randomkey($size) { @@ -2471,7 +2521,7 @@ abstract class CostbenefitprojectionHelper // WHMCS Encryption Type if ('whmcs' === $type || 'advanced' === $type) { - $key = $params->get('advanced_key', $default); + $key = $params->get('whmcs_key', $default); if (self::checkString($key)) { // load the file diff --git a/admin/helpers/headercheck.php b/admin/helpers/headercheck.php index 3595c86c..f9910117 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage headercheck.php diff --git a/admin/helpers/html/batch_.php b/admin/helpers/html/batch_.php index c8c349fa..528006e4 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage batch_.php diff --git a/admin/helpers/sum.php b/admin/helpers/sum.php index fa6edc1b..149d72c7 100644 --- a/admin/helpers/sum.php +++ b/admin/helpers/sum.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage sum.php diff --git a/admin/helpers/sumcombine.php b/admin/helpers/sumcombine.php index 25dd54fb..bddb7cfb 100644 --- a/admin/helpers/sumcombine.php +++ b/admin/helpers/sumcombine.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage sumcombine.php @@ -103,7 +103,7 @@ class SumCombine if (CostbenefitprojectionHelper::checkArray($namesnot)) { $companiesNamesNot = ''.implode(', ',$namesnot).''; - JError::raiseWarning(500, JText::_('Currency mismatch! These were excluded from results: ').$companiesNamesNot); + JError::raiseWarning(500, JText::_('COM_COSTBENEFITPROJECTION_CURRENCY_MISMATCH_THESE_WERE_EXCLUDED_FROM_RESULTS').$companiesNamesNot); } if (CostbenefitprojectionHelper::checkArray($names)) { diff --git a/admin/language/en-GB/en-GB.com_costbenefitprojection.ini b/admin/language/en-GB/en-GB.com_costbenefitprojection.ini index 33f4e800..356b1548 100644 --- a/admin/language/en-GB/en-GB.com_costbenefitprojection.ini +++ b/admin/language/en-GB/en-GB.com_costbenefitprojection.ini @@ -73,9 +73,9 @@ COM_COSTBENEFITPROJECTION_CAUSESRISKS_BATCH_USE_DESC="Allows users in this group COM_COSTBENEFITPROJECTION_CAUSESRISKS_CREATE="Causesrisks Create" COM_COSTBENEFITPROJECTION_CAUSESRISKS_CREATE_DESC="Allows the users in this group to create create causesrisks" COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_ADD="Causesrisks Dashboard Add" -COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the causerisk" +COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of causerisk" COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_LIST="Causesrisks Dashboard List" -COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the causerisk" +COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of causerisk" COM_COSTBENEFITPROJECTION_CAUSESRISKS_DELETE="Causesrisks Delete" COM_COSTBENEFITPROJECTION_CAUSESRISKS_DELETE_DESC="Allows the users in this group to delete delete causesrisks" COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT="Causesrisks Edit" @@ -108,7 +108,7 @@ COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_UNFEATURED_1="%s Cause/Risk unfeat COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_UNPUBLISHED="%s Causes/Risks unpublished." COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_UNPUBLISHED_1="%s Cause/Risk unpublished." COM_COSTBENEFITPROJECTION_CAUSESRISKS_SUBMENU="Causesrisks Submenu" -COM_COSTBENEFITPROJECTION_CAUSESRISKS_SUBMENU_DESC="Allows the users in this group to update the submenu of the causerisk" +COM_COSTBENEFITPROJECTION_CAUSESRISKS_SUBMENU_DESC="Allows the users in this group to submenu of causerisk" COM_COSTBENEFITPROJECTION_CAUSE_ID="Cause id" COM_COSTBENEFITPROJECTION_CAUSE_NAME="Cause name" COM_COSTBENEFITPROJECTION_CHARTS_MENU="Charts Menu" @@ -123,7 +123,7 @@ COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_ACCESS_SITE_DESC=" Allows the users i COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_COMPANIES_BUTTON_ACCESS="Combined Results Companies Button Access" COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_COMPANIES_BUTTON_ACCESS_DESC=" Allows the users in this group to access the companies button." COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_DASHBOARD_LIST="Combined Results Dashboard List" -COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the Combined Results" +COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Combined Results" COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_OF="Combined results of" COM_COSTBENEFITPROJECTION_COMPANIES="Companies" COM_COSTBENEFITPROJECTION_COMPANIES_ACCESS="Companies Access" @@ -135,41 +135,41 @@ COM_COSTBENEFITPROJECTION_COMPANIES_BATCH_USE_DESC="Allows users in this group t COM_COSTBENEFITPROJECTION_COMPANIES_CREATE="Companies Create" COM_COSTBENEFITPROJECTION_COMPANIES_CREATE_DESC="Allows the users in this group to create create companies" COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_ADD="Companies Dashboard Add" -COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of company" COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_LIST="Companies Dashboard List" -COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of company" COM_COSTBENEFITPROJECTION_COMPANIES_DELETE="Companies Delete" COM_COSTBENEFITPROJECTION_COMPANIES_DELETE_DESC="Allows the users in this group to delete delete companies" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT="Companies Edit" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS="Companies Edit Causesrisks" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS_DESC="Allows the users in this group to update the edit causesrisks of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS_DESC="Allows the users in this group to edit causesrisks of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY="Companies Edit Country" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY_DESC="Allows the users in this group to update the edit country of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY_DESC="Allows the users in this group to edit country of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_BY="Companies Edit Created By" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by companies" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_DATE="Companies Edit Created Date" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created companies" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR="Companies Edit Datayear" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR_DESC="Allows the users in this group to update the edit datayear of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR_DESC="Allows the users in this group to edit datayear of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT="Companies Edit Department" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT_DESC="Allows the users in this group to update the edit department of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT_DESC="Allows the users in this group to edit department of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DESC="Allows the users in this group to edit the company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL="Companies Edit Email" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL_DESC="Allows the users in this group to update the edit email of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL_DESC="Allows the users in this group to edit email of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_OWN="Companies Edit Own" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_OWN_DESC="Allows the users in this group to edit edit own companies created by them" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER="Companies Edit Per" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE="Companies Edit Percentfemale" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE_DESC="Allows the users in this group to update the edit percentfemale of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE_DESC="Allows the users in this group to edit percentfemale of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE="Companies Edit Percentmale" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE_DESC="Allows the users in this group to update the edit percentmale of the company" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER_DESC="Allows the users in this group to update the edit per of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE_DESC="Allows the users in this group to edit percentmale of company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER_DESC="Allows the users in this group to edit per of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICE_PROVIDER="Companies Edit Service Provider" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICE_PROVIDER_DESC="Allows the users in this group to update the edit service provider of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICE_PROVIDER_DESC="Allows the users in this group to edit service provider of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_STATE="Companies Edit State" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_STATE_DESC="Allows the users in this group to update the state of the company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER="Companies Edit User" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER_DESC="Allows the users in this group to update the edit user of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER_DESC="Allows the users in this group to edit user of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_VERSION="Companies Edit Version" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version companies" COM_COSTBENEFITPROJECTION_COMPANIES_EXPORT="Companies Export" @@ -194,7 +194,7 @@ COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_UNFEATURED_1="%s Company unfeatured. COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_UNPUBLISHED="%s Companies unpublished." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_UNPUBLISHED_1="%s Company unpublished." COM_COSTBENEFITPROJECTION_COMPANIES_SUBMENU="Companies Submenu" -COM_COSTBENEFITPROJECTION_COMPANIES_SUBMENU_DESC="Allows the users in this group to update the submenu of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_SUBMENU_DESC="Allows the users in this group to submenu of company" COM_COSTBENEFITPROJECTION_COMPANY="Company" COM_COSTBENEFITPROJECTION_COMPANYRESULTS="Company Results" COM_COSTBENEFITPROJECTION_COMPANYRESULTS_DESC="The company results" @@ -388,7 +388,6 @@ COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_DESC="Select where you want th COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_FRONT="Front-end" COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_LABEL="Show" COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SHOW_NONE="Hide" -COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_SIX="Contributor Six" COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_THREE="Contributor Three" COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_DESC="The job title that best describes the contributor's relationship to this component." COM_COSTBENEFITPROJECTION_CONFIG_CONTRIBUTOR_TITLE_LABEL="Contributor Job Title" @@ -448,9 +447,9 @@ COM_COSTBENEFITPROJECTION_CONFIG_UIKIT_STYLE_LABEL="css Style" COM_COSTBENEFITPROJECTION_CONFIG_VAXISTEXTSTYLEFONTCOLOR_DESC="Select the vertical axis font color." COM_COSTBENEFITPROJECTION_CONFIG_VAXISTEXTSTYLEFONTCOLOR_LABEL="vAxis Font Color" COM_COSTBENEFITPROJECTION_CONFIG_WHMCS_KEY_DESC="Add the key you recieved from Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb here." -COM_COSTBENEFITPROJECTION_CONFIG_WHMCS_KEY_LABEL="WHMCS Key" -COM_COSTBENEFITPROJECTION_CONFIG_WHMCS_KEY_NOTE_DESC="When using this (whmcs) encryption you need to get a key from Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb.
Never change this key once it is set! DATA WILL GET CORRUPTED IF YOU DO!" -COM_COSTBENEFITPROJECTION_CONFIG_WHMCS_KEY_NOTE_LABEL="Field Encryption (whmcs)" +COM_COSTBENEFITPROJECTION_CONFIG_WHMCS_KEY_LABEL="Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb Key" +COM_COSTBENEFITPROJECTION_CONFIG_WHMCS_KEY_NOTE_DESC="You need to get this key from Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb.
When using the Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb field encryption you can never change this key once it is set! DATA WILL GET CORRUPTED IF YOU DO!" +COM_COSTBENEFITPROJECTION_CONFIG_WHMCS_KEY_NOTE_LABEL="Your Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb Field Encryption Key" COM_COSTBENEFITPROJECTION_CONFIG_YES="Yes" COM_COSTBENEFITPROJECTION_CONTRIBUTION_TO_COSTS="Contribution to Costs" COM_COSTBENEFITPROJECTION_CONTRIBUTOR="Contributor" @@ -479,7 +478,7 @@ COM_COSTBENEFITPROJECTION_COUNTRIES_BATCH_USE_DESC="Allows users in this group t COM_COSTBENEFITPROJECTION_COUNTRIES_CREATE="Countries Create" COM_COSTBENEFITPROJECTION_COUNTRIES_CREATE_DESC="Allows the users in this group to create create countries" COM_COSTBENEFITPROJECTION_COUNTRIES_DASHBOARD_LIST="Countries Dashboard List" -COM_COSTBENEFITPROJECTION_COUNTRIES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the country" +COM_COSTBENEFITPROJECTION_COUNTRIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of country" COM_COSTBENEFITPROJECTION_COUNTRIES_DELETE="Countries Delete" COM_COSTBENEFITPROJECTION_COUNTRIES_DELETE_DESC="Allows the users in this group to delete delete countries" COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT="Countries Edit" @@ -512,7 +511,7 @@ COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_UNFEATURED_1="%s Country unfeatured. COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_UNPUBLISHED="%s Countries unpublished." COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_UNPUBLISHED_1="%s Country unpublished." COM_COSTBENEFITPROJECTION_COUNTRIES_SUBMENU="Countries Submenu" -COM_COSTBENEFITPROJECTION_COUNTRIES_SUBMENU_DESC="Allows the users in this group to update the submenu of the country" +COM_COSTBENEFITPROJECTION_COUNTRIES_SUBMENU_DESC="Allows the users in this group to submenu of country" COM_COSTBENEFITPROJECTION_COUNTRY="Country" COM_COSTBENEFITPROJECTION_COUNTRY_AGE_GROUPS_PERCENTAGES="Age Groups Percentages" COM_COSTBENEFITPROJECTION_COUNTRY_AGE_LABEL="Age Group" @@ -694,7 +693,7 @@ COM_COSTBENEFITPROJECTION_CURRENCIES_BATCH_USE_DESC="Allows users in this group COM_COSTBENEFITPROJECTION_CURRENCIES_CREATE="Currencies Create" COM_COSTBENEFITPROJECTION_CURRENCIES_CREATE_DESC="Allows the users in this group to create create currencies" COM_COSTBENEFITPROJECTION_CURRENCIES_DASHBOARD_LIST="Currencies Dashboard List" -COM_COSTBENEFITPROJECTION_CURRENCIES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the currency" +COM_COSTBENEFITPROJECTION_CURRENCIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of currency" COM_COSTBENEFITPROJECTION_CURRENCIES_DELETE="Currencies Delete" COM_COSTBENEFITPROJECTION_CURRENCIES_DELETE_DESC="Allows the users in this group to delete delete currencies" COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT="Currencies Edit" @@ -727,7 +726,7 @@ COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_UNFEATURED_1="%s Currency unfeature COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_UNPUBLISHED="%s Currencies unpublished." COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_UNPUBLISHED_1="%s Currency unpublished." COM_COSTBENEFITPROJECTION_CURRENCIES_SUBMENU="Currencies Submenu" -COM_COSTBENEFITPROJECTION_CURRENCIES_SUBMENU_DESC="Allows the users in this group to update the submenu of the currency" +COM_COSTBENEFITPROJECTION_CURRENCIES_SUBMENU_DESC="Allows the users in this group to submenu of currency" COM_COSTBENEFITPROJECTION_CURRENCY="Currency" COM_COSTBENEFITPROJECTION_CURRENCY_ALIAS="Alias" COM_COSTBENEFITPROJECTION_CURRENCY_ALIAS_HINT="Auto-generated from name" @@ -755,6 +754,7 @@ COM_COSTBENEFITPROJECTION_CURRENCY_DETAILS="Details" COM_COSTBENEFITPROJECTION_CURRENCY_EDIT="Editing the Currency" COM_COSTBENEFITPROJECTION_CURRENCY_ERROR_UNIQUE_ALIAS="Another Currency has the same alias." COM_COSTBENEFITPROJECTION_CURRENCY_ID="Id" +COM_COSTBENEFITPROJECTION_CURRENCY_MISMATCH_THESE_WERE_EXCLUDED_FROM_RESULTS="Currency mismatch! These were excluded from results:" COM_COSTBENEFITPROJECTION_CURRENCY_MODIFIED_BY_DESC="The last user that modified this Currency." COM_COSTBENEFITPROJECTION_CURRENCY_MODIFIED_BY_LABEL="Modified By" COM_COSTBENEFITPROJECTION_CURRENCY_MODIFIED_DATE_DESC="The date this Currency was modified." @@ -897,23 +897,23 @@ COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_BATCH_USE_DESC="Allows users in this COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_CREATE="Health Data Sets Create" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_CREATE_DESC="Allows the users in this group to create create health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DASHBOARD_LIST="Health Data Sets Dashboard List" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DELETE="Health Data Sets Delete" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DELETE_DESC="Allows the users in this group to delete delete health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT="Health Data Sets Edit" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK="Health Data Sets Edit Causerisk" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK_DESC="Allows the users in this group to update the edit causerisk of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK_DESC="Allows the users in this group to edit causerisk of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY="Health Data Sets Edit Country" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY_DESC="Allows the users in this group to update the edit country of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY_DESC="Allows the users in this group to edit country of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_DESC="Allows the users in this group to edit the health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH="Health Data Sets Edit Femaledeath" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH_DESC="Allows the users in this group to update the edit femaledeath of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH_DESC="Allows the users in this group to edit femaledeath of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD="Health Data Sets Edit Femaleyld" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD_DESC="Allows the users in this group to update the edit femaleyld of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD_DESC="Allows the users in this group to edit femaleyld of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH="Health Data Sets Edit Maledeath" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH_DESC="Allows the users in this group to update the edit maledeath of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH_DESC="Allows the users in this group to edit maledeath of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD="Health Data Sets Edit Maleyld" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD_DESC="Allows the users in this group to update the edit maleyld of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD_DESC="Allows the users in this group to edit maleyld of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_OWN="Health Data Sets Edit Own" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_OWN_DESC="Allows the users in this group to edit edit own health data sets created by them" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_STATE="Health Data Sets Edit State" @@ -921,7 +921,7 @@ COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_STATE_DESC="Allows the users in COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_VERSION="Health Data Sets Edit Version" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR="Health Data Sets Edit Year" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR_DESC="Allows the users in this group to update the edit year of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR_DESC="Allows the users in this group to edit year of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EXPORT="Health Data Sets Export" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EXPORT_DESC="Allows the users in this group to export export health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_IMPORT="Health Data Sets Import" @@ -944,7 +944,7 @@ COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_UNFEATURED_1="%s Health Data COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_UNPUBLISHED="%s Health Data Sets unpublished." COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_UNPUBLISHED_1="%s Health Data unpublished." COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_SUBMENU="Health Data Sets Submenu" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_SUBMENU_DESC="Allows the users in this group to update the submenu of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_SUBMENU_DESC="Allows the users in this group to submenu of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SIXTYSIXTY_FOUR="60-64" COM_COSTBENEFITPROJECTION_HEALTH_DATA_STATUS="Status" COM_COSTBENEFITPROJECTION_HEALTH_DATA_THIRTYTHIRTY_FOUR="30-34" @@ -981,7 +981,7 @@ COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_BATCH_USE_DESC="Allows users in this gr COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_CREATE="Help Documents Create" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_CREATE_DESC="Allows the users in this group to create create help documents" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DASHBOARD_LIST="Help Documents Dashboard List" -COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the help document" +COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of help document" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DELETE="Help Documents Delete" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DELETE_DESC="Allows the users in this group to delete delete help documents" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT="Help Documents Edit" @@ -1014,7 +1014,7 @@ COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_UNFEATURED_1="%s Help Document COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_UNPUBLISHED="%s Help Documents unpublished." COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_UNPUBLISHED_1="%s Help Document unpublished." COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_SUBMENU="Help Documents Submenu" -COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_SUBMENU_DESC="Allows the users in this group to update the submenu of the help document" +COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_SUBMENU_DESC="Allows the users in this group to submenu of help document" COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_ADMIN="Admin" COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_ADMIN_VIEW="Admin View" COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_ADMIN_VIEW_DESCRIPTION="Select the view being target." @@ -1136,9 +1136,9 @@ COM_COSTBENEFITPROJECTION_INTERVENTIONS_BATCH_USE_DESC="Allows users in this gro COM_COSTBENEFITPROJECTION_INTERVENTIONS_CREATE="Interventions Create" COM_COSTBENEFITPROJECTION_INTERVENTIONS_CREATE_DESC="Allows the users in this group to create create interventions" COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_ADD="Interventions Dashboard Add" -COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the intervention" +COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of intervention" COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_LIST="Interventions Dashboard List" -COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the intervention" +COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of intervention" COM_COSTBENEFITPROJECTION_INTERVENTIONS_DELETE="Interventions Delete" COM_COSTBENEFITPROJECTION_INTERVENTIONS_DELETE_DESC="Allows the users in this group to delete delete interventions" COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT="Interventions Edit" @@ -1172,7 +1172,7 @@ COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_UNFEATURED_1="%s Intervention un COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_UNPUBLISHED="%s Interventions unpublished." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_UNPUBLISHED_1="%s Intervention unpublished." COM_COSTBENEFITPROJECTION_INTERVENTIONS_SUBMENU="Interventions Submenu" -COM_COSTBENEFITPROJECTION_INTERVENTIONS_SUBMENU_DESC="Allows the users in this group to update the submenu of the intervention" +COM_COSTBENEFITPROJECTION_INTERVENTIONS_SUBMENU_DESC="Allows the users in this group to submenu of intervention" COM_COSTBENEFITPROJECTION_INTERVENTION_ALL_SERVICE_PROVIDERS_AND_ADMIN="All Service Providers and Admin" COM_COSTBENEFITPROJECTION_INTERVENTION_CAUSERISK="Causerisk" COM_COSTBENEFITPROJECTION_INTERVENTION_CAUSERISK_LABEL="Cause/Risk" @@ -1302,9 +1302,9 @@ COM_COSTBENEFITPROJECTION_SCALING_FACTORS_BATCH_USE_DESC="Allows users in this g COM_COSTBENEFITPROJECTION_SCALING_FACTORS_CREATE="Scaling Factors Create" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_CREATE_DESC="Allows the users in this group to create create scaling factors" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_ADD="Scaling Factors Dashboard Add" -COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the scaling factor" +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of scaling factor" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_LIST="Scaling Factors Dashboard List" -COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the scaling factor" +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of scaling factor" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DELETE="Scaling Factors Delete" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DELETE_DESC="Allows the users in this group to delete delete scaling factors" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT="Scaling Factors Edit" @@ -1337,7 +1337,7 @@ COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_UNFEATURED_1="%s Scaling Facto COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_UNPUBLISHED="%s Scaling Factors unpublished." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_UNPUBLISHED_1="%s Scaling Factor unpublished." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_SUBMENU="Scaling Factors Submenu" -COM_COSTBENEFITPROJECTION_SCALING_FACTORS_SUBMENU_DESC="Allows the users in this group to update the submenu of the scaling factor" +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_SUBMENU_DESC="Allows the users in this group to submenu of scaling factor" COM_COSTBENEFITPROJECTION_SCALING_FACTOR_CAUSERISK="Causerisk" COM_COSTBENEFITPROJECTION_SCALING_FACTOR_CAUSERISK_LABEL="Cause/Risk" COM_COSTBENEFITPROJECTION_SCALING_FACTOR_COMPANY="Company" @@ -1415,9 +1415,9 @@ COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_BATCH_USE_DESC="Allows users in this COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_CREATE="Service Providers Create" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_CREATE_DESC="Allows the users in this group to create create service providers" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_ADD="Service Providers Dashboard Add" -COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the service provider" +COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of service provider" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_LIST="Service Providers Dashboard List" -COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the service provider" +COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of service provider" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DELETE="Service Providers Delete" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DELETE_DESC="Allows the users in this group to delete delete service providers" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT="Service Providers Edit" @@ -1450,7 +1450,7 @@ COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_UNFEATURED_1="%s Service Pro COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_UNPUBLISHED="%s Service Providers unpublished." COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_UNPUBLISHED_1="%s Service Provider unpublished." COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_SUBMENU="Service Providers Submenu" -COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_SUBMENU_DESC="Allows the users in this group to update the submenu of the service provider" +COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_SUBMENU_DESC="Allows the users in this group to submenu of service provider" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDER_COMPANIES="Companies" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDER_COUNTRY="Country" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDER_COUNTRY_DESCRIPTION="List of available countries" diff --git a/admin/language/en-GB/en-GB.com_costbenefitprojection.sys.ini b/admin/language/en-GB/en-GB.com_costbenefitprojection.sys.ini index 84071f77..e48d3c8a 100644 --- a/admin/language/en-GB/en-GB.com_costbenefitprojection.sys.ini +++ b/admin/language/en-GB/en-GB.com_costbenefitprojection.sys.ini @@ -6,9 +6,9 @@ COM_COSTBENEFITPROJECTION_CAUSESRISKS_BATCH_USE_DESC="Allows users in this group COM_COSTBENEFITPROJECTION_CAUSESRISKS_CREATE="Causesrisks Create" COM_COSTBENEFITPROJECTION_CAUSESRISKS_CREATE_DESC="Allows the users in this group to create create causesrisks" COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_ADD="Causesrisks Dashboard Add" -COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the causerisk" +COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of causerisk" COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_LIST="Causesrisks Dashboard List" -COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the causerisk" +COM_COSTBENEFITPROJECTION_CAUSESRISKS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of causerisk" COM_COSTBENEFITPROJECTION_CAUSESRISKS_DELETE="Causesrisks Delete" COM_COSTBENEFITPROJECTION_CAUSESRISKS_DELETE_DESC="Allows the users in this group to delete delete causesrisks" COM_COSTBENEFITPROJECTION_CAUSESRISKS_EDIT="Causesrisks Edit" @@ -24,7 +24,7 @@ COM_COSTBENEFITPROJECTION_CAUSESRISKS_EXPORT_DESC="Allows the users in this grou COM_COSTBENEFITPROJECTION_CAUSESRISKS_IMPORT="Causesrisks Import" COM_COSTBENEFITPROJECTION_CAUSESRISKS_IMPORT_DESC="Allows the users in this group to import import causesrisks" COM_COSTBENEFITPROJECTION_CAUSESRISKS_SUBMENU="Causesrisks Submenu" -COM_COSTBENEFITPROJECTION_CAUSESRISKS_SUBMENU_DESC="Allows the users in this group to update the submenu of the causerisk" +COM_COSTBENEFITPROJECTION_CAUSESRISKS_SUBMENU_DESC="Allows the users in this group to submenu of causerisk" COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_ACCESS="Combined Results Access" COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_ACCESS_DESC="Allows the users in this group to access Combined Results" COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_ACCESS_SITE="Combined Results (Site) Access" @@ -32,7 +32,7 @@ COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_ACCESS_SITE_DESC=" Allows the users i COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_COMPANIES_BUTTON_ACCESS="Combined Results Companies Button Access" COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_COMPANIES_BUTTON_ACCESS_DESC=" Allows the users in this group to access the companies button." COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_DASHBOARD_LIST="Combined Results Dashboard List" -COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the Combined Results" +COM_COSTBENEFITPROJECTION_COMBINED_RESULTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of Combined Results" COM_COSTBENEFITPROJECTION_COMPANIES_ACCESS="Companies Access" COM_COSTBENEFITPROJECTION_COMPANIES_ACCESS_DESC="Allows the users in this group to access access companies" COM_COSTBENEFITPROJECTION_COMPANIES_BATCH_USE="Companies Batch Use" @@ -40,41 +40,41 @@ COM_COSTBENEFITPROJECTION_COMPANIES_BATCH_USE_DESC="Allows users in this group t COM_COSTBENEFITPROJECTION_COMPANIES_CREATE="Companies Create" COM_COSTBENEFITPROJECTION_COMPANIES_CREATE_DESC="Allows the users in this group to create create companies" COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_ADD="Companies Dashboard Add" -COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of company" COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_LIST="Companies Dashboard List" -COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of company" COM_COSTBENEFITPROJECTION_COMPANIES_DELETE="Companies Delete" COM_COSTBENEFITPROJECTION_COMPANIES_DELETE_DESC="Allows the users in this group to delete delete companies" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT="Companies Edit" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS="Companies Edit Causesrisks" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS_DESC="Allows the users in this group to update the edit causesrisks of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CAUSESRISKS_DESC="Allows the users in this group to edit causesrisks of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY="Companies Edit Country" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY_DESC="Allows the users in this group to update the edit country of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_COUNTRY_DESC="Allows the users in this group to edit country of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_BY="Companies Edit Created By" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by companies" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_DATE="Companies Edit Created Date" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created companies" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR="Companies Edit Datayear" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR_DESC="Allows the users in this group to update the edit datayear of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DATAYEAR_DESC="Allows the users in this group to edit datayear of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT="Companies Edit Department" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT_DESC="Allows the users in this group to update the edit department of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DEPARTMENT_DESC="Allows the users in this group to edit department of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_DESC="Allows the users in this group to edit the company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL="Companies Edit Email" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL_DESC="Allows the users in this group to update the edit email of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_EMAIL_DESC="Allows the users in this group to edit email of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_OWN="Companies Edit Own" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_OWN_DESC="Allows the users in this group to edit edit own companies created by them" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER="Companies Edit Per" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE="Companies Edit Percentfemale" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE_DESC="Allows the users in this group to update the edit percentfemale of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTFEMALE_DESC="Allows the users in this group to edit percentfemale of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE="Companies Edit Percentmale" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE_DESC="Allows the users in this group to update the edit percentmale of the company" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER_DESC="Allows the users in this group to update the edit per of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PERCENTMALE_DESC="Allows the users in this group to edit percentmale of company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_PER_DESC="Allows the users in this group to edit per of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICE_PROVIDER="Companies Edit Service Provider" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICE_PROVIDER_DESC="Allows the users in this group to update the edit service provider of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_SERVICE_PROVIDER_DESC="Allows the users in this group to edit service provider of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_STATE="Companies Edit State" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_STATE_DESC="Allows the users in this group to update the state of the company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER="Companies Edit User" -COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER_DESC="Allows the users in this group to update the edit user of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_USER_DESC="Allows the users in this group to edit user of company" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_VERSION="Companies Edit Version" COM_COSTBENEFITPROJECTION_COMPANIES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version companies" COM_COSTBENEFITPROJECTION_COMPANIES_EXPORT="Companies Export" @@ -82,7 +82,7 @@ COM_COSTBENEFITPROJECTION_COMPANIES_EXPORT_DESC="Allows the users in this group COM_COSTBENEFITPROJECTION_COMPANIES_IMPORT="Companies Import" COM_COSTBENEFITPROJECTION_COMPANIES_IMPORT_DESC="Allows the users in this group to import import companies" COM_COSTBENEFITPROJECTION_COMPANIES_SUBMENU="Companies Submenu" -COM_COSTBENEFITPROJECTION_COMPANIES_SUBMENU_DESC="Allows the users in this group to update the submenu of the company" +COM_COSTBENEFITPROJECTION_COMPANIES_SUBMENU_DESC="Allows the users in this group to submenu of company" COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_ACCESS="Company Results Access" COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_ACCESS_DESC="Allows the users in this group to access Company Results" COM_COSTBENEFITPROJECTION_COMPANY_RESULTS_ACCESS_SITE="Company results (Site) Access" @@ -99,7 +99,7 @@ COM_COSTBENEFITPROJECTION_COUNTRIES_BATCH_USE_DESC="Allows users in this group t COM_COSTBENEFITPROJECTION_COUNTRIES_CREATE="Countries Create" COM_COSTBENEFITPROJECTION_COUNTRIES_CREATE_DESC="Allows the users in this group to create create countries" COM_COSTBENEFITPROJECTION_COUNTRIES_DASHBOARD_LIST="Countries Dashboard List" -COM_COSTBENEFITPROJECTION_COUNTRIES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the country" +COM_COSTBENEFITPROJECTION_COUNTRIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of country" COM_COSTBENEFITPROJECTION_COUNTRIES_DELETE="Countries Delete" COM_COSTBENEFITPROJECTION_COUNTRIES_DELETE_DESC="Allows the users in this group to delete delete countries" COM_COSTBENEFITPROJECTION_COUNTRIES_EDIT="Countries Edit" @@ -115,7 +115,7 @@ COM_COSTBENEFITPROJECTION_COUNTRIES_EXPORT_DESC="Allows the users in this group COM_COSTBENEFITPROJECTION_COUNTRIES_IMPORT="Countries Import" COM_COSTBENEFITPROJECTION_COUNTRIES_IMPORT_DESC="Allows the users in this group to import import countries" COM_COSTBENEFITPROJECTION_COUNTRIES_SUBMENU="Countries Submenu" -COM_COSTBENEFITPROJECTION_COUNTRIES_SUBMENU_DESC="Allows the users in this group to update the submenu of the country" +COM_COSTBENEFITPROJECTION_COUNTRIES_SUBMENU_DESC="Allows the users in this group to submenu of country" COM_COSTBENEFITPROJECTION_CPANEL_ACCESS_SITE="cPanel (Site) Access" COM_COSTBENEFITPROJECTION_CPANEL_ACCESS_SITE_DESC=" Allows the users in this group to access site cpanel." COM_COSTBENEFITPROJECTION_CREATE_ACCOUNT_GIZ_ACCESS_SITE="Create Account (giz) (Site) Access" @@ -127,7 +127,7 @@ COM_COSTBENEFITPROJECTION_CURRENCIES_BATCH_USE_DESC="Allows users in this group COM_COSTBENEFITPROJECTION_CURRENCIES_CREATE="Currencies Create" COM_COSTBENEFITPROJECTION_CURRENCIES_CREATE_DESC="Allows the users in this group to create create currencies" COM_COSTBENEFITPROJECTION_CURRENCIES_DASHBOARD_LIST="Currencies Dashboard List" -COM_COSTBENEFITPROJECTION_CURRENCIES_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the currency" +COM_COSTBENEFITPROJECTION_CURRENCIES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of currency" COM_COSTBENEFITPROJECTION_CURRENCIES_DELETE="Currencies Delete" COM_COSTBENEFITPROJECTION_CURRENCIES_DELETE_DESC="Allows the users in this group to delete delete currencies" COM_COSTBENEFITPROJECTION_CURRENCIES_EDIT="Currencies Edit" @@ -143,7 +143,7 @@ COM_COSTBENEFITPROJECTION_CURRENCIES_EXPORT_DESC="Allows the users in this group COM_COSTBENEFITPROJECTION_CURRENCIES_IMPORT="Currencies Import" COM_COSTBENEFITPROJECTION_CURRENCIES_IMPORT_DESC="Allows the users in this group to import import currencies" COM_COSTBENEFITPROJECTION_CURRENCIES_SUBMENU="Currencies Submenu" -COM_COSTBENEFITPROJECTION_CURRENCIES_SUBMENU_DESC="Allows the users in this group to update the submenu of the currency" +COM_COSTBENEFITPROJECTION_CURRENCIES_SUBMENU_DESC="Allows the users in this group to submenu of currency" COM_COSTBENEFITPROJECTION_EDIT_CREATED_BY="Edit Created By" COM_COSTBENEFITPROJECTION_EDIT_CREATED_BY_DESC=" Allows users in this group to edit created by." COM_COSTBENEFITPROJECTION_EDIT_CREATED_DATE="Edit Created Date" @@ -159,23 +159,23 @@ COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_BATCH_USE_DESC="Allows users in this COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_CREATE="Health Data Sets Create" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_CREATE_DESC="Allows the users in this group to create create health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DASHBOARD_LIST="Health Data Sets Dashboard List" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DELETE="Health Data Sets Delete" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_DELETE_DESC="Allows the users in this group to delete delete health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT="Health Data Sets Edit" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK="Health Data Sets Edit Causerisk" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK_DESC="Allows the users in this group to update the edit causerisk of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_CAUSERISK_DESC="Allows the users in this group to edit causerisk of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY="Health Data Sets Edit Country" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY_DESC="Allows the users in this group to update the edit country of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_COUNTRY_DESC="Allows the users in this group to edit country of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_DESC="Allows the users in this group to edit the health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH="Health Data Sets Edit Femaledeath" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH_DESC="Allows the users in this group to update the edit femaledeath of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEDEATH_DESC="Allows the users in this group to edit femaledeath of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD="Health Data Sets Edit Femaleyld" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD_DESC="Allows the users in this group to update the edit femaleyld of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_FEMALEYLD_DESC="Allows the users in this group to edit femaleyld of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH="Health Data Sets Edit Maledeath" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH_DESC="Allows the users in this group to update the edit maledeath of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEDEATH_DESC="Allows the users in this group to edit maledeath of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD="Health Data Sets Edit Maleyld" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD_DESC="Allows the users in this group to update the edit maleyld of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_MALEYLD_DESC="Allows the users in this group to edit maleyld of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_OWN="Health Data Sets Edit Own" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_OWN_DESC="Allows the users in this group to edit edit own health data sets created by them" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_STATE="Health Data Sets Edit State" @@ -183,13 +183,13 @@ COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_STATE_DESC="Allows the users in COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_VERSION="Health Data Sets Edit Version" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR="Health Data Sets Edit Year" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR_DESC="Allows the users in this group to update the edit year of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EDIT_YEAR_DESC="Allows the users in this group to edit year of health data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EXPORT="Health Data Sets Export" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_EXPORT_DESC="Allows the users in this group to export export health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_IMPORT="Health Data Sets Import" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_IMPORT_DESC="Allows the users in this group to import import health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_SUBMENU="Health Data Sets Submenu" -COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_SUBMENU_DESC="Allows the users in this group to update the submenu of the health data" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_SUBMENU_DESC="Allows the users in this group to submenu of health data" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_ACCESS="Help Documents Access" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_ACCESS_DESC="Allows the users in this group to access access help documents" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_BATCH_USE="Help Documents Batch Use" @@ -197,7 +197,7 @@ COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_BATCH_USE_DESC="Allows users in this gr COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_CREATE="Help Documents Create" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_CREATE_DESC="Allows the users in this group to create create help documents" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DASHBOARD_LIST="Help Documents Dashboard List" -COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the help document" +COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of help document" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DELETE="Help Documents Delete" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_DELETE_DESC="Allows the users in this group to delete delete help documents" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EDIT="Help Documents Edit" @@ -213,7 +213,7 @@ COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_EXPORT_DESC="Allows the users in this g COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_IMPORT="Help Documents Import" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_IMPORT_DESC="Allows the users in this group to import import help documents" COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_SUBMENU="Help Documents Submenu" -COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_SUBMENU_DESC="Allows the users in this group to update the submenu of the help document" +COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_SUBMENU_DESC="Allows the users in this group to submenu of help document" COM_COSTBENEFITPROJECTION_IMPORT_DATA="Import Data" COM_COSTBENEFITPROJECTION_IMPORT_DATA_DESC=" Allows users in this group to import data." COM_COSTBENEFITPROJECTION_INTERVENTIONS_ACCESS="Interventions Access" @@ -223,9 +223,9 @@ COM_COSTBENEFITPROJECTION_INTERVENTIONS_BATCH_USE_DESC="Allows users in this gro COM_COSTBENEFITPROJECTION_INTERVENTIONS_CREATE="Interventions Create" COM_COSTBENEFITPROJECTION_INTERVENTIONS_CREATE_DESC="Allows the users in this group to create create interventions" COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_ADD="Interventions Dashboard Add" -COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the intervention" +COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of intervention" COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_LIST="Interventions Dashboard List" -COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the intervention" +COM_COSTBENEFITPROJECTION_INTERVENTIONS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of intervention" COM_COSTBENEFITPROJECTION_INTERVENTIONS_DELETE="Interventions Delete" COM_COSTBENEFITPROJECTION_INTERVENTIONS_DELETE_DESC="Allows the users in this group to delete delete interventions" COM_COSTBENEFITPROJECTION_INTERVENTIONS_EDIT="Interventions Edit" @@ -241,7 +241,7 @@ COM_COSTBENEFITPROJECTION_INTERVENTIONS_EXPORT_DESC="Allows the users in this gr COM_COSTBENEFITPROJECTION_INTERVENTIONS_IMPORT="Interventions Import" COM_COSTBENEFITPROJECTION_INTERVENTIONS_IMPORT_DESC="Allows the users in this group to import import interventions" COM_COSTBENEFITPROJECTION_INTERVENTIONS_SUBMENU="Interventions Submenu" -COM_COSTBENEFITPROJECTION_INTERVENTIONS_SUBMENU_DESC="Allows the users in this group to update the submenu of the intervention" +COM_COSTBENEFITPROJECTION_INTERVENTIONS_SUBMENU_DESC="Allows the users in this group to submenu of intervention" COM_COSTBENEFITPROJECTION_MENU="» Cost Benefit Projection" COM_COSTBENEFITPROJECTION_MENU_COMPANIES="Companies" COM_COSTBENEFITPROJECTION_MENU_CPANEL_DESC="The cpanel fo the front end" @@ -260,9 +260,9 @@ COM_COSTBENEFITPROJECTION_SCALING_FACTORS_BATCH_USE_DESC="Allows users in this g COM_COSTBENEFITPROJECTION_SCALING_FACTORS_CREATE="Scaling Factors Create" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_CREATE_DESC="Allows the users in this group to create create scaling factors" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_ADD="Scaling Factors Dashboard Add" -COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the scaling factor" +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of scaling factor" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_LIST="Scaling Factors Dashboard List" -COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the scaling factor" +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of scaling factor" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DELETE="Scaling Factors Delete" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_DELETE_DESC="Allows the users in this group to delete delete scaling factors" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EDIT="Scaling Factors Edit" @@ -278,7 +278,7 @@ COM_COSTBENEFITPROJECTION_SCALING_FACTORS_EXPORT_DESC="Allows the users in this COM_COSTBENEFITPROJECTION_SCALING_FACTORS_IMPORT="Scaling Factors Import" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_IMPORT_DESC="Allows the users in this group to import import scaling factors" COM_COSTBENEFITPROJECTION_SCALING_FACTORS_SUBMENU="Scaling Factors Submenu" -COM_COSTBENEFITPROJECTION_SCALING_FACTORS_SUBMENU_DESC="Allows the users in this group to update the submenu of the scaling factor" +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_SUBMENU_DESC="Allows the users in this group to submenu of scaling factor" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_ACCESS="Service Providers Access" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_ACCESS_DESC="Allows the users in this group to access access service providers" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_BATCH_USE="Service Providers Batch Use" @@ -286,9 +286,9 @@ COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_BATCH_USE_DESC="Allows users in this COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_CREATE="Service Providers Create" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_CREATE_DESC="Allows the users in this group to create create service providers" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_ADD="Service Providers Dashboard Add" -COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_ADD_DESC="Allows the users in this group to update the dashboard add of the service provider" +COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of service provider" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_LIST="Service Providers Dashboard List" -COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the service provider" +COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of service provider" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DELETE="Service Providers Delete" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_DELETE_DESC="Allows the users in this group to delete delete service providers" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EDIT="Service Providers Edit" @@ -304,6 +304,6 @@ COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_EXPORT_DESC="Allows the users in thi COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_IMPORT="Service Providers Import" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_IMPORT_DESC="Allows the users in this group to import import service providers" COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_SUBMENU="Service Providers Submenu" -COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_SUBMENU_DESC="Allows the users in this group to update the submenu of the service provider" +COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_SUBMENU_DESC="Allows the users in this group to submenu of service provider" COM_COSTBENEFITPROJECTION_USE_BATCH="Use Batch" COM_COSTBENEFITPROJECTION_USE_BATCH_DESC=" Allows users in this group to use batch copy/update method." \ No newline at end of file diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 8c350847..1d2c4109 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage batchselection.php @@ -21,8 +21,8 @@ defined('JPATH_BASE') or die; JHtmlBehavior::core(); -$divWrapper = range(1,120,2); -$counter = 0; +$divWrapper = range(1,120,2); +$counter = 0; ?> ListSelection) : ?>
diff --git a/admin/layouts/causerisk/details_above.php b/admin/layouts/causerisk/details_above.php index 3e8009bb..a6a03c39 100644 --- a/admin/layouts/causerisk/details_above.php +++ b/admin/layouts/causerisk/details_above.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php @@ -18,20 +18,24 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'name', 'ref', 'alias' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/causerisk/details_fullwidth.php b/admin/layouts/causerisk/details_fullwidth.php index ef37d3f2..3608db06 100644 --- a/admin/layouts/causerisk/details_fullwidth.php +++ b/admin/layouts/causerisk/details_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_fullwidth.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -27,16 +26,14 @@ $fields = $displayData->get('fields') ?: array( 'description' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/causerisk/details_left.php b/admin/layouts/causerisk/details_left.php index d402df48..5941098e 100644 --- a/admin/layouts/causerisk/details_left.php +++ b/admin/layouts/causerisk/details_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -29,20 +28,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/causerisk/details_right.php b/admin/layouts/causerisk/details_right.php index d9cb4b51..9cc3a3a8 100644 --- a/admin/layouts/causerisk/details_right.php +++ b/admin/layouts/causerisk/details_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -29,20 +28,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/causerisk/publishing.php b/admin/layouts/causerisk/publishing.php index 380c63d0..7b73f26f 100644 --- a/admin/layouts/causerisk/publishing.php +++ b/admin/layouts/causerisk/publishing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -33,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/causerisk/publlshing.php b/admin/layouts/causerisk/publlshing.php index 82a90399..2b11bb1c 100644 --- a/admin/layouts/causerisk/publlshing.php +++ b/admin/layouts/causerisk/publlshing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -35,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/company/age_groups_percentages_fullwidth.php b/admin/layouts/company/age_groups_percentages_fullwidth.php index 61767c4c..745015eb 100644 --- a/admin/layouts/company/age_groups_percentages_fullwidth.php +++ b/admin/layouts/company/age_groups_percentages_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_fullwidth.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -27,16 +26,14 @@ $fields = $displayData->get('fields') ?: array( 'age_groups_note' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/company/age_groups_percentages_left.php b/admin/layouts/company/age_groups_percentages_left.php index 8309dd33..c9c052a7 100644 --- a/admin/layouts/company/age_groups_percentages_left.php +++ b/admin/layouts/company/age_groups_percentages_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -29,20 +28,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/company/age_groups_percentages_right.php b/admin/layouts/company/age_groups_percentages_right.php index 484641b9..67714757 100644 --- a/admin/layouts/company/age_groups_percentages_right.php +++ b/admin/layouts/company/age_groups_percentages_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -29,20 +28,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/company/causerisk_selection_fullwidth.php b/admin/layouts/company/causerisk_selection_fullwidth.php index 68d41aaf..e97f28af 100644 --- a/admin/layouts/company/causerisk_selection_fullwidth.php +++ b/admin/layouts/company/causerisk_selection_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk_selection_fullwidth.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -28,16 +27,14 @@ $fields = $displayData->get('fields') ?: array( 'cause_risk_selection_note' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/company/details_above.php b/admin/layouts/company/details_above.php index 6341f3b2..eb1c9eac 100644 --- a/admin/layouts/company/details_above.php +++ b/admin/layouts/company/details_above.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php @@ -18,20 +18,24 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'name', 'user', 'department' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/company/details_left.php b/admin/layouts/company/details_left.php index 2e1a0c05..33b74802 100644 --- a/admin/layouts/company/details_left.php +++ b/admin/layouts/company/details_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -33,20 +32,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/company/details_right.php b/admin/layouts/company/details_right.php index 0b1bdc8f..4400376b 100644 --- a/admin/layouts/company/details_right.php +++ b/admin/layouts/company/details_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -39,20 +38,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/company/details_under.php b/admin/layouts/company/details_under.php index 1ad77bf6..ea66e577 100644 --- a/admin/layouts/company/details_under.php +++ b/admin/layouts/company/details_under.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_under.php @@ -18,18 +18,22 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'not_required' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/company/interventions_fullwidth.php b/admin/layouts/company/interventions_fullwidth.php index 91f6e10f..5047dd95 100644 --- a/admin/layouts/company/interventions_fullwidth.php +++ b/admin/layouts/company/interventions_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions_fullwidth.php @@ -18,16 +18,35 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vwdinterventions; -$user = JFactory::getUser(); -$id = $displayData->item->id; +$items = $displayData->vwdinterventions; +$user = JFactory::getUser(); +$id = $displayData->item->id; +// set the edit URL $edit = "index.php?option=com_costbenefitprojection&view=interventions&task=intervention.edit"; -$ref = ($id) ? "&ref=company&refid=".$id : ""; -$new = "index.php?option=com_costbenefitprojection&view=intervention&layout=edit".$ref; +// set a return value +$return = ($id) ? "index.php?option=com_costbenefitprojection&view=company&layout=edit&id=" . $id : ""; +// check for a return value +$jinput = JFactory::getApplication()->input; +if ($_return = $jinput->get('return', null, 'base64')) +{ + $return .= "&return=" . $_return; +} +// check if return value was set +if (CostbenefitprojectionHelper::checkString($return)) +{ + // set the referral values + $ref = ($id) ? "&ref=company&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); +} +else +{ + $ref = ($id) ? "&ref=company&refid=" . $id : ""; +} +// set the create new URL +$new = "index.php?option=com_costbenefitprojection&view=interventions&task=intervention.edit" . $ref; +// load the action object $can = CostbenefitprojectionHelper::getActions('intervention'); ?> @@ -73,14 +92,14 @@ $can = CostbenefitprojectionHelper::getActions('intervention'); $canDo = CostbenefitprojectionHelper::getActions('intervention',$item,'interventions'); ?> - + get('intervention.edit')): ?> - escape($item->name); ?> - checked_out): ?> - name, $item->checked_out_time, 'interventions.', $canCheckin); ?> - + escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'interventions.', $canCheckin); ?> + -
escape($item->name); ?>
+ escape($item->name); ?> diff --git a/admin/layouts/company/publishing.php b/admin/layouts/company/publishing.php index 380c63d0..7b73f26f 100644 --- a/admin/layouts/company/publishing.php +++ b/admin/layouts/company/publishing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -33,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/company/publlshing.php b/admin/layouts/company/publlshing.php index 82a90399..2b11bb1c 100644 --- a/admin/layouts/company/publlshing.php +++ b/admin/layouts/company/publlshing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -35,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/company/scaling_factors_fullwidth.php b/admin/layouts/company/scaling_factors_fullwidth.php index 31d0c6a5..14b93c94 100644 --- a/admin/layouts/company/scaling_factors_fullwidth.php +++ b/admin/layouts/company/scaling_factors_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factors_fullwidth.php @@ -18,14 +18,32 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vwcscaling_factors; -$user = JFactory::getUser(); -$id = $displayData->item->id; -$edit = "index.php?option=com_costbenefitprojection&view=scaling_factors&task=scaling_factor.edit"; +$items = $displayData->vwcscaling_factors; +$user = JFactory::getUser(); +$id = $displayData->item->id; +// set the edit URL +$edit = "index.php?option=com_costbenefitprojection&view=scaling_factors&task=scaling_factor.edit"; +// set a return value +$return = ($id) ? "index.php?option=com_costbenefitprojection&view=company&layout=edit&id=" . $id : ""; +// check for a return value +$jinput = JFactory::getApplication()->input; +if ($_return = $jinput->get('return', null, 'base64')) +{ + $return .= "&return=" . $_return; +} +// check if return value was set +if (CostbenefitprojectionHelper::checkString($return)) +{ + // set the referral values + $ref = ($id) ? "&ref=company&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); +} +else +{ + $ref = ($id) ? "&ref=company&refid=" . $id : ""; +} ?>
@@ -73,14 +91,14 @@ $edit = "index.php?option=com_costbenefitprojection&view=scaling_factors&task=sc $canDo = CostbenefitprojectionHelper::getActions('scaling_factor',$item,'scaling_factors'); ?> - + get('scaling_factor.edit')): ?> - escape($item->causerisk_name); ?> - checked_out): ?> - name, $item->checked_out_time, 'scaling_factors.', $canCheckin); ?> - + escape($item->causerisk_name); ?> + checked_out): ?> + name, $item->checked_out_time, 'scaling_factors.', $canCheckin); ?> + -
escape($item->causerisk_name); ?>
+ escape($item->causerisk_name); ?> diff --git a/admin/layouts/country/age_groups_percentages_left.php b/admin/layouts/country/age_groups_percentages_left.php index 8309dd33..c9c052a7 100644 --- a/admin/layouts/country/age_groups_percentages_left.php +++ b/admin/layouts/country/age_groups_percentages_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -29,20 +28,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/country/age_groups_percentages_right.php b/admin/layouts/country/age_groups_percentages_right.php index 484641b9..67714757 100644 --- a/admin/layouts/country/age_groups_percentages_right.php +++ b/admin/layouts/country/age_groups_percentages_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -29,20 +28,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/country/causerisk_selection_fullwidth.php b/admin/layouts/country/causerisk_selection_fullwidth.php index 83e530f7..e5021a96 100644 --- a/admin/layouts/country/causerisk_selection_fullwidth.php +++ b/admin/layouts/country/causerisk_selection_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk_selection_fullwidth.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -27,16 +26,14 @@ $fields = $displayData->get('fields') ?: array( 'causesrisks' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/country/companies_fullwidth.php b/admin/layouts/country/companies_fullwidth.php index 159feaea..cd5728d0 100644 --- a/admin/layouts/country/companies_fullwidth.php +++ b/admin/layouts/country/companies_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies_fullwidth.php @@ -18,16 +18,35 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vwhcompanies; -$user = JFactory::getUser(); -$id = $displayData->item->id; +$items = $displayData->vwhcompanies; +$user = JFactory::getUser(); +$id = $displayData->item->id; +// set the edit URL $edit = "index.php?option=com_costbenefitprojection&view=companies&task=company.edit"; -$ref = ($id) ? "&ref=country&refid=".$id : ""; -$new = "index.php?option=com_costbenefitprojection&view=company&layout=edit".$ref; +// set a return value +$return = ($id) ? "index.php?option=com_costbenefitprojection&view=country&layout=edit&id=" . $id : ""; +// check for a return value +$jinput = JFactory::getApplication()->input; +if ($_return = $jinput->get('return', null, 'base64')) +{ + $return .= "&return=" . $_return; +} +// check if return value was set +if (CostbenefitprojectionHelper::checkString($return)) +{ + // set the referral values + $ref = ($id) ? "&ref=country&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); +} +else +{ + $ref = ($id) ? "&ref=country&refid=" . $id : ""; +} +// set the create new URL +$new = "index.php?option=com_costbenefitprojection&view=companies&task=company.edit" . $ref; +// load the action object $can = CostbenefitprojectionHelper::getActions('company'); ?> @@ -73,29 +92,28 @@ $can = CostbenefitprojectionHelper::getActions('company'); $canDo = CostbenefitprojectionHelper::getActions('company',$item,'companies'); ?> - + get('company.edit')): ?> - escape($item->name); ?> - checked_out): ?> - name, $item->checked_out_time, 'companies.', $canCheckin); ?> - + escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'companies.', $canCheckin); ?> + -
escape($item->name); ?>
+ escape($item->name); ?>
get('companyresults.access')): ?> - +
- user); ?> - + authorise('core.edit', 'com_users')): ?> - name; ?> + user)->name; ?> - name; ?> + user)->name; ?> @@ -104,11 +122,11 @@ $can = CostbenefitprojectionHelper::getActions('company'); escape($item->country_name); ?> - + authorise('service_provider.edit', 'com_costbenefitprojection.service_provider.' . (int)$item->service_provider)): ?> - service_provider_user)->name; ?> + service_provider_user)->name; ?> -
service_provider_user)->name; ?>
+ service_provider_user)->name; ?> diff --git a/admin/layouts/country/details_above.php b/admin/layouts/country/details_above.php index 0c908e38..31492d90 100644 --- a/admin/layouts/country/details_above.php +++ b/admin/layouts/country/details_above.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php @@ -18,20 +18,24 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'name', 'alias', 'user' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/country/details_left.php b/admin/layouts/country/details_left.php index 5d9decf2..de03123a 100644 --- a/admin/layouts/country/details_left.php +++ b/admin/layouts/country/details_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -33,20 +32,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/country/details_right.php b/admin/layouts/country/details_right.php index 771ac275..fefa4ede 100644 --- a/admin/layouts/country/details_right.php +++ b/admin/layouts/country/details_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -34,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/country/health_data_totals_left.php b/admin/layouts/country/health_data_totals_left.php index 828977d2..f9cd508b 100644 --- a/admin/layouts/country/health_data_totals_left.php +++ b/admin/layouts/country/health_data_totals_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data_totals_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -30,20 +29,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/country/health_data_totals_right.php b/admin/layouts/country/health_data_totals_right.php index 65b8305a..d4a8fcec 100644 --- a/admin/layouts/country/health_data_totals_right.php +++ b/admin/layouts/country/health_data_totals_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data_totals_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -30,20 +29,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/country/interventions_fullwidth.php b/admin/layouts/country/interventions_fullwidth.php index 3b9cceb6..e1241cda 100644 --- a/admin/layouts/country/interventions_fullwidth.php +++ b/admin/layouts/country/interventions_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions_fullwidth.php @@ -18,16 +18,35 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vwfinterventions; -$user = JFactory::getUser(); -$id = $displayData->item->id; +$items = $displayData->vwfinterventions; +$user = JFactory::getUser(); +$id = $displayData->item->id; +// set the edit URL $edit = "index.php?option=com_costbenefitprojection&view=interventions&task=intervention.edit"; -$ref = ($id) ? "&ref=country&refid=".$id : ""; -$new = "index.php?option=com_costbenefitprojection&view=intervention&layout=edit".$ref; +// set a return value +$return = ($id) ? "index.php?option=com_costbenefitprojection&view=country&layout=edit&id=" . $id : ""; +// check for a return value +$jinput = JFactory::getApplication()->input; +if ($_return = $jinput->get('return', null, 'base64')) +{ + $return .= "&return=" . $_return; +} +// check if return value was set +if (CostbenefitprojectionHelper::checkString($return)) +{ + // set the referral values + $ref = ($id) ? "&ref=country&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); +} +else +{ + $ref = ($id) ? "&ref=country&refid=" . $id : ""; +} +// set the create new URL +$new = "index.php?option=com_costbenefitprojection&view=interventions&task=intervention.edit" . $ref; +// load the action object $can = CostbenefitprojectionHelper::getActions('intervention'); ?> @@ -73,21 +92,21 @@ $can = CostbenefitprojectionHelper::getActions('intervention'); $canDo = CostbenefitprojectionHelper::getActions('intervention',$item,'interventions'); ?> - + get('intervention.edit')): ?> - escape($item->name); ?> - checked_out): ?> - name, $item->checked_out_time, 'interventions.', $canCheckin); ?> - + escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'interventions.', $canCheckin); ?> + -
escape($item->name); ?>
+ escape($item->name); ?> - + authorise('company.edit', 'com_costbenefitprojection.company.' . (int)$item->company)): ?> - escape($item->company_name); ?> + escape($item->company_name); ?> -
escape($item->company_name); ?>
+ escape($item->company_name); ?> diff --git a/admin/layouts/country/public_details_fullwidth.php b/admin/layouts/country/public_details_fullwidth.php index 60753e59..021a5bda 100644 --- a/admin/layouts/country/public_details_fullwidth.php +++ b/admin/layouts/country/public_details_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage public_details_fullwidth.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -30,16 +29,14 @@ $fields = $displayData->get('fields') ?: array( 'publicaddress' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/country/publishing.php b/admin/layouts/country/publishing.php index 380c63d0..7b73f26f 100644 --- a/admin/layouts/country/publishing.php +++ b/admin/layouts/country/publishing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -33,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/country/publlshing.php b/admin/layouts/country/publlshing.php index 82a90399..2b11bb1c 100644 --- a/admin/layouts/country/publlshing.php +++ b/admin/layouts/country/publlshing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -35,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/country/service_providers_fullwidth.php b/admin/layouts/country/service_providers_fullwidth.php index 29470376..ecaa629d 100644 --- a/admin/layouts/country/service_providers_fullwidth.php +++ b/admin/layouts/country/service_providers_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_providers_fullwidth.php @@ -18,16 +18,35 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vwgservice_providers; -$user = JFactory::getUser(); -$id = $displayData->item->id; +$items = $displayData->vwgservice_providers; +$user = JFactory::getUser(); +$id = $displayData->item->id; +// set the edit URL $edit = "index.php?option=com_costbenefitprojection&view=service_providers&task=service_provider.edit"; -$ref = ($id) ? "&ref=country&refid=".$id : ""; -$new = "index.php?option=com_costbenefitprojection&view=service_provider&layout=edit".$ref; +// set a return value +$return = ($id) ? "index.php?option=com_costbenefitprojection&view=country&layout=edit&id=" . $id : ""; +// check for a return value +$jinput = JFactory::getApplication()->input; +if ($_return = $jinput->get('return', null, 'base64')) +{ + $return .= "&return=" . $_return; +} +// check if return value was set +if (CostbenefitprojectionHelper::checkString($return)) +{ + // set the referral values + $ref = ($id) ? "&ref=country&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); +} +else +{ + $ref = ($id) ? "&ref=country&refid=" . $id : ""; +} +// set the create new URL +$new = "index.php?option=com_costbenefitprojection&view=service_providers&task=service_provider.edit" . $ref; +// load the action object $can = CostbenefitprojectionHelper::getActions('service_provider'); ?> @@ -73,14 +92,14 @@ $can = CostbenefitprojectionHelper::getActions('service_provider'); $canDo = CostbenefitprojectionHelper::getActions('service_provider',$item,'service_providers'); ?> - + get('service_provider.edit')): ?> - escape($item->user_name); ?> - checked_out): ?> - name, $item->checked_out_time, 'service_providers.', $canCheckin); ?> - + user)->name; ?> + checked_out): ?> + name, $item->checked_out_time, 'service_providers.', $canCheckin); ?> + -
escape($item->user_name); ?>
+ user)->name; ?> diff --git a/admin/layouts/currency/details_above.php b/admin/layouts/currency/details_above.php index cf49c259..1aa751ef 100644 --- a/admin/layouts/currency/details_above.php +++ b/admin/layouts/currency/details_above.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php @@ -18,19 +18,23 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'name', 'alias' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/currency/details_left.php b/admin/layouts/currency/details_left.php index 9b494813..255fa3e1 100644 --- a/admin/layouts/currency/details_left.php +++ b/admin/layouts/currency/details_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -32,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/currency/details_right.php b/admin/layouts/currency/details_right.php index 3e74587f..78bcda88 100644 --- a/admin/layouts/currency/details_right.php +++ b/admin/layouts/currency/details_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -32,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/currency/publishing.php b/admin/layouts/currency/publishing.php index 380c63d0..7b73f26f 100644 --- a/admin/layouts/currency/publishing.php +++ b/admin/layouts/currency/publishing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -33,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/currency/publlshing.php b/admin/layouts/currency/publlshing.php index 82a90399..2b11bb1c 100644 --- a/admin/layouts/currency/publlshing.php +++ b/admin/layouts/currency/publlshing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -35,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/databreakdownmalefemale.php b/admin/layouts/databreakdownmalefemale.php index accf205e..26f45893 100644 --- a/admin/layouts/databreakdownmalefemale.php +++ b/admin/layouts/databreakdownmalefemale.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage databreakdownmalefemale.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('JPATH_BASE') or die('Restricted access'); $builder = array( diff --git a/admin/layouts/health_data/details_above.php b/admin/layouts/health_data/details_above.php index 11fc702c..34984f70 100644 --- a/admin/layouts/health_data/details_above.php +++ b/admin/layouts/health_data/details_above.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php @@ -18,18 +18,22 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'causerisk' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/health_data/details_left.php b/admin/layouts/health_data/details_left.php index e407a31f..67d2d4b2 100644 --- a/admin/layouts/health_data/details_left.php +++ b/admin/layouts/health_data/details_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -30,20 +29,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/health_data/details_right.php b/admin/layouts/health_data/details_right.php index 514d971c..8a11acc8 100644 --- a/admin/layouts/health_data/details_right.php +++ b/admin/layouts/health_data/details_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -30,20 +29,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/health_data/details_rightside.php b/admin/layouts/health_data/details_rightside.php index a26e4c02..e565d3c7 100644 --- a/admin/layouts/health_data/details_rightside.php +++ b/admin/layouts/health_data/details_rightside.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_rightside.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -30,20 +29,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/health_data/publishing.php b/admin/layouts/health_data/publishing.php index 380c63d0..7b73f26f 100644 --- a/admin/layouts/health_data/publishing.php +++ b/admin/layouts/health_data/publishing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -33,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/health_data/publlshing.php b/admin/layouts/health_data/publlshing.php index 82a90399..2b11bb1c 100644 --- a/admin/layouts/health_data/publlshing.php +++ b/admin/layouts/health_data/publlshing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -35,20 +33,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/details_above.php b/admin/layouts/help_document/details_above.php index 24765244..035d9bcb 100644 --- a/admin/layouts/help_document/details_above.php +++ b/admin/layouts/help_document/details_above.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php @@ -18,19 +18,23 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'title', 'alias' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/help_document/details_fullwidth.php b/admin/layouts/help_document/details_fullwidth.php index 2fa27f07..248d3ce1 100644 --- a/admin/layouts/help_document/details_fullwidth.php +++ b/admin/layouts/help_document/details_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_fullwidth.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -27,16 +26,14 @@ $fields = $displayData->get('fields') ?: array( 'content' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/help_document/details_left.php b/admin/layouts/help_document/details_left.php index 6c81ec2d..7c2de1a4 100644 --- a/admin/layouts/help_document/details_left.php +++ b/admin/layouts/help_document/details_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -33,20 +32,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/details_right.php b/admin/layouts/help_document/details_right.php index fc8fd2e3..4a9fbb82 100644 --- a/admin/layouts/help_document/details_right.php +++ b/admin/layouts/help_document/details_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -31,20 +30,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/details_under.php b/admin/layouts/help_document/details_under.php index 1ad77bf6..ea66e577 100644 --- a/admin/layouts/help_document/details_under.php +++ b/admin/layouts/help_document/details_under.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_under.php @@ -18,18 +18,22 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'not_required' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/help_document/publishing.php b/admin/layouts/help_document/publishing.php index 380c63d0..7b73f26f 100644 --- a/admin/layouts/help_document/publishing.php +++ b/admin/layouts/help_document/publishing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -33,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/help_document/publlshing.php b/admin/layouts/help_document/publlshing.php index b55082c0..11d13d26 100644 --- a/admin/layouts/help_document/publlshing.php +++ b/admin/layouts/help_document/publlshing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -34,20 +32,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/intervention/details_above.php b/admin/layouts/intervention/details_above.php index 297514e7..7a0426fa 100644 --- a/admin/layouts/intervention/details_above.php +++ b/admin/layouts/intervention/details_above.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php @@ -18,21 +18,25 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'name', 'company', 'country', 'type' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/intervention/details_fullwidth.php b/admin/layouts/intervention/details_fullwidth.php index 64bcc144..4de3432b 100644 --- a/admin/layouts/intervention/details_fullwidth.php +++ b/admin/layouts/intervention/details_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_fullwidth.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -31,16 +30,14 @@ $fields = $displayData->get('fields') ?: array( 'reference' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/intervention/details_under.php b/admin/layouts/intervention/details_under.php index 1ad77bf6..ea66e577 100644 --- a/admin/layouts/intervention/details_under.php +++ b/admin/layouts/intervention/details_under.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_under.php @@ -18,18 +18,22 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'not_required' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/intervention/publishing.php b/admin/layouts/intervention/publishing.php index 380c63d0..7b73f26f 100644 --- a/admin/layouts/intervention/publishing.php +++ b/admin/layouts/intervention/publishing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -33,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/intervention/publlshing.php b/admin/layouts/intervention/publlshing.php index b55082c0..11d13d26 100644 --- a/admin/layouts/intervention/publlshing.php +++ b/admin/layouts/intervention/publlshing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -34,20 +32,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/intervention/settings_fullwidth.php b/admin/layouts/intervention/settings_fullwidth.php index d61f941f..8de8f478 100644 --- a/admin/layouts/intervention/settings_fullwidth.php +++ b/admin/layouts/intervention/settings_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage settings_fullwidth.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -27,16 +26,14 @@ $fields = $displayData->get('fields') ?: array( 'intervention' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- -
-
- getLabel($field); ?> -
-
- getInput($field); ?> -
-
- + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/intervention/settings_left.php b/admin/layouts/intervention/settings_left.php index c8247ee1..b2e3e602 100644 --- a/admin/layouts/intervention/settings_left.php +++ b/admin/layouts/intervention/settings_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage settings_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -29,20 +28,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/scaling_factor/details_above.php b/admin/layouts/scaling_factor/details_above.php index 10b35db6..704ecc82 100644 --- a/admin/layouts/scaling_factor/details_above.php +++ b/admin/layouts/scaling_factor/details_above.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php @@ -18,19 +18,23 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'company', 'country' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/scaling_factor/details_left.php b/admin/layouts/scaling_factor/details_left.php index 4055464c..5b713cfe 100644 --- a/admin/layouts/scaling_factor/details_left.php +++ b/admin/layouts/scaling_factor/details_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -30,20 +29,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/scaling_factor/details_right.php b/admin/layouts/scaling_factor/details_right.php index cf9290cc..7fe6a631 100644 --- a/admin/layouts/scaling_factor/details_right.php +++ b/admin/layouts/scaling_factor/details_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -35,20 +34,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/scaling_factor/publishing.php b/admin/layouts/scaling_factor/publishing.php index 380c63d0..7b73f26f 100644 --- a/admin/layouts/scaling_factor/publishing.php +++ b/admin/layouts/scaling_factor/publishing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -33,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/scaling_factor/publlshing.php b/admin/layouts/scaling_factor/publlshing.php index b55082c0..11d13d26 100644 --- a/admin/layouts/scaling_factor/publlshing.php +++ b/admin/layouts/scaling_factor/publlshing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -34,20 +32,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/service_provider/companies_fullwidth.php b/admin/layouts/service_provider/companies_fullwidth.php index e58a6ea0..e3e0afd0 100644 --- a/admin/layouts/service_provider/companies_fullwidth.php +++ b/admin/layouts/service_provider/companies_fullwidth.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies_fullwidth.php @@ -18,16 +18,35 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vwecompanies; -$user = JFactory::getUser(); -$id = $displayData->item->id; +$items = $displayData->vwecompanies; +$user = JFactory::getUser(); +$id = $displayData->item->id; +// set the edit URL $edit = "index.php?option=com_costbenefitprojection&view=companies&task=company.edit"; -$ref = ($id) ? "&ref=service_provider&refid=".$id : ""; -$new = "index.php?option=com_costbenefitprojection&view=company&layout=edit".$ref; +// set a return value +$return = ($id) ? "index.php?option=com_costbenefitprojection&view=service_provider&layout=edit&id=" . $id : ""; +// check for a return value +$jinput = JFactory::getApplication()->input; +if ($_return = $jinput->get('return', null, 'base64')) +{ + $return .= "&return=" . $_return; +} +// check if return value was set +if (CostbenefitprojectionHelper::checkString($return)) +{ + // set the referral values + $ref = ($id) ? "&ref=service_provider&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); +} +else +{ + $ref = ($id) ? "&ref=service_provider&refid=" . $id : ""; +} +// set the create new URL +$new = "index.php?option=com_costbenefitprojection&view=companies&task=company.edit" . $ref; +// load the action object $can = CostbenefitprojectionHelper::getActions('company'); ?> @@ -73,39 +92,38 @@ $can = CostbenefitprojectionHelper::getActions('company'); $canDo = CostbenefitprojectionHelper::getActions('company',$item,'companies'); ?> - + get('company.edit')): ?> - escape($item->name); ?> - checked_out): ?> - name, $item->checked_out_time, 'companies.', $canCheckin); ?> - + escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'companies.', $canCheckin); ?> + -
escape($item->name); ?>
+ escape($item->name); ?>
get('companyresults.access')): ?> - +
- user); ?> - + authorise('core.edit', 'com_users')): ?> - name; ?> + user)->name; ?> - name; ?> + user)->name; ?> department); ?> - + authorise('country.edit', 'com_costbenefitprojection.country.' . (int)$item->country)): ?> - escape($item->country_name); ?> + escape($item->country_name); ?> -
escape($item->country_name); ?>
+ escape($item->country_name); ?> diff --git a/admin/layouts/service_provider/details_above.php b/admin/layouts/service_provider/details_above.php index f9c23f4a..57280af9 100644 --- a/admin/layouts/service_provider/details_above.php +++ b/admin/layouts/service_provider/details_above.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php @@ -18,19 +18,23 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); -$fields = array( +$fields = $displayData->get('fields') ?: array( 'user', 'country' ); +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + ?>
- renderField($field); - } ?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> +
diff --git a/admin/layouts/service_provider/details_left.php b/admin/layouts/service_provider/details_left.php index a21b29f6..ade53f40 100644 --- a/admin/layouts/service_provider/details_left.php +++ b/admin/layouts/service_provider/details_left.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -33,20 +32,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/service_provider/details_right.php b/admin/layouts/service_provider/details_right.php index e4845c59..c4326e6d 100644 --- a/admin/layouts/service_provider/details_right.php +++ b/admin/layouts/service_provider/details_right.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php @@ -18,7 +18,6 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); $form = $displayData->getForm(); @@ -29,20 +28,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/service_provider/publishing.php b/admin/layouts/service_provider/publishing.php index 380c63d0..7b73f26f 100644 --- a/admin/layouts/service_provider/publishing.php +++ b/admin/layouts/service_provider/publishing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -33,20 +31,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/layouts/service_provider/publlshing.php b/admin/layouts/service_provider/publlshing.php index b55082c0..11d13d26 100644 --- a/admin/layouts/service_provider/publlshing.php +++ b/admin/layouts/service_provider/publlshing.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php @@ -18,10 +18,8 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file - defined('_JEXEC') or die('Restricted access'); -$app = JFactory::getApplication(); $form = $displayData->getForm(); $fields = $displayData->get('fields') ?: array( @@ -34,20 +32,10 @@ $fields = $displayData->get('fields') ?: array( $hiddenFields = $displayData->get('hidden_fields') ?: array(); -foreach ($fields as $field) -{ - $field = is_array($field) ? $field : array($field); - foreach ($field as $f) - { - if ($form->getField($f)) - { - if (in_array($f, $hiddenFields)) - { - $form->setFieldAttribute($f, 'type', 'hidden'); - } - - echo $form->renderField($f); - break; - } - } -} +?> + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + diff --git a/admin/models/ajax.php b/admin/models/ajax.php index ec341e80..07612125 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage ajax.php @@ -20,8 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -jimport('joomla.application.component.helper'); - /** * Costbenefitprojection Ajax Model */ diff --git a/admin/models/causerisk.php b/admin/models/causerisk.php index 2e2aac90..5a62db75 100644 --- a/admin/models/causerisk.php +++ b/admin/models/causerisk.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 24 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk.php @author Llewellyn van der Merwe @@ -22,9 +22,6 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\Registry\Registry; -// import Joomla modelform library -jimport('joomla.application.component.modeladmin'); - /** * Costbenefitprojection Causerisk Model */ @@ -57,6 +54,9 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin */ public function getTable($type = 'causerisk', $prefix = 'CostbenefitprojectionTable', $config = array()) { + // add table path for when model gets used from other component + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_costbenefitprojection/tables'); + // get instance of the table return JTable::getInstance($type, $prefix, $config); } @@ -97,22 +97,25 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin } return $item; - } + } /** * Method to get the record form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. * * @return mixed A JForm object on success, false on failure * * @since 1.6 */ - public function getForm($data = array(), $loadData = true) - { + public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData; // Get the form. - $form = $this->loadForm('com_costbenefitprojection.causerisk', 'causerisk', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_costbenefitprojection.causerisk', 'causerisk', $options); if (empty($form)) { @@ -173,17 +176,20 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin // Only load these values if no id is found if (0 == $id) { - // Set redirected field name - $redirectedField = $jinput->get('ref', null, 'STRING'); - // Set redirected field value - $redirectedValue = $jinput->get('refid', 0, 'INT'); + // Set redirected view name + $redirectedView = $jinput->get('ref', null, 'STRING'); + // Set field name (or fall back to view name) + $redirectedField = $jinput->get('field', $redirectedView, 'STRING'); + // Set redirected view id + $redirectedId = $jinput->get('refid', 0, 'INT'); + // Set field id (or fall back to redirected view id) + $redirectedValue = $jinput->get('field_id', $redirectedId, 'INT'); if (0 != $redirectedValue && $redirectedField) { // Now set the local-redirected field default value $form->setValue($redirectedField, null, $redirectedValue); } } - return $form; } @@ -234,7 +240,7 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -342,7 +348,7 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin } return $data; - } + } /** * Method to get the unique fields of this table. @@ -500,7 +506,7 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -593,7 +599,7 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -627,7 +633,7 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -638,7 +644,7 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -759,7 +765,7 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin $metadata = new JRegistry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; - } + } // Set the Params Items to data if (isset($data['params']) && is_array($data['params'])) @@ -868,14 +874,14 @@ class CostbenefitprojectionModelCauserisk extends JModelAdmin } /** - * Method to change the title/s & alias. - * - * @param string $alias The alias. - * @param string/array $title The title. - * - * @return array/string Contains the modified title/s and/or alias. - * - */ + * Method to change the title/s & alias. + * + * @param string $alias The alias. + * @param string/array $title The title. + * + * @return array/string Contains the modified title/s and/or alias. + * + */ protected function _generateNewTitle($alias, $title = null) { diff --git a/admin/models/causesrisks.php b/admin/models/causesrisks.php index 117eaa25..54d7a7d4 100644 --- a/admin/models/causesrisks.php +++ b/admin/models/causesrisks.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 24 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesrisks.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import the Joomla modellist library -jimport('joomla.application.component.modellist'); - /** * Causesrisks Model */ @@ -94,7 +91,7 @@ class CostbenefitprojectionModelCausesrisks extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -104,11 +101,9 @@ class CostbenefitprojectionModelCausesrisks extends JModelList // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('causerisk.access', 'com_costbenefitprojection.causerisk.' . (int) $item->id) && $user->authorise('causerisk.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('causerisk.access', 'com_costbenefitprojection.causerisk.' . (int) $item->id) && JFactory::getUser()->authorise('causerisk.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -116,7 +111,7 @@ class CostbenefitprojectionModelCausesrisks extends JModelList } } - } + } // return items return $items; @@ -194,10 +189,10 @@ class CostbenefitprojectionModelCausesrisks extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -237,11 +232,9 @@ class CostbenefitprojectionModelCausesrisks extends JModelList // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('causerisk.access', 'com_costbenefitprojection.causerisk.' . (int) $item->id) && $user->authorise('causerisk.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('causerisk.access', 'com_costbenefitprojection.causerisk.' . (int) $item->id) && JFactory::getUser()->authorise('causerisk.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -291,7 +284,7 @@ class CostbenefitprojectionModelCausesrisks extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. @@ -315,16 +308,16 @@ class CostbenefitprojectionModelCausesrisks extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ protected function checkInNow() { // Get set check in time $time = JComponentHelper::getParams('com_costbenefitprojection')->get('check_in'); - + if ($time) { diff --git a/admin/models/combinedresults.php b/admin/models/combinedresults.php index f6440bca..403912c5 100644 --- a/admin/models/combinedresults.php +++ b/admin/models/combinedresults.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 22 of this MVC - @build 14th October, 2017 - @created 3rd October, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage combinedresults.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import the Joomla modellist library -jimport('joomla.application.component.modellist'); - /** * Costbenefitprojection Model for Combinedresults */ @@ -147,7 +144,7 @@ class CostbenefitprojectionModelCombinedresults extends JModelList // redirect away if not a correct (TODO for now we go to default view) $app->redirect('index.php?option=com_costbenefitprojection'); return false; - } + } // load parent items $items = parent::getItems(); @@ -169,61 +166,73 @@ class CostbenefitprojectionModelCombinedresults extends JModelList { // Always create a slug for sef URL's $item->slug = (isset($item->alias) && isset($item->id)) ? $item->id.':'.$item->alias : $item->id; - if (!empty($item->medical_turnovers_males) && $whmcskey && !is_numeric($item->medical_turnovers_males) && $item->medical_turnovers_males === base64_encode(base64_decode($item->medical_turnovers_males, true))) - { - // Decode medical_turnovers_males - $item->medical_turnovers_males = rtrim($whmcs->decryptString($item->medical_turnovers_males), "\0"); - } - if (!empty($item->females) && $whmcskey && !is_numeric($item->females) && $item->females === base64_encode(base64_decode($item->females, true))) - { - // Decode females - $item->females = rtrim($whmcs->decryptString($item->females), "\0"); - } - if (CostbenefitprojectionHelper::checkJson($item->causesrisks)) - { - // Decode causesrisks - $item->causesrisks = json_decode($item->causesrisks, true); - } - if (!empty($item->sick_leave_males) && $whmcskey && !is_numeric($item->sick_leave_males) && $item->sick_leave_males === base64_encode(base64_decode($item->sick_leave_males, true))) - { - // Decode sick_leave_males - $item->sick_leave_males = rtrim($whmcs->decryptString($item->sick_leave_males), "\0"); - } - if (!empty($item->medical_turnovers_females) && $whmcskey && !is_numeric($item->medical_turnovers_females) && $item->medical_turnovers_females === base64_encode(base64_decode($item->medical_turnovers_females, true))) - { - // Decode medical_turnovers_females - $item->medical_turnovers_females = rtrim($whmcs->decryptString($item->medical_turnovers_females), "\0"); - } - if (!empty($item->sick_leave_females) && $whmcskey && !is_numeric($item->sick_leave_females) && $item->sick_leave_females === base64_encode(base64_decode($item->sick_leave_females, true))) - { - // Decode sick_leave_females - $item->sick_leave_females = rtrim($whmcs->decryptString($item->sick_leave_females), "\0"); - } - if (!empty($item->total_salary) && $whmcskey && !is_numeric($item->total_salary) && $item->total_salary === base64_encode(base64_decode($item->total_salary, true))) - { - // Decode total_salary - $item->total_salary = rtrim($whmcs->decryptString($item->total_salary), "\0"); - } - if (!empty($item->total_healthcare) && $whmcskey && !is_numeric($item->total_healthcare) && $item->total_healthcare === base64_encode(base64_decode($item->total_healthcare, true))) - { - // Decode total_healthcare - $item->total_healthcare = rtrim($whmcs->decryptString($item->total_healthcare), "\0"); - } + // Check if we can decode males if (!empty($item->males) && $whmcskey && !is_numeric($item->males) && $item->males === base64_encode(base64_decode($item->males, true))) { // Decode males $item->males = rtrim($whmcs->decryptString($item->males), "\0"); } + // Check if we can decode sick_leave_males + if (!empty($item->sick_leave_males) && $whmcskey && !is_numeric($item->sick_leave_males) && $item->sick_leave_males === base64_encode(base64_decode($item->sick_leave_males, true))) + { + // Decode sick_leave_males + $item->sick_leave_males = rtrim($whmcs->decryptString($item->sick_leave_males), "\0"); + } + // Check if we can decode sick_leave_females + if (!empty($item->sick_leave_females) && $whmcskey && !is_numeric($item->sick_leave_females) && $item->sick_leave_females === base64_encode(base64_decode($item->sick_leave_females, true))) + { + // Decode sick_leave_females + $item->sick_leave_females = rtrim($whmcs->decryptString($item->sick_leave_females), "\0"); + } + // Check if we can decode total_salary + if (!empty($item->total_salary) && $whmcskey && !is_numeric($item->total_salary) && $item->total_salary === base64_encode(base64_decode($item->total_salary, true))) + { + // Decode total_salary + $item->total_salary = rtrim($whmcs->decryptString($item->total_salary), "\0"); + } + // Check if we can decode causesrisks + if (CostbenefitprojectionHelper::checkJson($item->causesrisks)) + { + // Decode causesrisks + $item->causesrisks = json_decode($item->causesrisks, true); + } + // Check if we can decode total_healthcare + if (!empty($item->total_healthcare) && $whmcskey && !is_numeric($item->total_healthcare) && $item->total_healthcare === base64_encode(base64_decode($item->total_healthcare, true))) + { + // Decode total_healthcare + $item->total_healthcare = rtrim($whmcs->decryptString($item->total_healthcare), "\0"); + } + // Check if we can decode females + if (!empty($item->females) && $whmcskey && !is_numeric($item->females) && $item->females === base64_encode(base64_decode($item->females, true))) + { + // Decode females + $item->females = rtrim($whmcs->decryptString($item->females), "\0"); + } + // Check if we can decode medical_turnovers_males + if (!empty($item->medical_turnovers_males) && $whmcskey && !is_numeric($item->medical_turnovers_males) && $item->medical_turnovers_males === base64_encode(base64_decode($item->medical_turnovers_males, true))) + { + // Decode medical_turnovers_males + $item->medical_turnovers_males = rtrim($whmcs->decryptString($item->medical_turnovers_males), "\0"); + } + // Check if we can decode medical_turnovers_females + if (!empty($item->medical_turnovers_females) && $whmcskey && !is_numeric($item->medical_turnovers_females) && $item->medical_turnovers_females === base64_encode(base64_decode($item->medical_turnovers_females, true))) + { + // Decode medical_turnovers_females + $item->medical_turnovers_females = rtrim($whmcs->decryptString($item->medical_turnovers_females), "\0"); + } + // Check if we can decode country_causesrisks if (CostbenefitprojectionHelper::checkJson($item->country_causesrisks)) { // Decode country_causesrisks $item->country_causesrisks = json_decode($item->country_causesrisks, true); } + // Check if item has params, or pass whole item. + $params = (isset($item->params) && CostbenefitprojectionHelper::checkJson($item->params)) ? json_decode($item->params) : $item; // Make sure the content prepare plugins fire on country_publicaddress $_country_publicaddress = new stdClass(); $_country_publicaddress->text =& $item->country_publicaddress; // value must be in text // Since all values are now in text (Joomla Limitation), we also add the field name (country_publicaddress) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.combinedresults.country_publicaddress', &$_country_publicaddress, &$this->params, 0)); + $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.combinedresults.country_publicaddress', &$_country_publicaddress, &$params, 0)); // Checking if country_publicaddress has uikit components that must be loaded. $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->country_publicaddress,$this->uikitComp); // set the global causesrisks value. @@ -249,18 +258,18 @@ class CostbenefitprojectionModelCombinedresults extends JModelList // set countryCountryInterventionDD to the $item object. $item->countryCountryInterventionDD = $this->getCountryCountryInterventionBcbb_DD($item->country); } - } + } // return items return $items; } /** - * Method to get an array of Health_data Objects. - * - * @return mixed An array of Health_data Objects on success, false on failure. - * - */ + * Method to get an array of Health_data Objects. + * + * @return mixed An array of Health_data Objects on success, false on failure. + * + */ public function getCountryCountryHealth_dataBcbb_B($country) { // Get a db connection. @@ -307,11 +316,11 @@ class CostbenefitprojectionModelCombinedresults extends JModelList } /** - * Method to get an array of Scaling_factor Objects. - * - * @return mixed An array of Scaling_factor Objects on success, false on failure. - * - */ + * Method to get an array of Scaling_factor Objects. + * + * @return mixed An array of Scaling_factor Objects on success, false on failure. + * + */ public function getIdCompanyScaling_factorBcbb_C($id) { // Get a db connection. @@ -346,11 +355,13 @@ class CostbenefitprojectionModelCombinedresults extends JModelList // Convert the parameter fields into objects. foreach ($items as $nr => &$item) { + // Check if item has params, or pass whole item. + $params = (isset($item->params) && CostbenefitprojectionHelper::checkJson($item->params)) ? json_decode($item->params) : $item; // Make sure the content prepare plugins fire on reference $_reference = new stdClass(); $_reference->text =& $item->reference; // value must be in text // Since all values are now in text (Joomla Limitation), we also add the field name (reference) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.combinedresults.reference', &$_reference, &$this->params, 0)); + $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.combinedresults.reference', &$_reference, &$params, 0)); // Checking if reference has uikit components that must be loaded. $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->reference,$this->uikitComp); } @@ -360,11 +371,11 @@ class CostbenefitprojectionModelCombinedresults extends JModelList } /** - * Method to get an array of Intervention Objects. - * - * @return mixed An array of Intervention Objects on success, false on failure. - * - */ + * Method to get an array of Intervention Objects. + * + * @return mixed An array of Intervention Objects on success, false on failure. + * + */ public function getIdCompanyInterventionBcbb_D($id) { // Get a db connection. @@ -398,13 +409,21 @@ class CostbenefitprojectionModelCombinedresults extends JModelList // Convert the parameter fields into objects. foreach ($items as $nr => &$item) { - // Make sure the content prepare plugins fire on reference - $_reference = new stdClass(); - $_reference->text =& $item->reference; // value must be in text - // Since all values are now in text (Joomla Limitation), we also add the field name (reference) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.combinedresults.reference', &$_reference, &$this->params, 0)); - // Checking if reference has uikit components that must be loaded. - $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->reference,$this->uikitComp); + // Check if we can decode interventions + if (CostbenefitprojectionHelper::checkJson($item->interventions)) + { + // Decode interventions + $item->interventions = json_decode($item->interventions, true); + } + // Check if item has params, or pass whole item. + $params = (isset($item->params) && CostbenefitprojectionHelper::checkJson($item->params)) ? json_decode($item->params) : $item; + // Make sure the content prepare plugins fire on description + $_description = new stdClass(); + $_description->text =& $item->description; // value must be in text + // Since all values are now in text (Joomla Limitation), we also add the field name (description) to context + $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.combinedresults.description', &$_description, &$params, 0)); + // Checking if description has uikit components that must be loaded. + $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->description,$this->uikitComp); } return $items; } @@ -412,11 +431,11 @@ class CostbenefitprojectionModelCombinedresults extends JModelList } /** - * Method to get an array of Causerisk Objects. - * - * @return mixed An array of Causerisk Objects on success, false on failure. - * - */ + * Method to get an array of Causerisk Objects. + * + * @return mixed An array of Causerisk Objects on success, false on failure. + * + */ public function getCausesrisksIdCauseriskBcbb_G($causesrisks) { // Get a db connection. @@ -458,11 +477,11 @@ class CostbenefitprojectionModelCombinedresults extends JModelList } /** - * Method to get an array of Health_data Objects. - * - * @return mixed An array of Health_data Objects on success, false on failure. - * - */ + * Method to get an array of Health_data Objects. + * + * @return mixed An array of Health_data Objects on success, false on failure. + * + */ public function getCountryCountryHealth_dataBcbb_BB($country) { // Get a db connection. @@ -509,11 +528,11 @@ class CostbenefitprojectionModelCombinedresults extends JModelList } /** - * Method to get an array of Causerisk Objects. - * - * @return mixed An array of Causerisk Objects on success, false on failure. - * - */ + * Method to get an array of Causerisk Objects. + * + * @return mixed An array of Causerisk Objects on success, false on failure. + * + */ public function getCausesrisksIdCauseriskBcbb_GG($causesrisks) { // Get a db connection. @@ -549,30 +568,17 @@ class CostbenefitprojectionModelCombinedresults extends JModelList // Load the JEvent Dispatcher JPluginHelper::importPlugin('content'); $this->_dispatcher = JEventDispatcher::getInstance(); - $items = $db->loadObjectList(); - - // Convert the parameter fields into objects. - foreach ($items as $nr => &$item) - { - // Make sure the content prepare plugins fire on description - $_description = new stdClass(); - $_description->text =& $item->description; // value must be in text - // Since all values are now in text (Joomla Limitation), we also add the field name (description) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.combinedresults.description', &$_description, &$this->params, 0)); - // Checking if description has uikit components that must be loaded. - $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->description,$this->uikitComp); - } - return $items; + return $db->loadObjectList(); } return false; } /** - * Method to get an array of Intervention Objects. - * - * @return mixed An array of Intervention Objects on success, false on failure. - * - */ + * Method to get an array of Intervention Objects. + * + * @return mixed An array of Intervention Objects on success, false on failure. + * + */ public function getCountryCountryInterventionBcbb_DD($country) { // Get a db connection. @@ -601,43 +607,18 @@ class CostbenefitprojectionModelCombinedresults extends JModelList // Load the JEvent Dispatcher JPluginHelper::importPlugin('content'); $this->_dispatcher = JEventDispatcher::getInstance(); - $items = $db->loadObjectList(); - - // Convert the parameter fields into objects. - foreach ($items as $nr => &$item) - { - if (CostbenefitprojectionHelper::checkJson($item->interventions)) - { - // Decode interventions - $item->interventions = json_decode($item->interventions, true); - } - // Make sure the content prepare plugins fire on description - $_description = new stdClass(); - $_description->text =& $item->description; // value must be in text - // Since all values are now in text (Joomla Limitation), we also add the field name (description) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.combinedresults.description', &$_description, &$this->params, 0)); - // Make sure the content prepare plugins fire on reference - $_reference = new stdClass(); - $_reference->text =& $item->reference; // value must be in text - // Since all values are now in text (Joomla Limitation), we also add the field name (reference) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.combinedresults.reference', &$_reference, &$this->params, 0)); - // Checking if description has uikit components that must be loaded. - $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->description,$this->uikitComp); - // Checking if reference has uikit components that must be loaded. - $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->reference,$this->uikitComp); - } - return $items; + return $db->loadObjectList(); } return false; } /** - * Get the uikit needed components - * - * @return mixed An array of objects on success. - * - */ + * Get the uikit needed components + * + * @return mixed An array of objects on success. + * + */ public function getUikitComp() { if (isset($this->uikitComp) && CostbenefitprojectionHelper::checkArray($this->uikitComp)) @@ -645,7 +626,7 @@ class CostbenefitprojectionModelCombinedresults extends JModelList return $this->uikitComp; } return false; - } + } // none } diff --git a/admin/models/companies.php b/admin/models/companies.php index 9eef0536..96182349 100644 --- a/admin/models/companies.php +++ b/admin/models/companies.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 101 of this MVC - @build 29th June, 2016 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import the Joomla modellist library -jimport('joomla.application.component.modellist'); - /** * Companies Model */ @@ -110,7 +107,7 @@ class CostbenefitprojectionModelCompanies extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -120,11 +117,9 @@ class CostbenefitprojectionModelCompanies extends JModelList // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('company.access', 'com_costbenefitprojection.company.' . (int) $item->id) && $user->authorise('company.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('company.access', 'com_costbenefitprojection.company.' . (int) $item->id) && JFactory::getUser()->authorise('company.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -132,7 +127,7 @@ class CostbenefitprojectionModelCompanies extends JModelList } } - } + } // set selection value to a translatable value if (CostbenefitprojectionHelper::checkArray($items)) @@ -145,17 +140,17 @@ class CostbenefitprojectionModelCompanies extends JModelList $item->per = $this->selectionTranslation($item->per, 'per'); } } - + // return items return $items; } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslation($value,$name) { // Array of department language strings @@ -271,7 +266,7 @@ class CostbenefitprojectionModelCompanies extends JModelList else { $search = $db->quote('%' . $db->escape($search) . '%'); - $query->where('(a.name LIKE '.$search.' OR a.email LIKE '.$search.' OR a.user LIKE '.$search.' OR g.name LIKE '.$search.' OR a.department LIKE '.$search.' OR a.country LIKE '.$search.' OR h.name LIKE '.$search.' OR a.service_provider LIKE '.$search.' OR i.user LIKE '.$search.' OR a.per LIKE '.$search.')'); + $query->where('(a.email LIKE '.$search.' OR a.name LIKE '.$search.' OR a.user LIKE '.$search.' OR g.name LIKE '.$search.' OR a.department LIKE '.$search.' OR a.country LIKE '.$search.' OR h.name LIKE '.$search.' OR a.service_provider LIKE '.$search.' OR i.user LIKE '.$search.' OR a.per LIKE '.$search.')'); } } @@ -308,10 +303,10 @@ class CostbenefitprojectionModelCompanies extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -373,37 +368,25 @@ class CostbenefitprojectionModelCompanies extends JModelList // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('company.access', 'com_costbenefitprojection.company.' . (int) $item->id) && $user->authorise('company.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('company.access', 'com_costbenefitprojection.company.' . (int) $item->id) && JFactory::getUser()->authorise('company.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); continue; } - if ($whmcskey && !is_numeric($item->medical_turnovers_males) && $item->medical_turnovers_males === base64_encode(base64_decode($item->medical_turnovers_males, true))) + if ($whmcskey && !is_numeric($item->males) && $item->males === base64_encode(base64_decode($item->males, true))) { - // decrypt medical_turnovers_males - $item->medical_turnovers_males = $whmcs->decryptString($item->medical_turnovers_males); - } - if ($whmcskey && !is_numeric($item->females) && $item->females === base64_encode(base64_decode($item->females, true))) - { - // decrypt females - $item->females = $whmcs->decryptString($item->females); + // decrypt males + $item->males = $whmcs->decryptString($item->males); } if ($whmcskey && !is_numeric($item->sick_leave_males) && $item->sick_leave_males === base64_encode(base64_decode($item->sick_leave_males, true))) { // decrypt sick_leave_males $item->sick_leave_males = $whmcs->decryptString($item->sick_leave_males); } - if ($whmcskey && !is_numeric($item->medical_turnovers_females) && $item->medical_turnovers_females === base64_encode(base64_decode($item->medical_turnovers_females, true))) - { - // decrypt medical_turnovers_females - $item->medical_turnovers_females = $whmcs->decryptString($item->medical_turnovers_females); - } if ($whmcskey && !is_numeric($item->sick_leave_females) && $item->sick_leave_females === base64_encode(base64_decode($item->sick_leave_females, true))) { // decrypt sick_leave_females @@ -419,10 +402,20 @@ class CostbenefitprojectionModelCompanies extends JModelList // decrypt total_healthcare $item->total_healthcare = $whmcs->decryptString($item->total_healthcare); } - if ($whmcskey && !is_numeric($item->males) && $item->males === base64_encode(base64_decode($item->males, true))) + if ($whmcskey && !is_numeric($item->females) && $item->females === base64_encode(base64_decode($item->females, true))) { - // decrypt males - $item->males = $whmcs->decryptString($item->males); + // decrypt females + $item->females = $whmcs->decryptString($item->females); + } + if ($whmcskey && !is_numeric($item->medical_turnovers_males) && $item->medical_turnovers_males === base64_encode(base64_decode($item->medical_turnovers_males, true))) + { + // decrypt medical_turnovers_males + $item->medical_turnovers_males = $whmcs->decryptString($item->medical_turnovers_males); + } + if ($whmcskey && !is_numeric($item->medical_turnovers_females) && $item->medical_turnovers_females === base64_encode(base64_decode($item->medical_turnovers_females, true))) + { + // decrypt medical_turnovers_females + $item->medical_turnovers_females = $whmcs->decryptString($item->medical_turnovers_females); } // unset the values we don't want exported. unset($item->asset_id); @@ -467,7 +460,7 @@ class CostbenefitprojectionModelCompanies extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. @@ -495,16 +488,16 @@ class CostbenefitprojectionModelCompanies extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ protected function checkInNow() { // Get set check in time $time = JComponentHelper::getParams('com_costbenefitprojection')->get('check_in'); - + if ($time) { diff --git a/admin/models/company.php b/admin/models/company.php index 3e330dab..934cfd5b 100644 --- a/admin/models/company.php +++ b/admin/models/company.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 101 of this MVC - @build 29th June, 2016 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.php @author Llewellyn van der Merwe @@ -22,9 +22,6 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\Registry\Registry; -// import Joomla modelform library -jimport('joomla.application.component.modeladmin'); - /** * Costbenefitprojection Company Model */ @@ -57,6 +54,9 @@ class CostbenefitprojectionModelCompany extends JModelAdmin */ public function getTable($type = 'company', $prefix = 'CostbenefitprojectionTable', $config = array()) { + // add table path for when model gets used from other component + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_costbenefitprojection/tables'); + // get instance of the table return JTable::getInstance($type, $prefix, $config); } @@ -94,16 +94,10 @@ class CostbenefitprojectionModelCompany extends JModelAdmin // Get the encryption object. $whmcs = new FOFEncryptAes($whmcskey); - if (!empty($item->medical_turnovers_males) && $whmcskey && !is_numeric($item->medical_turnovers_males) && $item->medical_turnovers_males === base64_encode(base64_decode($item->medical_turnovers_males, true))) + if (!empty($item->males) && $whmcskey && !is_numeric($item->males) && $item->males === base64_encode(base64_decode($item->males, true))) { - // whmcs decrypt data medical_turnovers_males. - $item->medical_turnovers_males = rtrim($whmcs->decryptString($item->medical_turnovers_males), "\0"); - } - - if (!empty($item->females) && $whmcskey && !is_numeric($item->females) && $item->females === base64_encode(base64_decode($item->females, true))) - { - // whmcs decrypt data females. - $item->females = rtrim($whmcs->decryptString($item->females), "\0"); + // whmcs decrypt data males. + $item->males = rtrim($whmcs->decryptString($item->males), "\0"); } if (!empty($item->sick_leave_males) && $whmcskey && !is_numeric($item->sick_leave_males) && $item->sick_leave_males === base64_encode(base64_decode($item->sick_leave_males, true))) @@ -112,12 +106,6 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $item->sick_leave_males = rtrim($whmcs->decryptString($item->sick_leave_males), "\0"); } - if (!empty($item->medical_turnovers_females) && $whmcskey && !is_numeric($item->medical_turnovers_females) && $item->medical_turnovers_females === base64_encode(base64_decode($item->medical_turnovers_females, true))) - { - // whmcs decrypt data medical_turnovers_females. - $item->medical_turnovers_females = rtrim($whmcs->decryptString($item->medical_turnovers_females), "\0"); - } - if (!empty($item->sick_leave_females) && $whmcskey && !is_numeric($item->sick_leave_females) && $item->sick_leave_females === base64_encode(base64_decode($item->sick_leave_females, true))) { // whmcs decrypt data sick_leave_females. @@ -136,10 +124,22 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $item->total_healthcare = rtrim($whmcs->decryptString($item->total_healthcare), "\0"); } - if (!empty($item->males) && $whmcskey && !is_numeric($item->males) && $item->males === base64_encode(base64_decode($item->males, true))) + if (!empty($item->females) && $whmcskey && !is_numeric($item->females) && $item->females === base64_encode(base64_decode($item->females, true))) { - // whmcs decrypt data males. - $item->males = rtrim($whmcs->decryptString($item->males), "\0"); + // whmcs decrypt data females. + $item->females = rtrim($whmcs->decryptString($item->females), "\0"); + } + + if (!empty($item->medical_turnovers_males) && $whmcskey && !is_numeric($item->medical_turnovers_males) && $item->medical_turnovers_males === base64_encode(base64_decode($item->medical_turnovers_males, true))) + { + // whmcs decrypt data medical_turnovers_males. + $item->medical_turnovers_males = rtrim($whmcs->decryptString($item->medical_turnovers_males), "\0"); + } + + if (!empty($item->medical_turnovers_females) && $whmcskey && !is_numeric($item->medical_turnovers_females) && $item->medical_turnovers_females === base64_encode(base64_decode($item->medical_turnovers_females, true))) + { + // whmcs decrypt data medical_turnovers_females. + $item->medical_turnovers_females = rtrim($whmcs->decryptString($item->medical_turnovers_females), "\0"); } if (!empty($item->causesrisks)) @@ -161,10 +161,10 @@ class CostbenefitprojectionModelCompany extends JModelAdmin } /** - * Method to get list data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getVwcscaling_factors() { // Get the user object. @@ -233,11 +233,9 @@ class CostbenefitprojectionModelCompany extends JModelAdmin // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('scaling_factor.access', 'com_costbenefitprojection.scaling_factor.' . (int) $item->id) && $user->authorise('scaling_factor.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('scaling_factor.access', 'com_costbenefitprojection.scaling_factor.' . (int) $item->id) && JFactory::getUser()->authorise('scaling_factor.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -252,10 +250,10 @@ class CostbenefitprojectionModelCompany extends JModelAdmin } /** - * Method to get list data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getVwdinterventions() { // Get the user object. @@ -320,11 +318,9 @@ class CostbenefitprojectionModelCompany extends JModelAdmin // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('intervention.access', 'com_costbenefitprojection.intervention.' . (int) $item->id) && $user->authorise('intervention.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('intervention.access', 'com_costbenefitprojection.intervention.' . (int) $item->id) && JFactory::getUser()->authorise('intervention.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -363,10 +359,10 @@ class CostbenefitprojectionModelCompany extends JModelAdmin } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslationVwdinterventions($value,$name) { // Array of type language strings @@ -383,22 +379,25 @@ class CostbenefitprojectionModelCompany extends JModelAdmin } } return $value; - } + } /** * Method to get the record form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. * * @return mixed A JForm object on success, false on failure * * @since 1.6 */ - public function getForm($data = array(), $loadData = true) - { + public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData; // Get the form. - $form = $this->loadForm('com_costbenefitprojection.company', 'company', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_costbenefitprojection.company', 'company', $options); if (empty($form)) { @@ -466,6 +465,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $form->setFieldAttribute('email', 'disabled', 'true'); // Disable fields for display. $form->setFieldAttribute('email', 'readonly', 'true'); + // If there is no value continue. if (!$form->getValue('email')) { // Disable fields while saving. @@ -482,6 +482,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $form->setFieldAttribute('user', 'disabled', 'true'); // Disable fields for display. $form->setFieldAttribute('user', 'readonly', 'true'); + // If there is no value continue. if (!$form->getValue('user')) { // Disable fields while saving. @@ -501,6 +502,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin // Disable radio button for display. $class = $form->getFieldAttribute('department', 'class', ''); $form->setFieldAttribute('department', 'class', $class.' disabled no-click'); + // If there is no value continue. if (!$form->getValue('department')) { // Disable fields while saving. @@ -517,6 +519,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $form->setFieldAttribute('country', 'disabled', 'true'); // Disable fields for display. $form->setFieldAttribute('country', 'readonly', 'true'); + // If there is no value continue. if (!$form->getValue('country')) { // Disable fields while saving. @@ -533,6 +536,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $form->setFieldAttribute('service_provider', 'disabled', 'true'); // Disable fields for display. $form->setFieldAttribute('service_provider', 'readonly', 'true'); + // If there is no value continue. if (!$form->getValue('service_provider')) { // Disable fields while saving. @@ -552,6 +556,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin // Disable radio button for display. $class = $form->getFieldAttribute('per', 'class', ''); $form->setFieldAttribute('per', 'class', $class.' disabled no-click'); + // If there is no value continue. if (!$form->getValue('per')) { // Disable fields while saving. @@ -560,6 +565,23 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $form->setFieldAttribute('per', 'required', 'false'); } } + // Modify the form based on Edit Datayear access controls. + if ($id != 0 && (!$user->authorise('company.edit.datayear', 'com_costbenefitprojection.company.' . (int) $id)) + || ($id == 0 && !$user->authorise('company.edit.datayear', 'com_costbenefitprojection'))) + { + // Disable fields for display. + $form->setFieldAttribute('datayear', 'disabled', 'true'); + // Disable fields for display. + $form->setFieldAttribute('datayear', 'readonly', 'true'); + // If there is no value continue. + if (!$form->getValue('datayear')) + { + // Disable fields while saving. + $form->setFieldAttribute('datayear', 'filter', 'unset'); + // Disable fields while saving. + $form->setFieldAttribute('datayear', 'required', 'false'); + } + } // Modify the form based on Edit Causesrisks access controls. if ($id != 0 && (!$user->authorise('company.edit.causesrisks', 'com_costbenefitprojection.company.' . (int) $id)) || ($id == 0 && !$user->authorise('company.edit.causesrisks', 'com_costbenefitprojection'))) @@ -568,6 +590,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $form->setFieldAttribute('causesrisks', 'disabled', 'true'); // Disable fields for display. $form->setFieldAttribute('causesrisks', 'readonly', 'true'); + // If there is no value continue. if (!$form->getValue('causesrisks')) { // Disable fields while saving. @@ -587,6 +610,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin // Disable radio button for display. $class = $form->getFieldAttribute('percentfemale', 'class', ''); $form->setFieldAttribute('percentfemale', 'class', $class.' disabled no-click'); + // If there is no value continue. if (!$form->getValue('percentfemale')) { // Disable fields while saving. @@ -595,22 +619,6 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $form->setFieldAttribute('percentfemale', 'required', 'false'); } } - // Modify the form based on Edit Datayear access controls. - if ($id != 0 && (!$user->authorise('company.edit.datayear', 'com_costbenefitprojection.company.' . (int) $id)) - || ($id == 0 && !$user->authorise('company.edit.datayear', 'com_costbenefitprojection'))) - { - // Disable fields for display. - $form->setFieldAttribute('datayear', 'disabled', 'true'); - // Disable fields for display. - $form->setFieldAttribute('datayear', 'readonly', 'true'); - if (!$form->getValue('datayear')) - { - // Disable fields while saving. - $form->setFieldAttribute('datayear', 'filter', 'unset'); - // Disable fields while saving. - $form->setFieldAttribute('datayear', 'required', 'false'); - } - } // Modify the form based on Edit Percentmale access controls. if ($id != 0 && (!$user->authorise('company.edit.percentmale', 'com_costbenefitprojection.company.' . (int) $id)) || ($id == 0 && !$user->authorise('company.edit.percentmale', 'com_costbenefitprojection'))) @@ -622,6 +630,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin // Disable radio button for display. $class = $form->getFieldAttribute('percentmale', 'class', ''); $form->setFieldAttribute('percentmale', 'class', $class.' disabled no-click'); + // If there is no value continue. if (!$form->getValue('percentmale')) { // Disable fields while saving. @@ -633,17 +642,20 @@ class CostbenefitprojectionModelCompany extends JModelAdmin // Only load these values if no id is found if (0 == $id) { - // Set redirected field name - $redirectedField = $jinput->get('ref', null, 'STRING'); - // Set redirected field value - $redirectedValue = $jinput->get('refid', 0, 'INT'); + // Set redirected view name + $redirectedView = $jinput->get('ref', null, 'STRING'); + // Set field name (or fall back to view name) + $redirectedField = $jinput->get('field', $redirectedView, 'STRING'); + // Set redirected view id + $redirectedId = $jinput->get('refid', 0, 'INT'); + // Set field id (or fall back to redirected view id) + $redirectedValue = $jinput->get('field_id', $redirectedId, 'INT'); if (0 != $redirectedValue && $redirectedField) { // Now set the local-redirected field default value $form->setValue($redirectedField, null, $redirectedValue); } } - return $form; } @@ -694,7 +706,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -805,18 +817,18 @@ class CostbenefitprojectionModelCompany extends JModelAdmin } /** - * Method to validate the form data. - * - * @param JForm $form The form to validate against. - * @param array $data The data to validate. - * @param string $group The name of the field group to validate. - * - * @return mixed Array of filtered data if valid, false otherwise. - * - * @see JFormRule - * @see JFilterInput - * @since 12.2 - */ + * Method to validate the form data. + * + * @param JForm $form The form to validate against. + * @param array $data The data to validate. + * @param string $group The name of the field group to validate. + * + * @return mixed Array of filtered data if valid, false otherwise. + * + * @see JFormRule + * @see JFilterInput + * @since 12.2 + */ public function validate($form, $data, $group = null) { // check if the not_required field is set @@ -838,7 +850,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin } } return parent::validate($form, $data, $group); - } + } /** * Method to get the unique fields of this table. @@ -996,7 +1008,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -1031,14 +1043,12 @@ class CostbenefitprojectionModelCompany extends JModelAdmin if (empty($pks)) { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } } else { $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); - return false; } } @@ -1123,7 +1133,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -1157,7 +1167,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -1168,7 +1178,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1204,14 +1214,12 @@ class CostbenefitprojectionModelCompany extends JModelAdmin if (empty($pks)) { $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', 0)); - return false; } } else { $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', 0)); - return false; } } @@ -1324,7 +1332,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin if (!isset($data['causesrisks'])) { $data['causesrisks'] = ''; - } + } // Set the causesrisks string to JSON string. if (isset($data['causesrisks'])) @@ -1337,16 +1345,10 @@ class CostbenefitprojectionModelCompany extends JModelAdmin // Get the encryption object $whmcs = new FOFEncryptAes($whmcskey); - // Encrypt data medical_turnovers_males. - if (isset($data['medical_turnovers_males']) && $whmcskey) + // Encrypt data males. + if (isset($data['males']) && $whmcskey) { - $data['medical_turnovers_males'] = $whmcs->encryptString($data['medical_turnovers_males']); - } - - // Encrypt data females. - if (isset($data['females']) && $whmcskey) - { - $data['females'] = $whmcs->encryptString($data['females']); + $data['males'] = $whmcs->encryptString($data['males']); } // Encrypt data sick_leave_males. @@ -1355,12 +1357,6 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $data['sick_leave_males'] = $whmcs->encryptString($data['sick_leave_males']); } - // Encrypt data medical_turnovers_females. - if (isset($data['medical_turnovers_females']) && $whmcskey) - { - $data['medical_turnovers_females'] = $whmcs->encryptString($data['medical_turnovers_females']); - } - // Encrypt data sick_leave_females. if (isset($data['sick_leave_females']) && $whmcskey) { @@ -1379,10 +1375,22 @@ class CostbenefitprojectionModelCompany extends JModelAdmin $data['total_healthcare'] = $whmcs->encryptString($data['total_healthcare']); } - // Encrypt data males. - if (isset($data['males']) && $whmcskey) + // Encrypt data females. + if (isset($data['females']) && $whmcskey) { - $data['males'] = $whmcs->encryptString($data['males']); + $data['females'] = $whmcs->encryptString($data['females']); + } + + // Encrypt data medical_turnovers_males. + if (isset($data['medical_turnovers_males']) && $whmcskey) + { + $data['medical_turnovers_males'] = $whmcs->encryptString($data['medical_turnovers_males']); + } + + // Encrypt data medical_turnovers_females. + if (isset($data['medical_turnovers_females']) && $whmcskey) + { + $data['medical_turnovers_females'] = $whmcs->encryptString($data['medical_turnovers_females']); } // make sure new company does not get locked @@ -1446,13 +1454,13 @@ class CostbenefitprojectionModelCompany extends JModelAdmin } /** - * Method to change the title - * - * @param string $title The title. - * - * @return array Contains the modified title and alias. - * - */ + * Method to change the title + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ protected function _generateNewTitle($title) { diff --git a/admin/models/companyresults.php b/admin/models/companyresults.php index b810748d..fb8d20b7 100644 --- a/admin/models/companyresults.php +++ b/admin/models/companyresults.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 60 of this MVC - @build 14th October, 2017 - @created 13th August, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage companyresults.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import Joomla modelitem library -jimport('joomla.application.component.modelitem'); - /** * Costbenefitprojection Companyresults Model */ @@ -179,61 +176,73 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem // Load the JEvent Dispatcher JPluginHelper::importPlugin('content'); $this->_dispatcher = JEventDispatcher::getInstance(); - if (!empty($data->medical_turnovers_males) && $whmcskey && !is_numeric($data->medical_turnovers_males) && $data->medical_turnovers_males === base64_encode(base64_decode($data->medical_turnovers_males, true))) - { - // Decode medical_turnovers_males - $data->medical_turnovers_males = rtrim($whmcs->decryptString($data->medical_turnovers_males), "\0"); - } - if (!empty($data->females) && $whmcskey && !is_numeric($data->females) && $data->females === base64_encode(base64_decode($data->females, true))) - { - // Decode females - $data->females = rtrim($whmcs->decryptString($data->females), "\0"); - } - if (CostbenefitprojectionHelper::checkJson($data->causesrisks)) - { - // Decode causesrisks - $data->causesrisks = json_decode($data->causesrisks, true); - } - if (!empty($data->sick_leave_males) && $whmcskey && !is_numeric($data->sick_leave_males) && $data->sick_leave_males === base64_encode(base64_decode($data->sick_leave_males, true))) - { - // Decode sick_leave_males - $data->sick_leave_males = rtrim($whmcs->decryptString($data->sick_leave_males), "\0"); - } - if (!empty($data->medical_turnovers_females) && $whmcskey && !is_numeric($data->medical_turnovers_females) && $data->medical_turnovers_females === base64_encode(base64_decode($data->medical_turnovers_females, true))) - { - // Decode medical_turnovers_females - $data->medical_turnovers_females = rtrim($whmcs->decryptString($data->medical_turnovers_females), "\0"); - } - if (!empty($data->sick_leave_females) && $whmcskey && !is_numeric($data->sick_leave_females) && $data->sick_leave_females === base64_encode(base64_decode($data->sick_leave_females, true))) - { - // Decode sick_leave_females - $data->sick_leave_females = rtrim($whmcs->decryptString($data->sick_leave_females), "\0"); - } - if (!empty($data->total_salary) && $whmcskey && !is_numeric($data->total_salary) && $data->total_salary === base64_encode(base64_decode($data->total_salary, true))) - { - // Decode total_salary - $data->total_salary = rtrim($whmcs->decryptString($data->total_salary), "\0"); - } - if (!empty($data->total_healthcare) && $whmcskey && !is_numeric($data->total_healthcare) && $data->total_healthcare === base64_encode(base64_decode($data->total_healthcare, true))) - { - // Decode total_healthcare - $data->total_healthcare = rtrim($whmcs->decryptString($data->total_healthcare), "\0"); - } + // Check if we can decode males if (!empty($data->males) && $whmcskey && !is_numeric($data->males) && $data->males === base64_encode(base64_decode($data->males, true))) { // Decode males $data->males = rtrim($whmcs->decryptString($data->males), "\0"); } + // Check if we can decode sick_leave_males + if (!empty($data->sick_leave_males) && $whmcskey && !is_numeric($data->sick_leave_males) && $data->sick_leave_males === base64_encode(base64_decode($data->sick_leave_males, true))) + { + // Decode sick_leave_males + $data->sick_leave_males = rtrim($whmcs->decryptString($data->sick_leave_males), "\0"); + } + // Check if we can decode sick_leave_females + if (!empty($data->sick_leave_females) && $whmcskey && !is_numeric($data->sick_leave_females) && $data->sick_leave_females === base64_encode(base64_decode($data->sick_leave_females, true))) + { + // Decode sick_leave_females + $data->sick_leave_females = rtrim($whmcs->decryptString($data->sick_leave_females), "\0"); + } + // Check if we can decode total_salary + if (!empty($data->total_salary) && $whmcskey && !is_numeric($data->total_salary) && $data->total_salary === base64_encode(base64_decode($data->total_salary, true))) + { + // Decode total_salary + $data->total_salary = rtrim($whmcs->decryptString($data->total_salary), "\0"); + } + // Check if we can decode causesrisks + if (CostbenefitprojectionHelper::checkJson($data->causesrisks)) + { + // Decode causesrisks + $data->causesrisks = json_decode($data->causesrisks, true); + } + // Check if we can decode total_healthcare + if (!empty($data->total_healthcare) && $whmcskey && !is_numeric($data->total_healthcare) && $data->total_healthcare === base64_encode(base64_decode($data->total_healthcare, true))) + { + // Decode total_healthcare + $data->total_healthcare = rtrim($whmcs->decryptString($data->total_healthcare), "\0"); + } + // Check if we can decode females + if (!empty($data->females) && $whmcskey && !is_numeric($data->females) && $data->females === base64_encode(base64_decode($data->females, true))) + { + // Decode females + $data->females = rtrim($whmcs->decryptString($data->females), "\0"); + } + // Check if we can decode medical_turnovers_males + if (!empty($data->medical_turnovers_males) && $whmcskey && !is_numeric($data->medical_turnovers_males) && $data->medical_turnovers_males === base64_encode(base64_decode($data->medical_turnovers_males, true))) + { + // Decode medical_turnovers_males + $data->medical_turnovers_males = rtrim($whmcs->decryptString($data->medical_turnovers_males), "\0"); + } + // Check if we can decode medical_turnovers_females + if (!empty($data->medical_turnovers_females) && $whmcskey && !is_numeric($data->medical_turnovers_females) && $data->medical_turnovers_females === base64_encode(base64_decode($data->medical_turnovers_females, true))) + { + // Decode medical_turnovers_females + $data->medical_turnovers_females = rtrim($whmcs->decryptString($data->medical_turnovers_females), "\0"); + } + // Check if we can decode country_causesrisks if (CostbenefitprojectionHelper::checkJson($data->country_causesrisks)) { // Decode country_causesrisks $data->country_causesrisks = json_decode($data->country_causesrisks, true); } + // Check if item has params, or pass whole item. + $params = (isset($data->params) && CostbenefitprojectionHelper::checkJson($data->params)) ? json_decode($data->params) : $data; // Make sure the content prepare plugins fire on country_publicaddress $_country_publicaddress = new stdClass(); $_country_publicaddress->text =& $data->country_publicaddress; // value must be in text // Since all values are now in text (Joomla Limitation), we also add the field name (country_publicaddress) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.companyresults.country_publicaddress', &$_country_publicaddress, &$this->params, 0)); + $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.companyresults.country_publicaddress', &$_country_publicaddress, &$params, 0)); // Checking if country_publicaddress has uikit components that must be loaded. $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($data->country_publicaddress,$this->uikitComp); // set the global causesrisks value. @@ -281,11 +290,11 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem } /** - * Method to get an array of Health_data Objects. - * - * @return mixed An array of Health_data Objects on success, false on failure. - * - */ + * Method to get an array of Health_data Objects. + * + * @return mixed An array of Health_data Objects on success, false on failure. + * + */ public function getCountryCountryHealth_dataEbbe_B($country) { // Get a db connection. @@ -332,11 +341,11 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem } /** - * Method to get an array of Scaling_factor Objects. - * - * @return mixed An array of Scaling_factor Objects on success, false on failure. - * - */ + * Method to get an array of Scaling_factor Objects. + * + * @return mixed An array of Scaling_factor Objects on success, false on failure. + * + */ public function getIdCompanyScaling_factorEbbe_C($id) { // Get a db connection. @@ -370,11 +379,13 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem // Convert the parameter fields into objects. foreach ($items as $nr => &$item) { + // Check if item has params, or pass whole item. + $params = (isset($item->params) && CostbenefitprojectionHelper::checkJson($item->params)) ? json_decode($item->params) : $item; // Make sure the content prepare plugins fire on reference $_reference = new stdClass(); $_reference->text =& $item->reference; // value must be in text // Since all values are now in text (Joomla Limitation), we also add the field name (reference) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.companyresults.reference', &$_reference, &$this->params, 0)); + $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.companyresults.reference', &$_reference, &$params, 0)); // Checking if reference has uikit components that must be loaded. $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->reference,$this->uikitComp); } @@ -384,11 +395,11 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem } /** - * Method to get an array of Intervention Objects. - * - * @return mixed An array of Intervention Objects on success, false on failure. - * - */ + * Method to get an array of Intervention Objects. + * + * @return mixed An array of Intervention Objects on success, false on failure. + * + */ public function getIdCompanyInterventionEbbe_D($id) { // Get a db connection. @@ -422,13 +433,15 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem // Convert the parameter fields into objects. foreach ($items as $nr => &$item) { - // Make sure the content prepare plugins fire on reference - $_reference = new stdClass(); - $_reference->text =& $item->reference; // value must be in text - // Since all values are now in text (Joomla Limitation), we also add the field name (reference) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.companyresults.reference', &$_reference, &$this->params, 0)); - // Checking if reference has uikit components that must be loaded. - $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->reference,$this->uikitComp); + // Check if item has params, or pass whole item. + $params = (isset($item->params) && CostbenefitprojectionHelper::checkJson($item->params)) ? json_decode($item->params) : $item; + // Make sure the content prepare plugins fire on description + $_description = new stdClass(); + $_description->text =& $item->description; // value must be in text + // Since all values are now in text (Joomla Limitation), we also add the field name (description) to context + $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.companyresults.description', &$_description, &$params, 0)); + // Checking if description has uikit components that must be loaded. + $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->description,$this->uikitComp); } return $items; } @@ -436,11 +449,11 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem } /** - * Method to get an array of Causerisk Objects. - * - * @return mixed An array of Causerisk Objects on success, false on failure. - * - */ + * Method to get an array of Causerisk Objects. + * + * @return mixed An array of Causerisk Objects on success, false on failure. + * + */ public function getCausesrisksIdCauseriskEbbe_G($causesrisks) { // Get a db connection. @@ -482,11 +495,11 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem } /** - * Method to get an array of Health_data Objects. - * - * @return mixed An array of Health_data Objects on success, false on failure. - * - */ + * Method to get an array of Health_data Objects. + * + * @return mixed An array of Health_data Objects on success, false on failure. + * + */ public function getCountryCountryHealth_dataEbbe_BB($country) { // Get a db connection. @@ -533,11 +546,11 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem } /** - * Method to get an array of Causerisk Objects. - * - * @return mixed An array of Causerisk Objects on success, false on failure. - * - */ + * Method to get an array of Causerisk Objects. + * + * @return mixed An array of Causerisk Objects on success, false on failure. + * + */ public function getCausesrisksIdCauseriskEbbe_GG($causesrisks) { // Get a db connection. @@ -573,30 +586,17 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem // Load the JEvent Dispatcher JPluginHelper::importPlugin('content'); $this->_dispatcher = JEventDispatcher::getInstance(); - $items = $db->loadObjectList(); - - // Convert the parameter fields into objects. - foreach ($items as $nr => &$item) - { - // Make sure the content prepare plugins fire on description - $_description = new stdClass(); - $_description->text =& $item->description; // value must be in text - // Since all values are now in text (Joomla Limitation), we also add the field name (description) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.companyresults.description', &$_description, &$this->params, 0)); - // Checking if description has uikit components that must be loaded. - $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->description,$this->uikitComp); - } - return $items; + return $db->loadObjectList(); } return false; } /** - * Method to get an array of Intervention Objects. - * - * @return mixed An array of Intervention Objects on success, false on failure. - * - */ + * Method to get an array of Intervention Objects. + * + * @return mixed An array of Intervention Objects on success, false on failure. + * + */ public function getCountryCountryInterventionEbbe_DD($country) { // Get a db connection. @@ -624,38 +624,18 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem // Load the JEvent Dispatcher JPluginHelper::importPlugin('content'); $this->_dispatcher = JEventDispatcher::getInstance(); - $items = $db->loadObjectList(); - - // Convert the parameter fields into objects. - foreach ($items as $nr => &$item) - { - // Make sure the content prepare plugins fire on description - $_description = new stdClass(); - $_description->text =& $item->description; // value must be in text - // Since all values are now in text (Joomla Limitation), we also add the field name (description) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.companyresults.description', &$_description, &$this->params, 0)); - // Make sure the content prepare plugins fire on reference - $_reference = new stdClass(); - $_reference->text =& $item->reference; // value must be in text - // Since all values are now in text (Joomla Limitation), we also add the field name (reference) to context - $this->_dispatcher->trigger("onContentPrepare", array('com_costbenefitprojection.companyresults.reference', &$_reference, &$this->params, 0)); - // Checking if description has uikit components that must be loaded. - $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->description,$this->uikitComp); - // Checking if reference has uikit components that must be loaded. - $this->uikitComp = CostbenefitprojectionHelper::getUikitComp($item->reference,$this->uikitComp); - } - return $items; + return $db->loadObjectList(); } return false; } /** - * Get the uikit needed components - * - * @return mixed An array of objects on success. - * - */ + * Get the uikit needed components + * + * @return mixed An array of objects on success. + * + */ public function getUikitComp() { if (isset($this->uikitComp) && CostbenefitprojectionHelper::checkArray($this->uikitComp)) @@ -663,7 +643,7 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem return $this->uikitComp; } return false; - } + } // none } diff --git a/admin/models/costbenefitprojection.php b/admin/models/costbenefitprojection.php index fc2c03a6..f1374e29 100644 --- a/admin/models/costbenefitprojection.php +++ b/admin/models/costbenefitprojection.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php @@ -20,10 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import the Joomla modellist library -jimport('joomla.application.component.modellist'); -jimport('joomla.application.component.helper'); - /** * Costbenefitprojection Model */ diff --git a/admin/models/countries.php b/admin/models/countries.php index c07a1ee2..6a8fd9df 100644 --- a/admin/models/countries.php +++ b/admin/models/countries.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 54 of this MVC - @build 17th May, 2018 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage countries.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import the Joomla modellist library -jimport('joomla.application.component.modellist'); - /** * Countries Model */ @@ -110,7 +107,7 @@ class CostbenefitprojectionModelCountries extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -120,11 +117,9 @@ class CostbenefitprojectionModelCountries extends JModelList // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('country.access', 'com_costbenefitprojection.country.' . (int) $item->id) && $user->authorise('country.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('country.access', 'com_costbenefitprojection.country.' . (int) $item->id) && JFactory::getUser()->authorise('country.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -132,7 +127,7 @@ class CostbenefitprojectionModelCountries extends JModelList } } - } + } // return items return $items; @@ -239,10 +234,10 @@ class CostbenefitprojectionModelCountries extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -298,11 +293,9 @@ class CostbenefitprojectionModelCountries extends JModelList // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('country.access', 'com_costbenefitprojection.country.' . (int) $item->id) && $user->authorise('country.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('country.access', 'com_costbenefitprojection.country.' . (int) $item->id) && JFactory::getUser()->authorise('country.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -352,7 +345,7 @@ class CostbenefitprojectionModelCountries extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. @@ -380,16 +373,16 @@ class CostbenefitprojectionModelCountries extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ protected function checkInNow() { // Get set check in time $time = JComponentHelper::getParams('com_costbenefitprojection')->get('check_in'); - + if ($time) { diff --git a/admin/models/country.php b/admin/models/country.php index f655e54f..98189edc 100644 --- a/admin/models/country.php +++ b/admin/models/country.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 54 of this MVC - @build 17th May, 2018 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage country.php @author Llewellyn van der Merwe @@ -22,9 +22,6 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\Registry\Registry; -// import Joomla modelform library -jimport('joomla.application.component.modeladmin'); - /** * Costbenefitprojection Country Model */ @@ -57,6 +54,9 @@ class CostbenefitprojectionModelCountry extends JModelAdmin */ public function getTable($type = 'country', $prefix = 'CostbenefitprojectionTable', $config = array()) { + // add table path for when model gets used from other component + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_costbenefitprojection/tables'); + // get instance of the table return JTable::getInstance($type, $prefix, $config); } @@ -109,10 +109,10 @@ class CostbenefitprojectionModelCountry extends JModelAdmin } /** - * Method to get list data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getVwfinterventions() { // Get the user object. @@ -177,11 +177,9 @@ class CostbenefitprojectionModelCountry extends JModelAdmin // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('intervention.access', 'com_costbenefitprojection.intervention.' . (int) $item->id) && $user->authorise('intervention.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('intervention.access', 'com_costbenefitprojection.intervention.' . (int) $item->id) && JFactory::getUser()->authorise('intervention.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -220,10 +218,10 @@ class CostbenefitprojectionModelCountry extends JModelAdmin } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslationVwfinterventions($value,$name) { // Array of type language strings @@ -243,10 +241,10 @@ class CostbenefitprojectionModelCountry extends JModelAdmin } /** - * Method to get list data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getVwgservice_providers() { // Get the user object. @@ -315,11 +313,9 @@ class CostbenefitprojectionModelCountry extends JModelAdmin // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('service_provider.access', 'com_costbenefitprojection.service_provider.' . (int) $item->id) && $user->authorise('service_provider.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('service_provider.access', 'com_costbenefitprojection.service_provider.' . (int) $item->id) && JFactory::getUser()->authorise('service_provider.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -334,10 +330,10 @@ class CostbenefitprojectionModelCountry extends JModelAdmin } /** - * Method to get list data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getVwhcompanies() { // Get the user object. @@ -425,11 +421,9 @@ class CostbenefitprojectionModelCountry extends JModelAdmin // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('company.access', 'com_costbenefitprojection.company.' . (int) $item->id) && $user->authorise('company.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('company.access', 'com_costbenefitprojection.company.' . (int) $item->id) && JFactory::getUser()->authorise('company.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -457,10 +451,10 @@ class CostbenefitprojectionModelCountry extends JModelAdmin } /** - * Method to convert selection values to translatable string. - * - * @return translatable string - */ + * Method to convert selection values to translatable string. + * + * @return translatable string + */ public function selectionTranslationVwhcompanies($value,$name) { // Array of department language strings @@ -490,22 +484,25 @@ class CostbenefitprojectionModelCountry extends JModelAdmin } } return $value; - } + } /** * Method to get the record form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. * * @return mixed A JForm object on success, false on failure * * @since 1.6 */ - public function getForm($data = array(), $loadData = true) - { + public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData; // Get the form. - $form = $this->loadForm('com_costbenefitprojection.country', 'country', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_costbenefitprojection.country', 'country', $options); if (empty($form)) { @@ -566,17 +563,20 @@ class CostbenefitprojectionModelCountry extends JModelAdmin // Only load these values if no id is found if (0 == $id) { - // Set redirected field name - $redirectedField = $jinput->get('ref', null, 'STRING'); - // Set redirected field value - $redirectedValue = $jinput->get('refid', 0, 'INT'); + // Set redirected view name + $redirectedView = $jinput->get('ref', null, 'STRING'); + // Set field name (or fall back to view name) + $redirectedField = $jinput->get('field', $redirectedView, 'STRING'); + // Set redirected view id + $redirectedId = $jinput->get('refid', 0, 'INT'); + // Set field id (or fall back to redirected view id) + $redirectedValue = $jinput->get('field_id', $redirectedId, 'INT'); if (0 != $redirectedValue && $redirectedField) { // Now set the local-redirected field default value $form->setValue($redirectedField, null, $redirectedValue); } } - return $form; } @@ -627,7 +627,7 @@ class CostbenefitprojectionModelCountry extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -735,7 +735,7 @@ class CostbenefitprojectionModelCountry extends JModelAdmin } return $data; - } + } /** * Method to get the unique fields of this table. @@ -893,7 +893,7 @@ class CostbenefitprojectionModelCountry extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -1017,7 +1017,7 @@ class CostbenefitprojectionModelCountry extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -1051,7 +1051,7 @@ class CostbenefitprojectionModelCountry extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -1062,7 +1062,7 @@ class CostbenefitprojectionModelCountry extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -1220,7 +1220,7 @@ class CostbenefitprojectionModelCountry extends JModelAdmin if (!isset($data['causesrisks'])) { $data['causesrisks'] = ''; - } + } // Set the causesrisks string to JSON string. if (isset($data['causesrisks'])) @@ -1335,14 +1335,14 @@ class CostbenefitprojectionModelCountry extends JModelAdmin } /** - * Method to change the title/s & alias. - * - * @param string $alias The alias. - * @param string/array $title The title. - * - * @return array/string Contains the modified title/s and/or alias. - * - */ + * Method to change the title/s & alias. + * + * @param string $alias The alias. + * @param string/array $title The title. + * + * @return array/string Contains the modified title/s and/or alias. + * + */ protected function _generateNewTitle($alias, $title = null) { diff --git a/admin/models/currencies.php b/admin/models/currencies.php index 737676f0..cff0db6b 100644 --- a/admin/models/currencies.php +++ b/admin/models/currencies.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage currencies.php @author Llewellyn van der Merwe @@ -20,9 +20,6 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -// import the Joomla modellist library -jimport('joomla.application.component.modellist'); - /** * Currencies Model */ @@ -102,7 +99,7 @@ class CostbenefitprojectionModelCurrencies extends JModelList * @return mixed An array of data items on success, false on failure. */ public function getItems() - { + { // check in items $this->checkInNow(); @@ -112,11 +109,9 @@ class CostbenefitprojectionModelCurrencies extends JModelList // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('currency.access', 'com_costbenefitprojection.currency.' . (int) $item->id) && $user->authorise('currency.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('currency.access', 'com_costbenefitprojection.currency.' . (int) $item->id) && JFactory::getUser()->authorise('currency.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -124,7 +119,7 @@ class CostbenefitprojectionModelCurrencies extends JModelList } } - } + } // return items return $items; @@ -202,10 +197,10 @@ class CostbenefitprojectionModelCurrencies extends JModelList } /** - * Method to get list export data. - * - * @return mixed An array of data items on success, false on failure. - */ + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ public function getExportData($pks) { // setup the query @@ -245,11 +240,9 @@ class CostbenefitprojectionModelCurrencies extends JModelList // set values to display correctly. if (CostbenefitprojectionHelper::checkArray($items)) { - // get user object. - $user = JFactory::getUser(); foreach ($items as $nr => &$item) { - $access = ($user->authorise('currency.access', 'com_costbenefitprojection.currency.' . (int) $item->id) && $user->authorise('currency.access', 'com_costbenefitprojection')); + $access = (JFactory::getUser()->authorise('currency.access', 'com_costbenefitprojection.currency.' . (int) $item->id) && JFactory::getUser()->authorise('currency.access', 'com_costbenefitprojection')); if (!$access) { unset($items[$nr]); @@ -299,7 +292,7 @@ class CostbenefitprojectionModelCurrencies extends JModelList return $headers; } return false; - } + } /** * Method to get a store id based on model configuration state. @@ -325,16 +318,16 @@ class CostbenefitprojectionModelCurrencies extends JModelList } /** - * Build an SQL query to checkin all items left checked out longer then a set time. - * - * @return a bool - * - */ + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ protected function checkInNow() { // Get set check in time $time = JComponentHelper::getParams('com_costbenefitprojection')->get('check_in'); - + if ($time) { diff --git a/admin/models/currency.php b/admin/models/currency.php index fdbbf2a7..55c21794 100644 --- a/admin/models/currency.php +++ b/admin/models/currency.php @@ -3,9 +3,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.php @author Llewellyn van der Merwe @@ -22,9 +22,6 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\Registry\Registry; -// import Joomla modelform library -jimport('joomla.application.component.modeladmin'); - /** * Costbenefitprojection Currency Model */ @@ -57,6 +54,9 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin */ public function getTable($type = 'currency', $prefix = 'CostbenefitprojectionTable', $config = array()) { + // add table path for when model gets used from other component + $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_costbenefitprojection/tables'); + // get instance of the table return JTable::getInstance($type, $prefix, $config); } @@ -97,22 +97,25 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin } return $item; - } + } /** * Method to get the record form. * * @param array $data Data for the form. * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * @param array $options Optional array of options for the form creation. * * @return mixed A JForm object on success, false on failure * * @since 1.6 */ - public function getForm($data = array(), $loadData = true) - { + public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData; // Get the form. - $form = $this->loadForm('com_costbenefitprojection.currency', 'currency', array('control' => 'jform', 'load_data' => $loadData)); + $form = $this->loadForm('com_costbenefitprojection.currency', 'currency', $options); if (empty($form)) { @@ -173,17 +176,20 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin // Only load these values if no id is found if (0 == $id) { - // Set redirected field name - $redirectedField = $jinput->get('ref', null, 'STRING'); - // Set redirected field value - $redirectedValue = $jinput->get('refid', 0, 'INT'); + // Set redirected view name + $redirectedView = $jinput->get('ref', null, 'STRING'); + // Set field name (or fall back to view name) + $redirectedField = $jinput->get('field', $redirectedView, 'STRING'); + // Set redirected view id + $redirectedId = $jinput->get('refid', 0, 'INT'); + // Set field id (or fall back to redirected view id) + $redirectedValue = $jinput->get('field_id', $redirectedId, 'INT'); if (0 != $redirectedValue && $redirectedField) { // Now set the local-redirected field default value $form->setValue($redirectedField, null, $redirectedValue); } } - return $form; } @@ -234,7 +240,7 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin protected function canEditState($record) { $user = JFactory::getUser(); - $recordId = (!empty($record->id)) ? $record->id : 0; + $recordId = (!empty($record->id)) ? $record->id : 0; if ($recordId) { @@ -342,7 +348,7 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin } return $data; - } + } /** * Method to get the unique fields of this table. @@ -500,7 +506,7 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin * * @return mixed An array of new IDs on success, boolean false on failure. * - * @since 12.2 + * @since 12.2 */ protected function batchCopy($values, $pks, $contexts) { @@ -593,7 +599,7 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin $this->table->id = 0; // TODO: Deal with ordering? - // $this->table->ordering = 1; + // $this->table->ordering = 1; // Check the row. if (!$this->table->check()) @@ -627,7 +633,7 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin $this->cleanCache(); return $newIds; - } + } /** * Batch move items to a new category @@ -638,7 +644,7 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin * * @return boolean True if successful, false otherwise and internal error is set. * - * @since 12.2 + * @since 12.2 */ protected function batchMove($values, $pks, $contexts) { @@ -759,7 +765,7 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin $metadata = new JRegistry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; - } + } // Set the Params Items to data if (isset($data['params']) && is_array($data['params'])) @@ -868,14 +874,14 @@ class CostbenefitprojectionModelCurrency extends JModelAdmin } /** - * Method to change the title/s & alias. - * - * @param string $alias The alias. - * @param string/array $title The title. - * - * @return array/string Contains the modified title/s and/or alias. - * - */ + * Method to change the title/s & alias. + * + * @param string $alias The alias. + * @param string/array $title The title. + * + * @return array/string Contains the modified title/s and/or alias. + * + */ protected function _generateNewTitle($alias, $title = null) { diff --git a/admin/models/fields/adminviewfolderlist.php b/admin/models/fields/adminviewfolderlist.php index 814c9e6c..e677b702 100644 --- a/admin/models/fields/adminviewfolderlist.php +++ b/admin/models/fields/adminviewfolderlist.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage adminviewfolderlist.php @@ -39,9 +39,9 @@ class JFormFieldAdminviewfolderlist extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // get custom folder files $localfolder = JPATH_COMPONENT_ADMINISTRATOR.'/views'; diff --git a/admin/models/fields/articles.php b/admin/models/fields/articles.php index da7dfa22..b71e991a 100644 --- a/admin/models/fields/articles.php +++ b/admin/models/fields/articles.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage articles.php @@ -39,9 +39,9 @@ class JFormFieldArticles extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); diff --git a/admin/models/fields/causesrisks.php b/admin/models/fields/causesrisks.php index cc43d1ca..b44a735d 100644 --- a/admin/models/fields/causesrisks.php +++ b/admin/models/fields/causesrisks.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesrisks.php @@ -39,9 +39,9 @@ class JFormFieldCausesrisks extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); diff --git a/admin/models/fields/causesriskscheck.php b/admin/models/fields/causesriskscheck.php index 5c010f39..622a4f3d 100644 --- a/admin/models/fields/causesriskscheck.php +++ b/admin/models/fields/causesriskscheck.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesriskscheck.php @@ -39,9 +39,9 @@ class JFormFieldCausesriskscheck extends JFormFieldCheckboxes /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); diff --git a/admin/models/fields/company.php b/admin/models/fields/company.php index d982707b..bbacb334 100644 --- a/admin/models/fields/company.php +++ b/admin/models/fields/company.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.php @@ -68,9 +68,15 @@ class JFormFieldCompany extends JFormFieldList $refJ = ''; if (!is_null($values['id']) && strlen($values['view'])) { - // only load referal if not new item. + // only load referral if not new item. $ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; + // get the return value. + $_uri = (string) JUri::getInstance(); + $_return = urlencode(base64_encode($_uri)); + // load return value. + $ref .= '&return=' . $_return; + $refJ .= '&return=' . $_return; } $user = JFactory::getUser(); // only add if user allowed to create company @@ -140,9 +146,9 @@ class JFormFieldCompany extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // Get the user object. $user = JFactory::getUser(); diff --git a/admin/models/fields/companycheck.php b/admin/models/fields/companycheck.php index 973c69a3..7eec6557 100644 --- a/admin/models/fields/companycheck.php +++ b/admin/models/fields/companycheck.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companycheck.php @@ -39,9 +39,9 @@ class JFormFieldCompanycheck extends JFormFieldCheckboxes /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // Get the user object. $user = JFactory::getUser(); diff --git a/admin/models/fields/countries.php b/admin/models/fields/countries.php index adc7e8b2..1eb7889c 100644 --- a/admin/models/fields/countries.php +++ b/admin/models/fields/countries.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage countries.php @@ -39,9 +39,9 @@ class JFormFieldCountries extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // Get the user object. $user = JFactory::getUser(); diff --git a/admin/models/fields/countryuser.php b/admin/models/fields/countryuser.php index 838b31d8..6b8395f8 100644 --- a/admin/models/fields/countryuser.php +++ b/admin/models/fields/countryuser.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage countryuser.php diff --git a/admin/models/fields/currency.php b/admin/models/fields/currency.php index 1a20b787..fffa45c9 100644 --- a/admin/models/fields/currency.php +++ b/admin/models/fields/currency.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.php @@ -39,9 +39,9 @@ class JFormFieldCurrency extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $db = JFactory::getDBO(); $query = $db->getQuery(true); diff --git a/admin/models/fields/datayear.php b/admin/models/fields/datayear.php index d25a87da..5e6780ea 100644 --- a/admin/models/fields/datayear.php +++ b/admin/models/fields/datayear.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage datayear.php @@ -39,9 +39,9 @@ class JFormFieldDatayear extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { $jinput = JFactory::getApplication()->input; $client = $jinput->get('id', 0, 'INT'); diff --git a/admin/models/fields/interventions.php b/admin/models/fields/interventions.php index 264888c9..ac100391 100644 --- a/admin/models/fields/interventions.php +++ b/admin/models/fields/interventions.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions.php @@ -39,9 +39,9 @@ class JFormFieldInterventions extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // get the input from url $jinput = JFactory::getApplication()->input; diff --git a/admin/models/fields/memberuser.php b/admin/models/fields/memberuser.php index b832b019..9de55eee 100644 --- a/admin/models/fields/memberuser.php +++ b/admin/models/fields/memberuser.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage memberuser.php diff --git a/admin/models/fields/serviceprovider.php b/admin/models/fields/serviceprovider.php index cdc5febb..5801691f 100644 --- a/admin/models/fields/serviceprovider.php +++ b/admin/models/fields/serviceprovider.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage serviceprovider.php @@ -68,9 +68,15 @@ class JFormFieldServiceprovider extends JFormFieldList $refJ = ''; if (!is_null($values['id']) && strlen($values['view'])) { - // only load referal if not new item. + // only load referral if not new item. $ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; + // get the return value. + $_uri = (string) JUri::getInstance(); + $_return = urlencode(base64_encode($_uri)); + // load return value. + $ref .= '&return=' . $_return; + $refJ .= '&return=' . $_return; } $user = JFactory::getUser(); // only add if user allowed to create service_provider @@ -140,9 +146,9 @@ class JFormFieldServiceprovider extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // Get the user object. $user = JFactory::getUser(); diff --git a/admin/models/fields/serviceprovideruser.php b/admin/models/fields/serviceprovideruser.php index f5868d75..ca0d84a2 100644 --- a/admin/models/fields/serviceprovideruser.php +++ b/admin/models/fields/serviceprovideruser.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage serviceprovideruser.php diff --git a/admin/models/fields/siteviewfolderlist.php b/admin/models/fields/siteviewfolderlist.php index 6c0964e5..a1f6db56 100644 --- a/admin/models/fields/siteviewfolderlist.php +++ b/admin/models/fields/siteviewfolderlist.php @@ -3,8 +3,8 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version 3.4.3 - @build 17th May, 2018 + @version 3.4.x + @build 4th April, 2019 @created 15th June, 2012 @package Cost Benefit Projection @subpackage siteviewfolderlist.php @@ -39,9 +39,9 @@ class JFormFieldSiteviewfolderlist extends JFormFieldList /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of JHtml options. */ - public function getOptions() + protected function getOptions() { // get custom folder files $localfolder = JPATH_COMPONENT_SITE.'/views'; diff --git a/admin/models/forms/causerisk.js b/admin/models/forms/causerisk.js index 511bad39..382a5bcd 100644 --- a/admin/models/forms/causerisk.js +++ b/admin/models/forms/causerisk.js @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 24 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk.js @author Llewellyn van der Merwe diff --git a/admin/models/forms/causerisk.xml b/admin/models/forms/causerisk.xml index 76c12ae5..b700da96 100644 --- a/admin/models/forms/causerisk.xml +++ b/admin/models/forms/causerisk.xml @@ -108,6 +108,7 @@ label="COM_COSTBENEFITPROJECTION_CAUSERISK_REF_LABEL" size="10" maxlength="50" + default="" description="COM_COSTBENEFITPROJECTION_CAUSERISK_REF_DESCRIPTION" class="text_area" readonly="false" @@ -140,6 +141,7 @@ label="COM_COSTBENEFITPROJECTION_CAUSERISK_IMPORT_ID_LABEL" size="50" maxlength="150" + default="" description="COM_COSTBENEFITPROJECTION_CAUSERISK_IMPORT_ID_DESCRIPTION" class="text_area" required="true" diff --git a/admin/models/forms/company.js b/admin/models/forms/company.js index f689e80c..e76f1371 100644 --- a/admin/models/forms/company.js +++ b/admin/models/forms/company.js @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 101 of this MVC - @build 29th June, 2016 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.js @author Llewellyn van der Merwe @@ -42,6 +42,7 @@ function vvvvvvv(department_vvvvvvv) if (department_vvvvvvv == 2) { jQuery('#jform_causesrisks').closest('.control-group').show(); + // add required attribute to causesrisks field if (jform_vvvvvvvvvv_required) { updateFieldRequired('causesrisks',0); @@ -50,10 +51,10 @@ function vvvvvvv(department_vvvvvvv) jQuery('#jform_causesrisks').addClass('required'); jform_vvvvvvvvvv_required = false; } - jQuery('#jform_percentfemale').closest('.control-group').show(); jQuery('#jform_percentmale').closest('.control-group').show(); jQuery('#jform_productivity_losses').closest('.control-group').show(); + // add required attribute to productivity_losses field if (jform_vvvvvvvvvw_required) { updateFieldRequired('productivity_losses',0); @@ -62,8 +63,8 @@ function vvvvvvv(department_vvvvvvv) jQuery('#jform_productivity_losses').addClass('required'); jform_vvvvvvvvvw_required = false; } - jQuery('#jform_medical_turnovers_females').closest('.control-group').show(); + // add required attribute to medical_turnovers_females field if (jform_vvvvvvvvvx_required) { updateFieldRequired('medical_turnovers_females',0); @@ -72,8 +73,8 @@ function vvvvvvv(department_vvvvvvv) jQuery('#jform_medical_turnovers_females').addClass('required'); jform_vvvvvvvvvx_required = false; } - jQuery('#jform_medical_turnovers_males').closest('.control-group').show(); + // add required attribute to medical_turnovers_males field if (jform_vvvvvvvvvy_required) { updateFieldRequired('medical_turnovers_males',0); @@ -82,8 +83,8 @@ function vvvvvvv(department_vvvvvvv) jQuery('#jform_medical_turnovers_males').addClass('required'); jform_vvvvvvvvvy_required = false; } - jQuery('#jform_sick_leave_females').closest('.control-group').show(); + // add required attribute to sick_leave_females field if (jform_vvvvvvvvvz_required) { updateFieldRequired('sick_leave_females',0); @@ -92,8 +93,8 @@ function vvvvvvv(department_vvvvvvv) jQuery('#jform_sick_leave_females').addClass('required'); jform_vvvvvvvvvz_required = false; } - jQuery('#jform_sick_leave_males').closest('.control-group').show(); + // add required attribute to sick_leave_males field if (jform_vvvvvvvvwa_required) { updateFieldRequired('sick_leave_males',0); @@ -102,8 +103,8 @@ function vvvvvvv(department_vvvvvvv) jQuery('#jform_sick_leave_males').addClass('required'); jform_vvvvvvvvwa_required = false; } - jQuery('#jform_total_healthcare').closest('.control-group').show(); + // add required attribute to total_healthcare field if (jform_vvvvvvvvwb_required) { updateFieldRequired('total_healthcare',0); @@ -112,12 +113,12 @@ function vvvvvvv(department_vvvvvvv) jQuery('#jform_total_healthcare').addClass('required'); jform_vvvvvvvvwb_required = false; } - jQuery('#jform_turnover_comment').closest('.control-group').show(); } else { jQuery('#jform_causesrisks').closest('.control-group').hide(); + // remove required attribute from causesrisks field if (!jform_vvvvvvvvvv_required) { updateFieldRequired('causesrisks',1); @@ -129,6 +130,7 @@ function vvvvvvv(department_vvvvvvv) jQuery('#jform_percentfemale').closest('.control-group').hide(); jQuery('#jform_percentmale').closest('.control-group').hide(); jQuery('#jform_productivity_losses').closest('.control-group').hide(); + // remove required attribute from productivity_losses field if (!jform_vvvvvvvvvw_required) { updateFieldRequired('productivity_losses',1); @@ -138,6 +140,7 @@ function vvvvvvv(department_vvvvvvv) jform_vvvvvvvvvw_required = true; } jQuery('#jform_medical_turnovers_females').closest('.control-group').hide(); + // remove required attribute from medical_turnovers_females field if (!jform_vvvvvvvvvx_required) { updateFieldRequired('medical_turnovers_females',1); @@ -147,6 +150,7 @@ function vvvvvvv(department_vvvvvvv) jform_vvvvvvvvvx_required = true; } jQuery('#jform_medical_turnovers_males').closest('.control-group').hide(); + // remove required attribute from medical_turnovers_males field if (!jform_vvvvvvvvvy_required) { updateFieldRequired('medical_turnovers_males',1); @@ -156,6 +160,7 @@ function vvvvvvv(department_vvvvvvv) jform_vvvvvvvvvy_required = true; } jQuery('#jform_sick_leave_females').closest('.control-group').hide(); + // remove required attribute from sick_leave_females field if (!jform_vvvvvvvvvz_required) { updateFieldRequired('sick_leave_females',1); @@ -165,6 +170,7 @@ function vvvvvvv(department_vvvvvvv) jform_vvvvvvvvvz_required = true; } jQuery('#jform_sick_leave_males').closest('.control-group').hide(); + // remove required attribute from sick_leave_males field if (!jform_vvvvvvvvwa_required) { updateFieldRequired('sick_leave_males',1); @@ -174,6 +180,7 @@ function vvvvvvv(department_vvvvvvv) jform_vvvvvvvvwa_required = true; } jQuery('#jform_total_healthcare').closest('.control-group').hide(); + // remove required attribute from total_healthcare field if (!jform_vvvvvvvvwb_required) { updateFieldRequired('total_healthcare',1); diff --git a/admin/models/forms/company.xml b/admin/models/forms/company.xml index 743ac70a..c721f1c7 100644 --- a/admin/models/forms/company.xml +++ b/admin/models/forms/company.xml @@ -85,6 +85,21 @@ filter="unset" /> + + - - @@ -175,163 +176,22 @@ - + - - - - - - - - - - - - - - - - - - - - + + + + - + + + + + - - diff --git a/admin/models/forms/country.js b/admin/models/forms/country.js index 188c3b9e..64739a98 100644 --- a/admin/models/forms/country.js +++ b/admin/models/forms/country.js @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 54 of this MVC - @build 17th May, 2018 - @created 25th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage country.js @author Llewellyn van der Merwe diff --git a/admin/models/forms/country.xml b/admin/models/forms/country.xml index 0f3cdc26..24395975 100644 --- a/admin/models/forms/country.xml +++ b/admin/models/forms/country.xml @@ -106,6 +106,7 @@ type="countryuser" name="user" label="COM_COSTBENEFITPROJECTION_COUNTRY_USER_LABEL" + default="" hint="COM_COSTBENEFITPROJECTION_COUNTRY_USER_HINT" /> @@ -116,6 +117,7 @@ description="COM_COSTBENEFITPROJECTION_COUNTRY_CURRENCY_DESCRIPTION" class="list_class" multiple="false" + default="" required="true" /> @@ -125,6 +127,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_CODETHREE_LABEL" size="40" maxlength="3" + default="" description="COM_COSTBENEFITPROJECTION_COUNTRY_CODETHREE_DESCRIPTION" class="text_area" required="true" @@ -139,6 +142,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_CODETWO_LABEL" size="40" maxlength="2" + default="" description="COM_COSTBENEFITPROJECTION_COUNTRY_CODETWO_DESCRIPTION" class="text_area" required="true" @@ -173,13 +177,14 @@ message="COM_COSTBENEFITPROJECTION_COUNTRY_PUBLICEMAIL_MESSAGE" hint="COM_COSTBENEFITPROJECTION_COUNTRY_PUBLICEMAIL_HINT" /> - + + required="false" + default=""> @@ -268,6 +276,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_NUMBER_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" @@ -284,7 +293,8 @@ class="list_class" multiple="false" filter="INT" - required="false"> + required="false" + default=""> @@ -337,6 +347,7 @@ name="maledeath" label="COM_COSTBENEFITPROJECTION_COUNTRY_MALEDEATH_LABEL" description="COM_COSTBENEFITPROJECTION_COUNTRY_MALEDEATH_DESCRIPTION" + default="" id="maledeath" class="malesdeath" select="COM_COSTBENEFITPROJECTION_COUNTRY_MALEDEATH_SELECT" @@ -351,7 +362,8 @@ class="list_class" multiple="false" filter="CMD" - required="false"> + required="false" + default=""> @@ -381,6 +393,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_NUMBER_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" @@ -397,7 +410,8 @@ class="list_class" multiple="false" filter="INT" - required="false"> + required="false" + default=""> @@ -441,6 +455,7 @@ name="percentfemale" label="COM_COSTBENEFITPROJECTION_COUNTRY_PERCENTFEMALE_LABEL" description="COM_COSTBENEFITPROJECTION_COUNTRY_PERCENTFEMALE_DESCRIPTION" + default="" id="percentfemale" class="percentfemales" select="COM_COSTBENEFITPROJECTION_COUNTRY_PERCENTFEMALE_SELECT" @@ -456,7 +471,8 @@ class="list_class" multiple="false" filter="CMD" - required="false"> + required="false" + default=""> @@ -486,6 +502,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_PERCENT_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" @@ -524,6 +541,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_WORLDZONE_LABEL" size="40" maxlength="50" + default="" description="COM_COSTBENEFITPROJECTION_COUNTRY_WORLDZONE_DESCRIPTION" class="text_area" required="false" @@ -537,6 +555,7 @@ name="percentmale" label="COM_COSTBENEFITPROJECTION_COUNTRY_PERCENTMALE_LABEL" description="COM_COSTBENEFITPROJECTION_COUNTRY_PERCENTMALE_DESCRIPTION" + default="" id="percentmale" class="percentmales" select="COM_COSTBENEFITPROJECTION_COUNTRY_PERCENTMALE_SELECT" @@ -552,7 +571,8 @@ class="list_class" multiple="false" filter="CMD" - required="false"> + required="false" + default=""> @@ -582,6 +602,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_PERCENT_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" @@ -600,6 +621,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_PRESENTEEISM_LABEL" size="10" maxlength="10" + default="" description="COM_COSTBENEFITPROJECTION_COUNTRY_PRESENTEEISM_DESCRIPTION" class="text_area" readonly="false" @@ -615,6 +637,7 @@ name="causesrisks" label="COM_COSTBENEFITPROJECTION_COUNTRY_CAUSESRISKS_LABEL" class="list_class" + default="" required="true" /> @@ -624,6 +647,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_MEDICAL_TURNOVERS_LABEL" size="10" maxlength="10" + default="" description="COM_COSTBENEFITPROJECTION_COUNTRY_MEDICAL_TURNOVERS_DESCRIPTION" class="text_area" readonly="false" @@ -639,6 +663,7 @@ name="femaledeath" label="COM_COSTBENEFITPROJECTION_COUNTRY_FEMALEDEATH_LABEL" description="COM_COSTBENEFITPROJECTION_COUNTRY_FEMALEDEATH_DESCRIPTION" + default="" id="femaledeath" class="femalesdeath" select="COM_COSTBENEFITPROJECTION_COUNTRY_FEMALEDEATH_SELECT" @@ -653,7 +678,8 @@ class="list_class" multiple="false" filter="CMD" - required="false"> + required="false" + default=""> @@ -683,6 +709,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_NUMBER_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" @@ -699,7 +726,8 @@ class="list_class" multiple="false" filter="INT" - required="false"> + required="false" + default=""> @@ -744,6 +772,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_SICK_LEAVE_LABEL" size="10" maxlength="10" + default="" description="COM_COSTBENEFITPROJECTION_COUNTRY_SICK_LEAVE_DESCRIPTION" class="text_area" readonly="false" @@ -759,6 +788,7 @@ name="femaleyld" label="COM_COSTBENEFITPROJECTION_COUNTRY_FEMALEYLD_LABEL" description="COM_COSTBENEFITPROJECTION_COUNTRY_FEMALEYLD_DESCRIPTION" + default="" id="femaleyld" class="femalesyld" select="COM_COSTBENEFITPROJECTION_COUNTRY_FEMALEYLD_SELECT" @@ -774,7 +804,8 @@ class="list_class" multiple="false" filter="CMD" - required="false"> + required="false" + default=""> @@ -804,6 +835,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_NUMBER_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" @@ -820,7 +852,8 @@ class="list_class" multiple="false" filter="INT" - required="false"> + required="false" + default=""> @@ -865,6 +898,7 @@ label="COM_COSTBENEFITPROJECTION_COUNTRY_HEALTHCARE_LABEL" size="10" maxlength="10" + default="" description="COM_COSTBENEFITPROJECTION_COUNTRY_HEALTHCARE_DESCRIPTION" class="text_area" readonly="false" diff --git a/admin/models/forms/currency.js b/admin/models/forms/currency.js index 37982a68..3e46f9e8 100644 --- a/admin/models/forms/currency.js +++ b/admin/models/forms/currency.js @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 17th May, 2018 - @created 8th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.js @author Llewellyn van der Merwe diff --git a/admin/models/forms/currency.xml b/admin/models/forms/currency.xml index cbadaedc..c7769397 100644 --- a/admin/models/forms/currency.xml +++ b/admin/models/forms/currency.xml @@ -108,6 +108,7 @@ label="COM_COSTBENEFITPROJECTION_CURRENCY_CODETHREE_LABEL" size="40" maxlength="3" + default="" description="COM_COSTBENEFITPROJECTION_CURRENCY_CODETHREE_DESCRIPTION" class="text_area" required="true" @@ -122,6 +123,7 @@ label="COM_COSTBENEFITPROJECTION_CURRENCY_NUMERICCODE_LABEL" size="40" maxlength="5" + default="" description="COM_COSTBENEFITPROJECTION_CURRENCY_NUMERICCODE_DESCRIPTION" class="text_area" required="true" @@ -136,6 +138,7 @@ label="COM_COSTBENEFITPROJECTION_CURRENCY_SYMBOL_LABEL" size="40" maxlength="7" + default="" description="COM_COSTBENEFITPROJECTION_CURRENCY_SYMBOL_DESCRIPTION" class="text_area" required="true" @@ -158,6 +161,7 @@ name="negativestyle" label="COM_COSTBENEFITPROJECTION_CURRENCY_NEGATIVESTYLE_LABEL" size="40" + default="" description="COM_COSTBENEFITPROJECTION_CURRENCY_NEGATIVESTYLE_DESCRIPTION" class="text_area" required="true" @@ -171,6 +175,7 @@ name="positivestyle" label="COM_COSTBENEFITPROJECTION_CURRENCY_POSITIVESTYLE_LABEL" size="40" + default="" description="COM_COSTBENEFITPROJECTION_CURRENCY_POSITIVESTYLE_DESCRIPTION" class="text_area" required="true" @@ -214,6 +219,7 @@ name="thousands" label="COM_COSTBENEFITPROJECTION_CURRENCY_THOUSANDS_LABEL" size="40" + default="" class="text_area" required="true" filter="STRING" diff --git a/admin/models/forms/health_data.js b/admin/models/forms/health_data.js index 41d8c6a2..553debd0 100644 --- a/admin/models/forms/health_data.js +++ b/admin/models/forms/health_data.js @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 110 of this MVC - @build 17th May, 2018 - @created 15th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data.js @author Llewellyn van der Merwe diff --git a/admin/models/forms/health_data.xml b/admin/models/forms/health_data.xml index 266396fc..8a8ccd86 100644 --- a/admin/models/forms/health_data.xml +++ b/admin/models/forms/health_data.xml @@ -103,7 +103,8 @@ class="list_class" multiple="false" filter="INT" - required="true"> + required="true" + default=""> @@ -155,6 +156,7 @@ name="femaleyld" label="COM_COSTBENEFITPROJECTION_HEALTH_DATA_FEMALEYLD_LABEL" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_FEMALEYLD_DESCRIPTION" + default="" id="femaleyld" class="femalesyld" select="COM_COSTBENEFITPROJECTION_HEALTH_DATA_FEMALEYLD_SELECT" @@ -170,7 +172,8 @@ class="list_class" multiple="false" filter="CMD" - required="false"> + required="false" + default=""> @@ -200,6 +203,7 @@ label="COM_COSTBENEFITPROJECTION_HEALTH_DATA_NUMBER_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" @@ -217,6 +221,7 @@ name="femaledeath" label="COM_COSTBENEFITPROJECTION_HEALTH_DATA_FEMALEDEATH_LABEL" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_FEMALEDEATH_DESCRIPTION" + default="" id="femaledeath" class="femalesdeath" select="COM_COSTBENEFITPROJECTION_HEALTH_DATA_FEMALEDEATH_SELECT" @@ -232,7 +237,8 @@ class="list_class" multiple="false" filter="CMD" - required="false"> + required="false" + default=""> @@ -262,6 +268,7 @@ label="COM_COSTBENEFITPROJECTION_HEALTH_DATA_NUMBER_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" @@ -279,6 +286,7 @@ name="maleyld" label="COM_COSTBENEFITPROJECTION_HEALTH_DATA_MALEYLD_LABEL" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_MALEYLD_DESCRIPTION" + default="" id="maleyld" class="malesyld" select="COM_COSTBENEFITPROJECTION_HEALTH_DATA_MALEYLD_SELECT" @@ -294,7 +302,8 @@ class="list_class" multiple="false" filter="CMD" - required="false"> + required="false" + default=""> @@ -324,6 +333,7 @@ label="COM_COSTBENEFITPROJECTION_HEALTH_DATA_NUMBER_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" @@ -341,6 +351,7 @@ name="maledeath" label="COM_COSTBENEFITPROJECTION_HEALTH_DATA_MALEDEATH_LABEL" description="COM_COSTBENEFITPROJECTION_HEALTH_DATA_MALEDEATH_DESCRIPTION" + default="" id="maledeath" class="malesdeath" select="COM_COSTBENEFITPROJECTION_HEALTH_DATA_MALEDEATH_SELECT" @@ -356,7 +367,8 @@ class="list_class" multiple="false" filter="CMD" - required="false"> + required="false" + default=""> @@ -386,6 +398,7 @@ label="COM_COSTBENEFITPROJECTION_HEALTH_DATA_NUMBER_LABEL" size="10" maxlength="50" + default="" class="text_area" readonly="false" disabled="false" diff --git a/admin/models/forms/help_document.js b/admin/models/forms/help_document.js index 60cd11e0..f2c7ceb3 100644 --- a/admin/models/forms/help_document.js +++ b/admin/models/forms/help_document.js @@ -2,9 +2,9 @@ Deutsche Gesellschaft für International Zusammenarbeit (GIZ) Gmb /-------------------------------------------------------------------------------------------------------/ - @version @update number 20 of this MVC - @build 13th April, 2018 - @created 13th July, 2015 + @version 3.4.x + @build 4th April, 2019 + @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_document.js @author Llewellyn van der Merwe @@ -53,6 +53,7 @@ function vvvvvwb(location_vvvvvwb) if (location_vvvvvwb == 1) { jQuery('#jform_admin_view').closest('.control-group').show(); + // add required attribute to admin_view field if (jform_vvvvvwbvwl_required) { updateFieldRequired('admin_view',0); @@ -61,11 +62,11 @@ function vvvvvwb(location_vvvvvwb) jQuery('#jform_admin_view').addClass('required'); jform_vvvvvwbvwl_required = false; } - } else { jQuery('#jform_admin_view').closest('.control-group').hide(); + // remove required attribute from admin_view field if (!jform_vvvvvwbvwl_required) { updateFieldRequired('admin_view',1); @@ -84,6 +85,7 @@ function vvvvvwc(location_vvvvvwc) if (location_vvvvvwc == 2) { jQuery('#jform_site_view').closest('.control-group').show(); + // add required attribute to site_view field if (jform_vvvvvwcvwm_required) { updateFieldRequired('site_view',0); @@ -92,11 +94,11 @@ function vvvvvwc(location_vvvvvwc) jQuery('#jform_site_view').addClass('required'); jform_vvvvvwcvwm_required = false; } - } else { jQuery('#jform_site_view').closest('.control-group').hide(); + // remove required attribute from site_view field if (!jform_vvvvvwcvwm_required) { updateFieldRequired('site_view',1); @@ -128,6 +130,7 @@ function vvvvvwd(type_vvvvvwd) if (type) { jQuery('#jform_url').closest('.control-group').show(); + // add required attribute to url field if (jform_vvvvvwdvwn_required) { updateFieldRequired('url',0); @@ -136,11 +139,11 @@ function vvvvvwd(type_vvvvvwd) jQuery('#jform_url').addClass('required'); jform_vvvvvwdvwn_required = false; } - } else { jQuery('#jform_url').closest('.control-group').hide(); + // remove required attribute from url field if (!jform_vvvvvwdvwn_required) { updateFieldRequired('url',1); @@ -183,6 +186,7 @@ function vvvvvwe(type_vvvvvwe) if (type) { jQuery('#jform_article').closest('.control-group').show(); + // add required attribute to article field if (jform_vvvvvwevwo_required) { updateFieldRequired('article',0); @@ -191,11 +195,11 @@ function vvvvvwe(type_vvvvvwe) jQuery('#jform_article').addClass('required'); jform_vvvvvwevwo_required = false; } - } else { jQuery('#jform_article').closest('.control-group').hide(); + // remove required attribute from article field if (!jform_vvvvvwevwo_required) { updateFieldRequired('article',1); @@ -238,6 +242,7 @@ function vvvvvwf(type_vvvvvwf) if (type) { jQuery('#jform_content-lbl').closest('.control-group').show(); + // add required attribute to content field if (jform_vvvvvwfvwp_required) { updateFieldRequired('content',0); @@ -246,11 +251,11 @@ function vvvvvwf(type_vvvvvwf) jQuery('#jform_content').addClass('required'); jform_vvvvvwfvwp_required = false; } - } else { jQuery('#jform_content-lbl').closest('.control-group').hide(); + // remove required attribute from content field if (!jform_vvvvvwfvwp_required) { updateFieldRequired('content',1); @@ -280,6 +285,7 @@ function vvvvvwg(target_vvvvvwg) if (target_vvvvvwg == 1) { jQuery('#jform_groups').closest('.control-group').show(); + // add required attribute to groups field if (jform_vvvvvwgvwq_required) { updateFieldRequired('groups',0); @@ -288,11 +294,11 @@ function vvvvvwg(target_vvvvvwg) jQuery('#jform_groups').addClass('required'); jform_vvvvvwgvwq_required = false; } - } else { jQuery('#jform_groups').closest('.control-group').hide(); + // remove required attribute from groups field if (!jform_vvvvvwgvwq_required) { updateFieldRequired('groups',1); diff --git a/admin/models/forms/help_document.xml b/admin/models/forms/help_document.xml index 7cfa8681..61c14e07 100644 --- a/admin/models/forms/help_document.xml +++ b/admin/models/forms/help_document.xml @@ -101,7 +101,8 @@ description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_TYPE_DESCRIPTION" class="list_class" multiple="false" - required="true"> + required="true" + default=""> @@ -128,6 +129,7 @@ label="COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_LOCATION_LABEL" description="COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_LOCATION_DESCRIPTION" class="btn-group" + default="" required="true">