Changeset 408 for trunk/services


Ignore:
Timestamp:
Aug 30, 2012 5:52:29 PM (12 years ago)
Author:
anonymous
Message:

Improved admin list filter query retention

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/services/admins.php

    r405 r408  
    8181$page->setPageNumber(getFormData('page_number'));
    8282
    83 // Search limiters retain their values between page requests.
    84 $app->carryQuery('search_query');
    85 
     83// Query parameters to retain only locally.
     84$locally_carried_queries = array(
     85    'search_query',
     86);
    8687
    8788/********************************************************************
     
    121122    if ($app->validBoomerangURL('admins')) {
    122123        // Display boomerang page.
    123         $app->dieBoomerangURL('admins');
     124        $app->dieBoomerangURL('admins', $locally_carried_queries);
    124125    }
    125126    // Display default page.
    126     $app->dieURL($_SERVER['PHP_SELF']);
     127    $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries);
    127128    break;
    128129
     
    131132        if ($app->validBoomerangURL('admins')) {
    132133            // Display boomerang page.
    133             $app->dieBoomerangURL('admins');
     134            $app->dieBoomerangURL('admins', $locally_carried_queries);
    134135        }
    135136        // Display default page.
    136         $app->dieURL($_SERVER['PHP_SELF']);
     137        $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries);
    137138    }
    138139    validateInput();
     
    146147        if (getFormdata('repeat', false)) {
    147148            // Display function again.
    148             $app->dieURL($_SERVER['PHP_SELF'] . '?op=add');
     149            $app->dieURL($_SERVER['PHP_SELF'] . '?op=add', $locally_carried_queries);
    149150        } else if ($app->validBoomerangURL('admins')) {
    150151            // Display boomerang page.
    151             $app->dieBoomerangURL('admins');
     152            $app->dieBoomerangURL('admins', $locally_carried_queries);
    152153        }
    153154        // Display default page.
    154         $app->dieURL($_SERVER['PHP_SELF']);
     155        $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries);
    155156    }
    156157    break;
     
    159160    if (getFormdata('reset', false)) {
    160161        $app->raiseMsg(_("Saved values have been reloaded."), MSG_NOTICE, __FILE__, __LINE__);
    161         $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . getFormData('admin_id'));
     162        $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . getFormData('admin_id'), $locally_carried_queries);
    162163    }
    163164    if (getFormdata('cancel', false)) {
     
    167168        if ($app->validBoomerangURL('admins')) {
    168169            // Display boomerang page.
    169             $app->dieBoomerangURL('admins');
     170            $app->dieBoomerangURL('admins', $locally_carried_queries);
    170171        }
    171172        // Display default page.
    172         $app->dieURL($_SERVER['PHP_SELF']);
     173        $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries);
    173174    }
    174175    validateInput();
     
    184185            $qid = $db->query("SELECT " . $auth->getParam('db_primary_key') . " FROM " . $auth->getParam('db_table') . " WHERE " . $auth->getParam('db_primary_key') . " > '" . $db->escapeString(getFormData('admin_id')) . "' ORDER BY " . $auth->getParam('db_primary_key') . " ASC LIMIT 1");
    185186            if (list($next_id) = mysql_fetch_row($qid)) {
    186                 $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $next_id);
     187                $app->dieURL($_SERVER['PHP_SELF'] . '?op=edit&admin_id=' . $next_id, $locally_carried_queries);
    187188            } else {
    188189                $app->raiseMsg(_("Cannot edit next, the end of the list was reached"), MSG_NOTICE, __FILE__, __LINE__);
     
    190191        } else if ($app->validBoomerangURL('admins')) {
    191192            // Display boomerang page.
    192             $app->dieBoomerangURL('admins');
     193            $app->dieBoomerangURL('admins', $locally_carried_queries);
    193194        }
    194195        // Display default page.
    195         $app->dieURL($_SERVER['PHP_SELF']);
     196        $app->dieURL($_SERVER['PHP_SELF'], $locally_carried_queries);
    196197    }
    197198    break;
     
    208209
    209210include 'header.ihtml';
     211$app->carryQuery($locally_carried_queries);
    210212include 'codebase/services/templates/' . $main_template;
    211213include 'footer.ihtml';
     
    305307        $app->logMsg('Could not find record with admin_id: ' . $id, LOG_WARNING, __FILE__, __LINE__);
    306308        $app->raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__);
    307         $app->dieBoomerangURL();
     309        $app->dieBoomerangURL('admins', $locally_carried_queries);
    308310    }
    309311
     
    366368        $app->logMsg('Could not find record with admin_id: ' . $id, LOG_WARNING, __FILE__, __LINE__);
    367369        $app->raiseMsg(sprintf(_("The requested record %s could not be found."), $id), MSG_ERR, __FILE__, __LINE__);
    368         $app->dieBoomerangURL();
     370        $app->dieBoomerangURL('admins', $locally_carried_queries);
    369371    }
    370372
Note: See TracChangeset for help on using the changeset viewer.