bug fixing

ccode
homonym companies terms
tel to long set to memo instead of phone field

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy
2012-05-21 17:50:22 +02:00
parent 9e85e7a105
commit 18982b6700
5 changed files with 46 additions and 23 deletions
+19 -4
View File
@@ -74,7 +74,9 @@ class MaterioIndustrialContactUserMigration extends MaterioBasicMigration {
if($cr->email_contact == "")
return false;
$cr->company = trim($cr->company);
$cr->company = trim($cr->company);
if(count(taxonomy_get_term_by_name($cr->company.'-'.$cr->id_industrial)))
$cr->company .= '-'.$cr->id_industrial;
$cr->memo = "#contact";
@@ -201,11 +203,11 @@ class MaterioIndustrialContactProfile2Migration extends MaterioBasicMigration {
$ccs = cck_phone_countrycodes();
$match = 0;
foreach ($ccs as $cc => $cc_values) {
if('+'.$cr->ccode1_contact == $cc_values['code']){
if('+'.preg_replace('/^\+/', '', $cr->ccode1_contact) == $cc_values['code']){
$cr->ccode1_contact = $cc;
$match++;
}
if('+'.$cr->ccode2_contact == $cc_values['code']){
if('+'.preg_replace('/^\+/', '', $cr->ccode2_contact) == $cc_values['code']){
$cr->ccode2_contact = $cc;
$match++;
}
@@ -213,11 +215,24 @@ class MaterioIndustrialContactProfile2Migration extends MaterioBasicMigration {
break;
}
if(strlen($cr->ccode1_contact) > 2 && $cr->tel1_contact != "" ){
$cr->memo .= "\n".'tel1 contact : '. $cr->ccode1_contact .' '. $cr->tel1_contact;
$cr->tel1_contact = NULL;
$cr->ccode1_contact = NULL;
}
if(strlen($cr->tel1_contact) > 15){
$cc = cck_phone_countrycodes($cr->ccode1_contact);
$cr->memo .= "\n".'tel1 contact : '. $cc['country'] . ' (' . $cc['code'] . ')' .' '. $cr->tel1_contact;
$cr->tel1_contact = NULL;
$cr->ccode1_contact = NULL;
}
if($cr->tel2_contact != ''){
$cc = cck_phone_countrycodes($cr->ccode2_contact);
$cr->memo .= "\n".'tel2 contact : '. $cc['country'] . ' (' . $cc['code'] . ')' .' '. $cr->tel2_contact;
}
// dsm($cr, '- - - - $cr - - - -');
return TRUE;