当前位置: 首页>>代码示例>>PHP>>正文


PHP I2CE_FormStorage::migrateForm方法代码示例

本文整理汇总了PHP中I2CE_FormStorage::migrateForm方法的典型用法代码示例。如果您正苦于以下问题:PHP I2CE_FormStorage::migrateForm方法的具体用法?PHP I2CE_FormStorage::migrateForm怎么用?PHP I2CE_FormStorage::migrateForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在I2CE_FormStorage的用法示例。


在下文中一共展示了I2CE_FormStorage::migrateForm方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: upgrade

 /**
  * Upgrade this module if necessary
  * @param string $old_vers
  * @param string $new_vers
  * @return boolean
  */
 public function upgrade($old_vers, $new_vers)
 {
     /*
      * In 3.2.3 we moved some lists from entry to magicdata storage so we need to get the
      * old data from entry and save them to the new form storage.
      */
     if (I2CE_Validate::checkVersion($old_vers, '<', '3.2.3')) {
         $user = new I2CE_User(1, false, false, false);
         $class_config = I2CE::getConfig()->modules->forms->formClasses;
         $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
         if (!I2CE_FormStorage::migrateForm("facility_type", "entry", $user, $migrate_path, false, array("type"))) {
             return false;
         }
         if (I2CE_FormStorage::migrateForm("facility", "entry", $user, $migrate_path, false, array("type"), array("facility_type" => "facility_type", "location" => array("county" => "county", "district" => "district", "country" => "country")))) {
             unset($class_config->iHRIS_Facility->fields->country);
             unset($class_config->iHRIS_Facility->fields->district);
             unset($class_config->iHRIS_Facility->fields->county);
             unset($class_config->iHRIS_Facility->fields->type);
         } else {
             return false;
         }
     } elseif (I2CE_Validate::checkVersion($old_vers, '<', '3.2.4')) {
         $user = new I2CE_User(1, false, false, false);
         $class_config = I2CE::getConfig()->modules->forms->formClasses;
         $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
         if (!I2CE_FormStorage::migrateForm("facility", "entry", $user, $migrate_path, false, array("type"))) {
             return false;
         }
         unset($class_config->iHRIS_Facility->fields->type);
     }
     return parent::upgrade($old_vers, $new_vers);
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:38,代码来源:iHRIS_Module_Facility.php

示例2: migrate

 /**
  * Migrate the facility contact data from entry to the current storage (magicdata)
  */
 public function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
     if (!I2CE_FormStorage::migrateForm("facility_contact", "entry", $user, $migrate_path)) {
         return false;
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:12,代码来源:iHRIS_Module_FacilityContact.php

示例3: migrate

 /**
  * Perform the migrate actions for this module.
  * @return boolean;
  */
 protected function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $class_config = I2CE::getConfig()->modules->forms->formClasses;
     $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
     if (!I2CE_FormStorage::migrateForm("id_type", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateField("person_id", array("id_type" => "id_type"), $migrate_path, $user)) {
         return false;
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:17,代码来源:iHRIS_Module_PersonID.php

示例4: migrate

 /**
  * Perform the migrate actions for this module
  * This is for going from pre 3.2 versions where benefit data has
  * been saved to the database.
  * @return boolean
  */
 protected function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $class_config = I2CE::getConfig()->modules->forms->formClasses;
     $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
     if (!I2CE_FormStorage::migrateForm("competency_evaluation", "entry", $user, $migrate_path, "name", array("type"), array(), true)) {
         return false;
     }
     if (!I2CE_FormStorage::migrateField("person_competency", array("competency_evaluation" => "competency_evaluation", "competency" => "competency"), $migrate_path, $user)) {
         return false;
     }
     unset($class_config->iHRIS_PersonCompetency->fields->competency_type);
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:20,代码来源:iHRIS_Module_PersonSimpleCompetency.php

示例5: migrate

 /**
  * Perform the migrate actions for this module.
  * @return boolean
  */
 protected function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $class_config = I2CE::getConfig()->modules->forms->formClasses;
     $migrate_path = "/I2CE/formsData/migrate_data/4.1.8";
     if (!I2CE_FormStorage::migrateForm("training_classification", "entry", $user, $migrate_path)) {
         return false;
     }
     if (I2CE_ModuleFactory::instance()->isEnabled("CachedForms")) {
         $cachedForm = new I2CE_CachedForm("training_classification");
         $cachedForm->dropTable();
     }
     if (!I2CE_FormStorage::migrateField("training", array("training_classification" => "training_classification"), $migrate_path, $user)) {
         return false;
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:21,代码来源:iHRIS_Module_TrainingClassification.php

示例6: migrate

 /**
  * Perform the migrate actions for this module.
  * @return boolean
  */
 protected function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $class_config = I2CE::getConfig()->modules->forms->formClasses;
     $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
     if (!I2CE_FormStorage::migrateForm("edu_type", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateForm("degree", "entry", $user, $migrate_path, false, array("type"), array("edu_type" => "edu_type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateField("education", array("degree" => "degree"), $migrate_path, $user)) {
         return false;
     }
     unset($class_config->iHRIS_Degree->fields->type);
     unset($class_config->iHRIS_Education->fields->edu_type);
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:22,代码来源:iHRIS_Module_PersonEducation.php

示例7: migrate

 /** 
  * Perform the migrate actions for this module
  * This is for going from pre 3.2 versions where benefit data has
  * been saved to the database.
  * @return boolean
  */
 protected function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $class_config = I2CE::getConfig()->modules->forms->formClasses;
     $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
     $migrate_node = I2CE::getConfig()->traverse($migrate_path, true, false);
     $constant_prof = array(1 => 'language_proficiency|elementary', 2 => 'language_proficiency|limited', 3 => 'language_proficiency|professional', 4 => 'language_proficiency|full_professional', 5 => 'language_proficiency|fluent');
     foreach ($constant_prof as $old_id => $new_id) {
         $migrate_node->forms->language_proficiency->{$old_id} = $new_id;
     }
     if (!I2CE_FormStorage::migrateForm("language", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateField("person_language", array("language" => "language", "speaking" => "language_proficiency", "reading" => "language_proficiency", "writing" => "language_proficiency"), $migrate_path, $user)) {
         return false;
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:24,代码来源:iHRIS_Module_PersonLanguage.php

示例8: migrate

 /**
  * Perform the migrate actions for this module.
  * @return boolean
  */
 protected function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $class_config = I2CE::getConfig()->modules->forms->formClasses;
     $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
     $migrate_node = I2CE::getConfig()->traverse($migrate_path, true, false);
     $constant_gender = array(1 => 'gender|F', 2 => 'gender|M');
     foreach ($constant_gender as $old_id => $new_id) {
         $migrate_node->forms->gender->{$old_id} = $new_id;
     }
     if (!I2CE_FormStorage::migrateForm("marital_status", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateField("demographic", array("gender" => "gender", "marital_status" => "marital_status"), $migrate_path, $user)) {
         return false;
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:22,代码来源:iHRIS_Module_PersonDemographic.php

示例9: upgrade

 /**
  * Upgrade this module if necessary
  * @param string $old_vers
  * @param string $new_vers
  * @return boolean
  */
 public function upgrade($old_vers, $new_vers)
 {
     /*
      * In 3.2.3 we moved some lists from entry to magicdata storage so we need to get the
      * old data from entry and save them to the new form storage.
      */
     if (I2CE_Validate::checkVersion($old_vers, '<', '3.2.6')) {
         $user = new I2CE_User(1, false, false, false);
         $class_config = I2CE::getConfig()->modules->forms->formClasses;
         $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
         if (!I2CE_FormStorage::migrateForm("competency_type", "entry", $user, $migrate_path, false, array("type"))) {
             return false;
         }
         if (!I2CE_FormStorage::migrateForm("competency", "entry", $user, $migrate_path, false, array("type"), array("competency_type" => "competency_type"))) {
             return false;
         }
         // If everything migrated correctly, then remove the unused fields.
         unset($class_config->iHRIS_Competency->fields->type);
     }
     return parent::upgrade($old_vers, $new_vers);
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:27,代码来源:iHRIS_Module_SimpleCompetency.php

示例10: migrate

 /**
  * Perform the migrate actions for this module
  * This is for going from pre 3.2 versions where benefit data has
  * been saved to the database.
  * @return boolean
  */
 protected function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $class_config = I2CE::getConfig()->modules->forms->formClasses;
     $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
     if (!I2CE_FormStorage::migrateForm("salary_grade", "entry", $user, $migrate_path, "code", array("type"), array("start" => "currency", "midpoint" => "currency", "end" => "currency"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateForm("cadre", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateForm("classification", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateForm("job", "entry", $user, $migrate_path, "code", array("type"), array("salary_grade" => "salary_grade", "cadre" => "cadre", "classification" => "classification"))) {
         return false;
     }
     // If everything migrated correctly, then remove the unused fields.
     unset($class_config->iHRIS_Job->fields->type);
     unset($class_config->iHRIS_SalaryGrade->fields->type);
     unset($class_config->iHRIS_Classification->fields->type);
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:29,代码来源:iHRIS_Module_ManageJob.php

示例11: migrate

 /**
  * Perform the migrate actions for this module
  * This is for going from pre 3.2 versions where benefit data has
  * been saved to the database.
  * @return boolean
  */
 protected function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $class_config = I2CE::getConfig()->modules->forms->formClasses;
     $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
     $migrate_node = I2CE::getConfig()->traverse($migrate_path, true, false);
     $constant_status = array(1 => 'position_status|open', 2 => 'position_status|closed', 3 => 'position_status|discontinued');
     foreach ($constant_status as $old_id => $new_id) {
         $migrate_node->forms->position_status->{$old_id} = $new_id;
     }
     if (!I2CE_FormStorage::migrateForm("pos_change_reason", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateForm("position_type", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateForm("department", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateField("person_position", array("position" => "position", "reason" => "pos_change_reason"), $migrate_path, $user)) {
         return false;
     }
     unset($class_config->iHRIS_Position->fields->status->default_eval);
     if (!I2CE_FormStorage::migrateField("position", array("job" => "job", "source" => "salary_source", "supervisor" => "position", "facility" => "facility", "department" => "department", "pos_type" => "position_type", "proposed_salary" => "currency", "status" => "position_status"), $migrate_path, $user)) {
         return false;
     }
     // If everything migrated correctly, then remove the unused fields.
     unset($class_config->iHRIS_Departent->fields->type);
     unset($class_config->iHRIS_Position->fields->type);
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:37,代码来源:iHRIS_Module_PersonPosition.php

示例12: migrate

 /**
  * Perform the migrate actions for this module
  * This is for going from pre 3.2 versions where benefit data has
  * been saved to the database.
  * @return boolean
  */
 protected function migrate()
 {
     $user = new I2CE_User(1, false, false, false);
     $class_config = I2CE::getConfig()->modules->forms->formClasses;
     $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
     $migrate_node = I2CE::getConfig()->traverse($migrate_path, true, false);
     $constant_recur = array(1 => 'benefit_recurrence|once', 2 => 'benefit_recurrence|weekly', 3 => 'benefit_recurrence|monthly', 4 => 'benefit_recurrence|yearly');
     foreach ($constant_recur as $old_id => $new_id) {
         $migrate_node->forms->benefit_recurrence->{$old_id} = $new_id;
     }
     if (!I2CE_FormStorage::migrateForm("benefit_type", "entry", $user, $migrate_path, false, array("type"))) {
         return false;
     }
     if (!I2CE_FormStorage::migrateField("benefit", array("type" => "benefit_type", "source" => "salary_source", "amount" => "currency", "recurrence" => "benefit_recurrence"), $migrate_path, $user)) {
         return false;
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:24,代码来源:iHRIS_Module_Benefit.php

示例13: upgrade

 /**
  * Upgrade this module if necessary
  * @param string $old_vers
  * @param string $new_vers
  * @return boolean
  */
 public function upgrade($old_vers, $new_vers)
 {
     /*
      * In 3.2.3 we moved some lists from entry to magicdata storage so we need to get the
      * old data from entry and save them to the new form storage.
      */
     if (I2CE_Validate::checkVersion($old_vers, '<', '3.2.3')) {
         $user = new I2CE_User(1, false, false, false);
         $class_config = I2CE::getConfig()->modules->forms->formClasses;
         $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
         if (!I2CE_FormStorage::migrateForm("training_course_status", "entry", $user, $migrate_path, false, array("type"))) {
             return false;
         }
         if (!I2CE_FormStorage::migrateForm("training_course_category", "entry", $user, $migrate_path, false, array("type"))) {
             return false;
         }
         if (!I2CE_FormStorage::migrateForm("training_course_evaluation", "entry", $user, $migrate_path, false, array("type"))) {
             return false;
         }
         if (!I2CE_FormStorage::migrateForm("training_course_requestor", "entry", $user, $migrate_path, false, array("type"))) {
             return false;
         }
         if (!I2CE_FormStorage::migrateField("training_course", array("training_institution" => "training_institution", "training_funder" => "training_funder", "continuing_education_course" => "continuing_education_course", "training_course_status" => "training_course_status", "training_course_category" => "training_course_category"), $migrate_path, $user)) {
             return false;
         }
         if (!I2CE_FormStorage::migrateField("person_scheduled_training_course", array("training_course_evaluation" => "training_course_evaluation", "training_course_requestor" => "training_course_requestor", "scheduled_training_course" => "scheduled_training_course"), $migrate_path, $user)) {
             return false;
         }
         if (!I2CE_FormStorage::migrateField("scheduled_training_course", array("location" => array("county" => "county", "district" => "district", "country" => "country")), $migrate_path, $user)) {
             return false;
         }
         unset($class_config->iHRIS_Person_Scheduled_Training_Course->fields->training_course);
         unset($class_config->iHRIS_Scheduled_Training_Course->fields->country);
         unset($class_config->iHRIS_Scheduled_Training_Course->fields->district);
         unset($class_config->iHRIS_Scheduled_Training_Course->fields->county);
     } elseif (I2CE_Validate::checkVersion($old_vers, '<', '3.2.35')) {
         $user = new I2CE_User(1, false, false, false);
         $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
         if (!I2CE_FormStorage::migrateField("person_scheduled_training_course", array("scheduled_training_course" => "scheduled_training_course"), $migrate_path, $user)) {
             return false;
         }
     }
     if (I2CE_Validate::checkVersion($old_vers, '<', '3.2.18')) {
         $evals = array('pass' => 'Pass', 'fail' => 'Fail', 'incomplete' => 'Incomplete');
         if (!I2CE_Module_Lists::remapFields('training_course_evaluation', $evals, 'person_scheduled_training_course')) {
             return false;
         }
         if (!I2CE_Module_Lists::deleteMappedValues('training_course_evaluation', $evals)) {
             return false;
         }
     }
     if (I2CE_Validate::checkVersion($old_vers, '<', '3.2.30')) {
         $evals = array('open' => 'Open', 'closed' => 'Closed');
         if (!I2CE_Module_Lists::remapFields('training_course_status', $evals, 'training_course')) {
             return false;
         }
         if (!I2CE_Module_Lists::deleteMappedValues('training_course_status', $evals)) {
             return false;
         }
     }
     if (I2CE_Validate::checkVersion($old_vers, '<', '3.2.32')) {
         $user = new I2CE_User(1, false, false, false);
         $class_config = I2CE::getConfig()->modules->forms->formClasses;
         $migrate_path = "/I2CE/formsData/migrate_data/3.2.3";
         if (!I2CE_FormStorage::migrateField("scheduled_training_course", array("location" => array("county" => "county", "district" => "district", "country" => "country")), $migrate_path, $user)) {
             return false;
         }
     }
     if (I2CE_Validate::checkVersion($old_vers, '<', '3.2.63')) {
         if (!$this->moveScheduledTrainingCourseToMap()) {
             return false;
         }
     }
     return parent::upgrade($old_vers, $new_vers);
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:81,代码来源:iHRIS_Module_Training_Course.php


注:本文中的I2CE_FormStorage::migrateForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。