Answers.Body: <p>You could try changing <a href="https://lab.civicrm.org/extensions/activityhours/-/blob/a459af5c4d5128a1f510a0eaabdd2e565909523b/activityhours.php#L141" rel="nofollow noreferrer">this line</a> in activityhours.php from:</p>
  <p><code>if ($formName == 'CRM_Activity_Form_Activity' &amp;&amp; !CRM_Utils_Request::retrieveValue('snippet', 'String')) {</code></p>
  <p>to</p>
  <p><code>if (($formName == 'CRM_Activity_Form_Activity' || $formName == 'CRM_Case_Form_Activity') &amp;&amp; !CRM_Utils_Request::retrieveValue('snippet', 'String')) {</code></p>
  <p>You'd probably also have to add some selectors in the .js file, e.g. whereever it says <code>.crm-activity-form-block-duration</code> also add <code>.crm-case-activity-form-block-duration</code></p>
  <p>You could post a feature request at <a href="https://lab.civicrm.org/extensions/activityhours/-/issues" rel="nofollow noreferrer">https://lab.civicrm.org/extensions/activityhours/-/issues</a>, but if you're able to also post a merge request with some tested code changes that would be best.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-06T05:13:50.797Z
Answers.Text: Hi Demerit, thank you for the prompt response. I have changed the lines based on your advice but the duration is still in minutes (Please see above). Please
Answers.UserDisplayName: TIAPL
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-06T14:18:11.943Z
Answers.Text: I was giving general instructions but you're going to have to investigate further and find the right things to add. The javascript I mentioned is just for viewing not editing but note you would need to add a selector as an additional target not insert the class into the existing target. For editing just the line in activityhours.php should work but note that on a New Case it's a different form so you would need to make additional adjustments specific to Open Case. It will take some trial and error.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-07T12:46:30.470Z
Answers.Text: My apologies: not being a coder & with English being a second language. I hope for a more layman explanation/ instructions
Answers.UserDisplayName: TIAPL
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-07T16:36:25.863Z
Answers.Text: No need to apologize it's just to add a feature like this and work out the details and test it etc someone will have to put in some time and effort.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-03T16:00:46.863Z
Answers.LastActivityDate: 2021-02-03T16:00:46.863Z
Answers.UserDisplayName: Demerit
Body: <p>Currently using CiviCRM Version 5.31 (Wordpress Version 5.5.3)</p>
  <p>Installed the extension to change Activities Duration from Minutes to Hours</p>
  <p><a href="https://lab.civicrm.org/extensions/activityhours" rel="nofollow noreferrer">https://lab.civicrm.org/extensions/activityhours</a></p>
  <p>The extension works for Contact Activities but not Case Activities.</p>
  <p><a href="https://i.sstatic.net/ilRTB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ilRTB.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.sstatic.net/qYmms.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qYmms.jpg" alt="enter image description here" /></a></p>
  <p>Does anyone know what needs to be done to make the changes in Case Activities ?</p>
  <p>===========================================================================</p>
  <p>Hi Demerit, thank you for the prompt response.</p>
  <p>I changed the lines in both activityhours.php and activityhours.js but the duration for case activities are still in 'minutes'.</p>
  <p>Please advise</p>
  <p><a href="https://i.sstatic.net/ilRTB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ilRTB.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.sstatic.net/qYmms.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qYmms.jpg" alt="enter image description here" /></a></p>
  
Tags: <extension><civicase><activities>
Title: Activity Duration in Hours extension NOT working for CiviCase
ThreadText: # Activity Duration in Hours extension NOT working for CiviCase
  
  (Asked by: username_0 on 2021-02-03)
  
  Currently using CiviCRM Version 5.31 (Wordpress Version 5.5.3)
  
  Installed the extension to change Activities Duration from Minutes to Hours
  
  <https://lab.civicrm.org/extensions/activityhours>
  
  The extension works for Contact Activities but not Case Activities.
  
  [![enter image description here](https://i.sstatic.net/ilRTB.png)](https://i.sstatic.net/ilRTB.png)
  
  [![enter image description here](https://i.sstatic.net/qYmms.jpg)](https://i.sstatic.net/qYmms.jpg)
  
  Does anyone know what needs to be done to make the changes in Case Activities ?
  
  ===========================================================================
  
  Hi username_1, thank you for the prompt response.
  
  I changed the lines in both activityhours.php and activityhours.js but the duration for case activities are still in 'minutes'.
  
  Please advise
  
  [![enter image description here](https://i.sstatic.net/ilRTB.png)](https://i.sstatic.net/ilRTB.png)
  
  [![enter image description here](https://i.sstatic.net/qYmms.jpg)](https://i.sstatic.net/qYmms.jpg)
  
  **Tags:** extension, civicase, activities
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-02-03. Score: 1
  
  You could try changing [this line](https://lab.civicrm.org/extensions/activityhours/-/blob/a459af5c4d5128a1f510a0eaabdd2e565909523b/activityhours.php#L141) in activityhours.php from:
  
  `if ($formName == 'CRM_Activity_Form_Activity' && !CRM_Utils_Request::retrieveValue('snippet', 'String')) {`
  
  to
  
  `if (($formName == 'CRM_Activity_Form_Activity' || $formName == 'CRM_Case_Form_Activity') && !CRM_Utils_Request::retrieveValue('snippet', 'String')) {`
  
  You'd probably also have to add some selectors in the .js file, e.g. whereever it says `.crm-activity-form-block-duration` also add `.crm-case-activity-form-block-duration`
  
  You could post a feature request at <https://lab.civicrm.org/extensions/activityhours/-/issues>, but if you're able to also post a merge request with some tested code changes that would be best.
  
  > **Comments:**
  > **username_0**: Hi username_1, thank you for the prompt response. I have changed the lines based on your advice but the duration is still in minutes (Please see above). Please  
  > **username_1**: I was giving general instructions but you're going to have to investigate further and find the right things to add. The javascript I mentioned is just for viewing not editing but note you would need to add a selector as an additional target not insert the class into the existing target. For editing just the line in activityhours.php should work but note that on a New Case it's a different form so you would need to make additional adjustments specific to Open Case. It will take some trial and error.  
  > **username_0**: My apologies: not being a coder & with English being a second language. I hope for a more layman explanation/ instructions  
  > **username_1**: No need to apologize it's just to add a feature like this and work out the details and test it etc someone will have to put in some time and effort.  
  
  ---
  
  