CRM-12254 Add ajax deletion to custom file uploads similar to attachment

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: Core CiviCRM, NYSS
    • Labels:
      None
    • Funding Source:
      Core Team Contract

      Description

      • Make deletion ajax driven
      • reuse the js code that is used by attachment

      For a future release consider hiding the browse button if a file is present. It currently show the existing file AND allows the user to upload a new file to overwrite current file

        Attachments

          Activity

          [CRM-12254] Add ajax deletion to custom file uploads similar to attachment
          Donald A. Lobo added a comment -

          coleman: assigning to you for some cleanup / rewrite if needed

          Coleman Watts added a comment -

          Pulling the PR as-is to keep it simple for NYSS. Can update the JS in 4.4.

          Brian Shaughnessy added a comment -

          this is working well.
          just one minor thing – when you trigger the deletion, there is a confirmation message displayed "are you sure you want to delete attachment: name_of_file.txt yes no"

          unless you have your browser set to be really wide, that forces the width of the inline box and you have to scroll to the right to find the yes/no links. let's add a line break after the question, so the filename and links fall to the next line and don't force the width.

          Coleman Watts added a comment -

          Fixed with https://github.com/civicrm/civicrm-core/pull/333
          Also fixed non-functioning "no" button.
          In a separate commit to make Brian's backport easier, I've upgraded the success message to use CRM.alert() instead of an ad-hoc div.
          TODO: Ought to use CRM.confirm() as well so we get rid of the ad-hoc message div completely.

            People

            • Assignee:
              Coleman Watts
              Reporter:
              Donald A. Lobo

              Dates

              • Due:
                Created:
                Updated:
                Resolved: