Commit Graph

20 Commits

Author SHA1 Message Date
Tim Almdal
4edf86f0eb Revert "Fix for ticket #452"
This reverts commit 809e52d80c.
2009-07-27 11:14:03 -07:00
Andy Staudacher
570e0b0267 Merge branch 'master' of git://github.com/rledisez/gallery3 into rledisez/master 2009-07-26 22:45:53 -07:00
Tim Almdal
809e52d80c Fix for ticket #452
1) Change access_Core::user_can to return true for all permissions if the
   owner is the specified user.
2) Change Item_Model::viewable to set the owner_id is the first view_restriction
   This allowed simplification of the generating the where clause to a single
   $this->orwhere instead of a where and an orwhere.
2009-07-25 23:45:48 -07:00
Romain LE DISEZ
23bb6eb7e3 Rename columns that use reserved SQL words : items.left and items.right 2009-07-25 19:06:54 +02:00
Romain LE DISEZ
d3fa2bed68 Merge commit 'upstream/master' 2009-07-20 10:49:47 +02:00
Bharat Mediratta
c461881110 Don't post the item_updated() event if we're just updating the view count. 2009-07-19 13:20:08 -07:00
Romain LE DISEZ
c78744d4f8 Merge commit 'upstream/master' 2009-07-18 17:51:23 +02:00
Bharat Mediratta
cd907c2b42 Change model_cache::clear() API to clear everything. This prevents
old ORM relationships from hanging around, which was causing problems
when doing MPTT manipulations (resulting in incorrect permission
propagation-- very bad!)
2009-07-17 12:51:27 -07:00
Bharat Mediratta
8a6556b30b Fix a bug where moved items don't properly inherit permissions from
their new target.  After each move, recalculate the permissions for
the new parent's hierarchy.

Fixes ticket #552
2009-07-17 08:14:08 -07:00
Bharat Mediratta
0f766b149d Second non-trivial change to the event code. We now publish model
related events from within the model handling code.  The only
exception to this currently is item_created which is challenging
because we have to save the item using ORM_MPTT::add_to_parent()
before the object itself is fully set up.  When we get that down to
one call to save() we can publish that event from within the model
also.
2009-07-16 12:31:40 -07:00
Bharat Mediratta
5b3b675b6d Non-trivial changes to the event handling code:
1) The item_updated event no longer takes the old and new items.
   Instead we overload ORM to track the original data and make
   that available via the item.  This will allow us to move event
   publishing down into the API methods which in turn will give us
   more stability since we won't require each controller to remember
   to do it.

2) ORM class now tracks the original values.  It doesn't track
   the original relationships (no need for that, yet)

3) Added new events:
     item_deleted
     group_deleted
     user_deleted
2009-07-16 11:19:34 -07:00
Romain LE DISEZ
7f5030ac20 Merge commit 'upstream/master' 2009-07-16 17:31:20 +02:00
Tim Almdal
8ed6d1183b Fix for #319.
Created a new view "movieplayer.html.php", which is rendered by
Item_Model::movie_img().  Changed movie.html.php to use movie_img to render
the movie player link.
2009-06-30 08:21:00 -07:00
Romain LE DISEZ
be354ab98b Remove an useless ORDER BY.
It improves compatibility with PgSQL.
(Replay of c80d2da0a9)
2009-06-24 23:40:47 +02:00
Bharat Mediratta
ba7163bd30 Fix get_position() to properly deal with duplicate values in the sort column. Fixes #389 2009-06-23 14:50:41 -07:00
Bharat Mediratta
4e3b84eb39 Escape {$this->sort_column} in get_position() 2009-06-23 14:23:11 -07:00
Bharat Mediratta
4f0a3fefa0 Fix a bug in Item_Model::get_position() where we incorrectly using the
grandparent id.  Oops.  This caused navigation from photo back up to
album to be broken.

Also update Photos_Controller to use the active sort order.. it was
still hardcoded to use the id.  It's more efficient now, yay.

Fixes ticket #340.
2009-06-04 22:11:08 -07:00
Tim Almdal
0f987880e6 Fix for ticket #320 2009-06-02 12:08:47 -07:00
Bharat Mediratta
9a7e642cd6 Don't let relative_path() try to update the database if the Item_Model
is not loaded, else you get weird errors.
2009-05-31 22:30:48 -07:00
Bharat Mediratta
28b41056e3 Restructure things so that the application is now just another module.
Kohana makes this type of transition fairly straightforward in that
all controllers/helpers/etc are still located in the cascading
filesystem without any extra effort, except that I've temporarily
added a hack to force modules/gallery into the module path.

Rename what's left of "core" to be "application" so that it conforms
more closely to the Kohana standard (basically, just
application/config/config.php which is the minimal thing that you need
in the application directory)

There's still considerable work left to be done here.
2009-05-27 15:07:27 -07:00