Commit Graph

23 Commits

Author SHA1 Message Date
Bharat Mediratta
23b0abb974 Redefine the batch API to be very very simple. You call
batch::start() before starting a series of events, and batch::stop()
when you're done.

In batch mode, the notification module will store up pending
notifications.  When the batch job is complete, it'll send a single
digested email to each user for all of her notifications.

Updated the scaffold and local_import to use this.  Haven't modified
SimpleUploader yet.
2009-03-04 08:51:49 +00:00
Bharat Mediratta
b493a534f2 A variety of cleanups:
* Allow for the "movie" type in all of our text
* Try to follow the pattern of mainly only passing ORM objects
  to the view and let it generate its own text (this becomes
  even more important when 3rd parties want to customize notification
  messages)
* Rename _send_message to be _notify_subscribers to be more acccurate
  and have it explicitly take a subject in the API
* Use Item_Model::url() in the views instead of hand crafting URLs
* Reformat HTML in views
* Use $comment->author_xxx() functions instead of replicating that code
* Fix several places where we were encoding data by doing ucfirst($item->type)
  with conditionals where we form the text properly.  We should *never*
  be showing data types to the end user!  This is not localizable!

Note that this probably breaks the existing batch processing code.  I
am going to redo that in a subsequent pass.
2009-03-04 06:25:55 +00:00
Bharat Mediratta
3600e73282 Simplify logic a bit and tweak the visible text. 2009-03-04 05:22:42 +00:00
Tim Almdal
81a6dc26cb Send 1 items added notification per batch of items 2009-03-04 03:31:01 +00:00
Tim Almdal
0408a0096a Undo r20234 2009-03-03 06:29:16 +00:00
Tim Almdal
1c6384f823 Removed the === false and === true checks 2009-03-03 06:18:18 +00:00
Tim Almdal
c04ff8e02f Change the pattern to identify tables that need prefix substitution to
mirror the drupal pattern of using braces {}.
2009-02-28 06:37:28 +00:00
Tim Almdal
bd15853708 This implements table prefix for all the queries in core, user, exif,
tag, search, comment and notification modules (Ticket #68)
2009-02-27 21:07:18 +00:00
Bharat Mediratta
9f76d15086 Clean up translations to use t() properly and differentiate between
albums and photos.  We should not say the word "item" to users if we
can avoid it.
2009-02-10 03:42:25 +00:00
Bharat Mediratta
9f77ca61f8 Indentation fix. 2009-02-10 03:22:42 +00:00
Tim Almdal
0f9c5feb89 Use the ORM method delete_all to remove selected records from the
database instead of calling the Database::query with raw sql.
2009-02-08 17:32:37 +00:00
Bharat Mediratta
1b231063a0 Set default charset to utf8 2009-02-05 08:00:42 +00:00
Tim Almdal
704fd72623 Delete subscriptions when a user is deleted 2009-02-04 17:25:30 +00:00
Tim Almdal
ef58ac91e8 Notifications now send emails when a comment is published. It won't
send the email if the comment status is not published.  This gives the
administrator to moderate the comments prior to being published.
2009-02-02 15:41:47 +00:00
Tim Almdal
9e01c80ef4 Enable csrf validation on the add/remove notification controller 2009-02-02 13:28:42 +00:00
Andy Staudacher
60d3d6e704 code audit fixes + bug fix: don't call sendmail with an empty To list (in notifications module) 2009-02-02 07:32:45 +00:00
Tim Almdal
e3b5eca50e Add sending notifications when an item is deleted. We are almost
done, just need to do comments.
2009-02-02 05:00:09 +00:00
Tim Almdal
01d00dfd86 Change the item menu to allow the watch icon to change depending on
whether the item is currently being watched.  Currently the icon is
the same as the add icon and needs to be changed.
2009-02-02 03:55:33 +00:00
Tim Almdal
0eb593711b We no longer need a dialog to set or remove a watch, so remove it. 2009-02-02 03:21:29 +00:00
Tim Almdal
69a7e238a4 As we stagger towards completing the notification module.
Item changes and Item additions email notifications with this change.
Still to come is item deleted, comment added and comment updated.
2009-02-02 03:09:17 +00:00
Tim Almdal
78106bcaea Remove models/notification.php as it is no longer used 2009-02-01 04:00:27 +00:00
Tim Almdal
6f35829173 Simplify the setting of a notifications. Notifications are not only
set on a album. The notifications are implicitly active for all child
elements.

It now sends emails if the email address of the subscribed user has
been set.  No email, no attempt to send the notification.

Still to do, come up with better messages as the current ones are just
place holders.
2009-02-01 03:58:31 +00:00
Tim Almdal
38cf6ca403 The start of the notification module. At this point, the icon has been added to the item menu in the sidebar (both photo and album). There is a corresponding icon in themes/default/images that needs to be spruced up. You can add and remove notifications to albums and photos, but nothing happens under the covers for event handling. 2009-01-30 20:52:25 +00:00