Merge branch 4.5 into master
authorColeman Watts <coleman@civicrm.org>
Tue, 3 Feb 2015 13:50:35 +0000 (08:50 -0500)
committerColeman Watts <coleman@civicrm.org>
Tue, 3 Feb 2015 13:52:10 +0000 (08:52 -0500)
Conflicts:
CRM/Core/BAO/CustomValueTable.php

CRM/Core/BAO/CustomField.php
CRM/Core/BAO/CustomValueTable.php
CRM/Core/Invoke.php
CRM/Pledge/Form/Payment.php
templates/CRM/Pledge/Form/Payment.tpl

index c923c542ac2e567ba1d85f50af457f11af4810d6..259de43c7fb4e135fbd3af78443ebd4358209580 100644 (file)
@@ -1312,11 +1312,9 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
         break;
 
       case 'File':
-        if ($contactID) {
-          $url = self::getFileURL($contactID, $fieldID, $value);
-          if ($url) {
-            $display = $url['file_url'];
-          }
+        if ($value) {
+          $icons = CRM_Core_BAO_File::paperIconAttachment('*', $value);
+          $display = $icons[$value];
         }
         break;
 
index 219f1a64a625ceaadc90910c786996c1c7711b81..ee7ae8652e6aaadde386897b5452e7bf8dc9d5cf 100644 (file)
@@ -454,30 +454,13 @@ AND    $cond
           $fieldName = "custom_{$fieldID}";
           if ($isMultiple[$tableName]) {
             if ($formatMultiRecordField) {
-              if ($file[$tableName][$fieldID] == 'File') {
-                if ($fileid = $dao->$fieldName) {
-                  $fileurl = CRM_Core_BAO_File::paperIconAttachment($tableName, $entityID);
-                  $result["{$dao->id}"]["{$fieldID}"] = $fileurl[$dao->$fieldName];
-                }
-              }
-              else {
-                $result["{$dao->id}"]["{$fieldID}"] = $dao->$fieldName;
-              }
-            }
-            else {
+              $result["{$dao->id}"]["{$fieldID}"] = $dao->$fieldName;
+            } else {
               $result["{$fieldID}_{$dao->id}"] = $dao->$fieldName;
             }
           }
           else {
-            if ($file[$tableName][$fieldID] == 'File') {
-              if ($fileid = $dao->$fieldName) {
-                $fileurl = CRM_Core_BAO_File::paperIconAttachment($tableName, $entityID);
-                $result[$fieldID] = $fileurl[$dao->$fieldName];
-              }
-            }
-            else {
-              $result[$fieldID] = $dao->$fieldName;
-            }
+            $result[$fieldID] = $dao->$fieldName;
           }
         }
       }
index 531954ede60a4e604082946e9558dfd571f3eb95..48d71a52c2905abef8345a5852fe263b48c0c1bc 100644 (file)
@@ -72,6 +72,10 @@ class CRM_Core_Invoke {
     if ($args[0] !== 'civicrm') {
       return NULL;
     }
+    // CRM-15901: Turn off PHP errors display for all ajax calls
+    if (CRM_Utils_Array::value(1, $args) == 'ajax' || CRM_Utils_Array::value('snippet', $_REQUEST)) {
+      ini_set('display_errors', 0);
+    }
 
     if (!defined('CIVICRM_SYMFONY_PATH')) {
       // Traditional Civi invocation path
index 6f0b6f99760e07ed323c24c7cd5a4180b363125d..5d06b4686732a9f0d418c81859a6756ae9068289 100644 (file)
@@ -96,13 +96,11 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form {
 
     $this->addMoney('scheduled_amount',
       ts('Scheduled Amount'), TRUE,
-      array(
-        'READONLY' => TRUE,
-        'style' => "background-color:#EBECE4",
-      ),
+      array('readonly' => TRUE),
       TRUE,
       'currency',
-      NULL, TRUE
+      NULL,
+      TRUE
     );
 
     $optionTypes = array(
@@ -120,7 +118,6 @@ class CRM_Pledge_Form_Payment extends CRM_Core_Form {
           'type' => 'next',
           'name' => ts('Save'),
           'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-          'js' => array('onclick' => "return verify( );"),
           'isDefault' => TRUE,
         ),
         array(
index abde66dd2b1cde5b058b988c2bdcb49d1168377e..0eb0df9e52d95cdc66ab64a5b62a98a82a2ff318 100644 (file)
 *}
 {* this template is used for updating pledge payment*}
 <div class="crm-block crm-form-block crm-pledge-payment-form-block">
-      <table class="form-layout-compressed">
-        <tr><td class="label">{ts}Status{/ts}</td><td class="form-layout">{$status}</td></tr>
-        <tr><td class="label">{$form.scheduled_date.label}</td>
-            <td>{include file="CRM/common/jcalendar.tpl" elementName=scheduled_date}
-            <span class="description">{ts}Scheduled Date for Pledge payment.{/ts}</span></td></tr>
-        </td></tr>
-  <tr><td class="label">{$form.scheduled_amount.label}</td><td class="form-layout">{$form.currency.html}&nbsp;{$form.scheduled_amount.html}
-      {if !$pledgePayment}{ts}<a href="#" onclick="adjustPayment();">adjust scheduled amount</a>{help id="adjust-payment-amount"}{/ts}{/if}
+  <table class="form-layout-compressed">
+    <tr>
+      <td class="label">{ts}Status{/ts}</td>
+      <td class="form-layout">{$status}</td>
+    </tr>
+    <tr>
+      <td class="label">{$form.scheduled_date.label}</td>
+      <td>{include file="CRM/common/jcalendar.tpl" elementName=scheduled_date}</td>
+    </tr>
+    <tr>
+      <td class="label">{$form.scheduled_amount.label}</td>
+      <td class="form-layout">
+        {$form.currency.html}&nbsp;{$form.scheduled_amount.html}
+        {if !$pledgePayment}
+          <a href="#" class="crm-hover-button action-item adjust-pledge-payment">
+            {ts}Adjust scheduled amount{/ts}
+          </a>
+          {help id="adjust-payment-amount"}
+        {/if}
       </td>
-  </tr>
-  <tr id="adjust-option-type" class="crm-contribution-form-block-option_type">
-         <td class="label"></td> <td>{$form.option_type.html}</td>
-  </tr>
-      </table>
-       <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
-</fieldset>
+    </tr>
+    <tr id="adjust-option-type" class="crm-contribution-form-block-option_type">
+      <td class="label"></td> <td>{$form.option_type.html}</td>
+    </tr>
+  </table>
+  <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
+  </fieldset>
 </div>
 {literal}
-<script type="text/javascript">
-  CRM.$(function($) {
-    $('#adjust-option-type').hide();
-  });
-  function adjustPayment( ) {
-    cj('#adjust-option-type').show();
-    cj("#scheduled_amount").removeAttr("READONLY").css('background-color', '#ffffff');
-  }
-</script>
+  <script type="text/javascript">
+    CRM.$(function($) {
+      $('#adjust-option-type').hide();
+
+      $('a.adjust-pledge-payment').click(function(e) {
+        e.preventDefault();
+        $(this).hide();
+        $('#adjust-option-type').show();
+        $("#scheduled_amount").prop("readonly", false);
+      });
+    });
+  </script>
 {/literal}