Changeset 266 for trunk/bin


Ignore:
Timestamp:
Jul 3, 2007 8:41:36 AM (17 years ago)
Author:
quinn
Message:

Bugfixes found during strangecode site upgrade.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/module_maker/validation.cli.php

    r151 r266  
    184184        }
    185185        if ($max_length > 0 && $len_type == 'setenum') {
    186             $o[] = "\$fv->stringLength('$field', 0, $max_length, _(\"$title has an invalid selection.\"));";
     186            $o[] = "\$fv->stringLength('$field', 0, $max_length, sprintf(_(\"%s has an invalid selection.\"), _(\"$title\")));";
    187187        }
    188188        if ($max_length > 0 && $len_type == 'string') {
     
    241241        case 'date' :
    242242        case 'datetime' :
    243             // \$fv->validateStrDate('$field', sprintf(_(\"%s must be a valid date in YYYY-MM-DD format.\"), _(\"$field\")));
    244             $o[] = "\$fv->validateStrDate('$field', sprintf(_(\"%s must be a valid date in YYYY-MM-DD format.\"), _(\"$field\")));";
    245             $o[] = "\$fv->checkRegex('$field', '/^\d{4}-\d{2}-\d{2}$/', true, sprintf(_(\"%s must be in YYYY-MM-DD format.\"), _(\"$field\")));";
     243            // \$fv->validateStrDate('$field', sprintf(_(\"%s must be a valid date in YYYY-MM-DD format.\"), _(\"$title\")));
     244            $o[] = "\$fv->validateStrDate('$field', sprintf(_(\"%s must be a valid date in YYYY-MM-DD format.\"), _(\"$title\")));";
     245            $o[] = "\$fv->checkRegex('$field', '/^\d{4}-\d{2}-\d{2}$/', true, sprintf(_(\"%s must be in YYYY-MM-DD format.\"), _(\"$title\")));";
    246246            break;
    247247
    248248        case 'timestamp' :
    249             $o[] = "\$fv->checkRegex('$field', '/^\d{14}$/', true, sprintf(_(\"%s must be a valid mysql timestamp in YYYYMMDDhhmmss format.\"), _(\"$field\")));";
     249            $o[] = "\$fv->checkRegex('$field', '/^\d{14}$/', true, sprintf(_(\"%s must be a valid mysql timestamp in YYYYMMDDhhmmss format.\"), _(\"$title\")));";
    250250            break;
    251251
    252252        case 'time' :
    253             $o[] = "\$fv->checkRegex('$field', '/^\d{1,3}:\d{2}:\d{2}$/', true, sprintf(_(\"%s must be a valid time in hh:mm:ss format.\"), _(\"$field\")));";
     253            $o[] = "\$fv->checkRegex('$field', '/^\d{1,3}:\d{2}:\d{2}$/', true, sprintf(_(\"%s must be a valid time in hh:mm:ss format.\"), _(\"$title\")));";
    254254            break;
    255255
    256256        case 'year' :
    257             $o[] = "\$fv->checkRegex('$field', '/^\d{4}$/', true, sprintf(_(\"%s must be a valid year in YYYY format.\"), _(\"$field\")));";
     257            $o[] = "\$fv->checkRegex('$field', '/^\d{4}$/', true, sprintf(_(\"%s must be a valid year in YYYY format.\"), _(\"$title\")));";
    258258            break;
    259259
Note: See TracChangeset for help on using the changeset viewer.