Merge pull request #15085 from seamuslee001/update_examples
authorEileen McNaughton <emcnaughton@wikimedia.org>
Tue, 20 Aug 2019 19:52:20 +0000 (07:52 +1200)
committerGitHub <noreply@github.com>
Tue, 20 Aug 2019 19:52:20 +0000 (07:52 +1200)
[NFC] Update Examples

22 files changed:
CRM/Case/BAO/Case.php
CRM/Core/BAO/UFField.php
CRM/Core/Form/RecurringEntity.php
CRM/Member/BAO/MembershipType.php
CRM/Member/DAO/Membership.php
CRM/Member/Import/Parser/Membership.php
CRM/Upgrade/Form.php
CRM/Upgrade/Incremental/php/FiveEighteen.php
templates/CRM/Group/Form/Search.tpl
tests/phpunit/CRM/Case/BAO/CaseTest.php
tests/phpunit/CRM/Export/BAO/ExportTest.php
tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php
tests/phpunit/api/v3/MembershipTest.php
tools/bin/scripts/ImportTags.php [deleted file]
tools/bin/scripts/create-pot-files [deleted file]
tools/bin/scripts/createdoc.sh [deleted file]
tools/bin/scripts/delete.sh [deleted file]
tools/bin/scripts/drop-closing-php-tags.sh [deleted file]
tools/bin/scripts/ircbot-civi.py [deleted file]
tools/bin/scripts/memcache.php [deleted file]
tools/bin/scripts/runStressTest.sh.txt [deleted file]
xml/schema/Member/Membership.xml

index 1b1340a9ef17c30887344fdd688c2977471c8621..f947784c068b93e06a4bf0c76b162afacf7ae44a 100644 (file)
@@ -2084,28 +2084,6 @@ HERESQL;
           continue;
         }
 
-        // CRM-11662 Copy Case custom data
-        $extends = array('case');
-        $groupTree = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, NULL, $extends);
-        if ($groupTree) {
-          foreach ($groupTree as $groupID => $group) {
-            $table[$groupTree[$groupID]['table_name']] = array('entity_id');
-            foreach ($group['fields'] as $fieldID => $field) {
-              $table[$groupTree[$groupID]['table_name']][] = $groupTree[$groupID]['fields'][$fieldID]['column_name'];
-            }
-          }
-
-          foreach ($table as $tableName => $tableColumns) {
-            $insert = 'INSERT INTO ' . $tableName . ' (' . implode(', ', $tableColumns) . ') ';
-            $tableColumns[0] = $mainCaseId;
-            $select = 'SELECT ' . implode(', ', $tableColumns);
-            $from = ' FROM ' . $tableName;
-            $where = " WHERE {$tableName}.entity_id = {$otherCaseId}";
-            $query = $insert . $select . $from . $where;
-            $dao = CRM_Core_DAO::executeQuery($query);
-          }
-        }
-
         $mainCaseIds[] = $mainCaseId;
         //insert record for case contact.
         $otherCaseContact = new CRM_Case_DAO_CaseContact();
index 357e0819357be4b5dde53a3a4d68cefaf0044006..58dd31f08f069d1090648ed9f962b2fe60fa1973 100644 (file)
@@ -970,6 +970,7 @@ SELECT  id
         'membership_type_id',
         'member_is_test',
         'is_override',
+        'member_is_override',
         'status_override_end_date',
         'status_id',
         'member_is_pay_later'
index 880c4f0b6298a417b10b54d7dca607d0944a611a..4e44aa0d09d3fcb2b59f30c01d62989248666a13 100644 (file)
@@ -343,7 +343,7 @@ class CRM_Core_Form_RecurringEntity {
       $params['entity_id'] = self::$_entityId;
     }
     //Process this function only when you get this variable
-    if ($params['allowRepeatConfigToSubmit'] == 1) {
+    if (CRM_Utils_Array::value('allowRepeatConfigToSubmit', $params) == 1) {
       if (!empty($params['entity_table']) && !empty($params['entity_id']) && $type) {
         $params['used_for'] = $type;
         if (empty($params['parent_entity_id'])) {
index 745294615101569dd39afebc50663db225b22515..3686b3f106dc1eae6628bce7efe54985c5eb05f1 100644 (file)
@@ -625,27 +625,6 @@ class CRM_Member_BAO_MembershipType extends CRM_Member_DAO_MembershipType {
     return $membershipDates;
   }
 
-  /**
-   * @deprecated Please use the Membership API
-   * Retrieve all Membership Types associated with an Organization
-   *
-   * @param int $orgID
-   *   Id of Organization.
-   *
-   * @return array
-   *   array of the details of membership types
-   */
-  public static function getMembershipTypesByOrg($orgID) {
-    CRM_Core_Error::deprecatedFunctionWarning('membership_type api');
-    $memberTypesSameParentOrg = civicrm_api3('MembershipType', 'get', [
-      'member_of_contact_id' => $orgID,
-      'options' => [
-        'limit' => 0,
-      ],
-    ]);
-    return CRM_Utils_Array::value('values', $memberTypesSameParentOrg, []);
-  }
-
   /**
    * Retrieve all Membership Types with Member of Contact id.
    *
index 3fa1ead53912a70eb40d55c46e24b39b69a56c83..59580c356fe69a8fbc071ffd2d696ae8501d034f 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Member/Membership.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:64ef044391b9dee565e8e2a9d893f4cf)
+ * (GenCodeChecksum:40f3b0813c1e13fab544ae1f8fa2ebb3)
  */
 
 /**
@@ -328,7 +328,7 @@ class CRM_Member_DAO_Membership extends CRM_Core_DAO {
             'labelColumn' => 'label',
           ],
         ],
-        'is_override' => [
+        'member_is_override' => [
           'name' => 'is_override',
           'type' => CRM_Utils_Type::T_BOOLEAN,
           'title' => ts('Status Override'),
@@ -381,6 +381,7 @@ class CRM_Member_DAO_Membership extends CRM_Core_DAO {
           'title' => ts('Max Related'),
           'description' => ts('Maximum number of related memberships (membership_type override).'),
           'where' => 'civicrm_membership.max_related',
+          'export' => TRUE,
           'table_name' => 'civicrm_membership',
           'entity' => 'Membership',
           'bao' => 'CRM_Member_BAO_Membership',
@@ -423,12 +424,13 @@ class CRM_Member_DAO_Membership extends CRM_Core_DAO {
             'type' => 'CheckBox',
           ],
         ],
-        'contribution_recur_id' => [
+        'membership_recur_id' => [
           'name' => 'contribution_recur_id',
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Membership Recurring Contribution'),
           'description' => ts('Conditional foreign key to civicrm_contribution_recur id. Each membership in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.'),
           'where' => 'civicrm_membership.contribution_recur_id',
+          'export' => TRUE,
           'table_name' => 'civicrm_membership',
           'entity' => 'Membership',
           'bao' => 'CRM_Member_BAO_Membership',
index 895eafdc4f449745cacebb7c8bab2cd641b40b10..224261207bfc6b81d74ac18ebb9b1edff2551655 100644 (file)
@@ -324,7 +324,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
               $params[$key] = $this->parsePseudoConstantField($val, $this->fieldMetadata[$key]);
               break;
 
-            case 'is_override':
+            case 'member_is_override':
               $params[$key] = CRM_Utils_String::strtobool($val);
               break;
           }
@@ -363,7 +363,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
       else {
         //fix for CRM-2219 Update Membership
         // onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE
-        if (!empty($formatted['is_override']) && empty($formatted['status_id'])) {
+        if (!empty($formatted['member_is_override']) && empty($formatted['status_id'])) {
           array_unshift($values, 'Required parameter missing: Status');
           return CRM_Import_Parser::ERROR;
         }
@@ -438,7 +438,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
             //fix for CRM-3570, exclude the statuses those having is_admin = 1
             //now user can import is_admin if is override is true.
             $excludeIsAdmin = FALSE;
-            if (empty($formatted['is_override'])) {
+            if (empty($formatted['member_is_override'])) {
               $formatted['exclude_is_admin'] = $excludeIsAdmin = TRUE;
             }
             $calcStatus = CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate($startDate,
@@ -453,7 +453,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
             if (empty($formatted['status_id'])) {
               $formatted['status_id'] = $calcStatus['id'];
             }
-            elseif (empty($formatted['is_override'])) {
+            elseif (empty($formatted['member_is_override'])) {
               if (empty($calcStatus)) {
                 array_unshift($values, 'Status in import row (' . $formatValues['status_id'] . ') does not match calculated status based on your configured Membership Status Rules. Record was not imported.');
                 return CRM_Import_Parser::ERROR;
@@ -528,7 +528,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
         //fix for CRM-3570, exclude the statuses those having is_admin = 1
         //now user can import is_admin if is override is true.
         $excludeIsAdmin = FALSE;
-        if (empty($formatted['is_override'])) {
+        if (empty($formatted['member_is_override'])) {
           $formatted['exclude_is_admin'] = $excludeIsAdmin = TRUE;
         }
         $calcStatus = CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate($startDate,
@@ -542,7 +542,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Member_Import_Parser {
         if (empty($formatted['status_id'])) {
           $formatted['status_id'] = CRM_Utils_Array::value('id', $calcStatus);
         }
-        elseif (empty($formatted['is_override'])) {
+        elseif (empty($formatted['member_is_override'])) {
           if (empty($calcStatus)) {
             array_unshift($values, 'Status in import row (' . CRM_Utils_Array::value('status_id', $formatValues) . ') does not match calculated status based on your configured Membership Status Rules. Record was not imported.');
             return CRM_Import_Parser::ERROR;
index 008d42210a4fb5c4dad952e6694b9d1d03124644..d9561c39532db39f55131892204b230ace216a7e 100644 (file)
@@ -50,10 +50,9 @@ class CRM_Upgrade_Form extends CRM_Core_Form {
   /**
    * Minimum php version required to run (equal to or lower than the minimum install version)
    *
-   * Even though 5.6 is no longer supported, this value is left here for a while
-   * so as not to block stragglers from upgrading.
+   * As of Civi 5.16, using PHP 5.x will lead to a hard crash during bootstrap.
    */
-  const MINIMUM_PHP_VERSION = '5.6';
+  const MINIMUM_PHP_VERSION = '7.0.0';
 
   /**
    * @var \CRM_Core_Config
index 266364530eb9d6dce263a7acf3ce7e5112c7d2da..5d535d234f463a243c369341db6a8687b555c624 100644 (file)
@@ -67,18 +67,19 @@ class CRM_Upgrade_Incremental_php_FiveEighteen extends CRM_Upgrade_Incremental_B
    * (change the x in the function name):
    */
 
-  //  /**
-  //   * Upgrade function.
-  //   *
-  //   * @param string $rev
-  //   */
-  //  public function upgrade_5_0_x($rev) {
-  //    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
-  //    $this->addTask('Do the foo change', 'taskFoo', ...);
-  //    // Additional tasks here...
-  //    // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
-  //    // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
-  //  }
+  /**
+   * Upgrade function.
+   *
+   * @param string $rev
+   */
+  public function upgrade_5_18_alpha1($rev) {
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
+    $this->addTask('Update smart groups to reflect change of unique name for is_override', 'updateSmartGroups', [
+      'renameField' => [
+        ['old' => 'is_override', 'new' => 'member_is_override'],
+      ],
+    ]);
+  }
 
   // public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
   //   return TRUE;
index f73fd4b10e9f8bdd6f77851910215e10fb4b321c..d31dd2103bc0385b64221e4355c5901d3f065b5b 100644 (file)
     // on initial load of manage group page and
     // also to handle search filtering for initial load of same page.
     var parentsOnly = 1
-    var ZeroRecordText = {/literal}'{ts escape="js"}<div class="status messages">No Groups have been created for this site.{/ts}</div>'{literal};
+    var ZeroRecordText = {/literal}'{ts escape="js"}<div class="status messages">None found.{/ts}</div>'{literal};
     $('table.crm-group-selector').data({
       "ajax": {
         "url": {/literal}'{crmURL p="civicrm/ajax/grouplist" h=0 q="snippet=4"}'{literal},
index 01308094303cb886f2ce626e907b817e23b640c4..2c346a4dc893cbf6be0d525e912a895dd998988d 100644 (file)
@@ -170,6 +170,68 @@ class CRM_Case_BAO_CaseTest extends CiviUnitTestCase {
     $this->assertEquals([1], $caseIds);
   }
 
+  /**
+   * Test that all custom files are migrated to new case when case is assigned to new client.
+   */
+  public function testCaseReassignForCustomFiles() {
+    $individual = $this->individualCreate();
+    $customGroup = $this->customGroupCreate(array(
+      'extends' => 'Case',
+    ));
+    $customGroup = $customGroup['values'][$customGroup['id']];
+
+    $customFileFieldA = $this->customFieldCreate(array(
+      'custom_group_id' => $customGroup['id'],
+      'html_type'       => 'File',
+      'is_active'       => 1,
+      'default_value'   => 'null',
+      'label'           => 'Custom File A',
+      'data_type'       => 'File',
+    ));
+
+    $customFileFieldB = $this->customFieldCreate(array(
+      'custom_group_id' => $customGroup['id'],
+      'html_type'       => 'File',
+      'is_active'       => 1,
+      'default_value'   => 'null',
+      'label'           => 'Custom File B',
+      'data_type'       => 'File',
+    ));
+
+    // Create two files to attach to the new case
+    $filepath = Civi::paths()->getPath('[civicrm.files]/custom');
+
+    CRM_Utils_File::createFakeFile($filepath, 'Bananas do not bend themselves without a little help.', 'i_bend_bananas.txt');
+    $fileA = $this->callAPISuccess('File', 'create', ['uri' => "$filepath/i_bend_bananas.txt"]);
+
+    CRM_Utils_File::createFakeFile($filepath, 'Wombats will bite your ankles if you run from them.', 'wombats_bite_your_ankles.txt');
+    $fileB = $this->callAPISuccess('File', 'create', ['uri' => "$filepath/wombats_bite_your_ankles.txt"]);
+
+    $caseObj = $this->createCase($individual);
+
+    $this->callAPISuccess('Case', 'create', array(
+      'id'                                => $caseObj->id,
+      'custom_' . $customFileFieldA['id'] => $fileA['id'],
+      'custom_' . $customFileFieldB['id'] => $fileB['id'],
+    ));
+
+    $reassignIndividual = $this->individualCreate();
+    $this->createLoggedInUser();
+    $newCase = CRM_Case_BAO_Case::mergeCases($reassignIndividual, $caseObj->id, $individual, NULL, TRUE);
+
+    $entityFiles = new CRM_Core_DAO_EntityFile();
+    $entityFiles->entity_id = $newCase[0];
+    $entityFiles->entity_table = $customGroup['table_name'];
+    $entityFiles->find();
+
+    $totalEntityFiles = 0;
+    while ($entityFiles->fetch()) {
+      $totalEntityFiles++;
+    }
+
+    $this->assertEquals(2, $totalEntityFiles, 'Two files should be attached with new case.');
+  }
+
   /**
    * FIXME: need to create an activity to run this test
    * function testGetCases() {
index d4f51f2450155f0dc26df93090f81f28817a232e..8bc6abdb88dc0eb80c7cbcd4858ab2b4104b50b3 100644 (file)
@@ -283,10 +283,10 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase {
       'Membership Status' => 'New',
       'Membership ID' => '2',
       'Primary Member ID' => '',
-      'max_related' => '',
-      'membership_recur_id' => 1,
+      'Max Related' => '',
+      'Membership Recurring Contribution' => 1,
       'Campaign ID' => '',
-      'member_is_override' => '',
+      'Status Override' => '',
       'Total Amount' => '200.00',
       'Contribution Status' => 'Pending',
       'Date Received' => '2019-07-25 07:34:23',
@@ -2362,10 +2362,10 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase {
       88 => 'Membership Status',
       89 => 'Membership ID',
       90 => 'Primary Member ID',
-      91 => 'max_related',
-      92 => 'membership_recur_id',
+      91 => 'Max Related',
+      92 => 'Membership Recurring Contribution',
       93 => 'Campaign ID',
-      94 => 'member_is_override',
+      94 => 'Status Override',
     ];
   }
 
@@ -2766,10 +2766,10 @@ class CRM_Export_BAO_ExportTest extends CiviUnitTestCase {
       'membership_status' => 'membership_status varchar(255)',
       'membership_id' => 'membership_id varchar(16)',
       'owner_membership_id' => 'owner_membership_id varchar(16)',
-      'max_related' => 'max_related text',
-      'membership_recur_id' => 'membership_recur_id varchar(255)',
+      'max_related' => 'max_related varchar(16)',
+      'membership_recur_id' => 'membership_recur_id varchar(16)',
       'member_campaign_id' => 'member_campaign_id varchar(16)',
-      'member_is_override' => 'member_is_override text',
+      'member_is_override' => 'member_is_override varchar(16)',
     ];
   }
 
index 06c2c2c738595e188b5fb77d30befe18ab9f4154..1d1a3b6745b94dd2b32d43f2a0ab0d554405649c 100644 (file)
@@ -148,6 +148,11 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase {
     $this->assertEquals(2, $result['count']);
   }
 
+  /**
+   * Test overriding a membership but not providing status.
+   *
+   * @throws \CRM_Core_Exception
+   */
   public function testImportOverriddenMembershipButWithoutStatus() {
     $this->individualCreate(['email' => 'anthony_anderson2@civicrm.org']);
 
@@ -155,7 +160,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase {
       'mapper[0][0]' => 'email',
       'mapper[1][0]' => 'membership_type_id',
       'mapper[2][0]' => 'membership_start_date',
-      'mapper[3][0]' => 'is_override',
+      'mapper[3][0]' => 'member_is_override',
     ];
     $membershipImporter = new CRM_Member_Import_Parser_Membership($fieldMapper);
     $membershipImporter->init();
@@ -184,7 +189,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase {
       'email',
       'membership_type_id',
       'membership_start_date',
-      'is_override',
+      'member_is_override',
       'status_id',
     ]);
 
@@ -207,7 +212,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase {
       'mapper[0][0]' => 'email',
       'mapper[1][0]' => 'membership_type_id',
       'mapper[2][0]' => 'membership_start_date',
-      'mapper[3][0]' => 'is_override',
+      'mapper[3][0]' => 'member_is_override',
       'mapper[4][0]' => 'status_id',
       'mapper[5][0]' => 'status_override_end_date',
     ];
@@ -235,7 +240,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase {
       'mapper[0][0]' => 'email',
       'mapper[1][0]' => 'membership_type_id',
       'mapper[2][0]' => 'membership_start_date',
-      'mapper[3][0]' => 'is_override',
+      'mapper[3][0]' => 'member_is_override',
       'mapper[4][0]' => 'status_id',
       'mapper[5][0]' => 'status_override_end_date',
     ];
@@ -275,7 +280,7 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase {
       'email',
       'membership_type_id',
       'membership_start_date',
-      'is_override',
+      'member_is_override',
       'status_id',
     ]);
 
index 07ea1173469c18f7d5927c0939a69b1264bc6aa3..c2aaadf176685498af84221ebb1d99cf60304747 100644 (file)
@@ -221,14 +221,14 @@ class api_v3_MembershipTest extends CiviUnitTestCase {
     $this->callAPISuccess('Membership', 'Delete', [
       'id' => $this->_membershipID,
     ]);
-    $this->assertEquals($result['contact_id'], $this->_contactID, "In line " . __LINE__);
-    $this->assertEquals($result['membership_type_id'], $this->_membershipTypeID, "In line " . __LINE__);
-    $this->assertEquals($result['status_id'], $this->_membershipStatusID, "In line " . __LINE__);
-    $this->assertEquals($result['join_date'], '2009-01-21', "In line " . __LINE__);
-    $this->assertEquals($result['start_date'], '2009-01-21', "In line " . __LINE__);
-    $this->assertEquals($result['end_date'], '2009-12-21', "In line " . __LINE__);
-    $this->assertEquals($result['source'], 'Payment', "In line " . __LINE__);
-    $this->assertEquals($result['is_override'], 1, "In line " . __LINE__);
+    $this->assertEquals($result['contact_id'], $this->_contactID);
+    $this->assertEquals($result['membership_type_id'], $this->_membershipTypeID);
+    $this->assertEquals($result['status_id'], $this->_membershipStatusID);
+    $this->assertEquals($result['join_date'], '2009-01-21');
+    $this->assertEquals($result['start_date'], '2009-01-21');
+    $this->assertEquals($result['end_date'], '2009-12-21');
+    $this->assertEquals($result['source'], 'Payment');
+    $this->assertEquals($result['is_override'], 1);
   }
 
   /**
diff --git a/tools/bin/scripts/ImportTags.php b/tools/bin/scripts/ImportTags.php
deleted file mode 100644 (file)
index df222cc..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-/*
- +--------------------------------------------------------------------+
- | CiviCRM version 5                                                  |
- +--------------------------------------------------------------------+
- | Copyright Tech To The People http:tttp.eu (c) 2008                 |
- +--------------------------------------------------------------------+
- |                                                                    |
- | CiviCRM is free software; you can copy, modify, and distribute it  |
- | under the terms of the GNU Affero General Public License           |
- | Version 3, 19 November 2007.                                       |
- |                                                                    |
- | CiviCRM is distributed in the hope that it will be useful, but     |
- | WITHOUT ANY WARRANTY; without even the implied warranty of         |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
- | See the GNU Affero General Public License for more details.        |
- |                                                                    |
- | You should have received a copy of the GNU Affero General Public   |
- | License along with this program; if not, contact CiviCRM LLC       |
- | at info[AT]civicrm[DOT]org. If you have questions about the        |
- | GNU Affero General Public License or the licensing of CiviCRM,     |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
- +--------------------------------------------------------------------+
-*/
-
-
-require_once('bin/cli.php');
-require_once 'CRM/Core/BAO/Tag.php';
-
-/**
- * Class tagsImporter
- */
-class tagsImporter extends civicrm_cli {
-  /**
-   * constructor
-   */
-  function __construct() {
-    parent::__construct();
-    if (sizeof($this->args) != 1) {
-      die("you need to profide a csv file (1st column parent name, 2nd tag name");
-    }
-    $this->file = $this->args[0];
-    $this->tags = array_flip(CRM_Core_PseudoConstant::get('CRM_Core_DAO_EntityTag', 'tag_id', ['onlyActive' => FALSE]));
-  }
-
-  //format expected: parent name, tag
-  function run() {
-    $row = 1;
-    $handle = fopen($this->file, "r");
-    //header
-    // $header = fgetcsv($handle, 1000, ",");
-    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
-      $num = count($data);
-      $row++;
-      $params = $this->convertLine($data);
-      $this->addTag($params);
-    }
-    fclose($handle);
-    return;
-  }
-
-  /**
-   * @param $param
-   *
-   * @return mixed
-   */
-  function addTag($param) {
-    if (array_key_exists($param['name'], $this->tags)) {
-      echo "\n- exists already: " . $param['name'];
-      return;
-    }
-    $key = ['tag' => ''];
-    if ($param['parent']) {
-      if (array_key_exists($param['parent'], $this->tags)) {
-        $param['parent_id'] = $this->tags[$param['parent']];
-      }
-      else {
-        $param['parent_id'] = $this->addTag([
-          parent => '',
-          name => $param['parent'],
-        ]);
-      }
-      $tag = CRM_Core_BAO_Tag::add($param, $key);
-      echo "\n" . $tag->id . ": create " . $param['name'] . " below " . $param['parent'];
-    }
-    else {
-      $tag = CRM_Core_BAO_Tag::add($param, $key);
-      echo "\n" . $tag->id . ": create " . $param['name'] . " (root)";
-    }
-    $this->tags[$param['name']] = $tag->id;
-    return $tag->id;
-  }
-
-  /* return a params as expected */
-  /**
-   * @param $data
-   *
-   * @return mixed
-   */
-  function convertLine($data) {
-    /*
-    [0] => parent tag name
-    [1] => name of the tag
-*/
-
-
-    $params['parent'] = $data[0];
-    $params['name'] = $data[1];
-    return $params;
-  }
-}
-
-$tagsImporter = new tagsImporter("civicrm_value_1_extra_information");
-$tagsImporter->run();
-echo "\n";
-
diff --git a/tools/bin/scripts/create-pot-files b/tools/bin/scripts/create-pot-files
deleted file mode 100755 (executable)
index 2b02397..0000000
+++ /dev/null
@@ -1,440 +0,0 @@
-#!/bin/bash
-set -e
-
-#####################################################################
-## Variables
-
-## Source code path
-SRC=
-
-## Output path
-POTDIR=
-
-## The component *.pot files are based roughly on CRM/Foo templates/CRM/Foo.
-COMPONENT_POTS="Admin Badge Batch Campaign Case Contribute Event Extension Financial Grant Mailing Member PCP Pledge Project Queue Report"
-
-## The adhoc *.pot files are based on clear file list (but may have some special/less predictable rules).
-ADHOC_POTS="common-base countries drupal-civicrm install menu provinces"
-
-## The magic *.pot files are derived from other *.pot files.
-MAGIC_POTS="common-components"
-
-## List of chosen *.pot files
-POTS=
-
-## Header file to prepend to any *.pot
-HEADER_TMPL=bin/header
-HEADER=
-
-## Flags to control which actions are performed
-DO_SCAN=
-DO_DIGEST=
-DO_CLEANUP=
-FORCE=
-
-#####################################################################
-function usage() {
-  cat <<EOT
-create-pot-files.sh - builds .pot files for CiviCRM.
-
-Usage:
-  ./bin/create-pot-files.sh [options] [srcdir] [destdir] [pot1...]
-
-Examples:
-  ./bin/create-pot-files.sh ~/repository/civicrm/ ~/repository/l10n/po/pot/
-  ./bin/create-pot-files.sh -sd ~/repository/civicrm/ ~/repository/l10n/po/pot/ common-base Admin Contribute
-
-Options:
-  -s    Scan targets for strings (Pass #1)
-  -d    Digest/dedupe scanned strings (Pass #2)
-  -c    Cleanup temp files
-  -a    All (scan+digest+cleanup; default)
-  -f    Force (Ignore cached results from previous scan)
-  -h    Help
-
-Targets:
-  $COMPONENT_POTS
-  $ADHOC_POTS $MAGIC_POTS
-
-Although you should probably not call this directly. Use build-unified-pots.sh
-if you are exporting the strings to Transifex.
-http://wiki.civicrm.org/confluence/display/CRMDOC/Pushing+new+strings+to+Transifex
-
-EOT
-
-  exit 1;
-}
-
-#####################################################################
-## Assert that CLI dependencies are met
-function check_deps() {
-  for cmd in sponge civistrings msgcomm msguniq tempfile tr grep cut date sed ; do
-    if ! which $cmd > /dev/null ; then
-      echo "Missing required command: $cmd"
-      echo
-      case "$cmd" in
-        sponge)
-          echo 'This program uses the "sponge" command which you can get by installing the'
-          echo '"moreutils" package under Debian/Ubuntu or by visting'
-          echo 'https://joeyh.name/code/moreutils/'
-          ;;
-        civistrings)
-          echo 'This program uses the "civistrings" command which is bundled with buildkit.'
-          echo 'You can download it separately from https://github.com/civicrm/civistrings'
-      esac
-      exit 1
-    fi
-  done
-}
-
-#####################################################################
-## civistrings wrapper with some default options
-function _civistrings() {
-  civistrings --header="$HEADER" "$@"
-}
-
-#####################################################################
-## usage: HEADER=$(build_header "$HEADER_TMPL")
-function build_header() {
-  local tmpl="$1"
-  local out="$POTDIR/.header"
-  local now=`date +'%F %R%z'`
-
-  cat "$tmpl" \
-    | sed "s/NOW/$now/" \
-    > "$out"
-
-  echo "$out"
-}
-
-#####################################################################
-## Build an individual POT file
-## usage: build_raw_pot <name>
-## example: build_raw_pot Mailing
-## example: build_raw_pot install
-function build_raw_pot() {
-  local name="$1"
-  local filepath="$POTDIR/.raw-"$(echo $name | tr '[:upper:]' '[:lower:]').pot
-
-  if [ -f "$filepath" -a -z "$FORCE" ]; then
-    echo "[[ Found raw strings for ${name} from previous scan. ]]"
-    return
-  fi
-
-  echo "[[ Building raw strings for ${name} ]]"
-
-  case "$name" in
-
-    ## Adhoc targets, sorted alphabetically
-
-    common-base)
-      _civistrings -o "$filepath" \
-        {CRM,templates/CRM}/{ACL,Activity,Block,common,Contact,Core} \
-        {CRM,templates/CRM}/{Custom,Dashlet,Dedupe,Export,Form,Friend} \
-        {CRM,templates/CRM}/{Group,Import,Logging,Note,Price,Profile} \
-        {CRM,templates/CRM}/{Relationship,SMS,Standalone,Tag,UF,Utils} \
-        xml/templates/civicrm_acl.tpl \
-        xml/templates/civicrm_data.tpl \
-        xml/templates/languages.tpl \
-        xml/templates/civicrm_msg_template.tpl \
-        xml/templates/message_templates/friend_* \
-        xml/templates/message_templates/uf_notify_* \
-        ang/crm{App,Attachment,Example,Ui,Util}{,.js}  \
-        js/Common.js \
-        js/crm.ajax.js \
-        js/crm.backbone.js \
-        js/jquery/jquery.crmeditable.js \
-        js/jquery/jquery.crmProfileSelector.js \
-        js/jquery/jquery.crmRevisionLink.js \
-        js/jquery/jquery.dashboard.js \
-        js/model/crm.designer.js \
-        js/model/crm.uf.js \
-        js/view/crm.designer.js \
-        packages/HTML/QuickForm
-
-      ## The CRM/Upgrade folder includes *.tpl files which, for some reason,
-      ## have been omitted from past pot's. Omitting these requires more
-      ## precise file selection.
-      find CRM/Upgrade -name '*.php' | _civistrings -ao "$filepath" -
-      _civistrings -ao "$filepath" templates/CRM/Upgrade
-      ;;
-
-    common-components)
-      ## Not yet; handled in the digest phase. That why it's in MAGIC_POTS
-      return
-      ;;
-
-    countries)
-      cat "$HEADER" > "$filepath"
-      grep ^INSERT xml/templates/civicrm_country.tpl \
-        | cut -d\" -f4 \
-        | while read entry; do
-          echo -e "msgctxt \"country\"\nmsgid \"$entry\"\nmsgstr \"\"\n"
-        done \
-        >> "$filepath"
-      ## Hmm, if civicrm_country.tpl used {ts}, then we could just call "civistrings --msgctxt=country"
-      ;;
-
-    drupal-civicrm)
-      _civistrings -o "$filepath" \
-        drupal \
-        CRM/Core/Permission.php
-      ;;
-
-    install)
-      _civistrings -o "$filepath" \
-        install/
-      ;;
-
-    menu)
-      cat "$HEADER" > "$filepath"
-      grep -h '<title>' CRM/*/xml/Menu/*.xml \
-        | sed 's/^.*<title>\(.*\)<\/title>.*$/\1/' \
-        | while read entry; do
-          echo -e "msgctxt \"menu\"\nmsgid \"$entry\"\nmsgstr \"\"\n"
-        done \
-        >> "$filepath"
-      _civistrings --msgctxt=menu xml/templates/civicrm_navigation.tpl -ao "$filepath"
-      ;;
-
-    provinces)
-      cat "$HEADER" > "$filepath"
-      grep '^(' xml/templates/civicrm_state_province.tpl \
-        | cut -d\" -f4 \
-        | while read entry; do
-          echo -e "msgctxt \"province\"\nmsgid \"$entry\"\nmsgstr \"\"\n"
-        done \
-        >> "$filepath"
-        ## Hmm, if civicrm_country.tpl used {ts}, then we could just call "civistrings --msgctxt=country"
-      ;;
-
-    ## Standard targets, sorted alphabetically
-
-    Campaign)
-      _civistrings -o "$filepath" \
-        {CRM,templates/CRM}/$name \
-        xml/templates/message_templates/petition_*
-      ;;
-
-    Case)
-      _civistrings -o "$filepath" \
-        {CRM,templates/CRM}/$name \
-        ang/crmCaseType{,.js} \
-        xml/templates/message_templates/case_*
-      ;;
-
-    Contribute)
-      _civistrings -o "$filepath" \
-        {CRM,templates/CRM}/$name \
-        xml/templates/message_templates/contribution_* \
-        xml/templates/message_templates/test_*
-      ;;
-
-    Event)
-      _civistrings -o "$filepath" \
-        {CRM,templates/CRM}/$name \
-        xml/templates/message_templates/event_* \
-        xml/templates/message_templates/participant_*
-      ;;
-
-    Mailing)
-      _civistrings -o "$filepath" \
-        {CRM,templates/CRM}/$name \
-        ang/crm{Mailing,MailingAB}{,.js}
-      ;;
-
-    Member)
-      _civistrings -o "$filepath" \
-        {CRM,templates/CRM}/$name \
-        xml/templates/message_templates/membership_*
-      ;;
-
-    PCP)
-      _civistrings -o "$filepath" \
-        {CRM,templates/CRM}/$name \
-        xml/templates/message_templates/pcp_*
-      ;;
-
-    Pledge)
-      _civistrings -o "$filepath" \
-        {CRM,templates/CRM}/$name \
-        xml/templates/message_templates/pledge_*
-      ;;
-
-    *)
-      if echo " $COMPONENT_POTS " | grep -q " $name " > /dev/null ; then
-        _civistrings -o "$filepath" {CRM,templates/CRM}/$name
-      else
-        echo "unrecognized pot: $name"
-      fi
-      ;;
-
-  esac
-
-  find "$filepath" ! -empty | while read f; do
-    msguniq "$filepath" | sponge "$filepath"
-  done
-}
-
-#####################################################################
-## usage: make_stat <name>
-## example: make_stat Mailing
-function make_stat() {
-  local name="$1"
-  local filepath="$POTDIR/.raw-"$(echo $name | tr '[:upper:]' '[:lower:]').pot
-  grep ^msgid "$filepath" | sort -u > "$filepath.msgid"
-  grep '^#:' "$filepath" | sed 's/#://' | tr ' ' '\n' | sort -u > "$filepath.files"
-}
-
-#####################################################################
-## Scan .raw-*.pot for common strings and put them in common-components.pot
-## usage: build_common_components
-function build_common_components() {
-  echo "[[ Building common-components.pot ]]"
-  local paths=""
-  local has_multiple=0
-  for comp in $COMPONENT_POTS ; do
-    local rawfile=".raw-"$(echo $comp | tr '[:upper:]' '[:lower:]').pot
-    if [ -f "$rawfile" ]; then
-      paths="$paths $rawfile"
-      has_multiple=1
-    fi
-  done
-  if [ $has_multiple -eq 1 ]; then
-    msgcomm $paths > .raw-common-components.pot
-  else
-    cat $HEADER > .raw-common-components.pot
-  fi
-}
-
-#####################################################################
-## example: build_final_pot Mailing
-## example: build_final_pot install
-function build_final_pot() {
-  local name="$1"
-  local rawpath="$POTDIR/.raw-"$(echo $name | tr '[:upper:]' '[:lower:]').pot
-  local finalpath="$POTDIR/"$(echo $name | tr '[:upper:]' '[:lower:]').pot
-  local tmpfile=`tempfile`
-
-  echo "[[ Building final strings for ${name} ]]"
-
-  cp -f "$rawpath" "$finalpath"
-
-  if echo " $COMPONENT_POTS " | grep -q " $name " > /dev/null ; then
-    msgcomm "$finalpath" .raw-common-components.pot > $tmpfile
-    msgcomm --unique "$finalpath" $tmpfile | sponge "$finalpath"
-
-    msgcomm "$finalpath" .raw-common-base.pot | sponge $tmpfile
-    msgcomm --unique "$finalpath" $tmpfile | sponge "$finalpath"
-
-  elif [ "$name" == "install" ]; then
-    msgcomm "$finalpath" .raw-common-base.pot | sponge $tmpfile
-    msgcomm --unique "$finalpath" $tmpfile | sponge "$finalpath"
-  fi
-
-  rm -f "$tmpfile"
-}
-
-#####################################################################
-## Delete temp files
-function do_cleanup() {
-  echo "[[ Cleanup temp files ]]"
-  rm .header .raw*pot -f
-}
-
-#####################################################################
-## Main
-
-[ "$1" == "--help" ] && usage
-[ "$1" == "-h" ] && usage
-
-check_deps
-
-FOUND_ACTION=
-while getopts "asfdc" opt; do
-  case $opt in
-    a)
-      DO_SCAN=1
-      DO_DIGEST=1
-      DO_CLEANUP=1
-      FOUND_ACTION=1
-      ;;
-    s)
-      DO_SCAN=1
-      FOUND_ACTION=1
-      ;;
-    d)
-      DO_DIGEST=1
-      FOUND_ACTION=1
-      ;;
-    c)
-      DO_CLEANUP=1
-      FOUND_ACTION=1
-      ;;
-    f)
-      FORCE=1
-      ;;
-    \?)
-      echo "Invalid option: -$OPTARG" >&2
-      exit 1
-      ;;
-    :)
-      echo "Option -$OPTARG requires an argument." >&2
-      exit 1
-      ;;
-  esac
-done
-
-if [ -z "$FOUND_ACTION" ]; then
-  DO_SCAN=1
-  DO_DIGEST=1
-  DO_CLEANUP=1
-fi
-
-shift $((OPTIND-1))
-
-[ "$1" == "" ] && echo 'source dir missing'     && usage
-test ! -e "$1" && echo 'source does not exist'  && usage
-test ! -d "$1" && echo 'source not a directory' && usage
-
-[ "$2" == "" ] && echo 'target dir missing'     && usage
-test ! -e "$2" && echo 'target does not exist'  && usage
-test ! -d "$2" && echo 'target not a directory' && usage
-
-# use absolute paths so that we can chdir/pushd
-SRC=$(php -r 'echo realpath($argv[1]);' "$1")
-POTDIR=$(php -r 'echo realpath($argv[1]);' "$2")
-HEADER=$(build_header "$HEADER_TMPL")
-## TODO: substitute "NOW" in HEADER
-shift 2
-
-if [ -z "$1" ]; then
-  POTS="$COMPONENT_POTS $ADHOC_POTS $MAGIC_POTS"
-else
-  POTS="$@"
-fi
-
-if [ -n "$DO_SCAN" ]; then
-  pushd "$SRC" >> /dev/null
-    for POT in $POTS ; do
-      build_raw_pot "$POT"
-    done
-  popd >> /dev/null
-fi
-
-if [ -n "$DO_DIGEST" ]; then
-  pushd "$POTDIR" >> /dev/null
-    echo "POTS : $POTS"
-    build_common_components
-    for POT in $POTS ; do
-      echo "+++++++++ $POT"
-      build_final_pot "$POT"
-    done
-  popd >> /dev/null
-fi
-
-if [ -n "$DO_CLEANUP" ]; then
-  pushd "$POTDIR" >> /dev/null
-    do_cleanup
-  popd >> /dev/null
-fi
diff --git a/tools/bin/scripts/createdoc.sh b/tools/bin/scripts/createdoc.sh
deleted file mode 100755 (executable)
index f80dd35..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env bash -v
-
-# Where are we called from?
-P=`dirname $0`
-
-# Current dir
-ORIGPWD=`pwd`
-
-# Function to Create Folder where documentation will be generated.
-create_doc_folder()
-{
-    cd $ORIGPWD/../
-
-    if [ ! -d "Documentation" ] ; then
-       mkdir Documentation
-    fi
-}
-
-create_documentation()
-{
-    #
-    # folder to be parsed
-    #
-    PARSE_FOLDER=$ORIGPWD/../
-
-    #
-    # target folder (documents will be generated in this folder)
-    #
-    TARGET_FOLDER=$ORIGPWD/../Documentation
-
-    #
-    # title of generated documentation
-    #
-    TITLE="CiviCRM"
-
-    #
-    # parse @internal and elements marked private with @access
-    #
-    PRIVATE=on
-
-    #
-    # JavaDoc-compliant description parsing
-    #
-    JAVADOC_STYLE=off
-
-    #
-    # parse a PEAR-style repository
-    #
-    PEAR_STYLE=on
-
-    #
-    # generate highlighted sourcecode for every parced file
-    #
-    SOURCECODE=on
-
-    #
-    # output information (output:converter:templatedir)
-    #
-    OUTPUT=HTML:frames:phpedit
-
-    phpdoc -t $TARGET_FOLDER -o $OUTPUT -d $PARSE_FOLDER -ti "$TITLE" -pp $PRIVATE -j $JAVADOC_STYLE -p $PEAR_STYLE -s $SOURCECODE
-}
-
-# Main Execution Starts Here.
-
-create_doc_folder
-
-create_documentation
diff --git a/tools/bin/scripts/delete.sh b/tools/bin/scripts/delete.sh
deleted file mode 100644 (file)
index c7683cd..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-for j in CRM bin api test distmaker drupal joomla xml; do
-  cd ../$j;
-  for i in `find . -name \*.php`; do
-    echo $i;
-    sed -i '' -e '/\@author Donald/d' $i
-  done
-done
-
-
diff --git a/tools/bin/scripts/drop-closing-php-tags.sh b/tools/bin/scripts/drop-closing-php-tags.sh
deleted file mode 100755 (executable)
index 668d691..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-for i in `find CRM api bin distmaker drupal extern joomla js sql standalone test test-new tools xml -name '*.php'`; do
-  echo $i;
-  perl -pi -e 's/^\?>$//' $i;
-done
diff --git a/tools/bin/scripts/ircbot-civi.py b/tools/bin/scripts/ircbot-civi.py
deleted file mode 100755 (executable)
index 7605fac..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/usr/bin/env python
-'''
-Push feed and vcs activities to an IRC channel.  Configured with the ".slander" rc file, or another yaml file specified on the cmd line.
-
-CREDITS
-Miki Tebeka, http://pythonwise.blogspot.com/2009/05/subversion-irc-bot.html
-Eloff, http://stackoverflow.com/a/925630
-rewritten by Adam Wight,
-project homepage is https://github.com/adamwight/slander
-
-EXAMPLE
-This is the configuration file used for the CiviCRM project:
-    jobs:
-        svn:
-            changeset_url_format:
-                https://fisheye2.atlassian.com/changelog/CiviCRM?cs=%s
-            root: http://svn.civicrm.org/civicrm
-            args: --username SVN_USER --password SVN_PASSS
-        jira:
-            base_url:
-                http://issues.civicrm.org/jira
-            source:
-                http://issues.civicrm.org/jira/activity?maxResults=20&streams=key+IS+CRM&title=undefined
-
-    irc:
-        host: irc.freenode.net
-        port: 6667
-        nick: civi-activity
-        realname: CiviCRM svn and jira notification bot
-        channel: "#civicrm" #note that quotes are necessary here
-        maxlen: 200
-
-    poll_interval: 60
-
-    sourceURL: https://svn.civicrm.org/tools/trunk/bin/scripts/ircbot-civi.py
-'''
-
-import sys
-import os
-import re
-
-import yaml
-
-from twisted.words.protocols import irc
-from twisted.internet.protocol import ReconnectingClientFactory
-from twisted.internet import reactor
-from twisted.internet.task import LoopingCall
-
-from xml.etree.cElementTree import parse as xmlparse
-from cStringIO import StringIO
-from subprocess import Popen, PIPE
-
-import feedparser
-from HTMLParser import HTMLParser
-
-
-class RelayToIRC(irc.IRCClient):
-    def connectionMade(self):
-        self.config = self.factory.config
-        self.jobs = create_jobs(self.config["jobs"])
-        self.nickname = self.config["irc"]["nick"]
-        self.realname = self.config["irc"]["realname"]
-        self.channel = self.config["irc"]["channel"]
-        self.sourceURL = "https://github.com/adamwight/slander"
-        if "sourceURL" in self.config:
-            self.sourceURL = self.config["sourceURL"]
-
-        irc.IRCClient.connectionMade(self)
-
-    def signedOn(self):
-        self.join(self.channel)
-
-    def joined(self, channel):
-        print "Joined channel %s as %s" % (channel, self.nickname)
-        task = LoopingCall(self.check)
-        task.start(self.config["poll_interval"])
-        print "Started polling jobs, every %d seconds." % (self.config["poll_interval"], )
-
-    def privmsg(self, user, channel, message):
-        if message.find(self.nickname) >= 0:
-            # TODO surely there are useful ways to interact?
-            if re.search(r'\bhelp\b', message):
-                self.say(self.channel, "If I only had a brain: %s" % (self.sourceURL, ))
-            else:
-                print "Failed to handle incoming command: %s said %s" % (user, message)
-
-    def check(self):
-        for job in self.jobs:
-            for line in job.check():
-                self.say(self.channel, str(line))
-                print(line)
-
-    @staticmethod
-    def run(config):
-        factory = ReconnectingClientFactory()
-        factory.protocol = RelayToIRC
-        factory.config = config
-        reactor.connectTCP(config["irc"]["host"], config["irc"]["port"], factory)
-        reactor.run()
-
-class SvnPoller(object):
-    def __init__(self, root=None, args=None, changeset_url_format=None):
-        self.pre = ["svn", "--xml"] + args.split()
-        self.root = root
-        self.changeset_url_format = changeset_url_format
-        print "Initializing SVN poller: %s" % (" ".join(self.pre)+" "+root, )
-
-    def svn(self, *cmd):
-        pipe = Popen(self.pre +  list(cmd) + [self.root], stdout=PIPE)
-        try:
-            data = pipe.communicate()[0]
-        except IOError:
-            data = ""
-        return xmlparse(StringIO(data))
-
-    def revision(self):
-        tree = self.svn("info")
-        revision = tree.find(".//commit").get("revision")
-        return int(revision)
-
-    def revision_info(self, revision):
-        revision = str(revision)
-        tree = self.svn("log", "-r", revision)
-        author = tree.find(".//author").text
-        comment = truncate(strip(tree.find(".//msg").text), self.config["irc"]["maxlen"])
-        url = self.changeset_url(revision)
-
-        return (revision, author, comment, url)
-
-    def changeset_url(self, revision):
-        return self.changeset_url_format % (revision, )
-
-    previous_revision = None
-    def check(self):
-        try:
-            latest = self.revision()
-            if self.previous_revision and latest != self.previous_revision:
-                for rev in range(self.previous_revision + 1, latest + 1):
-                    yield "r%s by %s: %s [%s]" % self.revision_info(rev)
-            self.previous_revision = latest
-        except Exception, e:
-            print "ERROR: %s" % e
-
-
-class FeedPoller(object):
-    last_seen_id = None
-
-    def __init__(self, **config):
-        print "Initializing feed poller: %s" % (config["source"], )
-        self.config = config
-
-    def check(self):
-        result = feedparser.parse(self.config["source"])
-        for entry in result.entries:
-            if (not self.last_seen_id) or (self.last_seen_id == entry.id):
-                break
-            yield self.parse(entry)
-
-        if result.entries:
-            self.last_seen_id = result.entries[0].id
-
-
-class JiraPoller(FeedPoller):
-    def parse(self, entry):
-        m = re.search(r'(CRM-[0-9]+)$', entry.link)
-        if (not m) or (entry.generator_detail.href != self.config["base_url"]):
-            return
-        issue = m.group(1)
-        summary = truncate(strip(entry.summary), self.config["irc"]["maxlen"])
-        url = self.config["base_url"]+"/browse/%s" % (issue, )
-
-        return "%s: %s %s [%s]" % (entry.author_detail.name, issue, summary, url)
-
-class MinglePoller(FeedPoller):
-    def parse(self, entry):
-        m = re.search(r'^(.*/([0-9]+))', entry.id)
-        url = m.group(1)
-        issue = int(m.group(2))
-        summary = truncate(strip(entry.summary), self.config["irc"]["maxlen"])
-        author = abbrevs(entry.author_detail.name)
-
-        return "#%d: (%s) %s [%s]" % (issue, author, summary, url)
-
-def strip(text, html=True, space=True):
-    class MLStripper(HTMLParser):
-        def __init__(self):
-            self.reset()
-            self.fed = []
-        def handle_data(self, d):
-            self.fed.append(d)
-        def get_data(self):
-            return ''.join(self.fed)
-
-    if html:
-        stripper = MLStripper()
-        stripper.feed(text)
-        text = stripper.get_data()
-    if space:
-        text = text.strip().replace("\n", " ")
-    return text
-
-def abbrevs(name):
-    return "".join([w[:1] for w in name.split()])
-
-def truncate(message, length):
-    if len(message) > length:
-        return (message[:(length-3)] + "...")
-    else:
-        return message
-
-
-def create_jobs(d):
-    for type, options in d.items():
-        classname = type.capitalize() + "Poller"
-        klass = globals()[classname]
-        yield klass(**options)
-
-if __name__ == "__main__":
-    if len(sys.argv) == 2:
-        dotfile = sys.argv[1]
-    else:
-        dotfile = os.path.expanduser("~/.slander")
-    print "Reading config from %s" % (dotfile, )
-    config = yaml.load(file(dotfile))
-    RelayToIRC.run(config)
diff --git a/tools/bin/scripts/memcache.php b/tools/bin/scripts/memcache.php
deleted file mode 100644 (file)
index a7dff16..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?php
-require_once '../civicrm.config.php';
-require_once 'CRM/Core/Config.php';
-require_once 'CRM/Utils/Cache.php';
-
-define('CIVICRM_USE_MEMCACHE', 1);
-
-$config = CRM_Core_Config::singleton();
-$cache = CRM_Utils_Cache::singleton();
-
-$cache->set('CRM_Core_Config' . CRM_Core_Config::domainID(), $config);
-CRM_Core_Error::debug('get', $cache->get('CRM_Core_Config' . CRM_Core_Config::domainID()));
-
diff --git a/tools/bin/scripts/runStressTest.sh.txt b/tools/bin/scripts/runStressTest.sh.txt
deleted file mode 100755 (executable)
index 64d5239..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/usr/bin/env bash
-
-# define your database name here, will be overriden by
-# FIRST command line argument if given
-DBNAME=
-# define your database usernamename here, will be overriden by
-# SECOND command line argument if given
-DBUSER=
-# define your database password here, will be overriden by
-# THIRD command line argument if given
-DBPASS=
-# set your PHP5 bin dir path here, if it's not in PATH
-# The path should be terminated with dir separator!
-PHP5PATH=
-
-# ==========================================================
-# No changes below, please.
-# ==========================================================
-
-CALLEDPATH=`dirname $0`
-
-if [ "$1" == '-h' ] || [ "$1" == '--help' ]; then
-       echo; echo Usage: setup.sh [database name] [database user] [database password]; echo
-       exit 0
-fi
-
-
-# fetch command line arguments if available
-if [ ! -z $1 ] ; then DBNAME=$1; fi
-if [ ! -z $2 ] ; then DBUSER=$2; fi
-if [ ! -z $3 ] ; then DBPASS=$3; fi
-
-# verify if we have at least DBNAME given
-if [ -z $DBNAME ] ; then
-       echo "No database name defined!"
-       exit 1
-fi
-if [ -z $DBUSER ] ; then
-       echo "No database username defined!"
-       exit 1
-fi
-if [ -z $DBPASS ] ; then
-       read -p "Database password:"
-       DBPASS=$REPLY
-fi
-
-# run code generator if it's there - which means it's
-# checkout, not packaged code
-if [ -d $CALLEDPATH/../xml ]; then
-       cd $CALLEDPATH/../xml
-       "$PHP5PATH"php GenCode.php
-fi
-
-# someone might want to use empty password for development,
-# let's make it possible - we asked before.
-if [ -z $DBPASS ]; then # password still empty
-       PASSWDSECTION=""
-else
-       PASSWDSECTION="-p$DBPASS"
-fi
-
-cd $CALLEDPATH/../sql
-echo; echo Dropping $DBNAME database
-mysqladmin -f -u $DBUSER $PASSWDSECTION drop $DBNAME
-echo; echo Creating $DBNAME database
-mysqladmin -f -u $DBUSER $PASSWDSECTION create $DBNAME
-echo; echo Creating database structure
-mysql -u $DBUSER $PASSWDSECTION $DBNAME < civicrm.mysql
-
-mysql -u $DBUSER $PASSWDSECTION $DBNAME < civicrm_data.mysql
-
-mysql -u $DBUSER $PASSWDSECTION $DBNAME < zipcodes.mysql
-cd ../test/RSTest/
-php Run.php
-
-echo; echo "DONE!"
-
-# to generate a new data file do the foll:
-# mysqladmin -f -uYourDBUser -pYourDBPassword drop YourDBName
-# mysqladmin -f -uYourDBUser -pYourDBPassword create YourDBName
-# mysql -uYourDBUser -pYourDBPassword YourDBName < civicrm.mysql
-# mysql -uYourDBUser -pYourDBPassword YourDBName < civicrm_data.mysql
-# mysql -uYourDBUser -pYourDBPassword YourDBName < zipcodes.mysql
-# php GenerateContactData.php
-# echo "drop table zipcodes" | mysql -uYourDBUser -pYourDBPassword YourDBName
-# mysqldump -t -n -uYourDBUser -pYourDBPassword YourDBName  > GeneratedData.sql
index 3be81314907cca0e95133af84d6de3e67ebe6b33..e46f4d634e41e672d916dae7c8f0f16c0026e63f 100644 (file)
   </foreignKey>
   <field>
     <name>is_override</name>
+    <uniqueName>member_is_override</uniqueName>
     <title>Status Override</title>
     <import>true</import>
+    <export>true</export>
     <headerPattern>/override$/i</headerPattern>
     <type>boolean</type>
     <comment>Admin users may set a manual status which overrides the calculated status. When this flag is true, automated status update scripts should NOT modify status for the record.</comment>
     <type>int</type>
     <comment>Maximum number of related memberships (membership_type override).</comment>
     <add>4.3</add>
+    <export>true</export>
     <html>
       <type>Text</type>
     </html>
   </field>
   <field>
     <name>contribution_recur_id</name>
+    <uniqueName>membership_recur_id</uniqueName>
     <title>Membership Recurring Contribution</title>
     <type>int unsigned</type>
+    <export>true</export>
     <comment>Conditional foreign key to civicrm_contribution_recur id. Each membership in connection with a recurring contribution carries a foreign key to the recurring contribution record. This assumes we can track these processor initiated events.</comment>
     <add>3.3</add>
   </field>