CRM-21550 Show report template name and file in Developer tab of Report

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.7.28
    • Fix Version/s: 4.7.30
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      If we are looking at report #99, it is difficult to tell from which template this report was created. Sure you can dig into the source or go to the "manage templates" or "create reports from templates" screens in the Civi UI, but this is cumbersome.

      What if the name & file of the template used was displayed in the Developer tab of the report itself, right above the MySQL output? Allen Shaw

        Attachments

          Activity

          [CRM-21550] Show report template name and file in Developer tab of Report
          Allen Shaw added a comment -

          I love this idea and have done it myself but didn't think of contributing to core. I would probably do this by calling addToDeveloperTab('Report template: '. get_class($this)); in CRM_Report_Form::postProcess() or CRM_Report_Form::beginPostProcess().  

           

          Allen Shaw added a comment - - edited

          We could also use something like this (I think) to print the full path to the specific report template class file (because once you know the class name, you still have to ask: "Is this in core? custom php directory? one of my many extensions?")

          $obj = new ReflectionClass($this);
          addToDeveloperTab('Report template file: '. $obj->getFileName());

          Is there an argument to be made that we don't want to expose full file paths even to users with Administer CiviReport permission?

          Stoob added a comment - - edited

          Awesome, thank you. Each template has a class and file as well as a label name. It occurs to me even users (non-developers) would be interested in knowing the label name, so is that possible to put that on the Title tab as well? (sorry to scope creep!)

          Regarding file path, so long as we display the relative file path from CiviCRM root, we are safe, as this is public information. We couldn't want the server-specific path to be displayed such as /www/www/mysite/public_html etc.

          Allen Shaw added a comment -

          Hi Stoob. Looks like the reason I "didn't think of contributing it to core" is because I haven't actually "done it myself." My local dev copy of master is showing "Class used:" under the Developer tab, like this:

           


             


           

          I knew I had seen it before; but it wasn't anything I did – it's in core already.

          Are you not seeing this? Are you after something more?

            People

            • Assignee:
              Allen Shaw
              Reporter:
              Stoob

              Dates

              • Created:
                Updated: