/**
     * @param SUBSCRIBER $obj
     * @access private
     */
    protected function _draw_box($obj)
    {
        ?>
    <input type="checkbox" value="<?php 
        echo $obj->email;
        ?>
" name="subscriber_ids[]" checked>
<?php 
        echo $obj->title_as_link();
    }
예제 #2
0
 /**
  * Remove all queued history items for this subscriber.
  * Call this once all emails have been sent to a subscriber in order to clear
  * the database or any pending history items for that subscriber.
  * @param SUBSCRIBER $subscriber
  * @access private
  */
 protected function _clear_queued_history_items_for($subscriber)
 {
     $this->record("{$subscriber->email}: Cleared queued history items from database.");
     $subscriber->clear_queued_history_items();
     if (!$this->testing) {
         $subscriber->store();
     }
 }
 /**
  * Updates the subscriber's folder subscriptions.
  * @param SUBSCRIBER $obj
  * @access private
  */
 public function commit($obj)
 {
     $obj->update_subscriptions_for(Subscribe_folder, $this->value_for('ids'));
 }
 /**
  * Updates the user's entry subscriptions.
  * @param SUBSCRIBER $obj
  * @access private
  */
 public function commit($obj)
 {
     $obj->update_subscriptions_for($this->_sub_type, $this->value_for('ids'), $this->_type);
 }
 /**
  * Store the form's values for this user's subscription options.
  * @param SUBSCRIBER $obj
  * @access private
  */
 public function commit($obj)
 {
     $orig_email = $this->value_for('email');
     $new_email = $this->value_for('new_email');
     if (!$new_email) {
         $obj->email = $orig_email;
         $obj->purge();
     } else {
         if ($orig_email) {
             /* If the subscriber already exists, make sure to load the full record (so that the existing
                record is updated and no new record is created). */
             $obj->email = $orig_email;
             $obj->synchronize();
         }
         $obj->email = $new_email;
         $obj->send_as_html = $this->value_for('send_as_html');
         if ($this->value_for('group_objects')) {
             $obj->max_individual_messages = $this->value_for('max_individual_messages');
         } else {
             $obj->max_individual_messages = 0;
         }
         if ($this->value_for('split_objects')) {
             $obj->max_items_per_message = $this->value_for('max_items_per_message');
         } else {
             $obj->max_items_per_message = 0;
         }
         $obj->min_hours_to_wait = $this->value_for('min_hours_to_wait');
         $obj->preferred_text_length = $this->value_for('preferred_text_length');
         $obj->show_history_items = $this->value_for('show_history_items');
         $obj->show_history_item_as_subject = $this->value_for('show_history_item_as_subject');
         $obj->group_history_items = $this->value_for('group_history_items');
         $obj->send_own_changes = $this->value_for('send_own_changes');
         $obj->store();
         if ($orig_email) {
             // The subscriber already existed, so see if there is a matching user for this subscriber. If so
             // synchronize the email address in the user record with the new subscriber address.
             $user_query = $this->app->user_query();
             $user = $user_query->object_at_email($orig_email);
             if (isset($user)) {
                 // matching user found for this subscriber
                 if ($orig_email != $new_email) {
                     $user->email = $new_email;
                     $user->store();
                 }
             }
         }
     }
 }