From f1ed42daa28cabb3ad1d6617fbca99be5e1f7df3 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 13 Jul 2017 10:28:00 +0800 Subject: [PATCH] sync --- DataObjects/Core_person.php | 10 ++++++---- I18n.php | 1 + Pman.Dialog.Image.bjs | 2 +- Pman.Dialog.Image.js | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/DataObjects/Core_person.php b/DataObjects/Core_person.php index 1de318bc..bbe4a178 100644 --- a/DataObjects/Core_person.php +++ b/DataObjects/Core_person.php @@ -151,7 +151,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $decoder = new Mail_mimeDecode($mailtext); $parts = $decoder->getSendArray(); - if (PEAR::isError($parts)) { + if (is_a($parts,'PEAR_Error')) { return $parts; //echo "PROBLEM: {$parts->message}"; //exit; @@ -350,9 +350,11 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $u->whereAdd(' LENGTH(passwd) > 0'); $n = $u->count(); $_SESSION[get_class($this)][$sesPrefix .'-empty'] = $n; - $error = PEAR::getStaticProperty('DB_DataObject','lastError'); - if ($error) { - die($error->toString()); // not really a good thing to do... + if (class_exists('PEAR')) { + $error = PEAR::getStaticProperty('DB_DataObject','lastError'); + if ($error) { + die($error->toString()); // not really a good thing to do... + } } if (!$n){ // authenticated as there are no users in the system... return true; diff --git a/I18n.php b/I18n.php index b6812a0d..d87210ff 100644 --- a/I18n.php +++ b/I18n.php @@ -201,6 +201,7 @@ class Pman_Core_I18n extends Pman } //echo '
';print_r($ar);
         header('Content-type: text/javascript');
+        echo "Roo.namespace('Pman.I18n');";
         echo 'Pman.I18n.Data = ' .  json_encode($ar);
         exit;
         
diff --git a/Pman.Dialog.Image.bjs b/Pman.Dialog.Image.bjs
index fd363ab6..5f3dbded 100644
--- a/Pman.Dialog.Image.bjs
+++ b/Pman.Dialog.Image.bjs
@@ -28,7 +28,7 @@
    "closable" : false,
    "resizable" : false,
    "haveProgress" : false,
-   "height" : 200,
+   "height" : 140,
    "$ uploadProgress" : "function()\n{\n    var dlg = this;\n   if (!dlg.haveProgress) {\n        Roo.MessageBox.progress(\"Uploading\", \"Uploading\");\n    }\n    \n    if (dlg.haveProgress == 2) {\n        // it's been closed elsewhere..\n        return;\n    }\n    if (dlg.uploadComplete) {\n        Roo.MessageBox.hide();\n        return;\n    }\n    \n    dlg.haveProgress = 1;\n\n    var uid = _this.form.findField('UPLOAD_IDENTIFIER').getValue();\n    new Pman.Request({\n        url : baseURL + '/Core/UploadProgress.php',\n        params: {\n            id : uid\n        },\n        method: 'GET',\n        success : function(res){\n            //console.log(data);\n            var data = res.data;\n            if (dlg.haveProgress == 2) {\n                // it's been closed elsewhere..\n                return;\n            }\n            \n            if (dlg.uploadComplete) {\n                Roo.MessageBox.hide();\n                return;\n            }\n                \n            if (data){\n                Roo.MessageBox.updateProgress(data.bytes_uploaded/data.bytes_total,\n                    Math.floor((data.bytes_total - data.bytes_uploaded)/1000) + 'k remaining'\n                );\n            } else {\n                Roo.MessageBox.updateProgress(1,\n                    \"Upload Complete - processing\"\n                );\n                return;\n            }\n            dlg.uploadProgress.defer(2000,dlg);\n        },\n        failure: function(data) {\n          //  console.log('fail');\n         //   console.log(data);\n        }\n    })\n    \n}\n",
    "items" : [
     {
diff --git a/Pman.Dialog.Image.js b/Pman.Dialog.Image.js
index b13eec9d..8f1ebacd 100644
--- a/Pman.Dialog.Image.js
+++ b/Pman.Dialog.Image.js
@@ -42,7 +42,7 @@ Pman.Dialog.Image = {
     closable : false,
     collapsible : false,
     haveProgress : false,
-    height : 200,
+    height : 140,
     modal : true,
     resizable : false,
     shadow : true,
-- 
2.39.2