{5} Assigned, Active Tickets by Owner (Full Description) (8 matches)

List tickets assigned, group by ticket owner. This report demonstrates the use of full-row display.

Kaste

Ticket Summary Component Milestone Type Created
Description
#134 AkActiveRecord::count should handle and sanitize variables in given conditions Active Record 0.9 enhancement 03/09/08

'conditions' part can't handle placeholders and arrays at all, ex.

  $id = 1; 
  $Class->count(array('conditions' => array('id = ?', $id))

is compiled as 'WHERE Array', while 'Where id = 1' is expected. Proposed patch is copy'n'paste from the &find () function, so it is a good candidate for refactoring

Index: lib/AkActiveRecord.php
===================================================================
--- lib/AkActiveRecord.php      (revision 505)
+++ lib/AkActiveRecord.php      (working copy)
@@ -5003,8 +5003,27 @@

         $sql .=  empty($options['joins']) ? '' : " {$options['joins']} ";

+        //$this->santizeSql(conditions);
+        if(!empty($options['conditions']) && is_array($options['conditions'])){
+            if (isset($options['conditions'][0]) && strstr($options['conditions'][0], '?') && count($options['conditions']) > 1){
+                //array('conditions' => array("name=?",$name))
+                $pattern = array_shift($options['conditions']);
+                $options['bind'] = array_values($options['conditions']);
+                $options['conditions'] = $pattern;
+            }elseif (isset($options['conditions'][0])){
+                //array('conditions' => array("user_name = :user_name", ':user_name' => 'hilario')
+                $pattern = array_shift($options['conditions']);
+                $options['conditions'] = str_replace(array_keys($options['conditions']), array_values($this->getSanitizedConditionsArray($options['conditions'])),$pattern);
+            }else{
+                //array('conditions' => array('user_name'=>'Hilario'))
+                $options['conditions'] = join(' AND ',(array)$this->getAttributesQuoted($options['conditions']));
+            }
+        }
+
+
         empty($options['conditions']) ? null : $this->addConditions($sql, $options['conditions']);

+
         if (!empty($options['group'])){
             $sql .=  " GROUP BY {$options['group_field']} ";
             $sql .= empty($options['having']) ? '' : " HAVING {$options['having']} ";
@@ -5013,6 +5032,11 @@
         $sql .= empty($options['order']) ? '' : " ORDER BY {$options['order']} ";
         $this->_db->addLimitAndOffset($sql, $options);
         $sql .= $use_workaround ? ')' : '';
+
+        if(!empty($options['bind']) && is_array($options['bind']) && strstr($sql,'?')){
+            $sql = array_merge(array($sql),$options['bind']);
+        }
+
         return $sql;
     }


arnoschn

Ticket Summary Component Milestone Type Created
Description
#214 Destructor invokes several times Others: core 0.9 defect 08/13/08

Constructor in AkObject? class registers shutdown function every time when new insance is creating. So at the end

____ak_shutdown_function

is calling several times. It happens because variable static $_callback_called different for each instance. My suggestion is to use separate function for registering shutdown function

function ___ak_register_shutdown() {
    static $_callback_called = false;

    if(!$_callback_called){
	$_callback_called = true;
        register_shutdown_function('____ak_shutdown_function');
    }
}

class AkObject
{
....

    function AkObject()
    {
        ...
	___ak_register_shutdown();
    }

....
}

And I suggest replace condition

function ____ak_shutdown_function($details = false)
{
    static $___registered_objects;
    if(!$details) { ... }
}

with

function ____ak_shutdown_function($details = false)
{
    static $___registered_objects;
    if($details === false) { ... }
}

Thanks, sorry for bad english


#52 Implement a DRY caching system Cache 1.0 enhancement 08/29/07

Akelos uses PEAR Cache_Lite for caching blocks, but we can use Rails conventions for caching and implement:

Page Caching

This is the fastest way of caching.

Using mapped routes the cache for post/show/3 will be stored at public/cache/post/show/3.html. This methods requires sweepers to be implemented preferably at app/sweepers for cleaning up static pages.

Page caching should also offer the possibility of using public/cache/post/show/3.php and inserting custom code portions at the beginning of the file for sending the correct cache headers or running very fast PHP code without the overhead of starting the framework.

Action Caching

Same as before but starting Akelos and calling before filters. Mainly for authenticating before delivering the page.

Cache is stored at /tmp/cache/example.com/development/post/show/3.cache

Fragment Caching

Caches parts of the views.

ActiveRecord? Query Caching

We currently can do this using phpAdodb instance available at Model::_db, but making it easier would be great.

More details at the excellent Rails Caching tutorial at http://www.railsenvy.com/2007/3/20/ruby-on-rails-caching-tutorial-part-2, I really envy this guys for such a funny videos :P


#56 Text fixtures should be loaded using class attributes Active Support 0.9 enhancement 08/31/07

Currently for installing a fixture you need to call AkUnitTest::intallAndIncludeModel, this runs down the migrations, then it runs them up to the latest version and includes the model into the test without instantiating them by default.

Adding support for declaring

class BlogTestCase extends AkUnitTest
{
   var $fixtures = 'post,comment';
}

should run the migrations, and also populate the database with the the data at posts.yaml and comments.yaml files if they exist, and then instantiate the models so they can be used without having to type new Post() on each case.


#205 Implement a way to add Irregulars to AkInflector Active Support 1.0 enhancement 07/19/08

follow up to #153

my suggestion is:

write an (php5) Autoloader; load in index.php.

then we could simply call

AkInflector::addIrregular(:singular,:plural)

inside config/config.php


#206 Distributed Sessions using AkSession - based on AkCache Handlers (db -OR- memcache) Action Controller 0.9 enhancement 07/20/08

Re-Use the AkCache? handlers for session storage. Deprecate AkDbSession?.

The Session Handler should be configurable through:

config/sessions.yml

defining the handler to use and the lifetime of the sessions


bermi

Ticket Summary Component Milestone Type Created
Description
#61 cant sort by pagination_helper with include option Action View 0.9 defect 09/14/07

using pagination_helper with include option, search for including model's column. at that time in PaginationHelper::_getOrderFromAssociations() uses AkActiveRecord::getAvailableAssociates(), it dones not implement.

and maybe it seems to have some problems. I make patches.

My environment is: WinXp?, Xampp1.5.5 apache2.2.3,PostgreSQL8.2, PHP5.2.0

Model: User

$this->createTable('users', "
  id,
  name text,
  kana text,
  login text,
  number text,
  email text,
  mobile text,
  enabled integer,
  user_type_id,
  created_at,
  updated_at
");

class User extends ActiveRecord
{
    var $belongsTo = 'user_type';
}

UserType:

{{{
$this->createTable('user_types', "
  id,
  name text,
  created_at,
  updated_at
");

}}}

user_controller:

    function listing()
    {
        $this->user_pages = $this->pagination_helper->getPaginator(
            $this->User, 
            array(
                'items_per_page' => 10,
                'include' => array('user_type'),
            )
        );
        $this->users = $this->User->find('all', $this->pagination_helper->getFindOptions($this->User));
        
    }

#172 Core Dump of Apache Installer 1.0 defect 05/13/08

First

svn co http://svn.akelos.org/trunk ./

them copy it to virtual host dir
then go to http://localhost/ for setup
and apache is break

PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Mar 27 2008 20:10:05)
Server version: Apache/2.2.8 (Unix)

Stable version (0.8) is working normally
Sorry for bad english


Note: See TracReports for help on using and creating reports.