Merge branch 'master' of http://git.roojs.com:8081/Pman.Core
authorAlan Knowles <alan@roojs.com>
Wed, 23 May 2012 01:04:37 +0000 (09:04 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 23 May 2012 01:04:37 +0000 (09:04 +0800)
DataObjects/I18n.php
DataObjects/Person.php
I18n.php
JsCompile.php
Pman.Dialog.CoreNotifyRecur.bjs
Pman.Dialog.CoreNotifyRecur.js

index ac047a6..41bff06 100644 (file)
@@ -240,7 +240,7 @@ class Pman_Core_DataObjects_I18n extends DB_DataObject
         
         $list =  $this->availableCodes($ltype);
         
-        
+        //print_r($list); 
         foreach($list as $lkey) {
             // skip ones we know we have done...
             if (in_array($lkey, $complete)) {
index 2f9b8de..ae47896 100644 (file)
@@ -574,12 +574,27 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
             if ( $q['query']['not_in_directory'] > -1) {
                 $tn_pd = DB_DataObject::Factory('ProjectDirectory')->tableName();
                 // can list current - so that it does not break!!!
-                $x->whereAdd("$tn_p.id NOT IN 
+                $this->whereAdd("$tn_p.id NOT IN 
                     ( SELECT distinct person_id FROM $tn_pd WHERE
                         project_id = " . $q['query']['not_in_directory'] . " AND 
                         company_id = " . $this->company_id . ')');
             }
         }
+           
+        if (!empty($q['query']['role'])) { 
+            // it's a Person list..
+            // DB_DATaobjecT::debugLevel(1);
+            
+            // specific to project directory which is single comp. login
+            //
+            $tn_pd = DB_DataObject::Factory('ProjectDirectory')->tableName();
+                // can list current - so that it does not break!!!
+            $this->whereAdd("$tn_p.id IN 
+                    ( SELECT distinct person_id FROM $tn_pd WHERE
+                        role = '". $this->escape($q['query']['role']) ."'
+            )");
+        
+        }
         
         
         if (!empty($q['query']['project_member_of'])) {
index 64e3e93..d7e6f52 100644 (file)
--- a/I18n.php
+++ b/I18n.php
@@ -116,22 +116,24 @@ class Pman_Core_I18n extends Pman
         
         switch($s) {
             case 'Lang':
+                 
+                
                 $i->ltype = 'l';
                 $i->applyFilters($_REQUEST, $this->authUser, $this);
-                $this->jdata($i->toTransList('l',  $lbits[0]));
+                $this->jdata($i->toTransList('l',  implode('_',$lbits)));
                 break;
 
             case 'Country':
                 $i->ltype = 'c';
                 $i->applyFilters($_REQUEST, $this->authUser, $this);
-                $this->jdata($i->toTransList('c',  $lbits[0]));
+                $this->jdata($i->toTransList('c',  implode('_',$lbits)));
                
                 break;
                 
             case 'Currency':
                 $i->ltype = 'm';
                 $i->applyFilters($_REQUEST, $this->authUser, $this);
-                $this->jdata($i->toTransList('m',  $lbits[0]));
+                $this->jdata($i->toTransList('m',  implode('_',$lbits)));
                 break;
             
             case 'Timezone':
index fbd94f6..6c88bcf 100644 (file)
@@ -86,6 +86,8 @@ class Pman_Core_JsCompile  extends Pman
         // or the compressed version.
         // first expand files..
         
+        echo "<!-- compiling   $basedir  -->\n";
+        
         $arfiles = array();
         $ofiles = array();
         foreach($files as $f) {
@@ -119,9 +121,9 @@ class Pman_Core_JsCompile  extends Pman
             echo '<script type="text/javascript" src="'.$output_url.'/'.$f.'"></script>'."\n";
             
         }
-         
-        
+          
     }
+    
     function packCss($basedir, $files,   $output_url)
     {
         // this outputs <script tags..>
@@ -239,14 +241,15 @@ class Pman_Core_JsCompile  extends Pman
             return false;
             
         }
-        $targetm = file_exists($output) ? filemtime($output) : 0;
+        $targetm = file_exists($output) && filesize($output) ? filemtime($output) : 0;
         $max = 0;
         $ofiles = array();
         foreach($files as $f => $mt) {
             $max = max($max,$mt);
             $ofiles[] = escapeshellarg($f);
         }
-        if ($max < $targetm)  {
+        if ($max < $targetm) {
+            echo '<!--  use cached compile. -->';
             return true;
         }
         //var_dump($output);
@@ -282,7 +285,7 @@ class Pman_Core_JsCompile  extends Pman
         //exit;
         file_put_contents($output.'.log', $cmd."\n\n". $res);
         // since this only appears when we change.. it's ok to dump it out..
-          echo "<!-- Compiled javascript
+        echo "<!-- Compiled javascript
             " . htmlspecialchars($res) . "
             -->";
             
index a3c7055..c328df7 100644 (file)
                                         },
                                         {
                                             "listeners": {
-                                                "|click": "function()\n{\n     _this.grid.stopEditing();\n     var s = _this.grid.selModel.getSelectedCell()\n     if (!s) {\n        Roo.MessageBox.alert(\"Error\", \"Select row\");\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/core_notify_recur',\n        method : 'POST',\n        params : {\n            _delete : _this.grid.ds.getAt(s[0]).data.id,\n        }, \n        success : function() {\n            _this.grid.ds.load({});\n        },\n        failure : function() {\n            Roo.MessageBox.alert(\"Error\", \"Deleting failed - try reloading\");\n        }\n   });\n    \n}\n        "
+                                                "|click": "function()\n{\n     _this.grid.stopEditing();\n     var s = _this.grid.selModel.getSelectedCell();\n     if (!s) {\n        Roo.MessageBox.alert(\"Error\", \"Select row\");\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/core_notify_recur',\n        method : 'POST',\n        params : {\n            _delete : _this.grid.ds.getAt(s[0]).data.id\n        }, \n        success : function() {\n            _this.grid.ds.load({});\n        },\n        failure : function() {\n            Roo.MessageBox.alert(\"Error\", \"Deleting failed - try reloading\");\n        }\n   });\n    \n}\n        "
                                             },
                                             "cls": "x-btn-text-icon",
                                             "text": "Delete",
index 1b3c0b8..2b3e116 100644 (file)
@@ -246,7 +246,7 @@ Pman.Dialog.CoreNotifyRecur = {
                                         click : function()
                                         {
                                              _this.grid.stopEditing();
-                                             var s = _this.grid.selModel.getSelectedCell()
+                                             var s = _this.grid.selModel.getSelectedCell();
                                              if (!s) {
                                                 Roo.MessageBox.alert("Error", "Select row");
                                                 return;
@@ -256,7 +256,7 @@ Pman.Dialog.CoreNotifyRecur = {
                                                 url : baseURL + '/Roo/core_notify_recur',
                                                 method : 'POST',
                                                 params : {
-                                                    _delete : _this.grid.ds.getAt(s[0]).data.id,
+                                                    _delete : _this.grid.ds.getAt(s[0]).data.id
                                                 }, 
                                                 success : function() {
                                                     _this.grid.ds.load({});