diff --git a/composer.json b/composer.json index 8dd8b0daac4..fcf1cbc69b5 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,8 @@ "bower-asset/leaflet": "0.7.3", "bower-asset/jquery-ace": "1.*", "bower-asset/jquery": "2.*", - "zendframework/zend-xmlrpc": "^2.5@dev" + "zendframework/zend-xmlrpc": "^2.5@dev", + "bower-asset/handsontable": "^0.20.2" }, "autoload" : { "classmap" : [ diff --git a/composer.lock b/composer.lock index 386a7c9fa25..57d8f83a28d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "ebb7ea5df152b4614b885d996d5da28d", - "content-hash": "cea181f5170b2cd7effe8e4394b545d3", + "hash": "1bb198cdb54323890e6ab5232ecc6401", + "content-hash": "3e0e4884134c39c769bc6ae43616df8a", "packages": [ { "name": "2amigos/yiiwheels", @@ -253,6 +253,60 @@ "description": "Font Awesome", "time": "2015-08-19 18:38:02" }, + { + "name": "bower-asset/handsontable", + "version": "0.20.2", + "source": { + "type": "git", + "url": "https://github.com/handsontable/handsontable.git", + "reference": "5a8dc8c1b903a9a8be84f2da25c7b6a85bc1fee5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/handsontable/handsontable/zipball/5a8dc8c1b903a9a8be84f2da25c7b6a85bc1fee5", + "reference": "5a8dc8c1b903a9a8be84f2da25c7b6a85bc1fee5", + "shasum": "" + }, + "require": { + "bower-asset/moment": ">=2.9.0,<3.0.0", + "bower-asset/pikaday": ">=1.3.2,<2.0.0", + "bower-asset/zeroclipboard": ">=2.2.0,<3.0.0" + }, + "require-dev": { + "bower-asset/chroma-js": "~0.5.6" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": [ + "./dist/handsontable.js", + "./dist/handsontable.css" + ], + "bower-asset-ignore": [ + "**/.*", + "components", + "demo", + "node_modules", + "src", + "test" + ] + }, + "description": "Spreadsheet-like data grid editor that provides copy/paste functionality compatible with Excel/Google Docs", + "keywords": [ + "data", + "data-grid", + "data-spreadsheet", + "data-table", + "edit-cell", + "editable-table", + "editor", + "excel", + "grid", + "grid-editor", + "spreadsheet", + "table", + "tabular-data" + ] + }, { "name": "bower-asset/jqgrid", "version": "v5.0.1", @@ -566,6 +620,43 @@ }, "description": "JavaScript library for mobile-friendly interactive maps" }, + { + "name": "bower-asset/moment", + "version": "2.10.6", + "source": { + "type": "git", + "url": "https://github.com/moment/moment.git", + "reference": "f3fbef9d9875bbff340b527dbe3f1c447a942f69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/moment/moment/zipball/f3fbef9d9875bbff340b527dbe3f1c447a942f69", + "reference": "f3fbef9d9875bbff340b527dbe3f1c447a942f69", + "shasum": "" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": "moment.js", + "bower-asset-ignore": [ + "**/.*", + "benchmarks", + "bower_components", + "meteor", + "node_modules", + "scripts", + "tasks", + "test", + "component.json", + "composer.json", + "CONTRIBUTING.md", + "ender.js", + "Gruntfile.js", + "Moment.js.nuspec", + "package.js", + "package.json" + ] + } + }, { "name": "bower-asset/papaparse", "version": "4.1.2", @@ -619,6 +710,43 @@ "workers" ] }, + { + "name": "bower-asset/pikaday", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/dbushell/Pikaday.git", + "reference": "651842140ee0f872f3364c33a34e2b595fd72d43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dbushell/Pikaday/zipball/651842140ee0f872f3364c33a34e2b595fd72d43", + "reference": "651842140ee0f872f3364c33a34e2b595fd72d43", + "shasum": "" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": [ + "./pikaday.js", + "./css/pikaday.css" + ], + "bower-asset-ignore": [ + "**/.*", + "node_modules", + "components" + ] + }, + "license": [ + "BSD", + "MIT" + ], + "description": "A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS", + "keywords": [ + "calendar", + "date", + "datepicker" + ] + }, { "name": "bower-asset/qtip2", "version": "v2.2.0", @@ -945,6 +1073,48 @@ "widgets" ] }, + { + "name": "bower-asset/zeroclipboard", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/zeroclipboard/zeroclipboard.git", + "reference": "039fb799c916d3730fbc898c2f5ef24581c7e9b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zeroclipboard/zeroclipboard/zipball/039fb799c916d3730fbc898c2f5ef24581c7e9b7", + "reference": "039fb799c916d3730fbc898c2f5ef24581c7e9b7", + "shasum": "" + }, + "type": "bower-asset-library", + "extra": { + "bower-asset-main": [ + "dist/ZeroClipboard.js", + "dist/ZeroClipboard.swf" + ], + "bower-asset-ignore": [ + "*", + "/dist/.jshintrc", + "!/bower.json", + "!/dist/**" + ] + }, + "license": [ + "https://github.com/zeroclipboard/zeroclipboard/blob/master/LICENSE" + ], + "description": "The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.", + "keywords": [ + "clip", + "clipboard", + "clippy", + "copy", + "cut", + "flash", + "paste", + "zclip" + ] + }, { "name": "cakephp/utility", "version": "3.1.x-dev", @@ -1782,12 +1952,12 @@ "source": { "type": "git", "url": "https://github.com/Studio-42/elFinder.git", - "reference": "e1ebe5fa1eef821dc5d3b3f8c4dc219519b0e2de" + "reference": "89625cc1d0b57aef24de0fd334c16c514321f317" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Studio-42/elFinder/zipball/e1ebe5fa1eef821dc5d3b3f8c4dc219519b0e2de", - "reference": "e1ebe5fa1eef821dc5d3b3f8c4dc219519b0e2de", + "url": "https://api.github.com/repos/Studio-42/elFinder/zipball/89625cc1d0b57aef24de0fd334c16c514321f317", + "reference": "89625cc1d0b57aef24de0fd334c16c514321f317", "shasum": "" }, "require": { @@ -1833,7 +2003,7 @@ ], "description": "File manager for web", "homepage": "http://elfinder.org", - "time": "2015-12-13 11:57:14" + "time": "2015-12-16 13:16:26" }, { "name": "tecnickcom/tcpdf", @@ -1904,12 +2074,12 @@ "source": { "type": "git", "url": "https://github.com/twbs/bootstrap.git", - "reference": "ad716b9ea9506456f28e2c1bcdd7b4a81b44c11c" + "reference": "71a0bfee8eef70999f9a2c486901b2b55a890b27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twbs/bootstrap/zipball/ad716b9ea9506456f28e2c1bcdd7b4a81b44c11c", - "reference": "ad716b9ea9506456f28e2c1bcdd7b4a81b44c11c", + "url": "https://api.github.com/repos/twbs/bootstrap/zipball/71a0bfee8eef70999f9a2c486901b2b55a890b27", + "reference": "71a0bfee8eef70999f9a2c486901b2b55a890b27", "shasum": "" }, "replace": { @@ -1947,7 +2117,7 @@ "responsive", "web" ], - "time": "2015-12-10 23:05:45" + "time": "2015-12-17 05:55:54" }, { "name": "yiisoft/yii", @@ -2097,12 +2267,12 @@ "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "64cdc57b544d396b68b2db3513d3f4e701e8f3a9" + "reference": "edc732c7d3457b880134cc1abbaef67ae0cd0452" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/64cdc57b544d396b68b2db3513d3f4e701e8f3a9", - "reference": "64cdc57b544d396b68b2db3513d3f4e701e8f3a9", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/edc732c7d3457b880134cc1abbaef67ae0cd0452", + "reference": "edc732c7d3457b880134cc1abbaef67ae0cd0452", "shasum": "" }, "require": { @@ -2119,8 +2289,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev", - "dev-develop": "1.3-dev" + "dev-master": "1.3-dev", + "dev-develop": "1.4-dev" } }, "autoload": { @@ -2139,7 +2309,7 @@ "psr", "psr-7" ], - "time": "2015-11-26 22:34:19" + "time": "2015-12-16 16:31:21" }, { "name": "zendframework/zend-escaper", diff --git a/protected/config/packages.php b/protected/config/packages.php index 2f75d623cde..dfebcfcb84c 100644 --- a/protected/config/packages.php +++ b/protected/config/packages.php @@ -166,5 +166,19 @@ 'depends' => [ 'jquery' ] + ], + 'handsontable' => [ + 'basePath' => 'bower.handsontable', + 'js' => [ + 'dist/handsontable.full.min.js', + 'plugins/jqueryHandsontable.js' + ], + 'css' => [ + 'dist/handsontable.full.css', + 'plugins/bootstrap/handsontable.bootstrap.css' + ], + 'depends' => [ + 'jquery' + ] ] ]; diff --git a/protected/controllers/AdminController.php b/protected/controllers/AdminController.php index 7dbb1c74c90..2d8c286bff4 100644 --- a/protected/controllers/AdminController.php +++ b/protected/controllers/AdminController.php @@ -44,7 +44,7 @@ protected function _init() updateCheck(); //unset(Yii::app()->session['FileManagerContext']); - App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . "admin_core.js"); + App()->getClientScript()->registerScriptFile(App()->getPublicUrl() . "/scripts/admin/admin_core.js"); $this->user_id = Yii::app()->user->getId(); if (!Yii::app()->getConfig("surveyid")) {Yii::app()->setConfig("surveyid", returnGlobal('sid'));} //SurveyID if (!Yii::app()->getConfig("ugid")) {Yii::app()->setConfig("ugid", returnGlobal('ugid'));} //Usergroup-ID @@ -400,7 +400,7 @@ public function _showadminmenu($surveyid = false) } $aData['surveyid'] = $surveyid; $aData['iconsize'] = Yii::app()->getConfig('adminthemeiconsize'); - $aData['sImageURL'] = Yii::app()->getConfig('adminimageurl'); + $aData['sImageURL'] = App()->theme->baseUrl. '/images'; $this->renderPartial("/admin/super/adminmenu", $aData); } @@ -416,6 +416,6 @@ public function _loadEndScripts() unset(Yii::app()->session['metaHeader']); - return $this->renderPartial('/admin/endScripts_view', []); +// return $this->renderPartial('/admin/endScripts_view', []); } } diff --git a/protected/controllers/Controller.php b/protected/controllers/Controller.php index fff23b5ce07..e0cf2c29a35 100644 --- a/protected/controllers/Controller.php +++ b/protected/controllers/Controller.php @@ -64,8 +64,8 @@ protected function _init() Yii::app()->setConfig("timeadjust",$timeadjust.' hours'); } - Yii::app()->setConfig('adminimageurl', Yii::app()->getConfig('styleurl').Yii::app()->getConfig('admintheme').'/images/'); - Yii::app()->setConfig('adminstyleurl', Yii::app()->getConfig('styleurl').Yii::app()->getConfig('admintheme').'/'); + Yii::app()->setConfig('adminimageurl', App()->theme->baseUrl. '/images/'); + Yii::app()->setConfig('adminstyleurl', App()->publicUrl . '/styles/gringegreen/'); } /** diff --git a/protected/controllers/FilesController.php b/protected/controllers/FilesController.php index a55929a50b9..7b9e13992eb 100644 --- a/protected/controllers/FilesController.php +++ b/protected/controllers/FilesController.php @@ -79,6 +79,7 @@ protected function getRootForSurvey($surveyId) { return [ 'alias' => "ls\models\Survey ({$surveyId})", 'driver' => 'LocalFileSystem', + 'autoload' => true, 'path' => $dir, 'URL' => App()->publicUrl . $relative, 'icon' => "{$this->getAssetsUrl()}/img/volume_icon_local.png", @@ -106,6 +107,7 @@ protected function getRootForTemplate($template) { $result[] = [ 'alias' => "ls\models\Template ({$template})", 'driver' => 'LocalFileSystem', + 'autoload' => true, 'path' => $dir, 'URL' => App()->baseUrl . $url, 'mimeMap' => [ diff --git a/protected/controllers/LabelsController.php b/protected/controllers/LabelsController.php new file mode 100644 index 00000000000..c97f7cd313b --- /dev/null +++ b/protected/controllers/LabelsController.php @@ -0,0 +1,51 @@ +render('index', [ + 'dataProvider' => new \CActiveDataProvider(LabelSet::class) + ]); + } + + public function actionCreate() + { + $model = new LabelSet(); + if (App()->request->isPostRequest) { + $model->setAttributes(App()->request->getPost(\CHtml::modelName($model))); + + if ($model->save()) { + App()->user->setFlash('success', gT("Label set created!")); + return $this->redirect(['labels/update', 'id' => $model->lid]); + } + } + $this->render('create', ['model' => $model]); + } + + public function actionUpdate($id) + { + $model = LabelSet::model()->findByPk($id); + if (isset($model)) { + if (App()->request->isPutRequest) { + $model->setAttributes(App()->request->getPost(\CHtml::modelName($model))); + + if ($model->save()) { + App()->user->setFlash('success', gT("Label set updated!")); + return $this->redirect(['labels/update', 'id' => $model->lid]); + } + } + $this->render('update', ['model' => $model]); + + } + } + + +// public funct +} \ No newline at end of file diff --git a/protected/controllers/UpgradeController.php b/protected/controllers/UpgradeController.php index 64cda659da7..0894f77314c 100644 --- a/protected/controllers/UpgradeController.php +++ b/protected/controllers/UpgradeController.php @@ -119,6 +119,7 @@ protected function runPreCheck($version) $json = $this->getFileContentsCached(App()->params['updateServer'] . 'prepare', [ 'query' => ['from' => App()->params['version'], 'to' => $version] ]); + $preUpdate->loadFromString($json, null); return ['success' => $preUpdate->run(), 'messages' => $preUpdate->getMessages(), 'changeLog' => $preUpdate->getChangeLog()]; } diff --git a/protected/controllers/UploaderController.php b/protected/controllers/UploaderController.php index dc533163792..e7f7a5fbad5 100644 --- a/protected/controllers/UploaderController.php +++ b/protected/controllers/UploaderController.php @@ -284,18 +284,18 @@ function actionIndex($sid, $fieldname, $qid, $show_title, $show_comment, $minfil $sTemplateUrl = \ls\models\Template::getTemplateURL($aSurveyInfo['template']) . "/"; App()->clientScript->registerScript('sNeededScriptVar', $sNeededScriptVar, CClientScript::POS_HEAD); App()->clientScript->registerScript('sLangScriptVar', $sLangScriptVar, CClientScript::POS_HEAD); - App()->getClientScript()->registerScriptFile(Yii::app()->getConfig("generalscripts") . 'ajaxupload.js'); - App()->getClientScript()->registerScriptFile(Yii::app()->getConfig("generalscripts") . 'uploader.js'); + App()->getClientScript()->registerScriptFile(App()->publicUrl . '/scripts/' . 'ajaxupload.js'); + App()->getClientScript()->registerScriptFile(App()->publicUrl . '/scripts/' . 'uploader.js'); App()->getClientScript()->registerScriptFile("{$sTemplateUrl}template.js"); - App()->clientScript->registerCssFile(Yii::app()->getConfig("publicstyleurl") . "uploader.css"); - App()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . "uploader-files.css"); + App()->clientScript->registerCssFile(App()->publicUrl . '/styles-public/' . "uploader.css"); + App()->getClientScript()->registerCssFile(App()->publicUrl . '/styles-public/' . "uploader-files.css"); if (file_exists($sTemplateDir . DIRECTORY_SEPARATOR . 'jquery-ui-custom.css')) { Yii::app()->getClientScript()->registerCssFile("{$sTemplateUrl}jquery-ui-custom.css"); } elseif (file_exists($sTemplateDir . DIRECTORY_SEPARATOR . 'jquery-ui.css')) { Yii::app()->getClientScript()->registerCssFile("{$sTemplateUrl}jquery-ui.css"); } else { - Yii::app()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . "jquery-ui.css"); + Yii::app()->getClientScript()->registerCssFile(App()->publicUrl . '/styles-public/' . "jquery-ui.css"); } App()->clientScript->registerCssFile("{$sTemplateUrl}template.css"); $header = getHeader($meta); diff --git a/protected/controllers/admin/assessments.php b/protected/controllers/admin/assessments.php index 17ca690fd04..6657146a0f4 100644 --- a/protected/controllers/admin/assessments.php +++ b/protected/controllers/admin/assessments.php @@ -75,7 +75,7 @@ public function index($iSurveyID) */ protected function _renderWrappedTemplate($sAction = 'assessments', $aViewUrls = [], $aData = []) { - App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('adminscripts') . 'assessments.js'); + App()->getClientScript()->registerScriptFile(App()->publicUrl . '/scripts/admin/' . 'assessments.js'); App()->getClientScript()->registerPackage('jquery-tablesorter'); diff --git a/protected/controllers/admin/conditionsaction.php b/protected/controllers/admin/conditionsaction.php index effcf3f37dd..16d45b5a481 100644 --- a/protected/controllers/admin/conditionsaction.php +++ b/protected/controllers/admin/conditionsaction.php @@ -1632,7 +1632,8 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null) if (isset($conditionsList) && is_array($conditionsList)) { //TIBO - App()->getClientScript()->registerScriptFile(Yii::app()->getConfig("generalscripts").'jquery/jquery.multiselect.min.js'); + + App()->getClientScript()->registerScriptFile(App()->publicUrl . '/scripts/'.'jquery/jquery.multiselect.min.js'); // TODO $aViewUrls['output'] .= ""; @@ -1942,7 +1943,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null) App()->getClientScript()->registerScriptFile(Yii::app()->getConfig("adminscripts").'conditions.js'); - //App()->getClientScript()->registerScriptFile(Yii::app()->getConfig("generalscripts").'jquery/lime-conditions-tabs.js'); + //App()->getClientScript()->registerScriptFile(App()->publicUrl . '/scripts/'.'jquery/lime-conditions-tabs.js'); if ($subaction == "editthiscondition" && isset($p_cid)) { diff --git a/protected/controllers/admin/dataentry.php b/protected/controllers/admin/dataentry.php index b455b95c4c8..899fc7cbc1c 100644 --- a/protected/controllers/admin/dataentry.php +++ b/protected/controllers/admin/dataentry.php @@ -884,7 +884,7 @@ public function editdata($subaction, $id, $surveyid, $language='') $aDataentryoutput .= ''; App()->getClientScript()->registerPackage('jquery-actual'); App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts') . 'ranking.js'); - App()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . 'ranking.css'); + App()->getClientScript()->registerCssFile(App()->publicUrl . '/styles-public/' . 'ranking.css'); $aDataentryoutput .= "