Changeset 655 for trunk/bin


Ignore:
Timestamp:
Jan 24, 2019 7:22:55 PM (5 years ago)
Author:
anonymous
Message:

Update module_maker. Minor fixes.

Location:
trunk/bin/module_maker
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/module_maker/skel/adm_list.ihtml

    r461 r655  
    88        <input type="text" class="sc-small" size="20" name="search_query" value="<?php echo getFormData('search_query'); ?>" title="<?php echo oTxt(_("Fields searched: __///__ %SEARCH_FIELDS%.")); ?>" />
    99        <select name="filter___///__" class="sc-small">
    10             <?php // printSelectForm('__///___tbl', "CONCAT(__///___id, '&mdash;', city, '&mdash;', title)", '__///___id', getFormData('filter___///__'), array('' => 'Any __///__'), 'ORDER BY __///__ ASC'); ?>
     10            <?php // HTML::printSelectOptions(HTML::getSelectOptions('__///___tbl', '__///___title', '__///___id', getFormData('filter___///__'), array('' => 'Any __///__'), 'ORDER BY __///__ ASC')); ?>
     11        </select>
     12        <select name="filter___///__" class="sc-small">
     13            <?php // HTML::printSelectOptions(HTML::getSelectOptionsEnum('__///___tbl', '__///___', getFormData('filter___///__'), array('' => 'Any type'))); ?>
    1114        </select>
    1215        <input type="submit" value="<?php echo _("Filter"); ?>" />
  • trunk/bin/module_maker/skel/admin.php

    r558 r655  
    3030
    3131$auth->requireLogin();
    32 $app->sslOn();
    3332
    3433require_once 'codebase/lib/PageNumbers.inc.php';
     
    8988if (getFormData('break_list_cache', false)) {
    9089    // Remove any stale cached list data.
    91     $cache->delete('list');
     90    $cache->delete('%NAME_SINGULAR% list');
    9291}
    9392
     
    284283
    285284    // Remove any stale cached list data.
    286     $cache->delete('list');
     285    $cache->delete('%NAME_SINGULAR% list');
    287286
    288287    // Get the information for this object.
     
    315314
    316315    // Remove any stale cached list data.
    317     $cache->delete('list');
     316    $cache->delete('%NAME_SINGULAR% list');
    318317
    319318%INSERT%
     
    343342
    344343    // Remove any stale cached list data.
    345     $cache->delete('list');
     344    $cache->delete('%NAME_SINGULAR% list');
    346345
    347346%UPDATE%
     
    351350    $version->create('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%'], $frm['__///__']);
    352351
    353     $app->raiseMsg(sprintf(_("The %ITEM_TITLE% <em>%s</em> has been updated."), $frm['__///__']), MSG_SUCCESS, __FILE__, __LINE__);
     352    $app->raiseMsg(sprintf(_("The %ITEM_TITLE% <em>%s</em> has been updated. <a href=\"%s\" class=\"small secondary button\">Edit again</a>"), $frm['__///__'], $app->ohref('?op=edit&%PRIMARY_KEY%=' . $frm['%PRIMARY_KEY%'])), MSG_SUCCESS, __FILE__, __LINE__);
    354353
    355354    // Unlock record.
     
    415414    $cache_hash = md5($sql . '|' . $page->total_items);
    416415    if ($tmp_prefs->get('cache_hash') != $cache_hash) {
    417         $cache->delete('list');
     416        $cache->delete('%NAME_SINGULAR% list');
    418417        $tmp_prefs->set('cache_hash', $cache_hash);
    419418    }
    420419
    421420    // First try to return from the cache.
    422     if ($cache->exists('list')) {
    423         $list = $cache->get('list');
     421    if ($cache->exists('%NAME_SINGULAR% list')) {
     422        $list = $cache->get('%NAME_SINGULAR% list');
    424423        return $list;
    425424    }
     
    433432    // Save this list into the cache.
    434433    if (isset($list) && !empty($list)) {
    435         $cache->set('list', $list);
     434        $cache->set('%NAME_SINGULAR% list', $list);
    436435    }
    437436
     
    451450
    452451    // Remove any stale cached list data.
    453     $cache->delete('list');
     452    $cache->delete('%NAME_SINGULAR% list');
    454453
    455454    // Count the ranks with invalid numbers
  • trunk/bin/module_maker/validation.cli.php

    r612 r655  
    286286        case 'numeric' :
    287287        case 'float' :
    288             $max = str_repeat('9', $max_dig - $max_dec);
    289             if ($max_dec > 0) {
    290                 $max .= '.' . str_repeat('9', $max_dec);
    291             }
    292288            if ($unsigned) {
    293289                $negative_ok = 'false';
    294                 $min = 0;
    295290            } else {
    296291                $negative_ok = 'true';
    297                 $min = -$max;
    298292            }
    299293            $negative_ok = $unsigned ? 'false' : 'true';
    300             $o[] = "\$fv->isDecimal('$field', sprintf(_(\"%s must be a number between %d and %d.\"), _(\"$title\"), $min, $max), $negative_ok, $max_dig, $max_dec);";
     294            $o[] = "\$fv->isDecimal('$field', $max_dig, $max_dec, false, sprintf(_(\"%s must be a number with a maximum of %d integer digits and %d fractional digits, e.g., {EX}.\"), _(\"$title\"), ${max_dig}-${max_dec}, $max_dec), MSG_ERR, __FILE__, __LINE__);";
    301295            break;
    302296
Note: See TracChangeset for help on using the changeset viewer.