CheckedOut.php

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CheckedOut.php

Steve Richardson

I suspect current implementers of vufind have already worked this out but (for new implementers) CheckedOut.php should be

 

    function launch()

    {

        global $configArray;

        global $interface;

        global $user;

 

        $catalog = new CatalogConnection($configArray['Catalog']['driver']);

 

        $solr = new SOLR($configArray['Index']['url']);

 

        // Get My Transactions

        if ($catalog->status) {

            if ($user->cat_username) {

                $patron = $catalog->patronLogin($user->cat_username, $user->cat_password);

                $result = $catalog->getMyTransactions($patron['id']);

                if (!PEAR::isError($result)) {

                    $transList = array();

 

        // Get My Transactions

        if ($catalog->status) {

            if ($user->cat_username) {

                $patron = $catalog->patronLogin($user->cat_username, $user->cat_password);

                $result = $catalog->getMyTransactions($patron['id']);

                if (!PEAR::isError($result)) {

                    $transList = array();

                    foreach ($result as $data) {

                        $record = $solr->getRecord($data['id']);

 

                        $transList[] = array('id' => $data['id'],

                                             'isbn' => $record['isbn'],

                                             'author' => $record['author'],

                                             'title' => $record['title'],

                                             'format' => $record['format'],

                                             'duedate' => $data['duedate']);

                    }

                    $interface->assign('transList', $transList);

                }

            }

        }

 

        $interface->setTemplate('checkedout.tpl');

 

        $interface->display('layout.tpl');

    }

 

Cheers Steve


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|

Re: CheckedOut.php

Andrew Nagy-2

Steve - thanks for sending any bug fixes to the list.  But to make it much easier, can you send a diff of your changes.

 

You can use the svn diff command to generate the diff against the live source code.

 

Thanks!

Andrew

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Steve Richardson
Sent: Monday, June 30, 2008 11:09 PM
To: [hidden email]
Subject: [VuFind-Tech] CheckedOut.php

 

I suspect current implementers of vufind have already worked this out but (for new implementers) CheckedOut.php should be

 

    function launch()

    {

        global $configArray;

        global $interface;

        global $user;

 

        $catalog = new CatalogConnection($configArray['Catalog']['driver']);

 

        $solr = new SOLR($configArray['Index']['url']);

 

        // Get My Transactions

        if ($catalog->status) {

            if ($user->cat_username) {

                $patron = $catalog->patronLogin($user->cat_username, $user->cat_password);

                $result = $catalog->getMyTransactions($patron['id']);

                if (!PEAR::isError($result)) {

                    $transList = array();

 

        // Get My Transactions

        if ($catalog->status) {

            if ($user->cat_username) {

                $patron = $catalog->patronLogin($user->cat_username, $user->cat_password);

                $result = $catalog->getMyTransactions($patron['id']);

                if (!PEAR::isError($result)) {

                    $transList = array();

                    foreach ($result as $data) {

                        $record = $solr->getRecord($data['id']);

 

                        $transList[] = array('id' => $data['id'],

                                             'isbn' => $record['isbn'],

                                             'author' => $record['author'],

                                             'title' => $record['title'],

                                             'format' => $record['format'],

                                             'duedate' => $data['duedate']);

                    }

                    $interface->assign('transList', $transList);

                }

            }

        }

 

        $interface->setTemplate('checkedout.tpl');

 

        $interface->display('layout.tpl');

    }

 

Cheers Steve


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech