Merge branch 'master' of http://git.roojs.com:8081/Pman.Core
authorAlan Knowles <alan@akbkhome.com>
Sat, 27 Oct 2012 13:08:27 +0000 (21:08 +0800)
committerAlan Knowles <alan@akbkhome.com>
Sat, 27 Oct 2012 13:08:27 +0000 (21:08 +0800)
1  2 
Notify.php
Pman.js

diff --combined Notify.php
@@@ -16,13 -16,7 +16,13 @@@ require_once 'Pman.php'
  class Pman_Core_Notify extends Pman
  {
      
 -    static $cli_desc = "Send out notification emails (usually from cron)";
 +    static $cli_desc = "Runs the notification queue (usually from cron)
 +                        Normally used to sends out emails to anyone in the notification list.
 +    
 +                        /etc/cron.d/pman-core-notify
 +                        * *  * * *     www-data     /usr/bin/php /home/gitlive/web.mtrack/admin.php  Core/Notify > /dev/null
 +    
 +";
      
      static $cli_opts = array(
          'debug' => array(
          $w = DB_DataObject::factory($this->table);
          
          if (!$showold) {
-             $w->whereAdd('act_when > sent'); // eg.. sent is not valid..
              
+             // standard
+             
+             $w->whereAdd('act_when > sent'); // eg.. sent is not valid..
+             $w->whereAdd('act_start > NOW() - INTERVAL 14 DAY'); // ignore the ones stuck in the queue
              if (!$this->force) {
                  $w->whereAdd('act_when < NOW()'); // eg.. not if future..
              }
diff --combined Pman.js
+++ b/Pman.js
@@@ -417,13 -417,14 +417,14 @@@ Pman = new Roo.Document
      onLoadTrackCall : function(id,cb, cls) {
          Roo.get(document.body).mask("Loading Document details");
  
-         Pman.request({
+         new Pman.Request({
              url: baseURL + '/Roo/Documents.html',  
              params: {
                  _id: id
              },  
              method: 'GET',  
-             success : function(data) {
+             success : function(res) {
+                 var data = res.data;
                  Roo.get(document.body).unmask();
               
                  
                  tab.grid.getView().mainWrap.mask("Deleting");
                  new Pman.Request({
                      url: baseURL + '/Roo/'+tbl+'.php',
-                     method: 'GET',
+                     method: 'POST',
                      params: {
                          _delete : r.join(',')
                      },
      },
      /**
       * Depreciated - USE new Pman.Request
 -    * 
 +    *  We need to replace all the uses with this, however the api is slightly different,
 +    *  the success argument is res.data, not res..
       * 
       */
      request : function(c) {
 -        return new Pman.Request(c);
 -        /*
 -        
 +        //return new Pman.Request(c);
 +         
          var r= new Roo.data.Connection({
              timeout : typeof(c.timeout) == 'undefined' ?  30000 : c.timeout
          });
              scope: this
              
          });
 -        */
 +         
      },