Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2014-11-14-11-21-50
[civicrm-core.git] / CRM / Contact / Form / Edit / Organization.php
index fcb81085b72d22436492b4b1786e490ca1eddce0..58e4be19d77654c352cd4843aec862d48a514383 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -77,7 +77,7 @@ class CRM_Contact_Form_Edit_Organization {
     }
 
     if ( !$inlineEditMode ) {
-      $form->add('text', 'external_identifier', ts('External Id'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'external_identifier'), FALSE);
+      $form->add('text', 'external_identifier', ts('External ID'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'external_identifier'), FALSE);
       $form->addRule('external_identifier',
         ts('External ID already exists in Database.'),
         'objectExists',
@@ -86,12 +86,19 @@ class CRM_Contact_Form_Edit_Organization {
     }
   }
 
+  /**
+   * @param $fields
+   * @param $files
+   * @param null $contactID
+   *
+   * @return array|bool
+   */
   static function formRule($fields, $files, $contactID = NULL) {
     $errors = array();
     $primaryID = CRM_Contact_Form_Contact::formRule($fields, $errors, $contactID);
 
     // make sure that organization name is set
-    if (!CRM_Utils_Array::value('organization_name', $fields)) {
+    if (empty($fields['organization_name'])) {
       $errors['organization_name'] = 'Organization Name should be set.';
     }