From 524378f6e03fb7703a18d98d2ea0d0d2eb42f021 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 19 Feb 2020 04:21:34 +0000 Subject: [PATCH 1/3] Add dashboard_enable to .env.dist. #334 --- .env.dist | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.env.dist b/.env.dist index b0392b88..30f9a925 100644 --- a/.env.dist +++ b/.env.dist @@ -15,7 +15,7 @@ APP_SECRET=b344cd6cd151ae1d61403ed55806c5ce # Configure your db driver and server_version in config/packages/doctrine.yaml DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name ###< doctrine/doctrine-bundle ### -GMAPS_API_KEY=insertgmapsapikeyhere +GMAPS_API_KEY=insert_gmapsapikey_here # rising tide sms gateway RT_USER=rt_user @@ -28,7 +28,7 @@ RT_SHORTCODE=1234 MQTT_IP_ADDRESS=localhost MQTT_PORT=8883 MQTT_CERT=/location/of/cert/file.crt -MQTT_WS_HOST=insertiphere +MQTT_WS_HOST=insert_ip_here MQTT_WS_PORT=8083 # redis client @@ -38,20 +38,22 @@ REDIS_CLIENT_PORT=6379 REDIS_CLIENT_PASSWORD=foobared # privacy policy ids -POLICY_PROMO=insertpromopolicyidhere -POLICY_THIRD_PARTY=insertthirdpartypolicyidhere -POLICY_MOBILE=insertmobilepolicyidhere +POLICY_PROMO=insert_promopolicyid_here +POLICY_THIRD_PARTY=insert_thirdpartypolicyid_here +POLICY_MOBILE=insert_mobilepolicyid_here # OTP -OTP_MODE=settotestorrandom +OTP_MODE=set_to_test_or_random # geofence -GEOFENCE_ENABLE=settotrueorfalse +GEOFENCE_ENABLE=set_to_true_or_false # unknown manufacturer and vehicle ids -CVU_MFG_ID=insertmfgidforunknownvehicles -CVU_BRAND_ID=insertbrandidforunknownvehicles +CVU_MFG_ID=insert_mfgid_for_unknown_vehicles +CVU_BRAND_ID=insert_brandid_for_unknown_vehicles # country code prefix -COUNTRY_CODE=+insertcountrycodehere +COUNTRY_CODE=+insert_country_code_here +# dashboard +DASHBOARD_ENABLE=set_to_true_or_false From 7b5239e5487ada81a63c5b36c8dfb8b35e06541e Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Wed, 19 Feb 2020 05:22:57 +0000 Subject: [PATCH 2/3] Add checking for dashboard_enable. #334 --- config/packages/twig.yaml | 1 + templates/home.html.twig | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index d912927a..cb90797b 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -6,3 +6,4 @@ twig: gmaps_api_key: "%env(GMAPS_API_KEY)%" mqtt_host: "%env(MQTT_WS_HOST)%" mqtt_port: "%env(MQTT_WS_PORT)%" + dashboard_enable: "%env(DASHBOARD_ENABLE)%" diff --git a/templates/home.html.twig b/templates/home.html.twig index 975b0ea5..b7ac2c24 100644 --- a/templates/home.html.twig +++ b/templates/home.html.twig @@ -15,7 +15,9 @@ -{{ include('map/' ~ map_js_file) }} +{% if dashboard_enable == 'true' %} + {{ include('map/' ~ map_js_file) }} +{% endif %} {% endblock %} From 4b9b3622d5232a6647b0d90685e5dfb588f7bde4 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 24 Feb 2020 03:06:47 +0000 Subject: [PATCH 3/3] Fix to display service charge amount when loading an existing JO. #355 --- .../JobOrderHandler/CMBJobOrderHandler.php | 17 ++++++++++++++++- templates/job-order/cmb.form.onestep.html.twig | 6 +++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Service/JobOrderHandler/CMBJobOrderHandler.php b/src/Service/JobOrderHandler/CMBJobOrderHandler.php index 06f1fb72..e61108bf 100644 --- a/src/Service/JobOrderHandler/CMBJobOrderHandler.php +++ b/src/Service/JobOrderHandler/CMBJobOrderHandler.php @@ -1407,7 +1407,22 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface $params['mode'] = 'onestep-edit'; $params['cvid'] = $obj->getCustomerVehicle()->getID(); $params['vid'] = $obj->getCustomerVehicle()->getVehicle()->getID(); - $params['jo_service_charges'] = $obj->getMeta('service_charges'); + + // get service charges + $sc_array = []; + $jo_service_charges = $obj->getMeta('service_charges'); + if (!(empty($jo_service_charges))) + { + foreach ($jo_service_charges as $jo_sc_id) + { + // find service charge + $sc_obj = $em->getRepository(ServiceCharge::class)->find($jo_sc_id); + + $sc_array[] = $sc_obj; + } + } + + $params['jo_service_charges'] = $sc_array; $this->fillDropdownParameters($params); $this->fillFormTags($params); diff --git a/templates/job-order/cmb.form.onestep.html.twig b/templates/job-order/cmb.form.onestep.html.twig index 4c913bca..c5246ddb 100644 --- a/templates/job-order/cmb.form.onestep.html.twig +++ b/templates/job-order/cmb.form.onestep.html.twig @@ -508,19 +508,19 @@ {% endif %} - {% for jo_sc_key, jo_sc in obj.getMeta('service_charges')|default([]) %} + {% for jo_sc in jo_service_charges %}
- +