Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-16130

Create CRM_Core_Form::addField method

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5.8
    • Fix Version/s: 4.7.5
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      Developer Doc

      Description

      We discussed the possibility to add an addfield method.
      Coming from https://github.com/civicrm/civicrm-core/pull/5419

      The fn signature would be pretty much the same as addSelect
      After resolving the $entity and $field it would call civicrm_api3($entity, 'getfields') to load the field's metadata (aside, maybe we need to add an api "getfield" action to make it easier to fetch a single field).
      Depending on the html type it would call CRM_Core_Form::add with appropriate options.
      Once implemented I think all calls to addSelect could be swapped for addField and probably that function could be deleted.

      A first step could be to implement the function, and change one form to use this method as much as possible.

        Attachments

        1. Screen Shot 2015-07-27 at 2.44.13 PM.PNG
          44 kB
          David Greenberg
        2. TooLong.png
          28 kB
          Coleman Watts

          Activity

            People

            • Assignee:
              mallezie Tim Mallezie
              Reporter:
              mallezie Tim Mallezie
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: