diff --git a/README.md b/README.md index 0d9bc48..4b26092 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,11 @@ -**Nibras PKM** is a __web-based self-hosted open source__ system for the __long-term management__ of __personal__ information. It is a combination of a __web-based__ application intended for desktop use and where all the records are entered, and an Android __reader and note taker__ application. +**Nibras PKM** is a __web-based self-hosted open source__ system for + the __long-term management__ of __personal__ information. + It is a combination of a __web-based__ application + intended for desktop use and where all the records are entered, + and an Android __mobile__ reader application. ![](https://raw.githubusercontent.com/mfakih294/Nibras-PKM/master/docs/images/screenshot.jpg) @@ -25,7 +29,7 @@ It manages resources (articles, books, documents), notes, writings, tasks, goals It was designed with large amounts of information in mind. In current usage, it manages dozens of thousands of records. With its commands and saved searches, it makes easy to navigate through all the information. -# Features +## Main Features * **Flexible text-based commands** to add, update and search records, which provides powerful ways to manage information. * **Saved searches** to save searches for later use. @@ -38,7 +42,7 @@ It was designed with large amounts of information in mind. In current usage, it ## Documentation -Documentation is available online at [https://mfakih294.github.io/Nibras-PKM/pages](https://mfakih294.github.io/Nibras-PKM/pages/). +User's guide is available online at [https://mfakih294.github.io/Nibras-PKM/](https://mfakih294.github.io/Nibras-PKM/). ## Releases diff --git a/build.gradle b/build.gradle index 45728a5..efe1cac 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,8 @@ +def esVersion = '7.3.0' +ext['elasticsearch.version'] = esVersion +ext { + elasticsearchVersion = esVersion +} buildscript { repositories { mavenLocal() @@ -49,6 +54,8 @@ dependencies { // compile files("lib/commons-logging-1.1.1.jar") // compile files("lib/icu4j.jar") //compile group: 'com.ibm.icu', name: 'icu4j', version: '68.2' +// compile group: 'com.ibm.icu', name: 'icu4j', version: '68.2' +// group=‘com.ibm.icu’, module=‘icu4j’, version=‘58.2’) // compile files("lib/jpwgen-1.0.3.jar") // compile files("lib/json-20140107.jar") // compile files("lib/lombok-1.16.16.jar") @@ -94,8 +101,12 @@ dependencies { compile "org.grails.plugins:events" compile "org.grails.plugins:hibernate5" compile "org.hibernate:hibernate-core:5.1.16.Final" +// compile "org.hibernate:hibernate-ehcache:5.1.16.Final" todo: needed? compile "org.grails.plugins:gsp" + // ok compile group: 'org.apache.lucene', name: 'lucene-core', version: '8.1.0' + // compile 'org.grails.plugins:elasticsearch:2.7.0.RC1' +// ok runtime 'org.elasticsearch.plugin:mapper-attachments:2.4.6' // compile "org.grails.plugins:elasticsearch:2.4.0" @@ -104,10 +115,11 @@ dependencies { compile group: 'com.cronutils', name: 'cron-utils', version: '9.0.2' // https://mvnrepository.com/artifact/com.intuit.fuzzymatcher/fuzzy-matcher - compile group: 'com.intuit.fuzzymatcher', name: 'fuzzy-matcher', version: '1.0.4' + compile group: 'com.intuit.fuzzymatcher', name: 'fuzzy-matcher', version: '1.1.0' // compile group: 'org.eclipse.mylyn.docs', name: 'org.eclipse.mylyn.wikitext.markdown.core', version: '2.6.0.v20150901-2143' compile 'com.vladsch.flexmark:flexmark-all:0.62.2' + implementation 'org.jsoup:jsoup:1.15.3' // other plugins compile "com.nayidisha.grails.uploadr:grails3-uploadr:3.0" @@ -119,9 +131,11 @@ dependencies { compile 'org.grails.plugins:external-config:1.4.0' - compile 'org.grails.plugins:quartz:2.0.13' + compile 'org.grails.plugins:quartz:2.0.9' - //compile "org.grails.plugins:feeds:1.6" +// compile "org.grails.plugins:feeds:1.6" + // todo: fix its range dependencies +// compile 'org.grails.plugins:feeds:2.0.0' compile 'org.grails.plugins:feeds:2.0.0-SNAPSHOT' compile 'org.grails.plugins:spring-security-core:3.2.3' @@ -142,6 +156,8 @@ dependencies { //runtime 'mysql-connector-java:5.1.18' runtime group: 'mysql', name: 'mysql-connector-java', version: '8.0.19' + runtime 'org.apache.derby:derby:10.14.2.0' + //compile "com.bertramlabs.plugins:asset-pipeline-grails:2.15.1" // testCompile "org.grails:grails-gorm-testing-support" diff --git a/docs/10.md b/docs/10.md old mode 100644 new mode 100755 index 7ed1ff5..d4e178f --- a/docs/10.md +++ b/docs/10.md @@ -88,6 +88,12 @@ username="nibras-user" password="the-password"/>` after chaning the username and password of the account to use to access the database. +mysql -u username -p +execute: +mysql +create user 'nibras'@'%' identified by 'nibras'; + +grant all privileges on *.* to 'nibras'@'%' with grant option; 1. install the database server MySQL, and create the database to be used by Nibras. diff --git a/docs/README.md b/docs/README.md new file mode 100755 index 0000000..948d539 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,85 @@ +# Nibras PKM + +**Nibras PKM** is a __local open source__ system for the __long-term management__ of __personal__ information. It is a combination of a __web-based__ application intended for desktop use and where all the records are entered, and an Android __mobile__ reader application. + +![](https://raw.githubusercontent.com/mfakih294/Nibras-PKM/master/docs/images/screenshot.jpg) + + +**Local** + +The user has full control over his/her data, without the need for a (fast) internet connection, and without all the distractions and information overload that the internet can cause. + +**Open source** + +The user has control over the system itself too, especially when using it on the long term to manage the important personal information and files. + +**Comprehensize** + +It manages resources (articles, books, documents), notes, writings, tasks, goals, journal, planner, payments, indicators, and (study) courses and departments. + +**Powerful** + +It was designed with large amounts of information in mind. In current usage, it manages dozens of thousands of records. With its commands and saved searches, it makes easy to navigate through all the information. + +## Main Features + +* **Flexible text-based commands** to add, update and search records, which provides powerful ways to manage information. +* **Saved searches** to save searches for later use. +* Ability to display records on calendars and Kanban boards. +* Full-text search of all record fields. +* Simple file system integration so to greatly reduce the need to organize files manually. + +## Documentation + +User's guide is available online at [https://mfakih294.github.io/Nibras-PKM/](https://mfakih294.github.io/Nibras-PKM/). + +## Code, releases and issues + +Nibras PKM is hosted on GitHub [https://github.com/mfakih294/Nibras-PKM](https://github.com/mfakih294/Nibras-PKM). + +## Quick start guide + +Running Nibras requires three simple steps: + +- Download the bundle file corresponding to your platform, e.g. nibras-bundle-windows.zip from the [releases page](https://github.com/mfakih294/Nibras-PKM/releases) on Github. +- Extract the zipped file to a location of your choice on your local disk. +- Launch Nibras by double clicking on ./scripts/start file. + +Once Nibras has finished launching, a message like the one below will appear. + +`************************************************************` + +`* Nibras has launched. You can access it from: *` + +`* https://localhost:1441/nibras *` + +`************************************************************` + +Go to **https://localhost:1441/nibras** using Firefox or Chrome. On the login page, enter *nibras* for username and *nibras* for the password. + +Notes: +- As it has a self-signed certificate, you need to accept and bypass the security warning that shows up at the beginning. +- On Linux, you need to make the files inside ./scripts and ./tomcat/bin folders executable (chmod +x *). +- To stop Nibras, you can close this window, or press ctrl+c in it, or run ./scripts/stop script. + +## Technical details + +* Nibras is developed in Grails framework 3.3.10, which is based on Groovy language, a dynamic language on top of the Java platform. +* Grails applications run on any platform that can run Java 8 and later, so practically all platforms, including Windows, Linux, Mac. +* For production use, Nibras uses MySQL 5 for its database, and the file system to store the files of the records. To testing and demonstration, you can run it with h2 database, with no need to configure it. +* Apache Tomcat 8+ is the recommended application server to run it for production use. + + +## Nibras Reader + + +* **Nibras Reader** is available as a companion Android application to Nibras. It that connects to a Nibras PKM system (e.g. on the same WIFI network), and syncs the bookmarked records in it, so you can read them without network access whenever you go. + +* It also allows the user to enter quick one-line notes that will be synced to Nibras Desktop on user's choice. + +* To use Nibras Reader, the user has to specify first the IP and port of Nibras PKM (found on the footer region). Then, when clicking 'Sync', all bookmarked records will be available for reading on mobile. + +* To install it, copy the bundled .apk file to your Android phone, and install it, or get it from its Github page: [https://github.com/mfakih294/nibras-mobile](https://github.com/mfakih294/nibras-mobile). + +![homepage](./images/nibras-mobile-homepage.jpg) + diff --git a/docs/index.md b/docs/index.md index 0d9bc48..55b0607 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,7 +3,8 @@ -**Nibras PKM** is a __web-based self-hosted open source__ system for the __long-term management__ of __personal__ information. It is a combination of a __web-based__ application intended for desktop use and where all the records are entered, and an Android __reader and note taker__ application. +**Nibras PKM** is a __web-based self-hosted open source__ system for +the __long-term management__ of __personal__ information. It is a combination of a __web-based__ application intended for desktop use and where all the records are entered, and an Android __reader and note taker__ application. ![](https://raw.githubusercontent.com/mfakih294/Nibras-PKM/master/docs/images/screenshot.jpg) @@ -36,9 +37,9 @@ It was designed with large amounts of information in mind. In current usage, it -## Documentation +## User's guide -Documentation is available online at [https://mfakih294.github.io/Nibras-PKM/pages](https://mfakih294.github.io/Nibras-PKM/pages/). +User's guide is available online at [https://mfakih294.github.io/Nibras-PKM/pages](https://mfakih294.github.io/Nibras-PKM/pages/). ## Releases @@ -67,12 +68,14 @@ Notes: - On Linux, you need to make the files inside ./scripts and ./tomcat/bin folders executable (chmod +x *). - To stop Nibras, you can close this window, or press ctrl+c in it, or run ./scripts/stop script. - ## Technical details -* Nibras is developed in Grails framework 3.3.10, a dynamic framework on top of the Java platform. +* Nibras is developed in Grails framework 3.3.10, a dynamic web framework on top of the Java platform. * Grails applications run on any platform that can run Java 8 and later, so practically all platforms, including Windows, Linux, Mac. -* For production use, Nibras uses MySQL 5+ for its database, and the file system to store the files of the records. To testing and demonstration, it can run with h2 database, with zero extra configuration. +* For production use, Nibras uses MySQL 5+ for its database, and the file system to store the files of the records. To testing and demonstration, you can run it with h2 database, with zera extra configurion. +* Apache Tomcat 8+ is the recommended application server to run it for production use. + + * Apache Tomcat 8+ is the recommended application server to run it for production use. * The bundled distribution comes with Tomcat 8 and runs with a h2 database. diff --git a/grails-app/conf/application.groovy b/grails-app/conf/application.groovy old mode 100644 new mode 100755 index 8fdbcf1..a168a49 --- a/grails-app/conf/application.groovy +++ b/grails-app/conf/application.groovy @@ -23,6 +23,17 @@ grails.plugin.springsecurity.controllerAnnotations.staticRules = [ [pattern: '/shutdown', access: ['permitAll']], [pattern: '/json/**', access: ['permitAll']], // working! 19.07.2019 [pattern: '**/json/**', access: ['permitAll']], // working! 19.07.2019 + [pattern: '**/jabal-amel/**', access: ['permitAll']], + [pattern: '*/jabal-amel/**', access: ['permitAll']], + [pattern: '/jabal-amel/**', access: ['permitAll']], + [pattern: '**/indexCard/generateWritingsBook/**', access: ['permitAll']], + [pattern: '**/staticPage/**', access: ['permitAll']], + [pattern: '**/viewRecordImage/**/**', access: ['permitAll']], + [pattern: '*/*/viewRecordImage/**/*', access: ['permitAll']], + [pattern: '**/generics/viewRecordImage/**', access: ['permitAll']], + [pattern: '**/staticRecord/**', access: ['permitAll']], + [pattern: '**/download/**', access: ['permitAll']], + [pattern: '**//jabal-amel/**', access: ['permitAll']], [pattern: '/assets/**', access: ['permitAll']], [pattern: '/**/js/**', access: ['permitAll']], [pattern: '/**/plugins/**', access: ['permitAll']], @@ -34,9 +45,11 @@ grails.plugin.springsecurity.controllerAnnotations.staticRules = [ [pattern: '/**/filed/**', access: ['permitAll']], [pattern: '/**/download/**', access: ['permitAll']], [pattern: '/**/page/mobile*/**', access: ['permitAll']], - + [pattern: '/**/page/appPile*/**', access: ['permitAll']], + [pattern: '/**/page/panel*/**', access: ['permitAll']], [pattern: '/**/sync/**', access: ['permitAll']], [pattern: '/**/css/**', access: ['permitAll']], + [pattern: '/**/layout/**', access: ['permitAll']], [pattern: '/**/kickstart/**', access: ['permitAll']], [pattern: '/**/file-icons/**', access: ['permitAll']], // [pattern: '/**/slides/**', access: ['permitAll']], @@ -46,12 +59,20 @@ grails.plugin.springsecurity.controllerAnnotations.staticRules = [ ] grails.plugin.springsecurity.filterChain.chainMap = [ + [pattern: '/jabal-amel/**', filters: 'none'], [pattern: '/assets/**', filters: 'none'], [pattern: '/page/heartbeat*/**', filters: 'none'], [pattern: '/page/mobile*/**', filters: 'none'], [pattern: '/sync/**', filters: 'none'], [pattern: '**/sync/**', filters: 'none'], [pattern: '/**/download/**', filters: 'none'], + [pattern: '/**/generateWritingsBook/**', filters: 'none'], + [pattern: '**/generics/viewRecordImage/**', filters: 'none'], + [pattern: '/**/generics/viewRecordImage/**', filters: 'none'], + [pattern: '**/viewRecordImage/**', filters: 'none'], + [pattern: '/**/viewRecordImage/**', filters: 'none'], + [pattern: '/**/staticPage/**', filters: 'none'], + [pattern: '/**/download/**', filters: 'none'], [pattern: '/**/filed/**', filters: 'none'], [pattern: '/json/**', filters: 'none'], [pattern: '/**/js/**', filters: 'none'], @@ -91,3 +112,16 @@ environments { grails.dbconsole.enabled = true } } +elasticSearch.datastoreImpl = 'hibernateDatastore' +elasticSearch.client.mode = 'local' +elasticSearch.migration.strategy = 'delete' +elasticSearch.disableAutoIndex = false +elasticSearch.bulkIndexOnStartup = true +//grails.app.enable.reload = true +//grails.gsp.view.dir = "/nibras/sys/views" + +//log4j = { // not here +// trace 'org.hibernate.type.descriptor.sql.BasicBinder' +// error 'org.hibernate.SQL' +// debug 'grails.app.controllers' +//} \ No newline at end of file diff --git a/grails-app/conf/application.yml b/grails-app/conf/application.yml old mode 100644 new mode 100755 index eca0b14..5394404 --- a/grails-app/conf/application.yml +++ b/grails-app/conf/application.yml @@ -24,8 +24,8 @@ info: version: 1.9.1 grailsVersion: '@info.app.grailsVersion@' server: - contextPath: '/' - port: 1441 # The port to listen on + contextPath: '/nibras' # ContextPath must start with '/' and not end with '/' + port: 1445 # The port to listen on session: timeout: 720000 # 20 hours (in ms) ssl: @@ -112,14 +112,15 @@ hibernate: flush: mode: AUTO environments: - h2: + h2: #h2 grails.dbconsole: enabled: true # urlRoot: ${appName}/dbc dataSource: dbCreate: update - url: jdbc:h2:./db/db;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE; - dialect: com.hp.opr.hibernate.dialect.H2Dialect + url: jdbc:h2:./db/db;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE; # MODE=MySQL + dialect: org.hibernate.dialect.H2Dialect + #org.hibernate.dialect.HSQLDialect # com.hp.opr.hibernate.dialect. # H2Dialect (MODE=MySQL; not supported in h2dialect) driverClassName: org.h2.Driver properties: jmxEnabled: true @@ -139,14 +140,24 @@ environments: testOnReturn: false jdbcInterceptors: ConnectionState defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED + derby: #derby + grails.dbconsole: + enabled: true + dataSource: + dbCreate: update + url: jdbc:derby:./db;create=true + dialect: org.hibernate.dialect.DerbyTenSeven + driverClassName: org.apache.derby.jdbc.EmbeddedDriver + logsql: true + development: dataSource: dbCreate: update url: jdbc:mysql://localhost:3306/db_nibras?serverTimezone=Asia/Beirut driverClassName: com.mysql.cj.jdbc.Driver dialect: org.hibernate.dialect.MySQL5InnoDBDialect - username: nibras - password: nibras + username: user1 + password: user1 properties: jmxEnabled: true initialSize: 5 @@ -222,3 +233,8 @@ environments: # - classpath:'@info.app.grailsVersion@'.groovy # - classpath:myconfig.yml + + +quartz: + autoStartup: true + jdbcStore: false \ No newline at end of file diff --git a/grails-app/conf/logback.groovy b/grails-app/conf/logback.groovy old mode 100644 new mode 100755 index f514780..e03fb47 --- a/grails-app/conf/logback.groovy +++ b/grails-app/conf/logback.groovy @@ -112,7 +112,12 @@ appender("STDOUT", ConsoleAppender) { //logger('nibras', INFO, ['STDOUT'], false) -logger('nibras', ERROR, ['STDOUT'], false) +logger('nibras', INFO, ['STDOUT'], false) +logger('org.hibernate.SQL', WARN, ['STDOUT'], false) +logger ' org.quartz.core.QuartzScheduler ', INFO +logger 'org.hibernate.type.descriptor.sql.BasicBinder', DEBUG +logger 'grails.app.controllers', DEBUG + //logger('nibras', WARN, ['STDOUT'], false) diff --git a/grails-app/controllers/UrlMappings.groovy b/grails-app/controllers/UrlMappings.groovy old mode 100644 new mode 100755 index ffdd81d..3e6939b --- a/grails-app/controllers/UrlMappings.groovy +++ b/grails-app/controllers/UrlMappings.groovy @@ -26,6 +26,8 @@ class UrlMappings { "/slides"(controller: 'page', action: 'slides') "/filed"(controller: 'operation', action: 'filed') + "/irfan"(controller: 'page', action: 'appIrfan') + // "/jabal-amel"(controller: 'indexCard', action: 'generateWritingsBook') "/$controller/$action?/$id?"{ constraints { // apply constraints here diff --git a/grails-app/controllers/app/IndexCardController.groovy b/grails-app/controllers/app/IndexCardController.groovy old mode 100644 new mode 100755 index 7a1250f..e6a9561 --- a/grails-app/controllers/app/IndexCardController.groovy +++ b/grails-app/controllers/app/IndexCardController.groovy @@ -8,11 +8,16 @@ import cmn.* import grails.converters.* import ker.OperationController import mcs.Book +import mcs.Course import mcs.Journal import mcs.parameters.GoalType import mcs.parameters.JournalType import mcs.parameters.WorkStatus import org.apache.commons.lang.StringUtils +import security.User + +import java.nio.file.Files +import java.nio.file.Paths import java.text.SimpleDateFormat //import jxl.* @@ -26,6 +31,7 @@ import grails.plugin.springsecurity.annotation.Secured class IndexCardController { // entity id = 16 def supportService + def springSecurityService static allClasses = [ mcs.Goal, @@ -478,7 +484,9 @@ class IndexCardController { // entity id = 16 n.summary = params.title//extractTitleReturn(params.description) n.description = params.description //extractDescriptionReturn(params.description) n.status = WorkStatus.findByCode('pending') - n.bookmarked = true +// n.bookmarked = true + if (params.goal) + n.goal = mcs.Goal.get(params.goal) if (params.context) n.context = mcs.parameters.Context.get(params.context) n.save() @@ -489,7 +497,7 @@ class IndexCardController { // entity id = 16 n.description = params.description //extractDescriptionReturn(params.description) n.type = GoalType.findByCode('goal') n.status = WorkStatus.findByCode('pending') - n.bookmarked = true +// n.bookmarked = true n.save() } else if (params.type == 'R'){ @@ -519,6 +527,18 @@ class IndexCardController { // entity id = 16 n.priority = params.priority?.toInteger() + n.user = User.findByUsername(springSecurityService.currentUser.username) + + def fullPath = supportService.getResourcePath(n.id, params.type, false) + + if (OperationController.getPath('currentFolder.path')) { + def currentPath = OperationController.getPath('currentFolder.path') + Files.createDirectories(Paths.get(fullPath)) + if (new File(fullPath).exists()) { + new File(currentPath + '/current').delete() + java.nio.file.Files.createSymbolicLink(Paths.get(currentPath + '/current'), Paths.get(fullPath)) + } + } render(template: "/gTemplates/recordSummary", model: [record: n, justSaved: true]) render(template: '/layouts/achtung', model: [message: 'Record saved with id: ' + n.id]) @@ -658,13 +678,14 @@ class IndexCardController { // entity id = 16 def generateWritingsBook(){ - render(template: "/appCourse/writingsBookHtml", model: [record: mcs.Course.get(params.id)]) - } - def generateWritingsBookToFile() { - def f = new File('/' + (OperationController.getPath('root.rps1.path') ?: '') + '/crs' + params.id + '.md') - f.write(g.include([controller: 'indexCard', action: 'generateWritingsBook', id: params.id]).toString(), 'UTF-8') - render 'Generation done: ' + new Date().format('HH:mm:ss') + params.id = params.id ?: 9263 + render(view: "/appCourse/writingsBookHtml", model: [record: mcs.Course.get(params.id)]) } + + + + + def sortNotes(){ render(template: "/appCourse/sortNotes", model: [record: mcs.Course.get(params.id)]) } diff --git a/grails-app/controllers/ker/ExportController.groovy b/grails-app/controllers/ker/ExportController.groovy index 6c38fcf..0138ce7 100755 --- a/grails-app/controllers/ker/ExportController.groovy +++ b/grails-app/controllers/ker/ExportController.groovy @@ -50,6 +50,7 @@ import java.text.SimpleDateFormat import grails.plugin.springsecurity.annotation.Secured +import java.time.ZoneId import java.time.format.DateTimeFormatter import static com.cronutils.model.CronType.QUARTZ; @@ -241,7 +242,7 @@ class ExportController { def allCalendarEvents() { def events = [] - Task.executeQuery("from Journal t where t.bookmarked = 1 and t.startDate between :start and :end", + Task.executeQuery("from Journal t where t.startDate between :start and :end", // t.bookmarked = 1 and //[new Date(Long.parseLong(params.start) * 1000), new Date(Long.parseLong(params.end) * 1000)]).each() { [start: Date.parse('yyyy-MM-dd', params.start) - 20, end: Date.parse('yyyy-MM-dd', params.end) + 20]).each() { @@ -264,7 +265,7 @@ class ExportController { url : request.contextPath + '/page/record/' + it.id + '?entityCode=J', allDay : (it.level != 'm' || it.startDate.hours < 5 ? true : false)]) } - Task.executeQuery("from Planner t where t.bookmarked = 1 and t.startDate between :start and :end", + Task.executeQuery("from Planner t where t.startDate between :start and :end", //t.bookmarked = 1 //[new Date(Long.parseLong(params.start) * 1000), new Date(Long.parseLong(params.end) * 1000)]).each() { [start: Date.parse('yyyy-MM-dd', params.start) - 20, end: Date.parse('yyyy-MM-dd', params.end) + 20]).each() { @@ -281,15 +282,15 @@ class ExportController { title : StringUtils.abbreviate(title, 80), description : it.summary + '|' + it.description, classNames: it.completedOn != null ? ['done'] : [''], - backgroundColor: 'Chocolate',//it.type?.color ?: '#F7F9EE', - borderColor : 'Chocolate', + backgroundColor: '#92B450',//it.type?.color ?: '#F7F9EE', + borderColor : '#92B450', textColor : 'white',//it.type?.style ?: '#515150', url : request.contextPath + '/page/record/' + it.id + '?entityCode=P', allDay : (it.level != 'm' || it.startDate.hours < 7 || it.task != null ? true : false)]) } - Task.executeQuery("from Task t where t.bookmarked = 1 and t.endDate between :start and :end", + Task.executeQuery("from Task t where t.endDate between :start and :end", // t.bookmarked = 1 and //[new Date(Long.parseLong(params.start) * 1000), new Date(Long.parseLong(params.end) * 1000)]).each() { [start: Date.parse('yyyy-MM-dd', params.start) - 20, end: Date.parse('yyyy-MM-dd', params.end) + 20]).each() { @@ -310,8 +311,8 @@ class ExportController { allDay : false ]) } - - Task.executeQuery("from Goal t where t.bookmarked = 1 and t.endDate between :start and :end", +/* + Task.executeQuery("from Goal t where t.bookmarked = 1 and t.endDate between :start and :end", //[new Date(Long.parseLong(params.start) * 1000), new Date(Long.parseLong(params.end) * 1000)]).each() { [start: Date.parse('yyyy-MM-dd', params.start) - 20, end: Date.parse('yyyy-MM-dd', params.end) + 20]).each() { @@ -332,10 +333,9 @@ class ExportController { url : request.contextPath + '/page/record/' + it.id + '?entityCode=T', allDay : false ]) } +*/ - - - Task.executeQuery("from Book t where t.bookmarked = 1 and t.readOn between :start and :end", + Task.executeQuery("from Book t where t.readOn between :start and :end", //[new Date(Long.parseLong(params.start) * 1000), new Date(Long.parseLong(params.end) * 1000)]).each() { [start: Date.parse('yyyy-MM-dd', params.start) - 20, end: Date.parse('yyyy-MM-dd', params.end) + 20]).each() { @@ -355,22 +355,25 @@ class ExportController { url : request.contextPath + '/page/record/' + it.id + '?entityCode=R', allDay : false ]) } -/* - def cc = 1000 - - [ - ['Oil every month on Monday', '0 15 1 * 1'], - ['Internet every 14th of month', '0 15 14 * *'], - ['Filter every two month on Monday', '0 15 1 /2 1'], - ['Every Friday', '0 15 * * 5'], - ['Every day', '0 15 * * *'], - ['Every last of month', '0 15 29 * *'] - ].each() { jobTitle, quartzCronExpression -> - - //String quartzCronExpression = "0 0 1 2 7"; - CronParser quartzCronParser = - new CronParser(CronDefinitionBuilder.instanceDefinitionFor(UNIX)); +// def cc = 1000 + +// [ +// ['Oil every month on Monday', '0 15 1 * 1'], +// ['Internet every 14th of month', '0 15 14 * *'], +// ['Filter every two month on Monday', '0 15 1 /2 1'], +// ['Every Friday', '0 15 * * 5'], +// ['Every day', '0 15 * * *'], +// ['Every last of month', '0 15 29 * *'] +// ] + Task.executeQuery('from Task where recurringCron is not null and bookmarked = true').each() { + def id = it.id + def jobTitle = it.summary + def quartzCronExpression = it.recurringCron + + //String quartzCronExpression = "0 0 1 2 7"; + CronParser quartzCronParser = + new CronParser(CronDefinitionBuilder.instanceDefinitionFor(UNIX)); // parse the QUARTZ cron expression. Cron parsedQuartzCronExpression = @@ -378,16 +381,14 @@ class ExportController { // Create ExecutionTime for a given cron expression. - // DateTimeFormatter formatter0 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss a z"); // ZonedDateTime dateTime = ZonedDateTime.parse("2020-06-01 00:00:00 AM +02:00", formatter0); - ZonedDateTime now = ZonedDateTime.now(); - ExecutionTime executionTime = - ExecutionTime.forCron(parsedQuartzCronExpression); + ExecutionTime executionTime = + ExecutionTime.forCron(parsedQuartzCronExpression); - // render 'quartz ' + parsedQuartzCronExpression.asString() + // render 'quartz ' + parsedQuartzCronExpression.asString() // Given a Cron instance, we can ask for next/previous execution DateTimeFormatter formatter = DateTimeFormatter.ofPattern("w E dd.MM.yyyy HH:mm Z"); @@ -400,22 +401,37 @@ class ExportController { // Date.from(executionTime.nextExecution(now).get().toInstant()).format("w E dd.MM.yyyy HH:mm") // //executionTime.nextExecution(now).get().format(formatter) // )) + ZonedDateTime now = ZonedDateTime.now(); - events.add([id : cc++, - start : new SimpleDateFormat("yyyy-MM-dd'T'HH:mm':00'").format(Date.from(executionTime.nextExecution(now).get().toInstant())), - end : new SimpleDateFormat("yyyy-MM-dd'T'HH:mm':00'").format(Date.from(executionTime.nextExecution(now).get().toInstant())), - //it.type?.name + - title : jobTitle, - description : 'cron generated', - backgroundColor: 'DarkRed',//it.type?.color ?: '#F7F9EE', - borderColor : 'DarkRed', - textColor : 'white',//it.type?.style ?: '#515150', - url : request.contextPath + '/page/record/' + cc + '?entityCode=T', - allDay : false ]) - } +// for (d in (-7..+7)) { + + + def zdtStart = (new Date() - 7).toInstant().atZone(ZoneId.systemDefault()) + def zdt = executionTime.nextExecution(zdtStart).get() + def zdtEnd = (new Date() + 14).toInstant().atZone(ZoneId.systemDefault()) +//def d = -7 + while (zdt <= zdtEnd) { +// [start: Date.parse('yyyy-MM-dd', params.start) - 20, end: Date.parse('yyyy-MM-dd', params.end) + 20]).each() { +// d++ +// println 'new cron task: ' + it.description + ' at date ' + new SimpleDateFormat("yyyy-MM-dd'T'HH:mm':00'").format(Date.from(zdt.toInstant())) + events.add([id : it.id + System.currentTimeMillis(), + start : new SimpleDateFormat("yyyy-MM-dd'T'HH:mm':00'").format(Date.from(zdt.toInstant())), + end : new SimpleDateFormat("yyyy-MM-dd'T'HH:mm':00'").format(Date.from(zdt.toInstant())), + //it.type?.name + + title : '* ' + it.summary, + description : it.summary + ' | ' + it.description, + backgroundColor: 'DarkGray',//it.type?.color ?: '#F7F9EE', + borderColor : 'Black', + textColor : 'white',//it.type?.style ?: '#515150', + url : request.contextPath + '/page/record/' + id + '?entityCode=T', + allDay : false]) + zdt = executionTime.nextExecution(zdt).get() + + } + + } -*/ render events as JSON } @@ -792,7 +808,7 @@ This presentation aims to give an overview of Pomegranate PKM system. def ref = now def dates = [] def i = 1 - render 'Dates in the next 40 days:

' + render 'Occurrences in the next 40 days (' + t.recurringInterval + ' times) ' + '

' // while (Date.from(executionTime.nextExecution(now).get().toInstant()) < new Date() + 40){ while (i <= (t.recurringInterval ?: 4)){ render i++ + ': ' + Date.from(executionTime.nextExecution(now).get().toInstant())?.format('EEE dd.MM.yyyy HH:mm') + '
' diff --git a/grails-app/controllers/ker/GenericsController.groovy b/grails-app/controllers/ker/GenericsController.groovy index 83c0f21..84a664a 100755 --- a/grails-app/controllers/ker/GenericsController.groovy +++ b/grails-app/controllers/ker/GenericsController.groovy @@ -32,6 +32,8 @@ import mcs.parameters.* import mcs.parameters.Context import org.apache.commons.lang.StringUtils import grails.converters.JSON +import security.User + import java.nio.file.* //import org.eclipse.mylyn.wikitext.core.parser.MarkupParser @@ -45,7 +47,10 @@ import grails.plugin.springsecurity.annotation.Secured import org.apache.pdfbox.PDFToImage + + @Secured(['ROLE_ADMIN','ROLE_READER']) + class GenericsController { static entityMapping = [ @@ -169,14 +174,14 @@ class GenericsController { def supportService def searchableService - + def springSecurityService def quickWritingSearch(String input) { if (!input.startsWith(' ')) { - findRecords('f w -- ' + params.input) + findRecords('w -- ' + params.input) } else if (input.startsWith(' ')) { - findRecords('f w :: ' + params.input) + findRecords('w :: ' + params.input) } } @@ -189,6 +194,28 @@ class GenericsController { } } + def quickCourseSearch(String input) { + if (!input.startsWith(' ')) { + findRecords("r C${params.id} -- " + params.input) + findRecords("n C${params.id} -- " + params.input) + findRecords("w C${params.id} -- " + params.input) + findRecords("t C${params.id} -- " + params.input) + findRecords("t C${params.id} -- " + params.input) + findRecords("j C${params.id} -- " + params.input) + findRecords("p C${params.id} -- " + params.input) + findRecords("g C${params.id} -- " + params.input) + } else if (input.startsWith(' ')) { + findRecords("r C${params.id} :: " + params.input) + findRecords("n C${params.id} :: " + params.input) + findRecords("w C${params.id} :: " + params.input) + findRecords("t C${params.id} :: " + params.input) + findRecords("t C${params.id} :: " + params.input) + findRecords("j C${params.id} :: " + params.input) + findRecords("p C${params.id} :: " + params.input) + findRecords("g C${params.id} :: " + params.input) + } + } + def quickTextSearch(String input) { // println params.dump() @@ -217,7 +244,7 @@ class GenericsController { queryKey : queryKey, title : entityCode + ': ' + count + ' results.' ])}*/ - render '

Search results...

Add a space before the term(s) to search inside the contents of the records.
' + render "

Search results for '${params.input}'...

" //Add a space before the term(s) to search inside the contents of the records.
' //println 'type' + params.resultType if (params.resultType == '*') { [ @@ -230,24 +257,29 @@ class GenericsController { [id: 'p', name: 'Planner', code: 'planner'], [id: 's', name: 'Contact', code: 'contacts'], [id: 'c', name: 'Course', code: 'courses'] - ].each() { - if (OperationController.getPath(it.code + '.enabled') == 'yes') + ].each() { //todo: simplify + if (OperationController.getPath(it.code + '.enabled') == 'yes'){ if (input.startsWith(' ')) findRecords(it.id + ' :: ' + params.input) else findRecords(it.id + ' -- ' + params.input) + } } } else { if (input?.trim()?.isInteger()) findRecords(params.resultType.toLowerCase() + ' i' + params.input?.trim()) - else if (input.startsWith(' ')) - findRecords(params.resultType.toLowerCase() + ' :: ' + params.input) - else - findRecords(params.resultType.toLowerCase() + ' -- ' + params.input) + else { + if (input.startsWith(' ')) + findRecords(params.resultType.toLowerCase() + ' :: ' + params.input) + else + findRecords(params.resultType.toLowerCase() + ' -- ' + params.input) + } + } + // render '

Searching contents...

' /* [ @@ -282,6 +314,9 @@ class GenericsController { Long actionDispatcher(String input) { + + input = input.trim() + try { if (input && input.trim() != '') { @@ -591,8 +626,8 @@ YellowGreen;#9ACD32""" } else { render(template: '/layouts/verification', model: - [line: prefix?.replace('--', ' -- ') + it?.trim(), - status: verifySmartCommand(prefix?.replace('--', ' -- ') + it?.trim()), index: index++]) // prefix + ' ' + + [line: prefix?.replace('--', ' -- ') + block?.trim(), + status: verifySmartCommand(prefix?.replace('--', ' -- ') + block?.trim()), index: index++]) // prefix + ' ' + } } @@ -791,7 +826,8 @@ r (resource) case 'e': hintResponce = 'e saved search code
' if (input.length() < 3){ SavedSearch.findAll().each(){ - hintResponce+= it.id + (it.code ? ' ' + it.code + '' : '') + ' - ' + it.summary + '
' + hintResponce+= (it.code ? ' ' + it.code + '' : '') + ' - ' + it.summary + '
' + // it.id + } } else { @@ -859,7 +895,7 @@ fr""" break case '#': - hintResponce += ('Types\n\n') + hintResponce += ('Types\n\n') switch (entityCode) { @@ -1202,7 +1238,11 @@ ll def record = grailsApplication.classLoader.loadClass(entityMapping[entityCode]).get(id) + if (record) { + // todo: remove + record.user = User.findByUsername(springSecurityService.currentUser.username) + if (entityCode == 'O'){ if (verifySmartCommand(record?.summary + ' -- ' + record.description?.trim()) == 'correctCommand') { @@ -1226,12 +1266,15 @@ ll def fullPath = supportService.getResourcePath(record.id, entityCode, false) + + if (OperationController.getPath('currentFolder.path')){ def currentPath = OperationController.getPath('currentFolder.path') Files.createDirectories(Paths.get(fullPath)) if (new File(fullPath).exists()) { new File(currentPath + '/current').delete() java.nio.file.Files.createSymbolicLink(Paths.get(currentPath + '/current'), Paths.get(fullPath)) } + } } render(template: '/gTemplates/recordSummary', model: [record: record, showFull: 'on', mobileView: params.mobileView]) @@ -1269,9 +1312,9 @@ def markAsMarkdowned(Long id, String entityCode) { def record = grailsApplication.classLoader.loadClass(entityMapping[entityCode]).get(id) try { record.withMarkdown = true - render 'is ? ' + record.withMarkdown - render 'is ? ' + record.id - render 'is ? ' + record.hasErrors() +// render 'is ? ' + record.withMarkdown +// render 'is ? ' + record.id +// render 'is ? ' + record.hasErrors() record.save() render(template: '/layouts/achtung', model: [message: "Record with ID ${id} has been marked as markdown"]) // render(template: '/gTemplates/recordSummary', model: [record: record]) @@ -1282,6 +1325,23 @@ def markAsMarkdowned(Long id, String entityCode) { } } + def unmarkAsMarkdowned(Long id, String entityCode) { + def record = grailsApplication.classLoader.loadClass(entityMapping[entityCode]).get(id) + try { + record.withMarkdown = false +// render 'is ? ' + record.withMarkdown +// render 'is ? ' + record.id +// render 'is ? ' + record.hasErrors() + record.save() + render(template: '/layouts/achtung', model: [message: "Record with ID ${id} has been ummarked as markdown"]) +// render(template: '/gTemplates/recordSummary', model: [record: record]) + } + catch (Exception) { + render(template: '/layouts/achtung', model: [message: "Record with ID ${id} could not be unmarked"]) + println 'Error saving record.' + } + } + def openRpsFolder() { @@ -1497,9 +1557,10 @@ def markAsMarkdowned(Long id, String entityCode) { // newRecord.dateCreated = oldRecord.dateCreated - } + oldRecord.user = newRecord.user + // render(template: '/layouts/achtung', model: [message: "Record with ID ${id} deleted"]) render(template: '/gTemplates/recordSummary', model: [record: newRecord]) } @@ -1586,7 +1647,28 @@ def markAsMarkdowned(Long id, String entityCode) { } - def markCompleted(Long id, String entityCode) { + def markPublic(Long id, String entityCode) { + + def record = grailsApplication.classLoader.loadClass(entityMapping[entityCode]).get(id) + +// !'RP'.contains(entityCode) && + if (record.class.declaredFields.name.contains('isPrivate')) { + if (record.isPrivate == true) { + record.isPrivate = false + render(template: '/layouts/achtung', model: [message: 'Record marked as public']) + } + else { + record.isPrivate = true + render(template: '/layouts/achtung', model: [message: 'Record marked as private']) + } + } + + render(template: '/gTemplates/recordSummary', model: [record: record]) + + } + + +def markCompleted(Long id, String entityCode) { def record = grailsApplication.classLoader.loadClass(entityMapping[entityCode]).get(id) @@ -1655,6 +1737,30 @@ def markAsMarkdowned(Long id, String entityCode) { render(template: '/gTemplates/recordSummary', model: [record: record]) render(template: '/layouts/achtung', model: [message: 'Record marked as completed']) } + def unmarkCompleted(Long id, String entityCode) { + + def record = grailsApplication.classLoader.loadClass(entityMapping[entityCode]).get(id) + + if ('GTP'.contains(entityCode)) { + record.completedOn = null + record.status = WorkStatus.findByCode('pending') + } + + if ('NJ'.contains(entityCode)) { + record.isMerged = false + record.mergedOn = null + } + + + if ('REN'.contains(entityCode)) { + if (!record.readOn) { + record.readOn = null + } + } + + render(template: '/gTemplates/recordSummary', model: [record: record]) + render(template: '/layouts/achtung', model: [message: 'Record marked as uncompleted']) + } // static def markCompletedStatic(Long id, String entityCode) { // @@ -1932,8 +2038,10 @@ def markAsMarkdowned(Long id, String entityCode) { typeRepositoryPath = OperationController.getPath('root.rps2.path') + '/' + entityCode + '/' folders.add([typeSandboxPath + '/' + (b.id)]) - if (!b.bookmarked) - folders.add([typeRepositoryPath + '/' + (b.id)]) + + +// if (!r.bookmarked) +// folders.add([typeRepositoryPath + '/' + (b.id)]) @@ -2045,6 +2153,34 @@ def markAsMarkdowned(Long id, String entityCode) { record.endDate = new Date() record.bookmarked = true // else +// record.endDate = record.endDate - 1 + + render(template: '/gTemplates/recordSummary', model: [record: record]) + } + def setEndDate() { + def entityCode = params.id.substring(0, 1) + def id = params.id.substring(1).toLong() + def record = grailsApplication.classLoader.loadClass(entityMapping[entityCode]).get(id) + + def oldEndDate = record.endDate + +// if (!record.endDate) + record.endDate = new Date() + params.i.toInteger() + + if (params.i.toInteger() > 3) + record.bookmarked = false + + + + if (oldEndDate) { + Calendar cal = GregorianCalendar.getInstance(); // turned out to be not needed, but old dates where in a different timezones!!! + cal.setTime(oldEndDate) + +// record.endDate = record.endDate.copyWith(hourOfDay: cal.get(Calendar.HOUR), minute: oldEndDate.getMinutes()) + record.endDate.setHours(oldEndDate.getHours()) + record.endDate.setMinutes(oldEndDate.getMinutes()) + } +// else // record.endDate = record.endDate - 1 render(template: '/gTemplates/recordSummary', model: [record: record]) @@ -2603,16 +2739,20 @@ def markAsMarkdowned(Long id, String entityCode) { } // postToBlog(String blogId, String title, String categoriesString, String tags, String fullText) { - sleep(2000) - int r = supportService.postToBlog(record.blog.id, summary, categories, tags, contents, record.entityCode(), record.publishedNodeId) - - if (r) { - record.publishedNodeId = r - record.publishedOn = new Date() - //render r - render(template: '/layouts/achtung', model: [message: "Record published with id " + r]) - } else "Problem posting the record" - + sleep(500) + try { + int r = supportService.postToBlog(record.blog.id, summary, categories, tags, contents, record.entityCode(), record.publishedNodeId, null) + + if (r) { + record.publishedNodeId = r + record.publishedOn = new Date() + //render r + render(template: '/layouts/achtung', model: [message: "Record published with id " + r]) + } else "Problem posting the record" + } catch (Exception e){ + println 'Problem occurred while posting ' + e.toString() + render 'Problem occurred while posting ' + e.toString() + } list.add(record) } @@ -2998,6 +3138,11 @@ def markAsMarkdowned(Long id, String entityCode) { if (params.id) record = grailsApplication.classLoader.loadClass(params.entityController).get(params.id) + if (params.id && params.entityController == 'mcs.parameters.SavedSearch') + render(template: '/gTemplates/recordSummary', model: [ + title: "", + record: record]) + render(template: '/gTemplates/addForm', model: [entityController: params.entityController, fields : grailsApplication.classLoader.loadClass(params.entityController).declaredFields.name, @@ -3017,8 +3162,11 @@ def markAsMarkdowned(Long id, String entityCode) { contexts : contexts, categories : categories ]) - if (params.isParameter) - render(template: '/gTemplates/recordListing', model: [list: grailsApplication.classLoader.loadClass(params.entityController).findAll([sort: 'id', order: 'desc'])]) + + if (params.isParameter) + render(template: '/gTemplates/recordListing', model: [ + title: "List of records", + list: grailsApplication.classLoader.loadClass(params.entityController).findAll([sort: 'id', order: 'desc'])]) } catch (Exception e) { @@ -3275,9 +3423,9 @@ def markAsMarkdowned(Long id, String entityCode) { def queryHead = 'from ' + entityMapping[entityCode] def queryCriteria = transformMcsNotation(input.substring(0, input.length() - 2))['queryCriteria'] - def fullquery = queryHead + (queryCriteria ? ' where ' + queryCriteria : '') + ' order by lastUpdated desc, id desc' + def fullquery = queryHead + (queryCriteria ? ' where ' + queryCriteria : '') + ' order by id desc' //lastUpdated desc, buggy, todo: configurable with a warning // println 'fq ' + fullquery - def list = Task.executeQuery(fullquery + ' order by lastUpdated desc, id desc', [], params) + def list = Task.executeQuery(fullquery + ' order by id desc', [], params) // lastUpdated desc, def r def limit = ker.OperationController.getPath('updateResultSet.max-items')?.toInteger() ?: 100 if (list.size() < limit) { @@ -3329,7 +3477,7 @@ def markAsMarkdowned(Long id, String entityCode) { def queryParams = '' - fullquery = queryHead + (queryCriteria ? ' where ' + queryCriteria : '') + ' order by lastUpdated desc, id desc' + fullquery = queryHead + (queryCriteria ? ' where ' + queryCriteria : '') + ' order by id desc' // lastUpdated desc, fullquerySort = 'select count(*) ' + queryHead + (queryCriteria ? ' where ' + queryCriteria : '') def list = Task.executeQuery(fullquery, [], params) @@ -3441,7 +3589,7 @@ def markAsMarkdowned(Long id, String entityCode) { render(template: '/reports/genericGrouping', model: [ - items : Task.executeQuery(queryHead + (queryCriteria ? ' where ' + queryCriteria : '') + ' order by lastUpdated desc, id desc', []), + items : Task.executeQuery(queryHead + (queryCriteria ? ' where ' + queryCriteria : '') + ' order by id desc', []), // lastUpdated desc, groups: groups, groupBy: groupBy, title : 'HQL Query: ' + input] ) @@ -3453,11 +3601,14 @@ def markAsMarkdowned(Long id, String entityCode) { def queryKey if (input.startsWith('_')) { fullquery = session[input] - fullquerySort = 'select count(*) ' + fullquery + fullquerySort = 'select count(*) ' + fullquery?.split('order by')[0] // bug: problem in h2 if "order by" is used with select count(*) + // println 'query sort ' + fullquery?.split('order by')[0] queryKey = input // println 'fullquery ' + fullquery + '\n\n' } else { + + def entityCode = input.split(/[ ]+/)[0]?.toUpperCase() // input = params.input.substring(params.input.indexOf(' ')) @@ -3465,9 +3616,10 @@ def markAsMarkdowned(Long id, String entityCode) { def queryHead = 'from ' + entityMapping[entityCode] def queryCriteria = transformMcsNotation(input)['queryCriteria'] + // println 'queryCriteria ' + queryCriteria def queryParams = '' - fullquery = queryHead + (queryCriteria ? ' where ' + queryCriteria : '') + ' order by lastUpdated desc, id desc' + fullquery = queryHead + (queryCriteria ? ' where ' + queryCriteria : '') + ' order by id desc' // lastUpdated desc, fullquerySort = 'select count(*) ' + queryHead + (queryCriteria ? ' where ' + queryCriteria : '') queryKey = '_' + entityCode + '-' + new Date().format('ddMMyyHHmmss') session[queryKey] = fullquery @@ -3737,6 +3889,9 @@ def markAsMarkdowned(Long id, String entityCode) { } else { def n = grailsApplication.classLoader.loadClass(entityMapping[entityCode]).newInstance(properties) // n.properties = properties + + n.user = User.findByUsername(springSecurityService.currentUser.username) + if (!n.hasErrors() && n.save()) { render(template: '/gTemplates/recordSummary', model: [ record: n, justSaved: true, justSaved: true]) @@ -3826,9 +3981,12 @@ def markAsMarkdowned(Long id, String entityCode) { record : n ]) - render 'Saved' +// render 'Saved' x + render(template: '/layouts/achtung', model: [message: 'Changes saved']) + + } else + render(template: '/layouts/achtung', model: [message: 'Problem occurred']) - } else render "Problem occurred." @@ -3928,6 +4086,7 @@ def markAsMarkdowned(Long id, String entityCode) { def types = [] def statuses = [] def topics = [] + def goals = [] def priorities = [] def sources = [] def departments = [] @@ -3946,6 +4105,7 @@ def markAsMarkdowned(Long id, String entityCode) { case 'mcs.Task': statuses = WorkStatus.list([sort: 'name']) locations = Location.list([sort: 'name']) + goals = Goal.findAllByBookmarked(true, [sort: 'name']) break case 'mcs.Goal': statuses = WorkStatus.list([sort: 'name']) @@ -3955,7 +4115,7 @@ def markAsMarkdowned(Long id, String entityCode) { case 'mcs.Planner': statuses = WorkStatus.list([sort: 'name']) types = PlannerType.list([sort: 'name']) - goals = Goal.list([sort: 'summary']) + goals = Goal.findAllByBookmarked(true, [sort: 'name']) break case 'app.Payment': @@ -3990,7 +4150,7 @@ def markAsMarkdowned(Long id, String entityCode) { updateRegion : params.updateRegion, entityController: entityController, savedRecord : n, - + goals: goals, types : types, statuses : statuses, topcis : topics, @@ -4013,7 +4173,7 @@ def markAsMarkdowned(Long id, String entityCode) { fields : n.class.declaredFields.name, record : n, savedRecord : n, - + goals : goals, types : types, statuses : statuses, topcis : topics, @@ -4025,9 +4185,9 @@ def markAsMarkdowned(Long id, String entityCode) { locations : locations, categories : categories ]) -// n.errors.each() { -// render it -// } + n.errors.each() { + render it + } } @@ -4041,16 +4201,16 @@ def markAsMarkdowned(Long id, String entityCode) { def filter = '%' - Writing.findAllBySummaryLike(filter, [sort: 'summary']).each() { - responce += [value: 'w ' + it.id + ' ' + it.summary] - } - Goal.findAllBySummaryLike(filter, [sort: 'summary']).each() { - responce += [value: 'g ' + it.id + ' ' + it.summary] - } - Task.findAllBySummaryLike(filter, [sort: 'summary']).each() { +// Writing.findAllBySummaryLike(filter, [sort: 'summary']).each() { +// responce += [value: 'w ' + it.id + ' ' + it.summary] +// } +// Goal.findAllBySummaryLike(filter, [sort: 'summary']).each() { +// responce += [value: 'g ' + it.id + ' ' + it.summary] +// } +// Task.findAllBySummaryLike(filter, [sort: 'summary']).each() { // responce += (it.summary + '|t' + '' + it.id + '\n') - responce += [value: 't ' + it.id + ' ' + it.summary] - } +// responce += [value: 't ' + it.id + ' ' + it.summary] +// } if (1 == 2 && input && input.contains(' ') && input.split(/[ ]+/).size() >= 2) { @@ -4093,7 +4253,9 @@ def markAsMarkdowned(Long id, String entityCode) { } - Book.findAllByStatus(ResourceStatus.get(1), [sort: 'title']).each() { // only textbooks + + + Book.findAll([sort: 'lastUpdated', order: 'desc', max: 100]).each() { responce += [id: it.id, value: 'r ' + it.id + ' ' + it.title, text: 'r ' + '' + it.id + '\n'] } // @@ -4104,21 +4266,30 @@ def markAsMarkdowned(Long id, String entityCode) { def r = new Relationship() + + /* + id: 11909 +entityCode: N +type: 1 +recordB: r 23451 الدين والأخلاق" بقلم العلامة الشيخ أحمد عارف الزين + + + */ // the child - r.entityA = entityMapping[params.entityCode] + r.entityA = params.entityCode r.entityACode = params.entityCode r.recordA = params.id.toLong() - def child = grailsApplication.classLoader.loadClass(r.entityA).get(r.recordA) + def child = grailsApplication.classLoader.loadClass(entityMapping[r.entityA]).get(r.recordA) // the parent def parentEntityCode = params.recordB.substring(0, 1).toUpperCase() - r.entityB = entityMapping[parentEntityCode] + r.entityB = parentEntityCode r.entityBCode = parentEntityCode r.recordB = params.recordB.split(' ')[1].toLong() - def parent = grailsApplication.classLoader.loadClass(r.entityB).get(r.recordB) + def parent = grailsApplication.classLoader.loadClass(entityMapping[r.entityB]).get(r.recordB) r.type = RelationshipType.get(params.type) @@ -4250,6 +4421,9 @@ def markAsMarkdowned(Long id, String entityCode) { record.description = description + + record.user = User.findByUsername(springSecurityService.currentUser.username) + if (!record.hasErrors() && record.save()) { render(template: '/gTemplates/recordSummary', model: [ record: record, justSaved: true]) @@ -4302,9 +4476,9 @@ def markAsMarkdowned(Long id, String entityCode) { record.description += ('\n' + params.text + ' (' + new Date().format('dd.MM.yyyy') + ')') // record.description += ('\n\n' + params.text) - render params.text - render '
' - render '
' +// render params.text +// render '
' +// render '
' render(template: '/gTemplates/recordSummary', model: [record: record]) //render(template: '/gTemplates/recordDetails', model: [record: record]) @@ -4824,7 +4998,7 @@ def markAsMarkdowned(Long id, String entityCode) { description = input.substring(input.indexOf('::') + 2).trim() properties[descriptionFieldName] = description if (entityCode == 'R') - queryCriteria.add("fullText like '%" + description + "%' or description like '%" + description + "%'") + queryCriteria.add("(fullText like '%" + description + "%' or description like '%" + description + "%')") else queryCriteria.add(descriptionFieldName + " like '%" + description + "%'") @@ -5195,10 +5369,10 @@ def addTagToAll(String input) { def savedSearch = SavedSearch.get(id) - if (params.reportType != 'tab') { - render(template: '/gTemplates/recordSummary', model: [record: savedSearch]) - render('
') - } +// if (params.reportType != 'tab') { +// render(template: '/gTemplates/recordSummary', model: [record: savedSearch]) +// render('
') +// } if (savedSearch.queryType == 'random' || params.reportType == 'random') { @@ -5274,11 +5448,14 @@ def addTagToAll(String input) { if (params.reportType == 'tab') { params.max = null - render(view: '/page/kanbanCrs', model: [groups: groups, groupBy: groupBy, + render(view: '/page/kanbanCrs', + model: [groups: groups, groupBy: groupBy, +// reportType: params.reportType, title : savedSearch.summary, ssId : savedSearch.id, items : Task.executeQuery(input, [])]) } else { + render(template: '/reports/genericGrouping', model: [groups: groups, groupBy: groupBy, title : savedSearch.summary, ssId : savedSearch.id, @@ -5311,6 +5488,7 @@ def addTagToAll(String input) { params.max = null render(view: '/page/kanbanCrs', model: [ ssId : id, +// reportType: params.reportType, searchResultsTotal: savedSearch.countQuery ? Task.executeQuery(savedSearch.countQuery)[0] : '', totalHits : savedSearch.countQuery ? Task.executeQuery(savedSearch.countQuery)[0] : '', list : Task.executeQuery(savedSearch.query, []), @@ -5324,7 +5502,8 @@ def addTagToAll(String input) { searchResultsTotal: savedSearch.countQuery ? Task.executeQuery(savedSearch.countQuery)[0] : '', totalHits : savedSearch.countQuery ? Task.executeQuery(savedSearch.countQuery)[0] : '', list : list, - title : savedSearch.summary + title : savedSearch.summary, + query: savedSearch.query ]) } } @@ -5338,12 +5517,14 @@ def addTagToAll(String input) { } else if (savedSearch.queryType == 'lucene') { render(template: '/gTemplates/recordListing', model: [ list : searchableService.search(savedSearch.query, [max: 100]), + query: savedSearch.query, title: savedSearch.summary + " (" + savedSearch.query + ")"]) } else if (savedSearch.queryType == 'adhoc') { render(template: '/reports/adHocQueryResults', model: [ list : mcs.Task.executeQuery(savedSearch.query), ssId : savedSearch.id, - title: '' + savedSearch.summary + " (" + savedSearch.query + ")" + title: '' + savedSearch.summary, + query: savedSearch.query ]) } else render(template: '/layouts/achtung', model: [message: 'Unknown query type']) @@ -5368,27 +5549,17 @@ def addTagToAll(String input) { def record = grailsApplication.classLoader.loadClass(entityMapping[params.entityCode]).get(params.id) // TODO: fix if (record.description) { - record.description = record.description?.replace(' وَ ', ' وَ')?.replaceAll(/\nوَ /, ' وَ') - .replaceAll(/\nوَ /, ' وَ') - .replaceAll(/^و /, ' و') - .replace(/^وَ /, '\n وَ').replace(' و ', ' و').replace('ی', 'ي').replace('ک', 'ك') + record.description = fixText(record.description) record.save(flush: true) render(record.description.replace('\n', '
')) } if (record.notes) { - record.notes = record.notes?.replace(' وَ ', ' وَ')?.replaceAll(/\nوَ /, ' وَ') - .replaceAll(/\nوَ /, ' وَ') - .replaceAll(/^و /, 'و') - .replaceAll(/\nو /, '\nو') - .replace(/^وَ /, '\n وَ').replace(' و ', ' و').replace('ی', 'ي').replace('ک', 'ك') + record.notes = fixText(record.notes) record.save(flush: true) render(record.notes.replace('\n', '
')) } if (record.class.declaredFields.name.contains('fullText') && record.fullText) { - record.fullText = record.fullText?.replace(' وَ ', ' وَ')?.replaceAll(/\nوَ /, ' وَ') - .replaceAll(/\nوَ /, ' وَ') - .replaceAll(/^و /, ' و') - .replace(/^وَ /, '\n وَ').replace(' و ', ' و').replace('ی', 'ي').replace('ک', 'ك') + record.fullText = fixText(record.fullText) record.save(flush: true) render(record.fullText.replace('\n', '
')) } @@ -5397,9 +5568,21 @@ def addTagToAll(String input) { } - def publish() { - def record = grailsApplication.classLoader.loadClass(entityMapping[params.entityCode]).get(params.id) + static long staticPublish(String entityCode, Long id) { + +// params.id = id +// params.entityCode = entityCode + +// publish() + + } + + def publish(String entityCode, Long id) { + + + + def record = grailsApplication.classLoader.loadClass(entityMapping[entityCode]).get(id) def tags = '' record.tags.each() { @@ -5415,7 +5598,7 @@ def addTagToAll(String input) { String summary, contents, type - switch (params.entityCode) { + switch (entityCode) { case 'W': summary = record.summary contents = //ys.wikiparser.WikiParser.renderXHTML(record.description)?.decodeHTML() (record.language == 'ar' ? ('
' + record.descriptionHTML + '
') : record.descriptionHTML) @@ -5432,20 +5615,57 @@ def addTagToAll(String input) { //record.description//?.encodeAsHTML() type = record.type?.name break + + case 'R': summary = record.title + contents = record.fullText//ys.wikiparser.WikiParser.renderXHTML(record.description)?.decodeHTML() + //record.description//?.encodeAsHTML() + type = record.type?.name + break } - // postToBlog(String blogId, String title, String categoriesString, String tags, String fullText) { - int r = supportService.postToBlog(record.blog.id, record.code ?: record.id?.toString(), summary, categories, tags, - contents, record.shortDescription, params.entityCode, record.publishedNodeId) + def coverPath + + if (new File(supportService.getResourcePath(record.id, entityCode, false) + '/cover.jpg').exists()){ + coverPath = supportService.getResourcePath(record.id, entityCode, false) + '/cover.jpg' + } + else coverPath = null + + + String[] files = [] + + if (new File(supportService.getResourcePath(record.id, entityCode, false)).exists()) { + new File(supportService.getResourcePath(record.id, entityCode, false)).listFiles().each() { + if (it.name != 'cover.jpg' && it.isFile()) { + files += it.name + } + } + } +// else +// files = null + + // int postToBlog(Long blogId, String code, String title, String categoriesString, String tags, String fullText, + // String excerpt, String entityCode, Integer publishedNodeId) { + if (!record.blog) + record.blog = Blog.findByBookmarked(true) + + + int r = supportService.postToBlog(record.blog ? record.blog.id : null, record.code ?: record.id?.toString(), summary, categories, tags, + contents, + // record.shortDescription, + record.description, + entityCode, record.publishedNodeId, coverPath, + files, "https://jabal-amel.khuta.org/wp-content/uploads" + ) if (r) { record.publishedNodeId = r record.publishedOn = new Date() - record.status = WritingStatus.findByCode('pub') +// record.status = WritingStatus.findByCode('pub') record.save(flush: true) render 'Published with id : ' + r //+ ' class ' + r.class render(template: '/layouts/achtung', model: [message: "Record published with id " + r]) + return r } else "Problem posting the record" } @@ -5916,6 +6136,7 @@ def addTagToAll(String input) { //println 'here 555' + String pdfPath = params.path if (params.module == 'E') @@ -5933,13 +6154,18 @@ def addTagToAll(String input) { try { // will output "my_image_2.jpg" + + new File( getRecordPaths(params.module, params.id.toLong())[0]).mkdirs() + PDFToImage.main(args_2); def ant = new AntBuilder() ant.move(file: args_2[5] + '1.jpg', tofile: (args_2[5] + '')) + render 'Cover generated to ' + args_2[5] } catch (Exception e) { e.printStackTrace() + render 'Problem generating the cover ' + e.toString() } } @@ -6029,6 +6255,11 @@ def addTagToAll(String input) { def viewRecordImage() { + params.entityCode = params.entityCode ?: 'R' + if (params.id.contains('.')) + params.id = params.id?.split('.')[0] + + def paths = getRecordPaths(params.entityCode, params.id.toLong()) def f paths.each(){ @@ -6395,4 +6626,77 @@ def body render "All operations have been marked as settled" } + String fixText(String text){ + return text?.replace(' وَ ', ' وَ')?.replaceAll(/\nوَ /, ' وَ') + .replaceAll(/\nوَ /, ' وَ') + .replaceAll(/ـ/, '') + .replaceAll(/[ ]+/, / /) + .replaceAll(/^[ ]+/, '') + .replace(' ,', ',') + .replace(' :', ':') + .replace(' ،', '،') + .replace(' .', '.') + .replaceAll(/^و /, ' و') + .replace(/^وَ /, '\n وَ').replace(' و ', ' و').replace('ی', 'ي').replace('ک', 'ك') + } + + + def generateWritingsBookToFile() { + + def siteRecords = [] + def ant = new AntBuilder() + def coverPath + + for (h in app.IndexCard.executeQuery('from IndexCard where course = ? and priority >= ?', [Course.get(params.id), 2])) { + + siteRecords.push([entity: 'N', id: h.id]) + + if (h.tags) + for (t in h.tags?.sort() { i, j -> i.name.toLowerCase().compareTo(j.name.toLowerCase()) }) { + +// t.bookmarked = true +// t.save(flush: true) + + for (r in mcs.Book.createCriteria().list() { tags { idEq(t.id.toLong()) } }) { + siteRecords.push([entity: 'R', id: r.id]) + + + def f = new File('/home/maitham/sites/jabal-amel/posts/' + r.id + '.html') + f.write(g.include([controller: 'page', action: 'staticPage', id: r.id]).toString(), 'UTF-8') + +// coverPath = supportService.getResourcePath(r.id, 'R', false) + '/cover.jpg' +// if (new File(coverPath).exists()) +// ant.copy(file: coverPath, +// tofile: '/home/maitham/sites/jabal-amel/covers' + '/' + r.id + '.jpg') + + def recordPath = supportService.getResourcePath(r.id, 'R', false) + + // publish('R', r.id) + + if (new File(recordPath).exists()) { + new File(recordPath).listFiles().each() { + if (it.name != 'cover.jpg' && it.isFile()) { + ant.copy(file: it.path, + tofile: '/home/maitham/sites/jabal-amel/files' + '/' + r.id + '/' + it.name) + } + } + + } + } + } + } + + println 'Site records: ' + siteRecords.size() + +// ' + (OperationController.getPath('root.rps1.path') ?: '') + def sitePath = '/home/maitham/sites/jabal-amel/' + 'index' + '.html' + def f = new File(sitePath) + f.write(g.include([controller: 'indexCard', action: 'generateWritingsBook', id: params.id]).toString(), 'UTF-8') + render 'Generation done: ' + new Date().format('HH:mm:ss') + '. Site saved to: ' + sitePath + + + + + + } } diff --git a/grails-app/controllers/ker/ImportController.groovy b/grails-app/controllers/ker/ImportController.groovy index 1212796..02aa518 100755 --- a/grails-app/controllers/ker/ImportController.groovy +++ b/grails-app/controllers/ker/ImportController.groovy @@ -36,12 +36,15 @@ import grails.plugin.springsecurity.annotation.Secured import com.gravity.goose.Article import com.gravity.goose.Configuration import com.gravity.goose.Goose +import security.User @Secured(['ROLE_ADMIN','ROLE_READER']) class ImportController { def supportService + def springSecurityService + static entityMapping = [ 'G': 'mcs.Goal', @@ -199,8 +202,15 @@ class ImportController { } else { b = grailsApplication.classLoader.loadClass(entityMapping[entityCode.toUpperCase()]).newInstance() b.summary = title - finalName = entityCode.toLowerCase() + '.' + ext +// if (ext == 'jpg') { +// finalName = 'cover' + '.' + ext +// } +// else { +// finalName = b.id + entityCode.toLowerCase() + '.' + ext +// } + +// finalName = entityCode.toLowerCase() + '.' + ext } @@ -214,7 +224,9 @@ class ImportController { // println 'text is ' + folder.text //b.description = 'Imported on ' + new Date().format(OperationController.getPath('date.format') ?: 'dd.MM.yyyy') - } else { + } + + else { b = grailsApplication.classLoader.loadClass(entityMapping[entityCode.toUpperCase()]).newInstance() b.properties = GenericsController.transformMcsNotation(title)['properties'] @@ -224,9 +236,10 @@ class ImportController { } - finalName = entityCode.toLowerCase() + '.' + ext + } + if (ext == 'txt') { if (entityCode.toLowerCase() == 'r') b.fullText = folder.text @@ -236,8 +249,23 @@ class ImportController { //b.notes = 'Imported on ' + new Date().format(OperationController.getPath('date.format') ?: 'dd.MM.yyyy') + + b.user = User.findByUsername(springSecurityService.currentUser.username) +// println ' imported file from ' + User.findByUsername(springSecurityService.currentUser.username) + + + if (!b.hasErrors() && b.save(flush: true)) { + + if (ext == 'jpg') { + finalName = 'cover' + '.' + ext + } + else { + finalName = b.id + entityCode.toLowerCase() + '.' + ext + } + + render(template: '/gTemplates/recordSummary', model: [record: b]) def ant = new AntBuilder() if (entityCode == 'R') { @@ -249,11 +277,11 @@ class ImportController { ant.move(file: path, tofile: rootPath + '/' + entityCode + (resourceNestedByType ? '/' + type.code : '') + (resourceNestedById ? '/' + (b.id / 100).toInteger() : '') + - '/' + b.id + '/' + b.id + '' + finalName) + '/' + b.id + '/' + finalName) } else //ant.move(file: path, tofile: OperationController.getPath('module.sandbox.' + entityCode + '.path') + '/' + b.id + '' + finalName) // inline move 22.10.2016 - ant.move(file: path, tofile: rootPath + '/' + entityCode + '/' + b.id + '/' + b.id + finalName) + ant.move(file: path, tofile: rootPath + '/' + entityCode + '/' + b.id + '/' + finalName) } else { b.errors.each() { @@ -311,7 +339,8 @@ class ImportController { if (OperationController.getPath('resourceNestedByType') == 'yes') resourceNestedByType = true - + b.user = User.findByUsername(springSecurityService.currentUser.username) + println ' imported folder from ' + User.findByUsername(springSecurityService.currentUser.username) if (!b.hasErrors() && b.save(flush: true)) { diff --git a/grails-app/controllers/ker/OperationController.groovy b/grails-app/controllers/ker/OperationController.groovy index 3d6759b..1591581 100755 --- a/grails-app/controllers/ker/OperationController.groovy +++ b/grails-app/controllers/ker/OperationController.groovy @@ -27,8 +27,11 @@ import groovy.io.FileType import mcs.* import mcs.parameters.* import grails.plugin.springsecurity.annotation.Secured +import org.apache.commons.lang.StringUtils import org.apache.pdfbox.PDFToImage +import security.User +import java.nio.file.* @Secured(['ROLE_ADMIN','ROLE_READER']) class OperationController { @@ -57,8 +60,13 @@ class OperationController { 'Y': 'cmn.Setting', 'X': 'mcs.parameters.SavedSearch' ] + + def supportService def searchableService + + def springSecurityService + private java.lang.Object object def actions() { @@ -777,6 +785,11 @@ class OperationController { return Setting.findByName(code)?.value?.replace(/[appFolder]/, '.') } + static def setPath(String code, String newValue) { + + return Setting.findByName(code)?.value = newValue + } + def generateBibEntry(Long id) { render OperationController.generateBibEntrySt(id) @@ -1096,7 +1109,7 @@ date = "${r.year ?: ''}" if (field == 'blog') { Blog.findAll([sort: 'code']).each() { responce += [value: it.id, - text : it.code] + text : it.summary] } } else if (field == 'pomegranate') { Pomegranate.findAll([sort: 'code']).each() { @@ -1121,12 +1134,12 @@ date = "${r.year ?: ''}" n.department) } else { - courses = Course.executeQuery('from Course c order by c.summary asc') + courses = Course.executeQuery('from Course c order by c.code asc, c.summary asc') } courses.each() { responce += [value: it.id, - text : '[' + it.code + '] ' + it.summary] + text : '' + it.code + ' - ' + it.summary] } // } else // responce += [value: 0, @@ -1466,6 +1479,7 @@ date = "${r.year ?: ''}" def rps1Folder def rps2Folder + def rps2Folder2 // legacy case if (params.entityCode == 'R') { rps1Folder = OperationController.getPath('root.rps1.path') + '/R' + @@ -1478,6 +1492,12 @@ date = "${r.year ?: ''}" (resourceNestedByType ? '/' + b.type.code : '') + (resourceNestedById ? '/' + (params.id.toLong()/ 100).toInteger() : '') + '/' + params.id + rps2Folder2 = + OperationController.getPath('root.rps2.path') + '/R' + + (resourceNestedByType ? '/' + b.type.code : '') + + (resourceNestedById ? '/' + (params.id.toLong()/ 100).toInteger() : '') + //+ + // '/' + params.id } else { rps1Folder = OperationController.getPath('root.rps1.path') + '/' + params.entityCode + '/' + params.id rps2Folder = OperationController.getPath('root.rps2.path') + '/' + params.entityCode + '/' + params.id @@ -1491,6 +1511,13 @@ date = "${r.year ?: ''}" } } + + if (rps2Folder2 && new File(rps2Folder2).exists()) { + new File(rps2Folder2).eachFileMatch(~/${params.id}[\S\s]*\.[\S\s]*/) { + filesList.add(it) + } + } + def ant = new AntBuilder() filesList.each() { f -> @@ -1693,7 +1720,7 @@ date = "${r.year ?: ''}" if (new File(folder[0]).exists()) { new File(folder[0]).eachFileMatch(~/${b.id}[a-z][\S\s]*\.[\S\s]*/) { filesCount++ - filesList += it.name// + '\n' + filesList += it.name + '|' + it.size()// + '\n' } } } @@ -1708,13 +1735,13 @@ date = "${r.year ?: ''}" folders.each() { folder -> // println 'fld ' + folder + ' class ' + folder.class if (new File(folder[0]).exists()) { - new File(folder[0]).eachFileRecurse() { + new File(folder[0]).eachFile() { //Recurse //Match(~/[\S\s]*\.[\S\s]*/) { //ToDo: only files with extensions! - if (!it.isFile()) - filesList += '*** ' + it.name - else { + if (it.isFile()){ +// filesList += '*** ' + it.name +// else { filesCount++ - filesList += it.name + filesList += it.name + '|' + it.size() } } } @@ -1760,17 +1787,15 @@ switch (entityCode){ if (!b.bookmarked) folders.add([typeRepositoryPath + '/' + (b.id)]) - - folders.each() { folder -> if (new File(folder[0]).exists()) { - new File(folder[0]).eachFileRecurse() { + new File(folder[0]).eachFile() { //Recurse //Match(~/[\S\s]*\.[\S\s]*/) { //ToDo: only files with extensions! - if (!it.isFile()) - filesList += '*** ' + it.name - else { + if (it.isFile()) { +// filesList += '*** ' + it.name +// else { filesCount++ - filesList += it.name + filesList += it.name + '|' + it.size() } } } @@ -1976,7 +2001,7 @@ past.each(){ // j.level = 'd' // else j.level = 'm' - j.bookmarked = true + // j.bookmarked = true if (params.task && params.task != 'null') j.task = Task.get(params.task.toLong()) @@ -2002,6 +2027,8 @@ past.each(){ // if (j.level == 'd') // j.endDate = null + j.user = User.findByUsername(springSecurityService.currentUser.username) + if (!j.hasErrors()) { j.save(flash: true) // render 'Saved with id: ' + ' ' + j.id + ': ' + j.summary @@ -2067,15 +2094,15 @@ past.each(){ n.wbsNumber = j+1 // sub++ n.save(flush: true) - // println 'found a child with id ' + n.id // + +'.' + (sub++) + '\n' + println 'found a child with id ' + n.id +'.' + (sub++) + ' ' + n.summary + '\n' } else { -// sub = 1 + sub = 1 n.wbsParent = null n.orderNumber = roots n.wbsNumber = roots n.save(flush: true) roots++ - // println 'found a root with id ' + n.orderNumber// + +'.' + (sub++) + '\n' + println 'found a root with id ' + n.orderNumber + '.' + (sub++) + n.summary + '\n' } } @@ -2104,7 +2131,7 @@ past.each(){ def dumpAllWritings(){ - Writing.list().each() { + Writing.executeQuery('from Writing where type.code != ?', ['surah']).each() { dumpRecordForImport(it.id, 'W') } @@ -2395,5 +2422,121 @@ margin: 5px 2px; + def makeSymbolicLink() { + + try { + def record = grailsApplication.classLoader.loadClass(entityMapping[params.entityCode]).get(params.id) + + // def relativePath = supportService.getResourcePath(record.id, params.entityCode, true) + def fullPath = supportService.getResourcePath(record.id, params.entityCode, false) + + def name = params.entityCode == 'R' ? record.title : record.summary + + def target = OperationController.getPath('root.rps1.path') + '/new/' + '/' + name + + // render 'target ' + target + '
' + // render 'source ' + fullPath + '
' +// render ' count is ' + Files.list(Paths.get(fullPath)).count() + '
' + + // Files.createDirectories(Paths.get(target).getParent()) + Files.createDirectories(Paths.get(fullPath)) + if (java.nio.file.Files.createSymbolicLink(Paths.get(target), Paths.get(fullPath))) +// render '' + render(template: '/layouts/achtung', model: [message: 'Link created on ' + OperationController.getPath('root.rps1.path') + '/new/']) + else + render(template: '/layouts/achtung', model: [message: 'Problem creating the link']) + + } catch (Exception e){ + render(template: '/layouts/achtung', model: [message: 'Problem creating the link ' + e]) + e.printStackTrace() + } + + + } + + + + def rescheduleEvent = { + + def m + + def scheduledStart = Date.parse('dd.MM.yyyy HH:mm', params.newStartTime) + def scheduledEnd = new Date(scheduledStart.time + 30 * 60 * 1000) + + switch(params.entityCode){ + + case 'J': + m = Journal.get(params.title) + break +case 'P': + m = Planner.get(params.title) + break +case 'T': + m = Task.get(params.title) + break + + } + + + m.startDate = scheduledStart + m.endDate = scheduledEnd + + + // scheduledStart + 600// +// println 's e:: ' + scheduledStart + ' -> ' + scheduledEnd + + + + render(template: '/layouts/achtung', model: [message: 'Plan rescheduled']) +// if (keepProcessing && scheduledStart.minutes == 45) { + + + } + def resizeEvent = { + +// println "id: = " + params.title + def m = Planner.get(params.title) + +// def scheduledStart = Date.parse('dd.MM.yyyy HH:mm', params.end) + def scheduledEnd = Date.parse('dd.MM.yyyy HH:mm', params.end) //new Date(scheduledStart.time + 30 * 60 * 1000) + // scheduledStart + 600// +// println 's e:: ' + scheduledStart + ' -> ' + scheduledEnd + +// m.startDate = scheduledStart + m.endDate = scheduledEnd + - } // end of class \ No newline at end of file + render(template: '/layouts/achtung', model: [message: 'Plan resized']) +// if (keepProcessing && scheduledStart.minutes == 45) { + + + } + + + def createUser() { // todo + def username = params.username?.trim() + def standardRole = security.Role.findByAuthority('ROLE_READER') +// println ' is it ' + standardRole + def standardUser = new security.User(username: username, password: username).save() + security.UserRole.create(standardUser, standardRole, true) + + render 'User created with username ' + username + ' and password ' + username + + } + + def toggleMetadataLine(){ + + if (OperationController.getPath('metadataLine.hidden') == 'yes'){ + + Setting.findByName('metadataLine.hidden').value = 'no' + + render 'Metadata line visible. Refresh view to take effect.' + } + else { + Setting.findByName('metadataLine.hidden').value = 'yes' + + render 'Metadata line hidden. Refresh view to take effect.' + } + + } +} // end of class \ No newline at end of file diff --git a/grails-app/controllers/ker/PageController.groovy b/grails-app/controllers/ker/PageController.groovy index bdca5cc..853a331 100755 --- a/grails-app/controllers/ker/PageController.groovy +++ b/grails-app/controllers/ker/PageController.groovy @@ -54,6 +54,9 @@ import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension; import com.vladsch.flexmark.parser.Parser; import com.vladsch.flexmark.util.data.MutableDataSet; + +import java.time.format.DateTimeFormatter + //import java.io.StringWriter; //import org.eclipse.mylyn.wikitext.core.parser.MarkupParser; //import org.eclipse.mylyn.wikitext.core.parser.builder.HtmlDocumentBuilder; @@ -122,6 +125,7 @@ class PageController { def appMain() { + // // ['IPs.show', 'add-import-panel.enabled', 'advanced-panel.enabled', 'calendar.enabled', 'commandbar.enabled', 'copyright.show', 'course.enabled', 'extra-panes.enabled', 'notes.enabled', 'open-record-folders.enabled', 'quick-add-form.enabled', 'review.enabled', 'rss.enabled', 'scans.enabled', 'selection-actions.enabled', 'tasks.enabled', 'today-report.enabled', // 'convert-records.enabled', @@ -132,7 +136,7 @@ class PageController { // } - def types = [] + def types = [ [id: 'C', name: 'Course', code: 'courses']] [ [id: 'T', name: 'Task', code: 'tasks'], @@ -141,6 +145,7 @@ class PageController { [id: 'W', name: 'Writing', code: 'writings'], [id: 'J', name: 'Journal', code: 'journal'], // [id: 'Jt', name: 'Yesterday journal', code: 'journal'], + [id: 'P', name: 'Planner', code: 'planner'], [id: 'R', name: 'Resource', code: 'resources'] ].each(){ if (OperationController.getPath(it.code + '.enabled') == 'yes') @@ -288,7 +293,8 @@ class PageController { ["updateResultSet.max-items","100"], ["upload-cover.enabled","no"], ["upload-files.enabled","yes"], - ["writings.enabled","no"] + ["writings.enabled","no"], + ["metadataLine.hidden","no"] ].each() { new cmn.Setting([name: it[0], value: it[1]]).save(flush: true) } @@ -312,10 +318,12 @@ class PageController { // } def recentRecords = [] - recentClasses.each() { + + if (1 == 2) { + recentClasses.each() { // recentRecords += it.findAllByDateCreatedGreaterThanAndDeletedOnIsNull(new Date() - 2, [sort: 'dateCreated', order: 'desc', max: 1])?.reverse() - recentRecords += it.findAll([sort: 'dateCreated', order: 'desc', max: 1])?.reverse() - } + recentRecords += it.findAll([sort: 'dateCreated', order: 'desc', max: 1])?.reverse() + } // def filledInDates = '' // Journal.executeQuery("select DATE_FORMAT(startDate, '%c/%e/%Y') from Journal group by date(startDate) order by startDate asc").each() { @@ -323,18 +331,18 @@ class PageController { // } // session['log'] = 1 - session['J'] = 1 - session['P'] = 1 + session['J'] = 1 + session['P'] = 1 - session['showLine1Only'] = 'on' - session['showFullCard'] = 'off' + session['showLine1Only'] = 'on' + session['showFullCard'] = 'off' // MarkupParser markupParser = new MarkupParser(); // markupParser.setMarkupLanguage(new MarkdownLanguage()); // String htmlContent = markupParser.parseToHtml(text); - def r = '' - // def c = 0 + def r = '' + // def c = 0 // def f = ker.OperationController.getPath('editBox.path') // if (f) { // new File(f)?.listFiles().each(){ @@ -345,26 +353,26 @@ class PageController { // } // } - def resources = - Book.executeQuery('from Book r where r.course.bookmarked = ? ' + + def resources = + Book.executeQuery('from Book r where r.course.bookmarked = ? ' + // in ' + // '(select course from Planner p where p.startDate < current_date and p.endDate > current_date and p.course is not null)' + - ' and r.priority >= ? and r.readOn is not null' + - ' and (r.lastReviewed < ? or r.lastReviewed is null) and r.reviewCount < ?' + - ' order by r.orderNumber asc, r.reviewCount asc', - [true, 3, new Date() + 7, 5]) - def excerpts = - Book.executeQuery('from Excerpt r where r.book.course.bookmarked = ? ' + + ' and r.priority >= ? and r.readOn is not null' + + ' and (r.lastReviewed < ? or r.lastReviewed is null) and r.reviewCount < ?' + + ' order by r.orderNumber asc, r.reviewCount asc', + [true, 3, new Date() + 7, 5]) + def excerpts = + Book.executeQuery('from Excerpt r where r.book.course.bookmarked = ? ' + // ' in' + // ' (select course from Planner p where p.startDate < current_date and p.endDate > current_date and p.course is not null)' + - ' and r.priority >= ? and r.readOn is not null' + - ' and (r.lastReviewed < ? or r.lastReviewed is null) and r.reviewCount < ?' + - ' order by r.orderNumber asc, r.reviewCount asc', - [true, 3, new Date() + 7, 5]) + ' and r.priority >= ? and r.readOn is not null' + + ' and (r.lastReviewed < ? or r.lastReviewed is null) and r.reviewCount < ?' + + ' order by r.orderNumber asc, r.reviewCount asc', + [true, 3, new Date() + 7, 5]) // println 'r ' + resources // println 'e ' + excerpts - + } def ips = [] def ip def interf @@ -392,7 +400,7 @@ class PageController { // [mcs.Book, 'Resource'], [mcs.Planner, 'Plan'], [mcs.Journal, 'Journal'], [app.IndexCard, 'Note']]) { - for (t in c[0].findAllByDateCreatedGreaterThan(new Date() - 90, [sort: 'dateCreated', order: 'asc'])) { + for (t in c[0].findAllByDateCreatedGreaterThan(new Date() - 14, [sort: 'dateCreated', order: 'asc'])) { def date = t.dateCreated.format('yyyy-MM-dd') if (!datesHb[date]) datesHb[date] = ['Goal' : 0, @@ -415,8 +423,10 @@ class PageController { def user = springSecurityService.currentUser + + // def rpsSize = '/home/maitham/job/rps1/bin/rps0size.sh'.execute().text - render(view: '/appMain/main', model: [ + render(view: '/appMain/main2', model: [ htmlContent : null, ips : ips, // rpsSize : rpsSize, @@ -424,7 +434,7 @@ class PageController { editFileCount : 0, // todo: fix dates: datesHb, username : user.username, - reviewPileSize : resources.size() + excerpts.size(), +// reviewPileSize : resources.size() + excerpts.size(), types: types, tasksActiveNotStarted: tasksActiveNotStarted, // environment: environment @@ -445,13 +455,16 @@ class PageController { def types = [] [ + [id: 'N', name: 'Note', code: 'notes'], + [id: 'W', name: 'Writing', code: 'writings'], + [id: 'T', name: 'Task', code: 'tasks'], [id: 'P', name: 'Plan', code: 'plans'], [id: 'G', name: 'Goal', code: 'goals'], - [id: 'N', name: 'Note', code: 'notes'], - [id: 'W', name: 'Writing', code: 'writings'], + [id: 'J', name: 'Journal', code: 'journal'], // [id: 'Jt', name: 'Yesterday journal', code: 'journal'], + [id: 'P', name: 'Planner', code: 'planner'], [id: 'R', name: 'Resource', code: 'resources'] ].each(){ if (OperationController.getPath(it.code + '.enabled') == 'yes') @@ -511,7 +524,13 @@ class PageController { ]) } def appPile() { - render(view: '/appPile/main', model: [ ]) + + + response.setHeader("Access-Control-Allow-Origin", "*") + response.setHeader("Access-Control-Allow-Methods", "*") + + render(view: '/appPile/main', model: [ ]) + } def appKanban() { @@ -570,6 +589,7 @@ def appPile() { [id: 'W', name: 'Writing', code: 'writings'], [id: 'J', name: 'Journal', code: 'journal'], // [id: 'Jt', name: 'Yesterday journal', code: 'journal'], + [id: 'P', name: 'Planner', code: 'planner'], [id: 'R', name: 'Resource', code: 'resources'] ].each() { if (OperationController.getPath(it.code + '.enabled') == 'yes') @@ -665,6 +685,9 @@ def appPile() { max = app.IndexCard.executeQuery('select count(*) from IndexCard i where i.priority >= ? and i.type.code = ? and length(i.summary) > 80 and length(i.summary) < 800', [4, 'aya'])[0].toInteger() + + + def overdue = supportService.getOverdueTasks() def pile = supportService.getTasksPile() def todayInProgress = supportService.getTasksTodayInProgress() @@ -676,7 +699,7 @@ def appPile() { render(view: '/appCalendar/main', model: [ - prayersText: prayersText, + prayersText: prayersTimes(), random: Math.floor(Math.random() * max), overdue: overdue, pile: pile, @@ -684,6 +707,7 @@ def appPile() { courses: mcs.Course.findAllByBookmarked(true), completed: todayCompleted, notStarted: todayNotStarted + ]) } def appMobileCalendar() { @@ -699,8 +723,15 @@ def appPile() { def record() { def record = grailsApplication.classLoader.loadClass(entityMapping[params.entityCode]).get(params.id) if (record) - render(view: '/page/record', model: [record:record - ]) + render(view: '/page/record', model: [record:record]) + else render 'Record not found.' + } + + def staticPage() { + params.entityCode = params.entityCode ?: 'R' + def record = grailsApplication.classLoader.loadClass(entityMapping[params.entityCode]).get(params.id) + if (record) + render(view: '/page/staticPage', model: [record: record]) else render 'Record not found.' } def rssPage() { @@ -711,8 +742,14 @@ def appPile() { } def panel() { + + response.setHeader("Access-Control-Allow-Origin", "*") + response.setHeader("Access-Control-Allow-Methods", "*") + def record = grailsApplication.classLoader.loadClass(entityMapping[params.entityCode]).get(params.id) +// supportService.updateBookmarkedRecordsFileCount() + def typeSandboxPath def resourceNestedById = false @@ -777,8 +814,11 @@ def coverPath def htmlText = '' +// record.entityCode() == 'N' && + if ('NRW'.contains(record.entityCode()) && record.description) { + + - if (record.entityCode() == 'N' && record.description) { MutableDataSet options = new MutableDataSet(); options.setFrom(ParserEmulationProfile.MARKDOWN); @@ -796,7 +836,8 @@ def htmlText = '' HtmlRenderer renderer = HtmlRenderer.builder(options).build(); // You can re-use parser and renderer instances - Node document = parser.parse(record.description?.replaceAll('\n', '\n
\n')); + def reposFilesUrl = ker.OperationController.getPath('repository.url') + Node document = parser.parse(record.description?.replaceAll('\n', '\n
\n').replace('](', '](' + reposFilesUrl + '/W/' + record.id + '/')); String html = renderer.render(document); // "

This is Sparta

\n" record.descriptionHTML = html//?.replaceAll('\n', '
\n')?.replaceAll('
', '
\n') // println 'html ' + html @@ -1090,11 +1131,18 @@ YellowGreen;#9ACD32""" } + + def appIrfan() { + render(view: '/appIrfan/main', model: []) + + } + def settingsMain() { render(template: '/page/settings', model: [full: false]) } + def settingsFull() { render(template: '/page/settings', model: [full: true]) @@ -1115,6 +1163,8 @@ YellowGreen;#9ACD32""" result = "ok" } + response.setHeader("Access-Control-Allow-Origin", "*") + response.setHeader("Access-Control-Allow-Methods", "*") render(status: 200, contentType: 'application/json', text: json) } @@ -1153,4 +1203,48 @@ YellowGreen;#9ACD32""" } + String prayersTimes(){ + + double latitude = 33.8933182; + double longitude = 35.5015717; + double timezone = ker.OperationController.getPath('prayers.timezone') ?ker.OperationController.getPath('prayers.timezone').toInteger(): 3 ; + // Test Prayer times here + PrayTime prayers = new newpackage.PrayTime(); + + prayers.setTimeFormat(prayers.Time12NS); + prayers.setCalcMethod(prayers.Jafari); + prayers.setAsrJuristic(prayers.Shafii); + prayers.setAdjustHighLats(prayers.AngleBased); + int[] offsets = [0, 1, 0, 0, 0, 3, 5]; // {Fajr,Sunrise,Dhuhr,Asr,Sunset,Maghrib,Isha} + prayers.tune(offsets); + + Date now = new Date(); + Calendar cal = Calendar.getInstance(); + cal.setTime(now); + + ArrayList prayerTimes = prayers.getPrayerTimes(cal, + latitude, longitude, timezone); + ArrayList prayerNames = prayers.getTimeNames(); + + def prayersText = '' +// for (int i = 0; i < prayerTimes.size(); i++) { + prayersText += (prayerNames.get(0) + ": " + prayerTimes.get(0) + '\n') + prayersText += (prayerNames.get(1) + ": " + prayerTimes.get(1) + '\n') + prayersText += (prayerNames.get(2) + ": " + prayerTimes.get(2) + '\n') + prayersText += (prayerNames.get(3) + ": " + prayerTimes.get(3) + '\n') + prayersText += (prayerNames.get(4) + ": " + prayerTimes.get(4) + '\n') + prayersText += (prayerNames.get(5) + ": " + prayerTimes.get(5) + '\n') +// prayersText += (prayerNames.get(6) + ": " + prayerTimes.get(6) + '\n') +// } + + + return prayersText + + } + + + def tasksTable (){ + render(view: '/reports/taskTable', model: []) + + } } // end of class \ No newline at end of file diff --git a/grails-app/controllers/ker/ReportController.groovy b/grails-app/controllers/ker/ReportController.groovy old mode 100644 new mode 100755 index a5ddcc1..7d8cec5 --- a/grails-app/controllers/ker/ReportController.groovy +++ b/grails-app/controllers/ker/ReportController.groovy @@ -28,7 +28,6 @@ import mcs.Planner import mcs.Writing import mcs.parameters.ResourceStatus - import com.intuit.fuzzymatcher.component.MatchService; import com.intuit.fuzzymatcher.domain.Document; import com.intuit.fuzzymatcher.domain.Element; @@ -40,7 +39,10 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import grails.converters.JSON +import grails.web.JSONBuilder +import com.ibm.icu.text.Transliterator; import grails.plugin.springsecurity.annotation.Secured @@ -258,6 +260,32 @@ def enterJournalWithType() { } + def updateIps() { + + def ips = [] + def ip + def interf + + def interfaces = NetworkInterface.getNetworkInterfaces() + + while (interfaces.hasMoreElements()) { + + interf = interfaces.nextElement() + def addresses = interf.getInetAddresses() + + while (addresses.hasMoreElements()) { + ip = addresses.nextElement().getHostAddress().toString() + if (ip && ip != '' && !ip.contains(':') && !ip.startsWith('127')) + ips.add([name: interf.getName(), title: interf.getDisplayName(), ip: ip]) //?.split(/\(/)[0] +// println (addresses.nextElement().getCanonicalHostName()) +// println (addresses.nextElement().hostAddress) + } + } + + + render(template: '/reports/ips', model: [ips: ips]) + } + def tagCloud() { Tag.list().each() { t -> @@ -344,27 +372,18 @@ def enterJournalWithType() { // journals: Journal.findAll('from Journal where date(startDate) >= ? and date(endDate) <= ?', [startDate, endDate]), // startDate: startDate, endDate: endDate]) // - def title = 'Activity log and agenda for: ' + + def title = // 'Activity log and agenda for: ' + (startDate.format('dd.MM.yyyy') == endDate.format('dd.MM.yyyy') ? startDate.format('EE dd.MM.yyyy') : - startDate.format('EE dd.MM.yyyy') + ' - ' + endDate.format('EE dd.MM.yyyy')) + '' - if (session['Kanban'] == 1) - render(template: '/reports/kanbanCalendar', model: [startDate: startDate, endDate: endDate]) - if (session['P'] == 1) - render(template: '/reports/pCalendar', model: [startDate: startDate, endDate: endDate]) - if (session['J'] == 1) - render(template: '/reports/jCalendar', model: [startDate: startDate, endDate: endDate]) - - if (session['Jtrk'] == 1) - render(template: '/reports/jtrkReport', model: [startDate: startDate, endDate: endDate]) + startDate.format('EE dd.MM.yyyy') + ' - ' + endDate.format('EE dd.MM.yyyy')) + '' - if (session['Qtrans'] == 1) - render(template: '/reports/financialReportTrans', model: [startDate: startDate, endDate: endDate]) - if (session['Qacc'] == 1) - render(template: '/reports/financialReportAcc', model: [startDate: startDate, endDate: endDate]) + def list = [] + for (c in [ + mcs.Goal, mcs.Task]) { + list += c.executeQuery(' from ' + c.name + ' where endDate between ? and ? ', [startDate, endDate]) + } if (session['log'] == 1) { - def list = [] for (c in [ mcs.Goal, mcs.Task, mcs.Planner, mcs.Journal, mcs.Writing, app.IndexCard, mcs.Book]) { @@ -379,10 +398,32 @@ def enterJournalWithType() { app.Payment, app.IndicatorData]) { list += c.executeQuery(' from ' + c.name + ' where date between ? and ? ', [startDate, endDate]) } + } + + render(template: '/gTemplates/recordListing', model: [list: list, title: title]) + + +// if (session['Kanban'] == 1) + render(template: '/reports/kanbanCalendar', model: [startDate: startDate, endDate: endDate]) +// if (session['P'] == 1) + render(template: '/reports/pCalendar', model: [startDate: startDate, endDate: endDate]) +// if (session['J'] == 1) + render(template: '/reports/jCalendar', model: [startDate: startDate, endDate: endDate]) - render(template: '/gTemplates/recordListing', model: [list: list, title: title]) +// if (session['Jtrk'] == 1) + render(template: '/reports/jtrkReport', model: [startDate: startDate, endDate: endDate]) + +// if (session['Qtrans'] == 1) + if (ker.OperationController.getPath('payments.enabled')?.toLowerCase() == 'yes') { + render(template: '/reports/financialReportTrans', model: [startDate: startDate, endDate: endDate]) + +// if (session['Qacc'] == 1) + + render(template: '/reports/financialReportAcc', model: [startDate: startDate, endDate: endDate]) } + + // Planner.executeQuery('from Planner where (date(dateCreated) >= ? and date(dateCreated) <= ?) or (date(startDate) >= ? and date(startDate) <= ?) order by dateCreated desc', [startDate, endDate, startDate, endDate]) + // // @@ -600,17 +641,47 @@ def enterJournalWithType() { } + def duplicateCandidates(){ + + + def results = [] + Goal.list([sort: 'id', order: 'desc']).each(){a-> + Goal.findAllByIdLessThan(a.id, [sort: 'id', order: 'desc']).each() { b -> + + if (supportService.similarity(a.summary, b.summary) > 0.85) + results.add(a) + results.add(b) + + } + + } + + render(template: '/gTemplates/recordListing', model: [list: results]) + + } + def duplicatesList2(){ + + + + +// String anything = "ш щ ч ц х ф г я चंब्रिद्गॆ цамбридге كَمبرِدگِ かんぶりでげ"; + String id = "Any-Latin"; + + + ; + + String[][] input = [ ]; + def summary = '' Goal.list().each(){ - input += [[it.id.toString(), it.summary?: it.id.toString(), '']] + summary = it.summary + ' ' + Transliterator.getInstance(id).transform(it.summary?: it.id.toString()) + input += [[it.id.toString(), summary , '']] } - // println input - List documentList = Arrays.asList(input).stream().map({contact -> return new Document.Builder(contact[0]) .addElement(new Element.Builder().setValue(contact[0]).setType(NAME).createElement()) @@ -625,7 +696,10 @@ def enterJournalWithType() { result.entrySet().forEach({ entry -> entry.getValue().forEach({ match -> - render("Data: " + match.getData() + " Matched With:
" + match.getMatchedWith() + " Score: " + new java.text.DecimalFormat('#.##').format(match.getScore().getResult()) + '


'); +// + render("

f g i" + match.getData().getKey() + ' -- ' + match.getData() + // " Matched With:
" + match.getMatchedWith() + " Score: " + new java.text.DecimalFormat('#.##').format(match.getScore().getResult()) + '


'); + "
f g i" + match.getMatchedWith().getKey() + ' -- ' + match.getMatchedWith() ) // " Matched With:
" + match.getMatchedWith() + " Score: " + new java.text.DecimalFormat('#.##').format(match.getScore().getResult()) + '


'); + // render("Data: " + match.getData() + " Matched With:
" + match.getMatchedWith() + " Score: " + new java.text.DecimalFormat('#.##').format(match.getScore().getResult()) + '


'); }); }); @@ -659,4 +733,57 @@ render (view: '/reports/customReport1', model: [list: list, i: 1]) } + +// trn charts + def chartData = { + + + def dataAll = [] + + def x = [] + def y = [] + def data = [:] + def lastValue = 0 + + for (c in [ + [app.IndexCard, 'IndexCard', 'Notes', 'fa8042'], + [mcs.Book, 'Book', 'Resources', 'c38ea3'], + [mcs.Journal, 'Journal', 'Jounal', '90accf'], + [mcs.Planner, 'Planner', 'Planner', '238cCC'], + [mcs.Goal, 'Goal', 'Goals', 'a1c650'], + [mcs.Task, 'Task', 'Tasks', 'cbe0a1'] + ]) { + + x = [] + y = [] + data = [:] + lastValue = 0 + + for (t in c[0].executeQuery('select date(dateCreated), count(*) from ' + c[1] + ' where dateCreated > ? group by date(dateCreated) order by date(dateCreated)', + [new Date() - 14])) { +// def date = t[0].format('yyyy-MM-dd') + x+= t[0].format('yyyy-MM-dd') // + '-' + t[1] + t[2] // '-01'// +// println 'in chart data ' + t[0] +// println 'in chart data ' + t[0].class +// println 'in chart data ' + t[0].format('yyyy-MM-dd') + println '' + println '' +// x+= date + y += t[1] // + lastValue // cumulative value +// lastValue = t[2] + lastValue + } + + data = [x: x[1..-1], y: y[1..-1], + name: '' + c[2] + ' ', + type: 'line', // scatter, lines, markers, + line: [ + color: "#${c[3]}", // 'rgb(' + Math.random() * 255 + ', ' + Math.random() * 255 + ',' + Math.random() * 255 + ')', + width: 2 + ] + ] + dataAll += [data] + } + render dataAll as JSON + } + } // end of class \ No newline at end of file diff --git a/grails-app/controllers/ker/SyncController.groovy b/grails-app/controllers/ker/SyncController.groovy old mode 100644 new mode 100755 index 37eccec..ae2f8e6 --- a/grails-app/controllers/ker/SyncController.groovy +++ b/grails-app/controllers/ker/SyncController.groovy @@ -2,6 +2,8 @@ package ker import app.IndexCard import app.parameters.* +import cmn.Setting +import mcs.Department import mcs.Operation import mcs.parameters.* import grails.converters.XML @@ -15,6 +17,7 @@ import grails.converters.JSON import org.grails.web.json.JSONObject import org.json.JSONArray import org.springframework.http.HttpRequest +import security.User import sun.reflect.generics.factory.GenericsFactory @@ -94,6 +97,7 @@ class SyncController { } } + def rssPile() { render(feedType: "rss", feedVersion: "2.0") { title = "PKM RSS" @@ -174,6 +178,7 @@ class SyncController { } } + def fetchFullText() { def b = mcs.Book.get(params.id) def t = '' @@ -258,8 +263,22 @@ class SyncController { def builder = new JSONBuilder() def records = [] - for (i in mcs.Planner.executeQuery("from Planner where startDate >= ? and startDate <= ? and completedOn is null order by startDate asc", - [new Date() - 4, new Date() + 4])) { + for (i in mcs.Planner.executeQuery("from Planner t where t.startDate >= ? and t.startDate <= ? and t.completedOn is null and (t.user.username = ? or t.isPrivate = true) order by t.startDate asc", + [new Date() - 7, new Date() + 7, params.id])) { + records += [type : 'P', id: i.id, ecode: 'P', + meta : i?.startDate?.format('dd-MM-yyyy-HH-mm'), + date : i?.startDate?.format('dd-MM-yyyy'), + datediff: i?.startDate - new Date(), + color : 'darkblue', + filesList : i.filesList, + nbFiles : i.nbFiles, + summary : (i.task ? ('[' + i.task?.summary + '] ') : '') + i.summary, + language: i.language, + body : i.description ? i.description?.replace('\n', '
') : ''] + } + + for (i in mcs.Planner.executeQuery("from Planner t where t.bookmarked = true and (t.user.username = ? or t.isPrivate = true) order by t.startDate asc", + [params.id])) { // new Date() - 20, new Date() + 20 records += [type : 'P', id: i.id, ecode: 'P', meta : i?.startDate?.format('dd-MM-yyyy-HH-mm'), date : i?.startDate?.format('dd-MM-yyyy'), @@ -282,11 +301,17 @@ class SyncController { } def exportJsonJ = { + + supportService.updateBookmarkedRecordsFileCount() + + def builder = new JSONBuilder() +// println ' in jsonJ, username: ' + params.id + def records = [] - for (i in mcs.Planner.executeQuery("from Journal where startDate >= ? and startDate <= ? and bookmarked = ? order by startDate desc ", - [new Date() - 14, new Date() + 7, true])) { + for (i in mcs.Planner.executeQuery("from Journal t where t.startDate >= ? and t.startDate <= ? and t.bookmarked = ? and (t.user.username = ? or t.isPrivate = true) order by t.startDate desc ", + [new Date() - 4, new Date() + 1, true, params.id])) { records += [type : 'J', id : i.id, ecode : 'J', @@ -345,12 +370,15 @@ class SyncController { def records = [] def priorityMap = [5: 'p5', 4: 'p4', 3: 'p3', 2: 'p2', 1: 'p1'] - for (i in Task.executeQuery("from Task t where t.bookmarked = ? order by t.priority desc, t.id desc", [true])) { + for (i in Task.executeQuery("from Task t where t.bookmarked = ? and (t.user.username = ? or t.isPrivate = true) order by t.priority desc, t.id desc", [true, params.id])) { // t.context.code asc, t.priority todo: fix records += [type : (i.isTodo == true ? 'Todo' : 'T'), id : i.id, ecode : 'T', meta : (i.context ? '@' + i.context?.code : '-') + ' ' + (i.priority ? priorityMap[i.priority] : ''), + context : (i.context ? '@' + i.context?.code : '-'), + date : i?.endDate?.format('dd-MM-yyyy-HH-mm'), + textDate : i?.endDate?.format('EEE dd, HH-mm'), color : 'lightgreen', summary : i.summary, filesList : i.filesList, @@ -359,16 +387,34 @@ class SyncController { description: i.description ? i.description?.replace('\n', '
') : ''] } - for (i in Task.executeQuery("from Task t where t.endDate >= ? and t.endDate <= ? order by t.priority desc, t.id desc", [new Date() - 3, new Date() + 3])) { + def json = builder.build { + result = "ok" + data = records + } + + render(status: 200, contentType: 'application/json', text: json) + } + +def exportJsonV = { + def builder = new JSONBuilder() + + def records = [] + def priorityMap = [5: 'p5', 4: 'p4', 3: 'p3', 2: 'p2', 1: 'p1'] + + + for (i in Task.executeQuery("from Task t where t.endDate >= ? and t.endDate <= ? and t.completedOn is null and (t.user.username = ? or t.isPrivate = true) order by t.priority desc, t.id desc", [new Date() - 14, new Date() + 32, params.id])) { // t.context.code asc, t.priority todo: fix records += [type : (i.isTodo == true ? 'Todo' : 'T'), id : i.id, ecode : 'T', meta : (i.context ? '@' + i.context?.code : '-') + ' ' + (i.priority ? priorityMap[i.priority] : ''), + context : (i.context ? '@' + i.context?.code : '-'), + date : i?.endDate ? i?.endDate?.format('dd-MM-yyyy-HH-mm') : null, color : 'lightgreen', summary : i.summary, filesList : i.filesList, nbFiles : i.nbFiles, + bookmarked: i.bookmarked ? '1' : '0', language : i.language, description: i.description ? i.description?.replace('\n', '
') : ''] } @@ -412,20 +458,20 @@ class SyncController { def records = [] def priorityMap = [5: 'p5', 4: 'p4', 3: 'p3', 2: 'p2', 1: 'p1'] // order by department.orderNumber asc, course.orderNumber asc, orderNumber asc - for (i in IndexCard.executeQuery("from Book where bookmarked = ? order by priority desc, id desc", - [true])) { + for (i in IndexCard.executeQuery("from Book b where b.bookmarked = ? and (b.user.username = ? or b.isPrivate = true) order by b.id desc", // b.priority desc // b.type.code asc, b.title asc + [true, params.id])) { // OperationController.countResourceFiles(i.id) records += [type : 'R', id : i.id, resourceType: i?.type?.code, ecode : 'R', - meta : '#' + i.type?.code + (i.publishedOn ? ' ' + i.publishedOn?.format('yyyy') + '' : ''), + meta : '#' + i.type?.code, // + (i.publishedOn ? ' ' + i.publishedOn?.format('yyyy') + '' : ''), color : 'DarkSlateBlue', language : i.language, filesList : i.filesList, nbFiles : i.nbFiles, summary : i.title + (i.legacyTitle ? ' [' + i.legacyTitle + ' ]' : ''), - description : (i.description ? i.description?.replace('\n', '
'): '') + ' --- ' + (i.fullText?.replace('\n', '
')?.replaceAll(/http[\S\.]*/, '') + description : (i.description ? i.description?.replace('\n', '
'): '') + '
' + (i.fullText?.replace('\n', '
')?.replaceAll(/http[\S\.]*/, '') ?.replaceAll(/www[\S\.]*/, '') ?: '')] } @@ -439,14 +485,15 @@ class SyncController { def exportJsonG = { - // syncMobile(params.tosync) + // syncMobile(params.tosync) +//println ' in jsonG' + params.id def builder = new JSONBuilder() def records = [] def priorityMap = [5: 'p5', 4: 'p4', 3: 'p3', 2: 'p2', 1: 'p1'] - for (i in Task.executeQuery("from Goal g where g.bookmarked = ? order by g.priority desc, g.id desc", [true])) { + for (i in Task.executeQuery("from Goal g where g.bookmarked = ? and (g.user.username = ? or g.isPrivate = true) order by g.priority desc, g.id desc", [true, params.id])) { // g.department.code asc, g.priority desc todo: records += [type : 'G', id : i.id, @@ -541,6 +588,10 @@ class SyncController { color : 'lightorange', summary : i.summary, language : i.language, + + filesList : i.filesList, + nbFiles : i.nbFiles, + description: (i.description ? i.description?.replace('\n', '
') : '') + (i.notes ? '
===
' + i.notes?.replace('\n', '
')?.replace('__________________________________________________', '---') : '')] } @@ -559,7 +610,7 @@ class SyncController { def records = [] def priorityMap = [5: 'p5', 4: 'p4', 3: 'p3', 2: 'p2', 1: 'p1'] - for (i in IndexCard.executeQuery("from IndexCard where bookmarked = ? order by priority desc, lastUpdated desc", [true])) { + for (i in IndexCard.executeQuery("from IndexCard t where t.bookmarked = ? and (t.user.username = ? or t.isPrivate = true) order by t.lastUpdated desc", [true, params.id])) { records += [type : 'N', id : i.id, ecode : 'N', @@ -672,24 +723,39 @@ class SyncController { def mobilePush() { + + if (Setting.findByName('lastMobileSync')) + OperationController.setPath('lastMobileSync', new Date().format('dd.MM.yyyy HH:mm')) + else { + new Setting([name: 'lastMobileSync', value: new Date().format('dd.MM.yyyy HH:mm')]).save(flush: true) + } + + def builder = new JSONBuilder() def json - //new File('d:/test.log').write(request.JSON.data, 'UTF-8') + +// try { +// new File('/nbr/mbl.log').write('\n Mobile push request, ' + new Date()?.format('dd.MM.yyyy HH:mm') + ':\n') +// new File('/nbr/mbl.log').write(request.JSON.data?.toString(), 'UTF-8') +// } catch (Exception e){ +// println 'Error write mobile push log file' +// } def data = request.JSON.data - println 'new data ' + data +// println 'new data ' + data def c = 0 + // println 'in mobile push json ' + params.dump() // println 'in mobile push json ' + params.tosyncText //println 'dump ' + params.dump() if (params.tosyncText) - println 'array ' + params.tosyncText +// println 'array ' + params.tosyncText data.each() { r -> // r = JSON.parse(r) - println ' processing row ' + r +// println ' processing row ' + r c++ // println GenericsController.markCompletedStatic(r.substring(1).toLong(), r.substring(0, 1).toUpperCase()) @@ -760,8 +826,14 @@ if (!record.notes) } } - render c - } + + + json = builder.build { + result = c + ' processed updates' + } + + render(status: 200, contentType: 'application/json', text: json) +} def mobilePush0() { def c = 0 @@ -834,7 +906,7 @@ if (!record.notes) } } - render c + render (c + ' processed updates') } @@ -925,7 +997,7 @@ if (!record.notes) def json // new File('/home/maitham/test.log').write(request.JSON.data, 'UTF-8') def data = request.JSON.data - println 'data is ' + data + // println 'data is ' + data /** for non-json requests!!! ionic 6 * def data = JSON.parse(params['data']) @@ -966,7 +1038,13 @@ if (!record.notes) } - record.bookmarked = true + + // if set to true, new records will be synced back to reader + + // record.bookmarked = true + + + record.department = Department.findByCode(o.department) record.priority = o.priority record.nbFiles = o.nbFiles record.filesList = o.filesList?.join(',') @@ -985,38 +1063,54 @@ if (!record.notes) record.publishedOn = Date.parse('dd.MM.yyyy_HHmm', o.textDate) - def savedRecord = record.save(flush: true) - def newPath = supportService.getResourcePath(savedRecord.id, module.toUpperCase(), false) +// println ' entered by ' + request.JSON.username + ' is found ' + security.User.findByUsername(request.JSON.username) + record.user = security.User.findByUsername(request.JSON.username) - def path - if (new File(OperationController.getPath('root.rps1.path') + '/new').exists()) { - new File(OperationController.getPath('root.rps1.path') + '/new').eachFileMatch(~/${o.operationId} [\S\s]*/) { f -> - path = f.path - } - if (path) { - //println 'found a folder for this operation' - //OperationController.getPath('root.rps1.path') + '/O/' + o.id - new File(newPath).mkdirs() - def ant = new AntBuilder() - new File(path).eachFile() { - ant.move(file: it.path, - tofile: newPath + '/' + it.name) +// def savedRecord = record.save(flush: true) + + if (!record.hasErrors() && record.save(flush: true)) { + + def newPath = supportService.getResourcePath(record.id, module.toUpperCase(), false) + + def path + + if (new File(OperationController.getPath('root.rps1.path') + '/new').exists()) { + new File(OperationController.getPath('root.rps1.path') + '/new').eachFileMatch(~/${o.operationId} [\S\s]*/) { f -> + path = f.path } - new File(path).delete() - } + if (path) { + //println 'found a folder for this operation' + //OperationController.getPath('root.rps1.path') + '/O/' + o.id + new File(newPath).mkdirs() + def ant = new AntBuilder() + new File(path).eachFile() { + ant.move(file: it.path, + tofile: newPath + '/' + it.name) + } + new File(path).delete() + } - } + + } // println data.size() + ' records found.' // n.save(flush: true) - json = builder.build { - result = 'Record committed with id ' + savedRecord.id + json = builder.build { + result = 'Record imported to Nibras Desktop'// with id ' + record.id + } + } + + else { + + println 'Errors in record ' + record.dump() + ' errors are: ' + record.errors.each() { println it } + } } else { json = builder.build { @@ -1028,6 +1122,122 @@ if (!record.notes) } + //// + + def types() { + +// println 'here in modules \n\n\n' + + def types = [] + + [ + [id: 'T', name: 'Task', code: 'tasks'], + [id: 'P', name: 'Plan', code: 'plans'], + [id: 'G', name: 'Goal', code: 'goals'], + [id: 'N', name: 'Note', code: 'notes'], + [id: 'W', name: 'Writing', code: 'writings'], + [id: 'J', name: 'Journal', code: 'journal'], +// [id: 'Jt', name: 'Yesterday journal', code: 'journal'], + [id: 'P', name: 'Planner', code: 'planner'], + [id: 'R', name: 'Resource', code: 'resources'] + ].each(){ + if (OperationController.getPath(it.code + '.enabled') == 'yes'){ + types += it +// println 'here in modules \n\n\n' + it.name + } + + } + + + + + def builder = new JSONBuilder() + def json + + json = builder.build { + result = 'yes' + modules = types + } + + render(status: 200, contentType: 'application/json', text: json) + } + + def departments() { + +// println 'here in deparmtns \n\n\n' + def builder = new JSONBuilder() + def json + + json = builder.build { + result = 'yes' + departments = Department.findAllByBookmarked(true, [sort: 'code', order: 'asc']) + } + + render(status: 200, contentType: 'application/json', text: json) + + + } + + def nibrasFilesNestedById() { + + def builder = new JSONBuilder() + def json + // def result = 'no' +// + def resourceNestedById = 'no' + + if (OperationController.getPath('resourceNestedById') == 'yes') { + resourceNestedById = 'yes' + + + json = builder.build { + result = 'yes' + } + + render(status: 200, contentType: 'application/json', text: json) + } + + else { + json = builder.build { + result = 'no' + } + + render(status: 200, contentType: 'application/json', text: json) + + } + } + + def nibrasFilesNestedByType() { + + def builder = new JSONBuilder() + def json + // def result = 'no' +// + def resourceNestedByType = 'no' + + if (OperationController.getPath('resourceNestedByType') == 'yes') { + resourceNestedByType = 'yes' + + + json = builder.build { + result = 'yes' + } + + render(status: 200, contentType: 'application/json', text: json) + } + else { + json = builder.build { + result = 'no' + } + + render(status: 200, contentType: 'application/json', text: json) + } + + + + } + + def exportGold = { def result = '' for (i in mcs.Planner.executeQuery("from Planner where bookmarked = ? order by startDate desc ", [true])) { diff --git a/grails-app/domain/app/Contact.groovy b/grails-app/domain/app/Contact.groovy index 4d7355e..f433afa 100755 --- a/grails-app/domain/app/Contact.groovy +++ b/grails-app/domain/app/Contact.groovy @@ -92,8 +92,8 @@ class Contact implements Comparable { // entity id = 26 static mapping = { // name (index:'name_index') - description(sqlType: 'longtext') - notes(sqlType: 'longtext') + description(sqlType: 'long varchar') + notes(sqlType: 'long varchar') } diff --git a/grails-app/domain/app/IndexCard.groovy b/grails-app/domain/app/IndexCard.groovy index 90f9069..d0673f4 100755 --- a/grails-app/domain/app/IndexCard.groovy +++ b/grails-app/domain/app/IndexCard.groovy @@ -139,7 +139,7 @@ class IndexCard implements Comparable { // entity id = 16 Boolean bookmarked = false Boolean keepSecret = false - Boolean isPrivate = false + Boolean isPrivate = true Boolean isMerged = false Date mergedOn @@ -172,17 +172,17 @@ class IndexCard implements Comparable { // entity id = 16 } static mapping = { - description(sqlType: 'longtext') - shortDescription(sqlType: 'longtext') - descriptionHTML(sqlType: 'longtext') - mainHighlights(sqlType: 'longtext') - sideHighlights(sqlType: 'longtext') - reaction(sqlType: 'longtext') - extractedWords(sqlType: 'longtext') - sourceFree(sqlType: 'longtext') - url(sqlType: 'longtext') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + description(sqlType: 'long varchar') + shortDescription(sqlType: 'long varchar') + descriptionHTML(sqlType: 'long varchar') + mainHighlights(sqlType: 'long varchar') + sideHighlights(sqlType: 'long varchar') + reaction(sqlType: 'long varchar') + extractedWords(sqlType: 'long varchar') + sourceFree(sqlType: 'long varchar') + url(sqlType: 'long varchar') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') // password type: GormEncryptedStringType } diff --git a/grails-app/domain/app/Indicator.groovy b/grails-app/domain/app/Indicator.groovy index 40535a8..2af9d6f 100755 --- a/grails-app/domain/app/Indicator.groovy +++ b/grails-app/domain/app/Indicator.groovy @@ -85,9 +85,9 @@ class Indicator implements Comparable { // entity id = 22 } static mapping = { - + table 'indicators' // name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') } diff --git a/grails-app/domain/app/IndicatorData.groovy b/grails-app/domain/app/IndicatorData.groovy index 645f588..86b2ebd 100755 --- a/grails-app/domain/app/IndicatorData.groovy +++ b/grails-app/domain/app/IndicatorData.groovy @@ -55,7 +55,7 @@ class IndicatorData implements Comparable { // entity id = 21 Integer priority Boolean bookmarked = false - Boolean isPrivate = false + Boolean isPrivate = true static constraints = { indicator(nullable: false) @@ -71,8 +71,8 @@ class IndicatorData implements Comparable { // entity id = 21 static mapping = { // name (index:'name_index') - description(sqlType: 'longtext') - notes(sqlType: 'longtext') + description(sqlType: 'long varchar') + notes(sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/app/Payment.groovy b/grails-app/domain/app/Payment.groovy index 2f685c2..524e509 100755 --- a/grails-app/domain/app/Payment.groovy +++ b/grails-app/domain/app/Payment.groovy @@ -81,13 +81,13 @@ class Payment implements Comparable { // entity id = 24 static mapping = { table 'payment' - description(sqlType: 'longtext') - intendedUse(sqlType: 'longtext') - reality(sqlType: 'longtext') + description(sqlType: 'long varchar') + intendedUse(sqlType: 'long varchar') + reality(sqlType: 'long varchar') // name (index:'name_index') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/app/PaymentCategory.groovy b/grails-app/domain/app/PaymentCategory.groovy index abb3d1f..e2dc6d1 100755 --- a/grails-app/domain/app/PaymentCategory.groovy +++ b/grails-app/domain/app/PaymentCategory.groovy @@ -65,7 +65,7 @@ class PaymentCategory implements Comparable { // entity id = 23 static mapping = { // name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') } public String entityCode() { diff --git a/grails-app/domain/app/Rating.groovy b/grails-app/domain/app/Rating.groovy deleted file mode 100755 index b24195b..0000000 --- a/grails-app/domain/app/Rating.groovy +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2018. Mohamad F. Fakih (mail@khuta.org) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see - */ - -package app - -class Rating implements Comparable { // entity id = 26 - - // Fields - - String source - String title - String link - Integer rating - String tag - - Date newsDate - - Date dateCreated - Date lastUpdated - - - static constraints = { -// summary(blank: false, nullable: false) - } - - static mapping = { - // name (index:'name_index') - title(sqlType: 'longtext') - } - - int compareTo(obj) { - if (id && obj.id) - return id.compareTo(obj.id) - else return 1 - } - -} // end of class diff --git a/grails-app/domain/app/Tag.groovy b/grails-app/domain/app/Tag.groovy index 1b50dd7..ad042a6 100755 --- a/grails-app/domain/app/Tag.groovy +++ b/grails-app/domain/app/Tag.groovy @@ -56,7 +56,7 @@ class Tag implements Comparable { // entity id = 12 static mapping = { // name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/app/parameters/Blog.groovy b/grails-app/domain/app/parameters/Blog.groovy old mode 100644 new mode 100755 index d002bf7..c40d54e --- a/grails-app/domain/app/parameters/Blog.groovy +++ b/grails-app/domain/app/parameters/Blog.groovy @@ -18,6 +18,8 @@ package app.parameters import cmn.DataChangeAudit +import security.User + //import com.bloomhealthco.jasypt.GormEncryptedStringType class Blog implements Comparable { // entity id = 20 @@ -27,6 +29,10 @@ class Blog implements Comparable { // entity id = 20 // Fields + User user + + Boolean bookmarked = false + String summary String code @@ -37,6 +43,8 @@ class Blog implements Comparable { // entity id = 20 String notes + String language + Date dateCreated Date lastUpdated Date deletedOn @@ -51,7 +59,7 @@ class Blog implements Comparable { // entity id = 20 } static mapping = { - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // password type: GormEncryptedStringType } diff --git a/grails-app/domain/app/parameters/CommandPrefix.groovy b/grails-app/domain/app/parameters/CommandPrefix.groovy old mode 100644 new mode 100755 index f9802fb..27b8d61 --- a/grails-app/domain/app/parameters/CommandPrefix.groovy +++ b/grails-app/domain/app/parameters/CommandPrefix.groovy @@ -18,6 +18,7 @@ package app.parameters import cmn.DataChangeAudit +import security.User class CommandPrefix implements Comparable { // entity id = 29 @@ -25,6 +26,9 @@ class CommandPrefix implements Comparable { // entity id = 29 // static searchable = [only:['name', 'notes' ]] // Fields + + User user + String code String summary String module @@ -54,7 +58,7 @@ class CommandPrefix implements Comparable { // entity id = 29 static mapping = { // name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/app/parameters/Markup.groovy b/grails-app/domain/app/parameters/Markup.groovy old mode 100644 new mode 100755 index 2d2f6e8..a4539ec --- a/grails-app/domain/app/parameters/Markup.groovy +++ b/grails-app/domain/app/parameters/Markup.groovy @@ -18,6 +18,7 @@ package app.parameters import cmn.DataChangeAudit +import security.User class Markup implements Comparable { // entity id = 20 @@ -26,6 +27,8 @@ class Markup implements Comparable { // entity id = 20 // Fields + User user + String summary String code @@ -47,7 +50,7 @@ class Markup implements Comparable { // entity id = 20 } static mapping = { - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/app/parameters/Module.groovy b/grails-app/domain/app/parameters/Module.groovy old mode 100644 new mode 100755 index ccfdc6b..a3db904 --- a/grails-app/domain/app/parameters/Module.groovy +++ b/grails-app/domain/app/parameters/Module.groovy @@ -18,6 +18,7 @@ package app.parameters import cmn.DataChangeAudit +import security.User class Module implements Comparable { // entity id = 20 @@ -26,6 +27,8 @@ class Module implements Comparable { // entity id = 20 // Fields + User user + String summary String code @@ -53,7 +56,7 @@ class Module implements Comparable { // entity id = 20 } static mapping = { - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/app/parameters/ResourceType.groovy b/grails-app/domain/app/parameters/ResourceType.groovy old mode 100644 new mode 100755 index 9f34e24..9a4aca7 --- a/grails-app/domain/app/parameters/ResourceType.groovy +++ b/grails-app/domain/app/parameters/ResourceType.groovy @@ -18,6 +18,7 @@ package app.parameters import cmn.DataChangeAudit +import security.User class ResourceType implements Comparable { // entity id = 29 @@ -25,6 +26,9 @@ class ResourceType implements Comparable { // entity id = 29 // static searchable = [only:['name', 'notes' ]] // Fields + + User user + String code String name String style @@ -54,7 +58,7 @@ class ResourceType implements Comparable { // entity id = 29 static mapping = { // name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/cmn/DataChangeAudit.groovy b/grails-app/domain/cmn/DataChangeAudit.groovy old mode 100644 new mode 100755 index 129c49c..48728d7 --- a/grails-app/domain/cmn/DataChangeAudit.groovy +++ b/grails-app/domain/cmn/DataChangeAudit.groovy @@ -53,8 +53,8 @@ class DataChangeAudit implements Comparable { // entity id = 18 } static mapping = { - operationDetails(sqlType: 'longtext') - exactOperation(sqlType: 'longtext') + operationDetails(sqlType: 'long varchar') + exactOperation(sqlType: 'long varchar') datePerformed(sqlType: 'datetime') table 'data_change_audits' diff --git a/grails-app/domain/cmn/Setting.groovy b/grails-app/domain/cmn/Setting.groovy old mode 100644 new mode 100755 index 01d2ebc..956a01f --- a/grails-app/domain/cmn/Setting.groovy +++ b/grails-app/domain/cmn/Setting.groovy @@ -17,8 +17,12 @@ package cmn +import security.User + class Setting { // entity id = 51 + User user + String name String summary String value @@ -39,13 +43,13 @@ class Setting { // entity id = 51 } static mapping = { - // table "SETTINGS" - value(sqlType: 'longtext') - summary(sqlType: 'longtext') - description(sqlType: 'longtext') - allowedValues(sqlType: 'longtext') - explanation(sqlType: 'longtext') - notes(sqlType: 'longtext') + // table "SETTINGS" + value(sqlType: 'long varchar') +// summary(sqlType: 'long varchar') + description(sqlType: 'long varchar') + allowedValues(sqlType: 'long varchar') + explanation(sqlType: 'long varchar') + notes(sqlType: 'long varchar') } public String entityCode() { diff --git a/grails-app/domain/mcs/Book.groovy b/grails-app/domain/mcs/Book.groovy index b8ba1db..373577d 100755 --- a/grails-app/domain/mcs/Book.groovy +++ b/grails-app/domain/mcs/Book.groovy @@ -72,6 +72,7 @@ class Book implements Comparable { // entity id = 134 String shortFileName String description + String descriptionHTML String fullText @@ -125,14 +126,14 @@ class Book implements Comparable { // entity id = 134 Contact person String journal String month - String year + String resourceYear String volume String number String series Boolean bookmarked = false - Boolean isPrivate = false + Boolean isPrivate = true Boolean keepSecret = false @@ -168,9 +169,15 @@ class Book implements Comparable { // entity id = 134 // Blog blog // String blogCode - Date publishedOn +// Date publishedOn // Integer publishedNodeId + Blog blog + String blogCode + Date publishedOn + Integer publishedNodeId + + String textTags String notes @@ -205,29 +212,30 @@ class Book implements Comparable { // entity id = 134 static mapping = { //id(generator: 'assigned') - title(sqlType: 'longtext') - author(sqlType: 'longtext') - authorInfo(sqlType: 'longtext') - description(sqlType: 'longtext') - fullText(sqlType: 'longtext') - bibEntry(sqlType: 'longtext') - highlights(sqlType: 'longtext') - comments(sqlType: 'longtext') - reviewHistory(sqlType: 'longtext') - stepsHistory(sqlType: 'longtext') - filesList(sqlType: 'longtext') +// title(sqlType: 'long varchar') +// author(sqlType: 'long varchar') + authorInfo(sqlType: 'long varchar') + description(sqlType: 'long varchar') + descriptionHTML(sqlType: 'long varchar') + fullText(sqlType: 'long varchar') + bibEntry(sqlType: 'long varchar') + highlights(sqlType: 'long varchar') + comments(sqlType: 'long varchar') + reviewHistory(sqlType: 'long varchar') + stepsHistory(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') table 'book' //sort "id":"desc" //name (index:'name_index') - textTags(sqlType: 'longtext') - notes(sqlType: 'longtext') - imageUrl(sqlType: 'longtext') - url(sqlType: 'longtext') - citation(sqlType: 'longtext') - citationText(sqlType: 'longtext') - citationHtml(sqlType: 'longtext') - citationAsciicode(sqlType: 'longtext') + textTags(sqlType: 'long varchar') + notes(sqlType: 'long varchar') + imageUrl(sqlType: 'long varchar') + url(sqlType: 'long varchar') + citation(sqlType: 'long varchar') + citationText(sqlType: 'long varchar') + citationHtml(sqlType: 'long varchar') + citationAsciicode(sqlType: 'long varchar') // excerpts: Excerpt cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/Course.groovy b/grails-app/domain/mcs/Course.groovy index 2e60bb6..901813f 100755 --- a/grails-app/domain/mcs/Course.groovy +++ b/grails-app/domain/mcs/Course.groovy @@ -99,13 +99,13 @@ class Course implements Comparable { // entity id = 130 } static mapping = { - description(sqlType: 'longtext') + description(sqlType: 'long varchar') table 'course' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/Department.groovy b/grails-app/domain/mcs/Department.groovy index 582297d..756e007 100755 --- a/grails-app/domain/mcs/Department.groovy +++ b/grails-app/domain/mcs/Department.groovy @@ -64,7 +64,7 @@ class Department { // entity id = 131 //long getNumberOfTasks() { return tasks ? tasks.size() : 0 } static constraints = { - code(unique: true) + code(nullable: true, unique: true) summary(nullable: false, blank: false) courses() @@ -79,7 +79,7 @@ class Department { // entity id = 131 table 'department' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // courses: Course cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/Excerpt.groovy b/grails-app/domain/mcs/Excerpt.groovy index e23d204..c1d3c6e 100755 --- a/grails-app/domain/mcs/Excerpt.groovy +++ b/grails-app/domain/mcs/Excerpt.groovy @@ -98,9 +98,9 @@ class Excerpt implements Comparable { // entity id = 143 table 'excerpt' //sort "id":"desc" //name (index:'name_index') - description(sqlType: 'longtext') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + description(sqlType: 'long varchar') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/Goal.groovy b/grails-app/domain/mcs/Goal.groovy index 1a9fe78..0630e9a 100755 --- a/grails-app/domain/mcs/Goal.groovy +++ b/grails-app/domain/mcs/Goal.groovy @@ -81,7 +81,7 @@ class Goal implements Comparable { // entity id = 126 Date endDate Boolean bookmarked = false - Boolean isPrivate = false + Boolean isPrivate = true // new value - migrate to it WorkStatus status @@ -126,14 +126,14 @@ class Goal implements Comparable { // entity id = 126 } static mapping = { - summary(sqlType: 'longtext') + // summary(sqlType: 'long varchar') table 'goal' - description(sqlType: 'longtext') - stepsHistory(sqlType: 'longtext') + description(sqlType: 'long varchar') + stepsHistory(sqlType: 'long varchar') //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/Journal.groovy b/grails-app/domain/mcs/Journal.groovy index 57382c6..a73b60e 100755 --- a/grails-app/domain/mcs/Journal.groovy +++ b/grails-app/domain/mcs/Journal.groovy @@ -92,7 +92,7 @@ class Journal implements Comparable { // entity id = 125 Boolean keepSecret = false - Boolean isPrivate = false + Boolean isPrivate = true Integer reviewCount = 0 @@ -138,9 +138,9 @@ class Journal implements Comparable { // entity id = 125 table 'journal' //sort "id":"desc" //name (index:'name_index') - description(sqlType: 'longtext') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + description(sqlType: 'long varchar') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/Operation.groovy b/grails-app/domain/mcs/Operation.groovy old mode 100644 new mode 100755 index f901926..191e0c0 --- a/grails-app/domain/mcs/Operation.groovy +++ b/grails-app/domain/mcs/Operation.groovy @@ -66,12 +66,12 @@ class Operation implements Comparable { // entity id = } static mapping = { - description(sqlType: 'longtext') + description(sqlType: 'long varchar') table 'operation' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/Planner.groovy b/grails-app/domain/mcs/Planner.groovy index c2a20b6..42073ab 100755 --- a/grails-app/domain/mcs/Planner.groovy +++ b/grails-app/domain/mcs/Planner.groovy @@ -106,7 +106,7 @@ class Planner implements Comparable { // entity id = 137 Boolean isDayChallenge Boolean bookmarked - Boolean isPrivate = false + Boolean isPrivate = true @@ -128,7 +128,9 @@ class Planner implements Comparable { // entity id = 137 static constraints = { level(inList: ['l', 'y', 'e', 'A', 'M', 'r', 'w', 'd', 'm', 'i']) - startDate(nullable: false, unique: ['task']) + + startDate(nullable: false) + endDate() description() @@ -141,14 +143,14 @@ class Planner implements Comparable { // entity id = 137 } static mapping = { - description(sqlType: 'longtext') - reality(sqlType: 'longtext') + description(sqlType: 'long varchar') + reality(sqlType: 'long varchar') table 'planner' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/Relationship.groovy b/grails-app/domain/mcs/Relationship.groovy old mode 100644 new mode 100755 index 70b4d4c..64ea8e9 --- a/grails-app/domain/mcs/Relationship.groovy +++ b/grails-app/domain/mcs/Relationship.groovy @@ -23,7 +23,9 @@ package mcs import cmn.* import grails.converters.* - import java.text.SimpleDateFormat +import security.User + +import java.text.SimpleDateFormat class Relationship implements Comparable { // entity id = 453 @@ -36,7 +38,9 @@ class Relationship implements Comparable { // entity id = 453 // static searchable = [only:['entityA', 'entityB', 'type', 'recordA', 'recordB', 'notes' ]] // Fields - + + User user + String entityA String entityACode @@ -73,7 +77,7 @@ class Relationship implements Comparable { // entity id = 453 static mapping = { table 'relationship' - notes (sqlType: 'longtext') + notes (sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/mcs/Task.groovy b/grails-app/domain/mcs/Task.groovy index 777ef9e..3e00dff 100755 --- a/grails-app/domain/mcs/Task.groovy +++ b/grails-app/domain/mcs/Task.groovy @@ -92,7 +92,7 @@ class Task implements Comparable { // entity id = 127 Boolean isTopic = false Boolean bookmarked - Boolean isPrivate = false + Boolean isPrivate = true String notes @@ -132,14 +132,14 @@ class Task implements Comparable { // entity id = 127 } static mapping = { - description(sqlType: 'longtext') + description(sqlType: 'long varchar') table 'task' //sort "id":"desc" //name (index:'name_index') - description(sqlType: 'longtext') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + description(sqlType: 'long varchar') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/Writing.groovy b/grails-app/domain/mcs/Writing.groovy index f06f553..0a5cfcc 100755 --- a/grails-app/domain/mcs/Writing.groovy +++ b/grails-app/domain/mcs/Writing.groovy @@ -93,7 +93,7 @@ class Writing implements Comparable { // entity id = 144 Date bornOn Boolean bookmarked = false - Boolean isPrivate = false + Boolean isPrivate = true Boolean keepSecret = false Integer priority = 2 @@ -143,15 +143,15 @@ class Writing implements Comparable { // entity id = 144 } static mapping = { - description(sqlType: 'longtext') - shortDescription(sqlType: 'longtext') - descriptionHTML(sqlType: 'longtext') + description(sqlType: 'long varchar') + shortDescription(sqlType: 'long varchar') + descriptionHTML(sqlType: 'long varchar') table 'writing' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') - filesList(sqlType: 'longtext') + notes(sqlType: 'long varchar') + filesList(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/Context.groovy b/grails-app/domain/mcs/parameters/Context.groovy old mode 100644 new mode 100755 index 71e0567..b82971b --- a/grails-app/domain/mcs/parameters/Context.groovy +++ b/grails-app/domain/mcs/parameters/Context.groovy @@ -18,6 +18,7 @@ package mcs.parameters import cmn.DataChangeAudit +import security.User class Context implements Comparable { // entity id = 156 @@ -26,6 +27,8 @@ class Context implements Comparable { // entity id = 156 // Fields + User user + String code String name @@ -54,7 +57,7 @@ class Context implements Comparable { // entity id = 156 table 'work_location' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/Country.groovy b/grails-app/domain/mcs/parameters/Country.groovy old mode 100644 new mode 100755 index 9187153..be3ea34 --- a/grails-app/domain/mcs/parameters/Country.groovy +++ b/grails-app/domain/mcs/parameters/Country.groovy @@ -18,6 +18,7 @@ package mcs.parameters import cmn.DataChangeAudit +import security.User class Country implements Comparable { // entity id = 156 @@ -26,6 +27,8 @@ class Country implements Comparable { // entity id = 156 // Fields + User user + String code String name @@ -53,7 +56,7 @@ class Country implements Comparable { // entity id = 156 //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/GoalType.groovy b/grails-app/domain/mcs/parameters/GoalType.groovy old mode 100644 new mode 100755 index fc3b434..8966a1a --- a/grails-app/domain/mcs/parameters/GoalType.groovy +++ b/grails-app/domain/mcs/parameters/GoalType.groovy @@ -18,6 +18,7 @@ package mcs.parameters import cmn.DataChangeAudit +import security.User class GoalType implements Comparable { // entity id = 139 @@ -26,6 +27,8 @@ class GoalType implements Comparable { // entity id = 139 // Fields + User user + String code String name @@ -56,7 +59,7 @@ class GoalType implements Comparable { // entity id = 139 table 'goal_type' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/JournalType.groovy b/grails-app/domain/mcs/parameters/JournalType.groovy old mode 100644 new mode 100755 index 657820a..ad4776b --- a/grails-app/domain/mcs/parameters/JournalType.groovy +++ b/grails-app/domain/mcs/parameters/JournalType.groovy @@ -18,6 +18,7 @@ package mcs.parameters import cmn.DataChangeAudit +import security.User class JournalType implements Comparable { // entity id = 141 @@ -26,13 +27,16 @@ class JournalType implements Comparable { // entity id = 141 // Fields + User user + String code String color String style String name Integer metaType - Integer category +// Integer category + String indicatorCode String notes @@ -58,7 +62,7 @@ class JournalType implements Comparable { // entity id = 141 table 'journal_type' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/Location.groovy b/grails-app/domain/mcs/parameters/Location.groovy old mode 100644 new mode 100755 index 06fbcdb..5e9257a --- a/grails-app/domain/mcs/parameters/Location.groovy +++ b/grails-app/domain/mcs/parameters/Location.groovy @@ -18,6 +18,7 @@ package mcs.parameters import cmn.DataChangeAudit +import security.User class Location implements Comparable { // entity id = 156 @@ -26,6 +27,9 @@ class Location implements Comparable { // entity id = 156 // Fields + User user + + Country country String code String name @@ -55,7 +59,7 @@ class Location implements Comparable { // entity id = 156 table 'location' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/PlannerType.groovy b/grails-app/domain/mcs/parameters/PlannerType.groovy old mode 100644 new mode 100755 index caee346..bf8a34f --- a/grails-app/domain/mcs/parameters/PlannerType.groovy +++ b/grails-app/domain/mcs/parameters/PlannerType.groovy @@ -30,7 +30,7 @@ class PlannerType implements Comparable { // entity id = 157 String color String style String name - Integer category +// Integer category String notes @@ -56,7 +56,7 @@ class PlannerType implements Comparable { // entity id = 157 table 'planner_type' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/RelationshipType.groovy b/grails-app/domain/mcs/parameters/RelationshipType.groovy old mode 100644 new mode 100755 index 10f8cc0..537e7c2 --- a/grails-app/domain/mcs/parameters/RelationshipType.groovy +++ b/grails-app/domain/mcs/parameters/RelationshipType.groovy @@ -62,7 +62,7 @@ class RelationshipType implements Comparable { // entity id = 452 static mapping = { table 'relationship_type' - notes (sqlType: 'longtext') + notes (sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/mcs/parameters/ResourceStatus.groovy b/grails-app/domain/mcs/parameters/ResourceStatus.groovy old mode 100644 new mode 100755 index b1e6a1e..2e9b760 --- a/grails-app/domain/mcs/parameters/ResourceStatus.groovy +++ b/grails-app/domain/mcs/parameters/ResourceStatus.groovy @@ -53,7 +53,7 @@ class ResourceStatus implements Comparable { // entity id = 158 table 'resource_status' // sort "id":"desc" // name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/SavedSearch.groovy b/grails-app/domain/mcs/parameters/SavedSearch.groovy old mode 100644 new mode 100755 index 40aec0b..516887e --- a/grails-app/domain/mcs/parameters/SavedSearch.groovy +++ b/grails-app/domain/mcs/parameters/SavedSearch.groovy @@ -23,7 +23,9 @@ import mcs.* import cmn.* import grails.converters.* - import java.text.SimpleDateFormat +import security.User + +import java.text.SimpleDateFormat class SavedSearch implements Comparable { // entity id = 451 @@ -37,6 +39,7 @@ class SavedSearch implements Comparable { // entity id = 451 // Fields + User user String queryType = 'hql' String reportType = 'list' @@ -92,9 +95,9 @@ class SavedSearch implements Comparable { // entity id = 451 static mapping = { table 'saved_search' - query (sqlType: 'longtext') - countQuery (sqlType: 'longtext') - notes (sqlType: 'longtext') + query (sqlType: 'long varchar') + countQuery (sqlType: 'long varchar') + notes (sqlType: 'long varchar') } static namedQueries = { diff --git a/grails-app/domain/mcs/parameters/WorkStatus.groovy b/grails-app/domain/mcs/parameters/WorkStatus.groovy old mode 100644 new mode 100755 index 6145c13..b649dfa --- a/grails-app/domain/mcs/parameters/WorkStatus.groovy +++ b/grails-app/domain/mcs/parameters/WorkStatus.groovy @@ -18,13 +18,16 @@ package mcs.parameters import cmn.DataChangeAudit +import security.User class WorkStatus implements Comparable { // entity id = 138 static searchable = [only: ['name', 'notes']] + // Fields + User user String code Boolean isActive @@ -56,7 +59,7 @@ class WorkStatus implements Comparable { // entity id = 138 table 'work_status' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/WritingStatus.groovy b/grails-app/domain/mcs/parameters/WritingStatus.groovy old mode 100644 new mode 100755 index 798b12b..7b02d3f --- a/grails-app/domain/mcs/parameters/WritingStatus.groovy +++ b/grails-app/domain/mcs/parameters/WritingStatus.groovy @@ -53,7 +53,7 @@ class WritingStatus implements Comparable { // entity id = 145 table 'writing_status' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/domain/mcs/parameters/WritingType.groovy b/grails-app/domain/mcs/parameters/WritingType.groovy old mode 100644 new mode 100755 index 0b9f5a7..4f27799 --- a/grails-app/domain/mcs/parameters/WritingType.groovy +++ b/grails-app/domain/mcs/parameters/WritingType.groovy @@ -54,7 +54,7 @@ class WritingType implements Comparable { // entity id = 155 table 'writing_type' //sort "id":"desc" //name (index:'name_index') - notes(sqlType: 'longtext') + notes(sqlType: 'long varchar') // null cascade: 'persist,merge,save-update' } diff --git a/grails-app/init/nibras/BootStrap.groovy b/grails-app/init/nibras/BootStrap.groovy index 7f0d1ab..72289eb 100644 --- a/grails-app/init/nibras/BootStrap.groovy +++ b/grails-app/init/nibras/BootStrap.groovy @@ -2,10 +2,12 @@ package nibras import ker.OperationController import security.* - +import grails.core.GrailsApplication class BootStrap { + GrailsApplication grailsApplication + def init = { servletContext -> if (User.count() == 0) { @@ -41,12 +43,16 @@ class BootStrap { """ + + def port = grailsApplication.config.getProperty('server.port') + def contextPath = grailsApplication.config.getProperty('server.contextPath') + println '' println ' ************************************************************' println ' * *' println ' * Nibras has launched. You can access it from: *' println ' * *' - println ' * https://localhost:1441/ *' + println " * https://localhost:${port}${contextPath} " println ' * *' // println ' * Note: To stop Nibras, press ctrl+c in this window, or *' // println ' * run ./scripts/stop script. *' @@ -56,9 +62,9 @@ class BootStrap { println '' if (org.apache.commons.lang.SystemUtils.IS_OS_WINDOWS) { - """c:\\windows\\explorer "" https://localhost:1441/""".execute() + """c:\\windows\\explorer "" https://localhost:${port}/${contextPath}""".execute() } else if (org.apache.commons.lang.SystemUtils.IS_OS_LINUX){ - """/usr/bin/xdg-open https://localhost:1441/""".execute() + """/usr/bin/xdg-open https://localhost:${port}${contextPath}""".execute() } diff --git a/grails-app/services/SupportService.groovy b/grails-app/services/SupportService.groovy old mode 100644 new mode 100755 index 82a93db..c05d6a6 --- a/grails-app/services/SupportService.groovy +++ b/grails-app/services/SupportService.groovy @@ -23,6 +23,8 @@ import mcs.Goal //import mcs.WritingType import net.bican.wordpress.CustomField +import net.bican.wordpress.MediaItem +import net.bican.wordpress.MediaItemUploadResult //import net.bican.wordpress.Post @@ -49,6 +51,58 @@ class SupportService { // private static final log = LogFactory.getLog(this) + static entityMapping = [ + 'G' : 'mcs.Goal', + 'ه' : 'mcs.Goal', + 'T' : 'mcs.Task', + 'ع' : 'mcs.Task', + 'P' : 'mcs.Planner', + 'خ' : 'mcs.Planner', + + 'W' : 'mcs.Writing', + 'ك' : 'mcs.Writing', + 'N' : 'app.IndexCard', + 'ن' : 'app.IndexCard', + + 'J' : 'mcs.Journal', + 'ذ' : 'mcs.Journal', + 'I' : 'app.IndicatorData', + 'K' : 'app.Indicator', + + 'Q' : 'app.Payment', + 'د' : 'app.Payment', + 'L' : 'app.PaymentCategory', + + 'R' : 'mcs.Book', + 'م' : 'mcs.Book', + 'C' : 'mcs.Course', + 'و' : 'mcs.Course', + 'D' : 'mcs.Department', + 'ج' : 'mcs.Department', + 'E' : 'mcs.Excerpt', + 'ف' : 'mcs.Excerpt', + 'S' : 'app.Contact', + 'Tag' : 'app.Tag', + + 'Y' : 'cmn.Setting', + 'X' : 'mcs.parameters.SavedSearch', + 'A' : 'app.parameters.CommandPrefix', + 'O' : 'mcs.Operation', +//todo for all params + 'ResourceType' : 'app.parameters.ResourceType', + 'WorkStatus' : 'mcs.parameters.WorkStatus', + 'WritingStatus': 'mcs.parameters.WritingStatus', + 'GoalType' : 'mcs.parameters.GoalType', + 'JournalType' : 'mcs.parameters.JournalType', + 'PlannerType' : 'mcs.parameters.PlannerType', + 'WritingType' : 'mcs.parameters.WritingType', + 'Context' : 'mcs.parameters.Context', + 'Blog' : 'app.parameters.Blog' + + ] + + + String getResourcePath(Long id, String type, Boolean relative) { if (type == 'R') { @@ -392,7 +446,7 @@ class SupportService { if (i.path) result = countFolder(i.path, i.extensions) else if (i.query) - result = Goal.executeQuery("" + i.query)[0] + result = Goal.executeQuery("select count(*)" + i.query)[0] // todo: why select count(*) was removed! return result } @@ -422,14 +476,24 @@ class SupportService { } - int postToBlog(Long blogId, String code, String title, String categoriesString, String tags, String fullText, String excerpt, String entityCode, Integer publishedNodeId) { + int postToBlog(Long blogId, String code, String title, String categoriesString, String tags, String fullText, + String excerpt, String entityCode, Integer publishedNodeId, String coverPath, String[] files, String uploadBase) { + try { def username def password def link ArrayList categories = categoriesString.split(',') - Blog blog = Blog.get(blogId) + + + Blog blog + + if (blogId) + blog = Blog.get(blogId) + else + blog = Blog.findByCode(OperationController.getPath('blog.current.code')) + username = blog.username password = blog.password link = blog.link @@ -484,11 +548,39 @@ class SupportService { post.setPost_title(title) post.setPost_excerpt(excerpt) + + def links = [] + + if (files){ + files.each(){ + links += '' + it + '' + + } + } + if (fullText && links) + post.setPost_content(fullText + '

Files:
' + links.join('
')) + else if (fullText && !links) post.setPost_content(fullText) + else if (!fullText && links) + post.setPost_content( '
Files:
' + links.join('
')) // post.setPage_status('published') post.setPost_status('publish') post.setPost_name(code) +// def mi = new MediaItem() +// mi.setLink('https://khuta.org/cover.jpg') + +if (coverPath) { + InputStream media = new FileInputStream(new File(coverPath)) + final String fileName = "cover.jpg"; + final MediaItemUploadResult mediaUploaded = wp.uploadFile(media, fileName); + final MediaItem r = wp.getMediaItem(mediaUploaded.getId()); + post.setPost_thumbnail(r); +} +// Integer p = wp.newPost(post); + +// post.setPost_thumbnail(mi) + final List terms = wp.getTerms("post_tag"); def postTags = [] @@ -582,7 +674,11 @@ class SupportService { // result = wp.getPost(publishedNodeId.intValue()) } -// println 'resut is: ' + result + println 'resut is: ' + result + + println 'post link is: ' + post.getLink() +// render 'post link is: ' + post.getLink() + if (!publishedNodeId ) { // println 'here' return result @@ -735,5 +831,104 @@ class SupportService { return list } + def updateBookmarkedRecordsFileCount(){ + +// println 'In support service counting files...' + + + + if (OperationController.getPath('panel.integrations.currentPlan.enabled') == 'yes') { + def path = OperationController.getPath('panel.integrations.currentPlan.path') + if (mcs.Planner.executeQuery('select count(*) from Planner where startDate <= ? and endDate >= ? ', [new Date(), new Date()])[0] > 0) { + def p = + mcs.Planner.executeQuery('from Planner where startDate <= ? and endDate >= ? ', [new Date(), new Date()])[0] + + new File(path).write('>' + p.endDate?.format('HH:mm') + ' ' + p.summary, 'UTF-8') + } else { + new File(path).write('*** No plan set!', 'UTF-8') + } + } + + + def results = [] + [mcs.Course, + mcs.Goal, + mcs.Task, + mcs.Planner, + mcs.Journal, + + mcs.Writing, + app.IndexCard, + + mcs.Book, + mcs.Excerpt, + app.Contact + ].each() { + it.findAllByBookmarked(true).each(){ + OperationController.countResourceFilesStatic(it.id, it.entityCode()) + } + } + + + + } + + def loadRecord(String entitCode, Long id){ + return grailsApplication.classLoader.loadClass(entityMapping[entitCode]).get(id) + } + + + + /** + * Calculates the similarity (a number within 0 and 1) between two strings. + */ + public static double similarity(String s1, String s2) { + String longer = s1, shorter = s2; + if (s1.length() < s2.length()) { // longer should always have greater length + longer = s2; shorter = s1; + } + int longerLength = longer.length(); + if (longerLength == 0) { return 1.0; /* both strings are zero length */ } + /* // If you have StringUtils, you can use it to calculate the edit distance: + return (longerLength - StringUtils.getLevenshteinDistance(longer, shorter)) / + (double) longerLength; */ + return (longerLength - editDistance(longer, shorter)) / (double) longerLength; + + } + + // Example implementation of the Levenshtein Edit Distance + // See http://r...content-available-to-author-only...e.org/wiki/Levenshtein_distance#Java + public static int editDistance(String s1, String s2) { + s1 = s1.toLowerCase(); + s2 = s2.toLowerCase(); + + int[] costs = new int[s2.length() + 1]; + for (int i = 0; i <= s1.length(); i++) { + int lastValue = i; + for (int j = 0; j <= s2.length(); j++) { + if (i == 0) + costs[j] = j; + else { + if (j > 0) { + int newValue = costs[j - 1]; + if (s1.charAt(i - 1) != s2.charAt(j - 1)) + newValue = Math.min(Math.min(newValue, lastValue), + costs[j]) + 1; + costs[j - 1] = lastValue; + lastValue = newValue; + } + } + } + if (i > 0) + costs[s2.length()] = lastValue; + } + return costs[s2.length()]; + } + + public static void printSimilarity(String s, String t) { +// System.out.println + render (String.format( + "%.3f is the similarity between \"%s\" and \"%s\"", similarity(s, t), s, t)); + } } diff --git a/grails-app/taglib/pkm/PkmTagLib.groovy b/grails-app/taglib/pkm/PkmTagLib.groovy old mode 100644 new mode 100755 index 11d2618..43599bf --- a/grails-app/taglib/pkm/PkmTagLib.groovy +++ b/grails-app/taglib/pkm/PkmTagLib.groovy @@ -58,7 +58,7 @@ class PkmTagLib { def text = attrs.text ? attrs.text.encodeAsHTML() : '' def length = attrs.length - out << StringUtils.abbreviate(text, length ? length.toInteger() : 80)?.replaceAll('>', ' ')?.replaceAll('<', ' ')?.encodeAsHTML()?.decodeHTML() + out << StringUtils.abbreviate(text, length ? length.toInteger() : 80)?.replaceAll('>', ' ')?.replaceAll('<', ' ')?.trim()//?.encodeAsHTML()?.replaceAll('\n', '
')?.decodeHTML() } else { out << '' } @@ -159,13 +159,16 @@ ${i.isFile() ? '('+ prettySizeMethod(i.size()) + ')' : ''} } def listRecordFiles = { attrs -> + def module = attrs.module def fileClass = attrs.fileClass def recordId = attrs.recordId def type = attrs.type - def isStatic = attrs.static + def isStatic = attrs.isStatic + def abridged = attrs.abridged def filesList = [] + def resourceNestedById = false def resourceNestedByType = false @@ -225,9 +228,14 @@ ${i.isFile() ? '('+ prettySizeMethod(i.size()) + ')' : ''} folders = [ typeSandboxPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : ''), - typeRepositoryPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : ''), - typeLibraryPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : '') +// typeRepositoryPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : ''), + ] + + if (isStatic != 'yes') { + folders += (typeRepositoryPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : '')) + folders += (typeLibraryPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : '')) + } folders.each() { folder -> if (new File(folder).exists()) { @@ -237,13 +245,20 @@ ${i.isFile() ? '('+ prettySizeMethod(i.size()) + ')' : ''} } } folders = [ - typeSandboxPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : '') + '/' + recordId, + typeSandboxPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : '') + '/' + recordId // typeLibraryPath + '/' + (recordId / 100).toInteger() + '/' + recordId, - typeRepositoryPath +(resourceNestedById ? '/' + (recordId / 100).toInteger() : '') + '/' + recordId, - typeLibraryPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : '') + '/' + recordId +// typeRepositoryPath +(resourceNestedById ? '/' + (recordId / 100).toInteger() : '') + '/' + recordId, +// typeLibraryPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : '') + '/' + recordId ] - def b = Book.get(recordId) + + if (isStatic != 'yes') { + folders += (typeRepositoryPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : '') + '/' + recordId) + folders += (typeLibraryPath + (resourceNestedById ? '/' + (recordId / 100).toInteger() : '') + '/' + recordId) + } + + + def b = Book.get(recordId) // if (b.code){ // folders.add(typeSandboxPath + '/' + b.code) // folders.add(typeRepositoryPath + '/' + b.code) @@ -279,22 +294,33 @@ ${i.isFile() ? '('+ prettySizeMethod(i.size()) + ')' : ''} out << '' print 'Problem in listing record folder: ' + e.printStackTrace() } - def output = filesList.size() > 0 ? "
    " : '' + + + def output = filesList.size() > 0 ? "
      " : '' def c = 1 for (i in filesList) { def fileId = new Date().format('HHmmssSSS') + c //Math.floor(Math.random()*1000) c++ if (isStatic == 'yes') { + if (i.name != 'cover.jpg') { + +// """ + } } else { session[fileId] = i.path @@ -308,45 +334,52 @@ ${i.isFile() ? '('+ prettySizeMethod(i.size()) + ')' : ''} title="${i.path}"> """ if (i.isFile()){ +// if (i.name != 'cover.jpg') { output += """ +
      """ +//} } else { output += """ + """ } output += """ - +${i.name} + ${i.isFile() ? '('+ prettySizeMethod(i.size()) + ')' : ''} -${i.name} + + - cvr -   vtt   - +   -> -   x + + -
      """ @@ -362,7 +395,7 @@ ${i.isFile() ? '('+ prettySizeMethod(i.size()) + ')' : ''} } - output += "
" + output += "" @@ -743,7 +776,7 @@ source src="${createLink(controller: 'operation', action: 'download', id: fileId } } else { color = 'darkorange' - output = "" + name + "" + output = "" + name + "" out << output.decodeHTML() } @@ -827,7 +860,7 @@ source src="${createLink(controller: 'operation', action: 'download', id: fileId def prettyDuration = { attrs -> // out << supportService.toWeekDate(attrs.date) - +//println 'here in pretty' + attrs.dump() if (attrs.date1) { try { Instant start = attrs.date1.toInstant() @@ -836,12 +869,14 @@ source src="${createLink(controller: 'operation', action: 'download', id: fileId long years = dur.toDays() / 365; long months = (dur.toDays() % 365 ) / 30; long days = ((dur.toDays() % 365 ) % 30) ; -// long hours = dur.toDays(); -// long minutes = dur.toHours(); + long hours = ((dur.toHours() % 365 ) % 30) % 24; + long minutes = (((dur.toMinutes() % 365 ) % 30) % 24 ) % 60; + +// todo: fine tune the display + out << (minutes ? minutes + 'min ' : '') + (hours ? hours + 'h ' : '') +(days ? days + 'd ' : '') + (months ? months + 'm ' : '') + (years ? years + 'y ' : '') - out << (days ? days + 'd ' : '') + (months ? months + 'm ' : '') + (years ? years + 'y ' : '') } catch(Exception e){ out << 'WD error!' } diff --git a/grails-app/views/appCalendar/_west.gsp b/grails-app/views/appCalendar/_west.gsp new file mode 100755 index 0000000..f6e24e9 --- /dev/null +++ b/grails-app/views/appCalendar/_west.gsp @@ -0,0 +1,143 @@ +
+ %{--todo: dynamic height --}% + + Add task/goal +
+
+ + + +   + Priority: +   + Context: +
+ Goal: +
+ Course: + +
+ + %{-- todo: parametric language list--}% + + %{----}% + %{--
--}% + + %{-- --}% +
+ +
+ %{-- --}% +
+ +

Bookmarked tasks without goals

+ + + + %{----}% + + %{--

@${c}

--}% + + + +
+
+ + +

@${c}

+ + + +
+
+ + %{----}% + +

@${c}

+ + + +
+
+ + %{--

Overdue

--}% + %{----}% + + %{--

@${c}

--}% + + + +
+
+ +
+
+ %{----}% + + %{--

@${c}

--}% + + + +
+ +
+
+ +
+

Goals and their tasks

+ + %{--

@${c}

--}% + %{----}% + + + %{----}% +
+ %{--
--}% + %{--
--}% + %{----}% + %{----}% + %{--

@${c}

--}% + %{----}% + %{----}% + %{----}% + %{--
--}% + +
diff --git a/grails-app/views/appCalendar/main.gsp b/grails-app/views/appCalendar/main.gsp index e3ad283..8c9a463 100755 --- a/grails-app/views/appCalendar/main.gsp +++ b/grails-app/views/appCalendar/main.gsp @@ -1,4 +1,4 @@ -<%@ page import="mcs.Goal; ker.OperationController; java.time.temporal.ChronoUnit; mcs.parameters.JournalType; mcs.Journal; mcs.Planner; mcs.parameters.PlannerType" %> +<%@ page import="mcs.Task; mcs.Goal; ker.OperationController; java.time.temporal.ChronoUnit; mcs.parameters.JournalType; mcs.Journal; mcs.Planner; mcs.parameters.PlannerType" %> @@ -52,6 +52,24 @@ %{-- --}% + + + + + + + + + %{----}% + %{----}% + %{----}% + + + + + + + @@ -67,7 +85,94 @@ + + + + + +
+
+
- -
- +
+ + + + +
+
+ + +
+ %{--
--}% + Below are the applications that you are allowed to access. +
+ + +
+
+ +
+ + +

${n.wbsNumber} ${n.summary}

+ %{--[${n.id}]--}% +
+ %{--${n.description}--}% + ${n.descriptionHTML ? raw(n.descriptionHTML) : raw(n.description?.replace("\n", "
"))} +
+
+
+ +
+
+
+ + + + + %{--Create Account--}% +
+ + +
+ + +
+
+ +
+ + %{--version ??--}% +
+
+
+ + + + %{--
--}% + %{--
--}% + %{--${app.englishName}--}% + %{--
--}% + %{----}% + %{--
--}% + + %{--
--}% + %{----}% + %{--
--}% + +
+ %{--
--}% + %{--A BEAUTIFUL LANDSCAPE HERE--}% + %{--
--}% +
+ ${app.description} +
+
+
+ +
+ +
+ +
- -
\ No newline at end of file +
+ + +%{----}% + + + + + + +%{----}% +%{----}% +%{----}% +%{----}% +%{----}% + + + + diff --git a/grails-app/views/appCourse/writingsBookHtml.gsp b/grails-app/views/appCourse/writingsBookHtml.gsp new file mode 100755 index 0000000..5880ec7 --- /dev/null +++ b/grails-app/views/appCourse/writingsBookHtml.gsp @@ -0,0 +1,400 @@ +<%@ page import="app.IndexCard" %> + + + + + + + ${record?.summary} + + + + + + %{----}% + %{----}% + %{----}% + %{----}% + %{----}% + + %{----}% + %{----}% + %{----}% + + %{----}% + + + + + + + %{----}% + %{----}% + + + %{----}% + + + %{----}% + %{----}% + %{----}% + + + + + + + + + + + + + +%{--
--}% + %{--
--}% + %{----}% + %{--
--}% +%{--
--}% + + + + + + + +%{--
--}% + %{--أهلاً وسهلاً بكم في موقع جبل عامل--}% + +
+ + +
+ %{--
--}% + الإصدار الرابع - آخر تحديث: + 3 كانون الأول 2022 +
+ + +
+
+ +
+ %{-- + %{----}% + +
+ +

+ + ${n.wbsNumber} - ${n.summary} +

+
+ + ${raw(n.description?.replace("\n", "
"))} +
+
+ + %{--

${n.wbsNumber} - ${n.summary}

--}% + %{--[${n.id}]--}% + %{--
--}% + %{--${n.description}--}% + %{--${raw(n.description?.replace("\n", "
"))}--}% + %{--n.description ? raw(n.description) :--}% + %{--
--}% + + + %{--
--}% +
+ +
+
+
+ + + + + %{--Create Account--}% +
+ + +
+ + +
+
+ +
+ + %{--version ??--}% +
+
+
+ + + + %{--
--}% + %{--
--}% + %{--${app.englishName}--}% + %{--
--}% + %{----}% + %{--
--}% + + %{--
--}% + %{----}% + %{--
--}% + +
+ %{--
--}% + %{--A BEAUTIFUL LANDSCAPE HERE--}% + %{--
--}% +
+ ${app.description} +
+
+
+ +
+ +
+ + +
+%{--
--}% + + + + + + + +%{----}% +%{----}% +%{----}% +%{----}% +%{----}% + +%{----}% + + + diff --git a/grails-app/views/appMain/_east.gsp b/grails-app/views/appMain/_east.gsp old mode 100644 new mode 100755 index 755a802..5b76845 --- a/grails-app/views/appMain/_east.gsp +++ b/grails-app/views/appMain/_east.gsp @@ -1,5 +1,7 @@ <%@ page import="mcs.parameters.ResourceStatus; mcs.Goal; org.apache.commons.lang.StringUtils; mcs.Book; app.parameters.ResourceType; mcs.Writing; mcs.Department; mcs.parameters.WritingType; app.Tag; cmn.Setting; mcs.Course; mcs.Journal; mcs.Planner; app.IndexCard; mcs.Task; ker.OperationController" %> -
+
%{----}% - + %{----}% diff --git a/grails-app/views/appMain/_north-old.gsp b/grails-app/views/appMain/_north-old.gsp old mode 100644 new mode 100755 index fb7bba9..f5c861b --- a/grails-app/views/appMain/_north-old.gsp +++ b/grails-app/views/appMain/_north-old.gsp @@ -1,6 +1,522 @@ <%@ page import="ker.OperationController; cmn.Setting;" %> + + + %{----}% + + + + + + %{-- --}% + %{----}% + + %{----}% + + + + + + + + + + %{----}% + %{----}% + %{----}% + + + + + + + + + + %{----}% + + %{----}% + + %{----}% + %{--todo--}% + %{----}% + %{----}% + %{----}% + %{----}% + %{--A Pomegranate PKM system--}% + %{----}% + %{----}% + %{----}% + + %{----}% + + + + + + %{----}% + %{----}% + %{----}% + + + + + + + + + + + %{----}% + %{----}% + %{----}% + + %{----}% + + %{----}% + + %{----}% + + + + + %{-- + %{----}% + + + + %{----}% + %{--Logout  --}% + %{----}% + + + + + + + + + + + + + + %{----}% + %{----}% + %{----}% + + + %{----}% + + %{----}% + %{----}% + + + + %{-- --}% + %{----}% + + + + + + %{----}% + + + + %{----}% + %{----}% + + + + %{----}% + + %{-- --}% + + + %{----}% + + %{----}% + %{-- --}% + %{----}% + + + + + + + %{----}% + + %{--
  • --}% + %{----}% + %{--نسخه --}% + %{----}% + %{----}% + %{--
  • --}% + + +
    --}% + %{--  --}% + %{-- --}% + %{-- +   +   + + + %{----}% + %{----}% + + + + + ${OperationController.getPath('app.name') ?: 'Nibras'} + +   + v${grailsApplication.metadata.getApplicationVersion()} + %{----}% + + + + + + + Mihrab + %{-- ↗--}% + + --}% + %{-- --}% + %{-- Light--}% + + %{-- --}% + %{-- + + Reader + + + + Notes + + + + Scans + + --}% + %{----}% + %{--Tasks--}% + %{----}% + %{-- + + Calendar + + --}% + + %{-- + %{----}% + <% Calendar c = new GregorianCalendar(); c.setLenient(false); c.setMinimalDaysInFirstWeek(4); + c.setFirstDayOfWeek(java.util.Calendar.MONDAY) %> + + %{-- Week ${c.get(Calendar.WEEK_OF_YEAR)}--}% + + + %{--before="jQuery.address.value(jQuery(this).attr('href'));"--}% + + + %{----}% + %{----}% + Import + %{----}% + + + %{--before="jQuery.address.value(jQuery(this).attr('href'));"--}% + + %{----}% + %{----}% + ++ + %{----}% + + + --}% + %{----}% + %{----}% + %{----}% + %{----}% + + %{----}% + %{----}% + %{----}% + %{----}% + %{----}% + + %{----}% + %{----}% + %{----}% + %{----}% + %{----}% + + + + %{----}% + Edit (${editFileCount ?: 0}) + + + + + %{----}% + + () + + %{--(${mcs.Journal.countByType(mcs.parameters.JournalType.findByCode('pkm'))})--}% + + + + + + %{----}% + %{-- --}% + Today + %{-- ()--}% + + %{--(${mcs.Journal.countByType(mcs.parameters.JournalType.findByCode('pkm'))})--}% + + + + + + (${reviewPileSize}) + + + --}% + %{----}% + + %{--بياناتي--}% + %{----}% + + + + %{----}% + %{----}% + %{--دقات--}% + %{----}% + + %{----}% + %{----}% + %{--سجل--}% + %{----}% + + %{----}% + %{----}% + %{--RSS--}% + %{----}% + + %{----}% + %{----}% + %{--  رزمة--}% + %{-- --}% + + %{----}% + %{----}% + + + + + + %{----}% + %{--
  • --}% + %{--
  • --}% + %{--
  • --}% + %{--
  • --}% + %{--
  • --}% + %{--
  • --}% + %{--
  • --}% + + + + %{----}% + %{--
  • Private mode
  • --}% + %{--
    --}% + + %{--
  • --}% + %{----}% + %{--DB: ${org.codehaus.groovy.grails.commons.ConfigurationHolder.config.dataSource.url.split('/').last()}--}% + %{----}% + %{----}% + %{--Prod db--}% + %{----}% + %{--
  • --}% + + %{--
  • --}% + %{----}% + %{----}% + %{--${new Date() - Date.parse('dd.MM.yyyy', OperationController.getPath('countup.date.days'))} days--}% + %{----}% + %{----}% + %{----}% + %{--
  • --}% + %{----}% + %{-- ${new DecimalFormat('##.##').format((new Date() - Date.parse('dd.MM.yyyy', OperationController.getPath('countup.date.years'))) / 365.25)} years--}% + %{----}% + + + %{----}% + + %{----}% + %{--
    --}% + + + + %{----}% + + %{----}% + + + %{-- --}% + %{----}% + + %{----}% + %{----}% + + %{----}% + + %{----}% + %{-- + + + %{--Records per page--}% + + %{-- noSelection="${['null': '']}"--}% + + + %{----}% + + + + %{----}% + + + %{----}% + + %{----}% + + + ${username} + %{--دقات--}% + %{----}% + %{--style="" target="_blank">--}% + %{----}% + %{----}% + + + + + Logout + %{----}% + + --}% + %{--بالصفحة--}% + + %{--
    + + +%{--/* ********* */--}% +%{--/* ********* */--}% +%{--/* ********* */--}% +%{--/* ********* */--}% +%{--/* ********* */--}% +%{--/* ********* */--}% +%{--/* ********* */--}% + +

    Clear - N++ - -- -
    +

    @@ -127,10 +129,15 @@ %{--

    --}% %{--
    --}% %{--
    --}% - - +
    - Quick add panel + Side panel
    @@ -525,6 +551,20 @@
    \ No newline at end of file diff --git a/grails-app/views/appMain/_west.gsp b/grails-app/views/appMain/_west.gsp old mode 100644 new mode 100755 index e662dc9..97b65f1 --- a/grails-app/views/appMain/_west.gsp +++ b/grails-app/views/appMain/_west.gsp @@ -71,6 +71,8 @@ %{--
    --}% %{--Calendar report includes:--}% + +
    Show: @@ -81,9 +83,11 @@ ${type} + %{--
    --}%
    + %{--
    --}% %{--
    --}% @@ -473,7 +477,7 @@ -

    +

    @@ -537,13 +541,13 @@ -

    +

    -

    Append to writing

    +

    Append to writing

    %{----}% @@ -630,8 +634,9 @@ %{-- style="background: #e8efe7; width: 100%; ;" dir="auto"/>--}% + value="" + class="uk-textArea uk-width-expand" + style="font-family: tahoma; height: 100px !important;"/> %{--
    --}% %{-- R ID: --}% @@ -651,10 +656,9 @@
    + class="uk-button uk-button-primary uk-width-expand"/>
    @@ -714,7 +718,8 @@ [enabled: OperationController.getPath('tasks.enabled')?.toLowerCase() == 'yes', code: 'T', name: 'Tasks', controller: 'mcs.Task'], [enabled: OperationController.getPath('planner.enabled')?.toLowerCase() == 'yes', code: 'P', name: 'Planner', controller: 'mcs.Planner'], [enabled: OperationController.getPath('journal.enabled')?.toLowerCase() == 'yes', code: 'J', name: 'Journal', controller: 'mcs.Journal'], - [enabled: OperationController.getPath('indicators.enabled')?.toLowerCase() == 'yes', code: 'I', name: 'Indicator', controller: 'app.IndicatorData'], + [enabled: OperationController.getPath('indicators.enabled')?.toLowerCase() == 'yes', code: 'K', name: 'Indicator', controller: 'app.Indicator'], + [enabled: OperationController.getPath('indicators.enabled')?.toLowerCase() == 'yes', code: 'I', name: 'IndicatorData', controller: 'app.IndicatorData'], [enabled: OperationController.getPath('Payment.enabled')?.toLowerCase() == 'yes', code: 'Q', name: 'Payment', controller: 'app.Payment'], [enabled: OperationController.getPath('writings.enabled')?.toLowerCase() == 'yes', code: 'W', name: 'Writing', controller: 'mcs.Writing'], [enabled: OperationController.getPath('notes.enabled')?.toLowerCase() == 'yes', code: 'N', name: 'Notes', controller: 'app.IndexCard',], @@ -993,7 +998,7 @@ %{--
    --}% - + %{--

    Configuration

    --}% %{--
    --}% @@ -1007,21 +1012,42 @@
    - Records per page + %{--Records per page--}% %{-- noSelection="${['null': '']}"--}% - - - + %{----}% + %{----}%
      -
    • + %{--
    • --}% + %{----}% + + %{--
    • --}% +
    • + Records per page +
        +
      • + %{--noSelection="${['null': '']}"--}% + + + +
      • +
      + +
    • + + +
    • Configuration
      • @@ -1035,6 +1061,8 @@ Full settings list (${Setting.count()})
      • + +
      • --}% - + %{----}%
      • Execute code
          @@ -1140,23 +1168,6 @@ -
        • - Records per page -
            -
          • - %{-- noSelection="${['null': '']}"--}% - - - - -
          • -
          - -

        @@ -1201,10 +1212,10 @@ %{--
    --}% -
    +

    -

    +
    %{--
    --}% @@ -1416,8 +1427,28 @@ Generate all bibs + + +
    +
    + + Candidate duplicates + + + +
    +
    + + + + + Export all writings + + +

    + Mark all operations as settled @@ -1451,6 +1482,22 @@ Books with duplication ISBN
    + + +irfan: تصدير المقالات إلى الموقع + + + +
    + + + +irfan: كل ا لمقالات + + + +
    +
    Admin saved searches @@ -1460,8 +1507,9 @@
    -
    - + %{----}% +
    +

    + + %{----}% + %{----}% + %{----}% + + + + + + + + + %{----}% + + + +
    - \ No newline at end of file diff --git a/grails-app/views/appMain/main2.gsp b/grails-app/views/appMain/main2.gsp new file mode 100755 index 0000000..974e9e6 --- /dev/null +++ b/grails-app/views/appMain/main2.gsp @@ -0,0 +1,1357 @@ +<%@ page import="mcs.parameters.ResourceStatus; mcs.Goal; org.apache.commons.lang.StringUtils; mcs.Book; app.parameters.ResourceType; mcs.Writing; mcs.Department; mcs.parameters.WritingType; app.Tag; cmn.Setting; mcs.Course; mcs.Journal; mcs.Planner; app.IndexCard; mcs.Task; ker.OperationController" %> + + +%{--xml:lang="ar" lang="ar" dir="rtl"--}% + + + + %{----}% + + + %{----}% + + + + + ${OperationController.getPath('app.name') ?: 'Nibras PKM'} + %{--<g:meta name="app.version"/>--}% + ${new Date()?.format('HH:mm')} + + + + + %{----}% + + + + + + + + + %{-- --}% + + + + + %{-- --}% + + + + + + + + + + + + + + + + + + %{----}% + + + + + + + + + + + %{--custom js for the keyboard shortcuts--}% + + + + + + + + %{-- --}% + %{-- --}% + %{-- --}% + %{-- --}% + + + + + + + + + + + + + %{----}% + %{----}% + + %{----}% + %{----}% + %{----}% + + + + + + %{----}% + %{----}% + %{----}% + + + + + + + + %{--${ker.OperationController.getPath('app.headers.background') ?: '#5b7a59'}--}% + + + + + + + + + + + + +
    + + + +
    + + +
    + + + +
    + +
    + + + +
    + +
    + + + + +
    + +
    + + +
    + + + %{--onLoading="jQuery('#spinner2').show();" onComplete="jQuery('#spinner2').hide();"--}% + %{--todo: no spinner--}% + + + + %{----}% + %{--if (jQuery('#quickAddTextFieldBottomTop').val().search('--')== -1){--}% + %{--
    --}% + + + +
    + +
    + + + %{--
    --}% + %{--
    --}% + %{--
    --}% + %{--

    Create new record...

    --}% + %{--

    --}% + %{--
    --}% + %{--
    --}% + +
    + + %{--
    --}% + %{--

    Create new record...

    --}% + %{--

    --}% + + Add a record + + %{--

    --}% + %{--
    --}% + %{--
    --}% +
    + + + %{--jQuery('#summayDaftar').focus();--}% + +
    + + %{--onkeyup="jQuery('#topDaftarArea').load('${request.contextPath}/indexCard/extractTitle/', {'typing': this.value})"--}% + %{--Format: title (line 1)
    details (from line 2 till the end)--}% + %{--
    --}% + + %{--
    --}% + %{--Legend--}% + +
    + %{----}% + %{--
    --}% + + %{--
    --}% +
    + %{--console.log('now sel: ', this.value);--}% + + %{----}% +
    + %{----}% + %{--
    --}% + + + %{--disabled="true"--}% + %{----}% + + %{--
    --}% +
    + %{--
    --}% + %{----}% + %{--
    --}% + + + + + + %{--
    --}% + %{--
    --}% + %{----}% + %{--more--}% + %{----}% + + + + %{--
    --}% + %{--(ctrl+enter)--}% + + %{-- + %{--
    --}% + %{--
    --}% + + + %{--
    --}% + %{----}% + %{--
    --}% + + + %{--
    --}% + %{--
    --}% + %{--
    --}% + %{--
    --}% + + + + + + + + +
    + +
    +
    + + + +
    + + %{--
    --}% + + + %{--
    --}% +
    + + + + + + + + %{--
    --}% + +
    + +
    + + + + %{--
    --}% + + + +
    + +
    + +
    + +
    + +
    + + + %{--Main panel--}% + %{--
    --}% + + +
    + +
    + + + %{----}% + + + %{--
    --}% + + %{--
    --}% +
    + +
    + %{-- --}% + %{----}% + + + + + + + + + %{----}% + %{----}% + %{----}% + %{----}% + %{--

    @${c}

    --}% +
      + %{--.grep{it.context == c}--}% + +
    • + + + ${task.context?.code} + ${task.summary} + + +
    • + + %{----}% +
      +
    + %{--
    --}% + + %{----}% + +
    + + + + %{--
    --}% + %{--
    --}% + + %{--Clear--}% + + + %{--
    --}% + +
    + + +
    + + + + +
    + + + + %{----}% + %{----}% + %{----}% + %{----}% + %{----}% + %{--
    --}% + + %{--
    --}% + %{--Main panel--}% + %{--panel--}% + %{--
    --}% + +
    + + + + + + + %{--
    --}% + + %{--
    --}% + + + %{--
    --}% + %{----}% + %{--
    --}% + + %{--
    --}% + %{--
    --}% + %{--
    --}% + + + + + + + %{-- --}% + %{--
    Last plan
    --}% + %{----}% + + + %{-- render(template: '/reports/heartbeat', model: [dates: dates])--}% + + + + + + %{--
    --}% + + %{----}% + %{--
    --}% + %{--
    --}% + %{--Repository folder not found. Please choose an existing folder:--}% + %{--
    --}% + %{----}% + %{--
    --}% + + + %{----}% + %{----}% + %{----}% + %{--
    --}% + + + %{--before="jQuery('#testTitle2').text('[2]: ' + jQuery('#testField2').val());"--}% +
    +
    +
    + +
    + + + +
    + + +
    + + +
    + Side panel +
    + + + +
    +
    + +
    + + + + + + %{----}% + + %{--before="jQuery('#testTitle2').text('[2]: ' + jQuery('#testField2').val());"--}% +
    +
    +
    + +
    + + + + +
    + %{--
    --}% +
    + + +
    + Extra panel +
    + +
    +
    + + %{--

    Saved searches

    --}% + %{----}% + +
    + %{--before="jQuery('#testTitle3').text('[3]: ' + jQuery('#testField3').val());"--}% + %{----}% + + + + + + %{----}% + +
    + +
    +
    + %{----}% + + +
    + Advanced panel +
    + +
    +
    +
    + + %{--
    --}% + + + + + + + %{--first commented one below was in action 14.03.2019 --}% + %{----}% + %{----}% + %{----}% + + %{----}% + %{----}% + + + + + %{----}% + %{----}% + %{----}% + + %{----}% + %{----}% + + %{----}% + %{----}% + %{----}% + + %{----}% + %{----}% + +
    +
    + %{--
    --}% + + %{--
    --}% + %{--5--}% + %{--
    --}% + + %{--
    --}% + %{--
    --}% + %{--
    --}% + + %{----}% + %{----}% + %{----}% + + %{----}% + %{----}% + + %{--
    --}% + + %{--
    --}% + + %{--
    --}% + %{--before="jQuery('#testTitle1').text('[1]: ' + jQuery('#quickAddTextFieldBottomTop').val());"--}% + + %{----}% + + + %{--
    --}% + + + %{----}% + %{----}% + + + +
    + %{--
    --}% + %{--Inner West
    --}% + %{--
    --}% + %{--Inner East
    --}% + + + + + + %{--
    --}% +%{----}% + + + + + + + + + + + + + \ No newline at end of file diff --git a/grails-app/views/appPile/_north.gsp b/grails-app/views/appPile/_north.gsp old mode 100644 new mode 100755 index 0d02c45..c949691 --- a/grails-app/views/appPile/_north.gsp +++ b/grails-app/views/appPile/_north.gsp @@ -20,7 +20,7 @@ %{-- ${OperationController.getPath('app.name') ?: 'Nibras'} /Study --}% %{--Course--}% - My Writings
    + Writings diff --git a/grails-app/views/appPile/_regions.gsp b/grails-app/views/appPile/_regions.gsp index 626b530..ab2c176 100755 --- a/grails-app/views/appPile/_regions.gsp +++ b/grails-app/views/appPile/_regions.gsp @@ -1,5 +1,15 @@ <%@ page import="mcs.parameters.ResourceStatus; mcs.Goal; org.apache.commons.lang.StringUtils; mcs.Book; app.parameters.ResourceType; mcs.Writing; mcs.Department; mcs.parameters.WritingType; app.Tag; cmn.Setting; mcs.Course; mcs.Journal; mcs.Planner; app.IndexCard; mcs.Task; ker.OperationController" %> %{--${ker.OperationController.getPath('app.headers.background') ?: '#5b7a59'}--}% + + + + +
    %{----}% @@ -99,14 +109,96 @@
    +
    +
    + + + + + %{----}% + %{----}% + + %{----}% + + %{----}% + %{----}% + + + + %{----}% + %{----}% + + + + +
    + + + + +
    + ${t.numberCode} + ${StringUtils.abbreviate(t.summary ?: '', 26)} (${Writing.countByCourse(t)}w) +
    + +
    + + %{------}% + %{--
  • --}% +

    + + ${w.toString()} + +

    + + + + %{--&& w.withMarkdown--}% + +
    + ${raw(w.descriptionHTML)} +
    +
    + + %{--ToDo didn't work--}% +
    + ${raw(w.description?.replaceAll('\n', '
    ')?.replace('Product Description', ''))} + %{--${?.encodeAsHTML()?.replaceAll('\n', '
    ')}--}% +
    + +
    + + + +
  • +
    +
    +
    +
    %{----}% - %{--
    --}% diff --git a/grails-app/views/appPile/_west.gsp b/grails-app/views/appPile/_west.gsp index 3909ce7..a5d3f5f 100755 --- a/grails-app/views/appPile/_west.gsp +++ b/grails-app/views/appPile/_west.gsp @@ -2,8 +2,7 @@
    - + style="width: 90%; padding: 0 30px;">

    There are no departments yet.

    @@ -70,48 +69,76 @@
    %{--

    All courses

    --}% +

    - Active Writings + Active records

    + +
    - dumpAllWritings + Export all writings +

    - - -
    - ${t.numberCode} + + + + +
    + ${t.numberCode} ${StringUtils.abbreviate(t.summary ?: '', 26)} (${Writing.countByCourse(t)}) -
    -
      - -
    • - - ${w.toString()} - -
      - - - - +
      + + +
        + +
      • + + ${w.toString()} + +
        + + - + +
        -
        -
      • -
        -
      -
      +
      +
    • -
    + +
    +
    + + + + + %{--todo: repeat--}% + + + + + + + + +
    + + +

    @@ -129,10 +156,12 @@ %{----}% -
    - + %{----}% @@ -151,28 +180,33 @@ -
    +
    ${t.numberCode} - ${StringUtils.abbreviate(t.summary ?: '', 26)} (${Writing.countByCourse(t)}) - + ${StringUtils.abbreviate(t.summary ?: '', 26)} (${Writing.countByCourse(t)}w)
    -
    +

    - -
    diff --git a/grails-app/views/appPile/_westOld.gsp b/grails-app/views/appPile/_westOld.gsp new file mode 100755 index 0000000..fe2287f --- /dev/null +++ b/grails-app/views/appPile/_westOld.gsp @@ -0,0 +1,279 @@ +<%@ page import="mcs.parameters.ResourceStatus; mcs.Goal; org.apache.commons.lang.StringUtils; mcs.Book; app.parameters.ResourceType; mcs.Writing; mcs.Department; mcs.parameters.WritingType; app.Tag; cmn.Setting; mcs.Course; mcs.Journal; mcs.Planner; app.IndexCard; mcs.Task; ker.OperationController" %> + + +
    + + +

    There are no departments yet.

    +
    + + + +

    Active courses

    + + + +
    +

    + %{----}% + %{----}% + + + + + + + ${d.summary} + ${d.code} (${d.courses.size()}) + + %{----}% + + + %{----}% + %{----}% + %{----}% + + + +

    + + +
    +
      + +
    • + + ${t.numberCode} + ${StringUtils.abbreviate(t.summary ?: '', 26)} + + ${t.code != t.numberCode.toString() ? t.code : ''} + + + +
    • +
      +
    +
    +
    +
    + + +
    + +%{--

    All courses

    --}% + +

    + + Active records + +

    + + +
    + + + Export all writings + + +
    +
    + + + + + +
    + ${t.numberCode} + ${StringUtils.abbreviate(t.summary ?: '', 26)} (${Writing.countByCourse(t)}) +
    + + +
      + +
    • + + ${w.toString()} + + %{--
      --}% + + - + + %{--
      --}% +
      +
      +
    • +
      +
    +
    +
    + + + + + %{--todo: repeat--}% + + %{----}% + %{----}% + %{----}% + %{----}% + + + +
    +
    + + + +

    + + All Writings + +

    +
    + + + %{----}% + %{----}% + + %{----}% + + %{----}% + %{----}% + + + + %{----}% + %{----}% + + + + +
    + + + + +
    + ${t.numberCode} + ${StringUtils.abbreviate(t.summary ?: '', 26)} (${Writing.countByCourse(t)}w) +
    + +
      + + %{------}% + %{--
    • --}% +
    • + + ${w.toString()} + +
      + + - + +    +    +
      +
      + +
      +
    • +
      +
    +
    +
    +
    +
    +
    +
    + + + +
    + + + + +
    + + + +

    + Pile (${IndexCard.countByBookmarked(true) + Writing.countByBookmarked(true) + + Journal.countByBookmarked(true) + Planner.countByBookmarked(true) + Task.countByBookmarked(true) + Book.countByBookmarked(true)}) +

    +
    + + + +

    ${mcs.Operation.executeQuery('select count(*) from mcs.Operation where deletedOn = null and bookmarked = true order by id desc')[0]} pending operation(s)

    + + + + Mark all operations as settled + + +
    + + %{-- + %{-- + %{--todo: repeat--}% + %{----}% + %{-- + %{----}% + %{----}% + %{----}% +
    + +
    +
    + +%{--

    --}% +%{-- Notes (${IndexCard.countByCourse(record)})--}% +%{--

    --}% + +%{--
    --}% +%{-- --}% +%{--
    --}% + + diff --git a/grails-app/views/appPile/main.gsp b/grails-app/views/appPile/main.gsp index bf67bab..4ee05f4 100755 --- a/grails-app/views/appPile/main.gsp +++ b/grails-app/views/appPile/main.gsp @@ -21,6 +21,9 @@ + + + %{----}% @@ -28,7 +31,7 @@ - Nibras Pile + Reader %{-- ${OperationController.getPath('app.name') ? OperationController.getPath('app.name') + ' /Study': 'Nibras PKM /Study'}--}% %{--<g:meta name="app.version"/>--}% diff --git a/grails-app/views/gTemplates/_addForm.gsp b/grails-app/views/gTemplates/_addForm.gsp old mode 100644 new mode 100755 index adfc70d..3525757 --- a/grails-app/views/gTemplates/_addForm.gsp +++ b/grails-app/views/gTemplates/_addForm.gsp @@ -1,64 +1,68 @@ <%@ page import="app.Contact; ker.OperationController; app.parameters.Blog;mcs.Department; mcs.parameters.WorkStatus;" %> -<g:if test="${record}"> - <g:render template="/gTemplates/recordSummary" model="[record: record]"/> -</g:if> -<div style="margin: 10px; padding: 5px; border: 0.5px solid darkgray !important;"> +%{--<g:if test="${record}">--}% + %{--<g:render template="/gTemplates/recordSummary" model="[record: record]"/>--}% +%{--</g:if>--}% +<h4>Add record</h4> <g:formRemote name="genericSearch" id="genericSearch22" url="[controller: 'generics', action: 'saveViaForm']" - update="${updateRegion}" method="post" style="display: inline; " onComplete=""> + class="uk-form-stacked uk-grid-small uk-margin-small-left uk-margin-small-right" + update="${updateRegion}" method="post" onComplete=""> <g:hiddenField name="entityController" value="${entityController}"/> <g:hiddenField name="updateRegion" value="${updateRegion}"/> <g:hiddenField name="id" value="${record?.id}"/> - - <table> + %{--<div style="uk-grid" uk-grid>--}% <g:if test="${ker.OperationController.getPath('courses.enabled')?.toLowerCase() == 'yes'}"> - <tr> <g:if test="${fields.contains('book')}"> - <td> - <label>Resource</label> - <g:select name="book.id" style="width: 200px;" + <div> + <label class="uk-form-label">Resource</label> + <div class="uk-form-controls"> + <g:select class="uk-width-1-1 uk-select" name="book.id" style="width: 200px;" from="${record?.book ? [record.book] + mcs.Book.executeQuery('from Book r where r.type.code = ? and r.status.code = ? order by r.title asc', ['prd', 'zbk']) : mcs.Book.executeQuery('from Book r where r.type.code = ? and r.status.code = ? order by r.title asc', ['prd', 'zbk'])}" value="${record?.book?.id}" optionKey="id" optionValue="title" noSelection="${['null': 'No book']}"/> - </td> + </div> + </div> </g:if> <g:if test="${fields.contains('contact')}"> - <td> - <label>Contact</label> - <g:select name="contact.id" class="ui-corner-all" + <div> + <label class="uk-form-label">Contact</label> + <div class="uk-form-controls"> + <g:select class="uk-width-1-1 uk-select" name="contact.id" class="ui-corner-all" from="${sources}" optionKey="id" value="${record?.contact?.id}" noSelection="${['null': 'No person']}"/> - </td> + </div> + </div> </g:if> <g:if test="${fields.contains('department')}"> - <td> - <label>Department</label> - <g:select name="department.id" style="width: 200px;" from="${departments}" + <div> + <label class="uk-form-label">Department</label> + + <g:select class="uk-width-1-1 uk-select" name="department.id" style="width: 200px;" from="${departments}" value="${record?.department?.id}" optionKey="id" optionValue="summary" noSelection="${['null': 'No department']}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('course')}"> - <td> - <label>Course</label> - <g:select name="course.id" style="width: 200px;" from="${courses}" + <div> + <label class="uk-form-label">Course</label> + <g:select class="uk-width-1-1 uk-select" name="course.id" style="" from="${courses}" id="chosenCourse${record?.id}" value="${record?.course?.id}" optionKey="id" optionValue="summary" noSelection="${['null': 'No course']}"/> - + </div> <script type="text/javascript"> @@ -68,52 +72,50 @@ }) </script> - </td> </g:if> - </tr> </g:if> - <tr> <g:if test="${fields.contains('queryType')}"> - <td> - <label>Query type</label> - <g:select name="queryType" from="${['hql', 'lucene', 'adhoc']}" value="${record?.queryType}"/> - </td> + + + <div> + <label class="uk-form-label">Query type</label> + <g:select class="uk-width-1-1 uk-select" name="queryType" from="${['hql', 'lucene', 'adhoc']}" value="${record?.queryType}"/> + </div> </g:if> <g:if test="${fields.contains('code')}"> - <td> - <label>Code</label> - <g:textField name="code" placeholder="Code" title="Code" class="ui-corner-all" + <div> + <label class="uk-form-label">Code</label> + <g:textField class="uk-width-1-1 uk-input" name="code" placeholder="Code" title="Code" value="${record?.code}"/> - </td> + </div> </g:if> %{--<g:if test="${fields.contains('slug')}">--}% - %{--<td>--}% + %{----}% - %{--<g:textField name="slug" placeholder="Slug" title="Slug" class="ui-corner-all"--}% + %{--<g:textField class="uk-width-1-1 uk-input" name="slug" placeholder="Slug" title="Slug" --}% %{--value="${record?.slug}"/>--}% %{--</g:if>--}% %{--<g:if test="${fields.contains('publishedNodeId')}">--}% - %{--<td>--}% - %{--Pub. Id: <g:textField id="publishedNodeId" name="publishedNodeId"--}% + %{----}% + %{--Pub. Id: <g:textField class="uk-width-1-1 uk-input" id="publishedNodeId" name="publishedNodeId"--}% %{--placeholder="Published node Id" title="Published node Id"--}% - %{--style="width: 90px;" class="ui-corner-all"--}% + %{--style="width: 90px;" --}% %{--value="${record?.publishedNodeId}"/>--}% %{--</g:if>--}% - </td> + <g:if test="${fields.contains('type')}"> - <td> - <label>Type</label> - <g:select name="type.id" style="width: 150px;" + <div> + <label class="uk-form-label">Type</label> + <g:select class="uk-width-1-1 uk-select" name="type.id" style="width: 150px;" from="${types}" optionKey="id" optionValue="name" value="${record?.type?.id}" id="chosenType${record?.id}" noSelection="${['null': 'No type']}"/> - </td> - + </div> <script type="text/javascript"> jQuery("#chosenType${record?.id}").chosen({ allow_single_deselect: true, @@ -124,15 +126,14 @@ </g:if> <g:if test="${fields.contains('category')}"> - <td> - <label>Category</label> - <g:select name="category.id" style="width: 150px;" + <div> + <label class="uk-form-label">Category</label> + <g:select class="uk-width-1-1 uk-select" name="category.id" style="width: 150px;" from="${categories}" optionKey="id" value="${record?.category?.id}" id="chosenCategory${record?.id}" noSelection="${['null': 'No category']}"/> - </td> - + </div> <script type="text/javascript"> jQuery("#chosenCategory${record?.id}").chosen({ allow_single_deselect: true, @@ -144,14 +145,14 @@ <g:if test="${fields.contains('writing')}"> - <td> - <label>Writing</label> - <g:select name="writing.id" from="${writings}" style="width: 150px;" + <div> + <label class="uk-form-label">Writing</label> + <g:select class="uk-width-1-1 uk-select" name="writing.id" from="${writings}" style="width: 150px;" optionKey="id" optionValue="summary" id="chosenWriting${record?.id}" value="${record?.writing?.id ?: (session['writingId'] ?: null)}" noSelection="['null': 'No writing']"/> - + </div> <script type="text/javascript"> jQuery("#chosenWriting${record?.id}").chosen({ @@ -160,22 +161,21 @@ }) </script> - </td> </g:if> <g:if test="${fields.contains('status')}"> - <td> + <div> - <label>Status</label> - <g:select name="status.id" style="width: 150px;" + <label class="uk-form-label">Status</label> + <g:select class="uk-width-1-1 uk-select" name="status.id" style="width: 150px;" from="${statuses}" optionKey="id" optionValue="name" id="chosenStatus${record?.id}" data-placeholder="No status" value="${record?.status?.id}" noSelection="${['null': 'No status']}"/> - </td> + </div> <script type="text/javascript"> jQuery("#chosenStatus${record?.id}").chosen({ @@ -187,17 +187,17 @@ </g:if> <g:if test="${fields.contains('goal')}"> + <div> + + <label class="uk-form-label">Goal</label> - <td> - <label>Goal</label> - - <g:select name="goal.id" from="${goals}" style="width: 150px;" + <g:select class="uk-width-1-1 uk-select" name="goal.id" from="${goals}" style="width: 150px;" optionKey="id" optionValue="summary" data-placeholder="No goal" id="chosenGoal${record?.id}" value="${record?.goal?.id ?: (session['goalId'] ?: null)}" noSelection="['null': 'No goal']"/> - + </div> <script type="text/javascript"> jQuery("#chosenGoal${record?.id}").chosen({ @@ -206,723 +206,752 @@ }) </script> - </td> + </g:if> %{--<g:if test="${fields.contains('location')}">--}% - %{--<td>--}% - %{--<g:select name="location.id" style="width: 150px;"--}% + %{----}% + %{--<g:select class="uk-width-1-1 uk-select" name="location.id" style="width: 150px;"--}% %{--from="${locations}" optionKey="id" optionValue="name"--}% %{--value="${record?.location?.id}"--}% %{--noSelection="${['null': 'No location']}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% <g:if test="${fields.contains('context')}"> - <td> - <label>Context</label> - <g:select name="context.id" style="width: 150px;" + <div> + <label class="uk-form-label">Context</label> + <g:select class="uk-width-1-1 uk-select" name="context.id" style="width: 150px;" from="${contexts}" optionKey="id" optionValue="name" value="${record?.context?.id}" noSelection="${['null': 'No context']}"/> - </td> + </div> </g:if> - </tr> - <tr> + + <g:if test="${fields.contains('numberCode')}"> - <td> - <label>Code (number)</label> - <g:textField name="numberCode" placeholder="Number Code" title="Number Code" class="ui-corner-all" + <div> + <label class="uk-form-label">Code (number)</label> + <g:textField class="uk-width-1-1 uk-input" name="numberCode" placeholder="Number Code" title="Number Code" value="${record?.numberCode}"/> - </td> + </div> </g:if> - %{--<g:if test="${fields.contains('username')}">--}% - %{--<td>--}% - %{--<g:textField name="username" placeholder="Username" title="Username" class="ui-corner-all"--}% - %{--value="${record?.username}"/>--}% - %{--</td>--}% - %{--</g:if>--}% - %{--<g:if test="${fields.contains('password')}">--}% - %{--<td>--}% - %{--<g:textField name="password" placeholder="Password" title="Password" class="ui-corner-all"--}% - %{--value="${record?.password}"/>--}% - %{--</td>--}% - %{--</g:if>--}% + <g:if test="${fields.contains('username')}"> + <div> + <g:textField class="uk-width-1-1 uk-input" name="username" placeholder="Username" title="Username" + value="${record?.username}"/> + </div> + </g:if> + <g:if test="${fields.contains('password')}"> + <div> + <g:textField class="uk-width-1-1 uk-input" name="password" placeholder="Password" title="Password" + value="${record?.password}"/> + </div> + </g:if> <g:if test="${fields.contains('name')}"> - <td> - <label>Name</label> - <g:textField name="name" placeholder="Name" title="Name" class="ui-corner-all" + <div> + <label class="uk-form-label">Name</label> + <g:textField class="uk-width-1-1 uk-input" name="name" placeholder="Name" title="Name" value="${record?.name}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('value')}"> - <td> - <label>Value</label> - <g:textArea id="value" name="value" placeholder="Value" title="Value" style="width: 250px;" - class="ui-corner-all" - rows="5" cols="80" + <div> + <label class="uk-form-label">Value</label> + <g:textField class="uk-width-1-1 uk-input" id="value" name="value" placeholder="Value" title="Value" style="width: 250px;" value="${record?.value}"/> - </td> + %{--rows="5" cols="80"--}% + </div> </g:if> - </tr> + - <tr> + <g:if test="${fields.contains('summary')}"> - <td colspan="3"> - <label>Summary</label> - <g:textField id="sumamryField" name="summary" title="summary" value="${record?.summary}" - style="width: 95%;"/> - </td> + + <div> + <label class="uk-form-label">Summary</label> + <g:textField class="uk-width-1-1 uk-input" id="sumamryField" name="summary" title="summary" value="${record?.summary}" + /> + </div> </g:if> - </tr> - <tr> + + <g:if test="${fields.contains('title')}"> - <td colspan="2"> - <label>Title</label> - <g:textField placeholder="Title" name="title" title="title" value="${record?.title}" - style="width: 95%;"/> - + <div> + <label class="uk-form-label">Title</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="Title" name="title" title="title" value="${record?.title}" + /> +</div> <g:if test="${fields.contains('authorInfo')}"> - <label>Author info</label> - <g:textField placeholder="Author infor" name="authorInfo" title="Author info" - value="${record?.authorInfo}" - style="width: 95%;"/> + <div> + <label class="uk-form-label">Author info</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="Author infor" name="authorInfo" title="Author info" + value="${record?.authorInfo}"/> + </div> </g:if> <g:if test="${ker.OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> <g:if test="${fields.contains('legacyTitle')}"> - <br/> - <label>Legacy title</label> - <g:textField placeholder="Legacy title" name="legacyTitle" title="Legacy title" - value="${record?.legacyTitle}" style="width: 95%;"/> - +<div> + <label class="uk-form-label">Legacy title</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="Legacy title" name="legacyTitle" title="Legacy title" + value="${record?.legacyTitle}" /> + </div> </g:if> </g:if> - </td> + </g:if> <g:if test="${fields.contains('link')}"> - <td colspan="3"> - <label>Link</label> - <g:textField placeholder="link (should start with http and ends with /xmlrpc.php" name="link" + <div> + <label class="uk-form-label">Link</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="link (should start with http and ends with /xmlrpc.php" name="link" title="link" - value="${record?.link}" style="width: 150px;"/> - </td> + value="${record?.link}" style="width: 350px;"/> + </div> </g:if> <g:if test="${fields.contains('style')}"> - <td> - <label>Style</label> - <g:textField id="style" name="style" placeholder="CSS Style" title="CSS Style" style="width: 120px;" - class="ui-corner-all" + <div> + <label class="uk-form-label">Style</label> + <g:textField class="uk-width-1-1 uk-input" id="style" name="style" placeholder="CSS Style" title="CSS Style" style="width: 120px;" + value="${record?.style}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('color')}"> - <td> - <label>Color</label> - <g:textField id="color" name="color" placeholder="Color" title="Color" color="width: 60px;" - class="ui-corner-all" + <div> + <label class="uk-form-label">Color</label> + <g:textField class="uk-width-1-1 uk-input" id="color" name="color" placeholder="Color" title="Color" color="width: 60px;" + value="${record?.color}"/> - </td> + </div> </g:if> - %{--</tr>--}% + %{----}% - %{--<tr>--}% + %{----}% <g:if test="${fields.contains('author')}"> - <td> - <label>Author</label> - <g:textField name="author" placeholder="Author" title="Author" class="ui-corner-all" + <div> + <label class="uk-form-label">Author</label> + <g:textField class="uk-width-1-1 uk-input" name="author" placeholder="Author" title="Author" value="${record?.author}"/> + </div> + <g:if test="${OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> - <br/> - <label>Bib author</label> - <g:textField name="authorInBib" placeholder="Author in Bib" title="Author in Bib" - class="ui-corner-all" + <div> + <label class="uk-form-label">Bib author</label> + <g:textField class="uk-width-1-1 uk-input" name="authorInBib" placeholder="Author in Bib" title="Author in Bib" value="${record?.authorInBib}"/> + </div> </g:if> - <br/> - <label>Trans.</label> - <g:textField name="translator" placeholder="Translator" title="Translator" class="ui-corner-all" + + <div> + <label class="uk-form-label">Trans.</label> + <g:textField class="uk-width-1-1 uk-input" name="translator" placeholder="Translator" title="Translator" value="${record?.translator}"/> - <br/> - <label>Editor</label> - <g:textField name="editor" placeholder="Editor" title="Editor" class="ui-corner-all" + + </div> + <div> + <label class="uk-form-label">Editor</label> + <g:textField class="uk-width-1-1 uk-input" name="editor" placeholder="Editor" title="Editor" value="${record?.editor}"/> - </td> + </div> </g:if> - </tr> - <tr> + + <g:if test="${fields.contains('publisher')}"> - <td> - <label>Publisher</label> - <g:textField name="publisher" + <div> + <label class="uk-form-label">Publisher</label> + <g:textField class="uk-width-1-1 uk-input" name="publisher" placeholder="Publisher" title="Publisher" style="width: 200px;" value="${fieldValue(bean: record, field: 'publisher')}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('journal')}"> - <td colspan="2"> - <label>Journal</label> - <g:textField placeholder="Journal" name="journal" value="${record?.journal}" - style="width: 95%;"/> - </td> + <div> + <label class="uk-form-label">Journal</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="Journal" name="journal" value="${record?.journal}" + /> + </div> </g:if> - </tr> - <tr> + + <g:if test="${fields.contains('edition')}"> - <td> - <label>Ed.</label> <g:textField name="edition" + <div> + <label class="uk-form-label">Ed.</label> + <g:textField class="uk-width-1-1 uk-input" name="edition" value="${fieldValue(bean: record, field: 'edition')}" placeholder="Edition" title="Edition" style="width: 80px;"/> - <br/> - <label>Vol.</label> <g:textField name="volume" value="${fieldValue(bean: record, field: 'volume')}" - placeholder="volume" title="volume" style="width: 80px;"/> + </div> - </td> + <div> + + <label class="uk-form-label">Vol.</label> + <g:textField class="uk-width-1-1 uk-input" name="volume" value="${fieldValue(bean: record, field: 'volume')}" + placeholder="volume" title="volume" style="width: 80px;"/> + </div> + </g:if> - <g:if test="${fields.contains('year')}"> - <td> - <label>Year</label> - <g:textField name="year" value="${fieldValue(bean: record, field: 'year')}" - placeholder="year" title="year" style="width: 80px;"/> + <g:if test="${fields.contains('resourceYear')}"> + <div> + <label class="uk-form-label">Year</label> + <g:textField class="uk-width-1-1 uk-input" name="resourceYear" value="${fieldValue(bean: record, field: 'resourceYear')}" + placeholder="Year" title="resourceYear" style="width: 80px;"/> + </div> + <g:if test="${fields.contains('number')}"> - <br/> - <label>Number</label> - <g:textField name="number" value="${fieldValue(bean: record, field: 'number')}" + <div> + <label class="uk-form-label">Number</label> + <g:textField class="uk-width-1-1 uk-input" name="number" value="${fieldValue(bean: record, field: 'number')}" placeholder="number" title="number" style="width: 80px;"/> + </div> </g:if> - </td> + </g:if> <g:if test="${fields.contains('month')}"> - <td> - <label>Month</label> - <g:textField name="month" value="${fieldValue(bean: record, field: 'month')}" + <div> + <label class="uk-form-label">Month</label> + <g:textField class="uk-width-1-1 uk-input" name="month" value="${fieldValue(bean: record, field: 'month')}" placeholder="month" title="month" style="width: 80px;"/> + </div> <g:if test="${fields.contains('series')}"> - <br/> - <label>Series</label> - <g:textField name="series" value="${fieldValue(bean: record, field: 'series')}" + <div> + <label class="uk-form-label">Series</label> + <g:textField class="uk-width-1-1 uk-input" name="series" value="${fieldValue(bean: record, field: 'series')}" placeholder="series" title="series" style="width: 80px;"/> + </div> </g:if> - </td> + </g:if> %{--<g:if test="${fields.contains('indicator')}">--}% - %{--<td>--}% - %{--<g:select name="indicator.id" class="ui-corner-all"--}% + %{----}% + %{--<g:select class="uk-width-1-1 uk-select" name="indicator.id" --}% %{--from="${indicators}"--}% %{--optionKey="id" optionValue="code"--}% %{--value="${record?.indicator?.id ?: (session['lastIndicatorId'] ?: null)}"--}% %{--noSelection="${['null': '']}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% %{--<g:if test="${fields.contains('category') && entityCode == 'Q'}">--}% - %{--<td>--}% - %{--<g:select name="category.id" class="ui-corner-all"--}% + %{----}% + %{--<g:select class="uk-width-1-1 uk-select" name="category.id" --}% %{--from="${app.PaymentCategory.list()}" optionKey="id"--}% %{--value="${record?.category?.id}"--}% %{--noSelection="${['null': '']}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% - </tr> + - <tr> + <g:if test="${fields.contains('query')}"> - <td colspan="2"> - <label>Query</label> - <g:textField placeholder="Query" title="Query" rows="5" name="query" value="${record?.query}" - style="width: 99%;"/> + <div> + <label class="uk-form-label">Query</label> + <g:textArea class="uk-width-1-1 uk-textarea" placeholder="Query" title="Query" rows="5" name="query" value="${record?.query}" + /> + </div> </g:if> <g:if test="${fields.contains('countQuery')}"> - <br/> - <label>Count query</label> - <g:textField placeholder="Count query" title="Count query" name="countQuery" + <div> + <label class="uk-form-label">Count query</label> + <g:textArea class="uk-width-1-1 uk-textarea" placeholder="Count query" title="Count query" name="countQuery" value="${record?.countQuery}" - style="width: 99%;"/> - </td> + /> + </div> </g:if> <g:if test="${fields.contains('nbPages')}"> - <td> - <label>Nb. pages</label> - <g:textField placeholder="Nb. pages" title="Nb. pages" id="pages" name="nbPages" - style="width: 150px" - class="ui-corner-all" + <div> + <label class="uk-form-label">Nb. pages</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="Nb. pages" title="Nb. pages" id="pages" name="nbPages" value="${record?.nbPages}"/> - <br/> + </div> + + <g:if test="${fields.contains('isbn')}"> - <label>ISBN</label> - <g:textField placeholder="ISBN" name="isbn" title="isbn" value="${record?.isbn}" + <div> + <label class="uk-form-label">ISBN</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="ISBN" name="isbn" title="isbn" value="${record?.isbn}" style="width: 150px;"/> + </div> </g:if> - </td> + </g:if> <g:if test="${fields.contains('pages')}"> - <td> - <label>Pages</label> - <g:textField placeholder="Pages" title="Pages" id="pages" name="pages" style="width: 150px" - class="ui-corner-all" + <div> + <label class="uk-form-label">Pages</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="Pages" title="Pages" id="pages" name="pages" style="width: 150px" + value="${record?.pages}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('sourceFree')}"> - <td colspan="2"> - <label>Source</label> - <g:textField placeholder="Source" - id="sourceFree" name="sourceFree" style="width: 95%;" - class="ui-corner-all" + <div> + <label class="uk-form-label">Source</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="Source" + id="sourceFree" name="sourceFree" value="${record?.sourceFree}"/> + </div> <g:if test="${fields.contains('url')}"> - <label>URL</label> - <g:textField placeholder="URL" name="url" value="${record?.url}" - style="width: 95%;"/> - + <div> + <label class="uk-form-label">URL</label> + <g:textField class="uk-width-1-1 uk-input" placeholder="URL" name="url" value="${record?.url}" + /> + </div> </g:if> - </td> + </g:if> - </tr> - <tr> + + <g:if test="${fields.contains('startDate')}"> - <td> - <table> - <tr> - <td> <label>Start date</label> + + <div> + + <label class="uk-form-label">Start date</label> <pkm:datePicker placeholder="" name="startDate" value="${record?.startDate}"/> - </td> - <td> <label>time</label> + </div> + <div> + <label class="uk-form-label">time</label> + + <g:textField class="uk-width-1-1 uk-input" name="startTime" style="width:60px;" placeholder="Start time" title="Start time" + value="${record?.startDate ? record?.startDate?.format('HH.mm') : '00.00'}"/> + </div> - <g:textField name="startTime" style="width:60px;" placeholder="Start time" title="Start time" - value="${record?.startDate ? record?.startDate?.format('HH.mm') : '00.00'}"/></td> - </tr> - </table> - </td> + </g:if> <g:if test="${fields.contains('endDate')}"> - <td> - <table> - <tr> - <td> <label>End date</label> + + <div> + + <label class="uk-form-label">End date</label> <pkm:datePicker name="endDate" placeholder="End date" id="asdfasdf" - value="${record?.endDate}"/></td> - <td> <label>time</label> - <g:textField name="endTime" style="width:60px;" placeholder="Time" title="End time" - value="${record?.endDate ? record?.endDate?.format('HH.mm') : '00.00'}"/></td> - </tr> - </table> + value="${record?.endDate}"/> + </div> + <div> + <label class="uk-form-label">time</label> + <g:textField class="uk-width-1-1 uk-input" name="endTime" style="width:60px;" placeholder="Time" title="End time" + value="${record?.endDate ? record?.endDate?.format('HH.mm') : '00.00'}"/> + + </div> - </td> + </g:if> <g:if test="${fields.contains('completedOn')}"> - <td> - <label>Completed on</label> + <div> + <label class="uk-form-label">Completed on</label> <pkm:datePicker name="completedOn" placeholder="" value="${record?.completedOn}"/> - </td> + </div> </g:if> %{--<g:if test="${fields.contains('actualEndDate')}">--}% - %{--<td>--}% + %{----}% %{--Actual end date<pkm:datePicker name="actualEndDate" placeholder="Actual end date" id="234rsdfsdf"--}% %{--value="${record?.actualEndDate}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% <g:if test="${fields.contains('publicationCity')}"> - <td> - <label>Pub. city</label> - <g:textField name="publicationCity" + <div> + <label class="uk-form-label">Publication city</label> + <g:textField class="uk-width-1-1 uk-input" name="publicationCity" placeholder="Publication City" title="Publication City" style="width: 200px;" value="${fieldValue(bean: record, field: 'publicationCity')}"/> - </td> - - <td> + </div> - <label>Pub. date</label> - <g:textField name="publicationDate" placeholder="Publication date" + +<div> + <label class="uk-form-label">Publication date</label> + <g:textField class="uk-width-1-1 uk-input" name="publicationDate" placeholder="Publication date" value="${record?.publicationDate}"/> - </td> + </div> - <td> - <label>Pub. on</label> + <div> + <label class="uk-form-label">Published on</label> <pkm:datePicker placeholder="Pub. on" name="publishedOn" value="${record?.publishedOn}"/> - - </td> + </div> + </g:if> - </tr> + - <tr> + <g:if test="${fields.contains('description')}"> - <td colspan="2"> - <label>Description</label> - <g:textArea cols="80" rows="5" placeholder="Description" title="Description" name="description" + <div> + <label class="uk-form-label">Description</label> + <g:textArea class="uk-width-1-1 uk-textarea" cols="80" rows="5" placeholder="Description" title="Description" name="description" value="${record?.description}" - style="width: 95%; height: 100px;"/> - </td> + style="height: 100px;"/> + </div> </g:if> %{-- <g:if test="${fields.contains('recurringInterval')}">--}% - %{-- <td>--}% - %{-- <label>Recurring interval</label>--}% - %{-- <g:textField name="recurringInterval"--}% + %{-- --}% + %{-- <label class="uk-form-label">Recurring interval</label>--}% + %{-- <g:textField class="uk-width-1-1 uk-input" name="recurringInterval"--}% %{-- value="${fieldValue(bean: record, field: 'recurringInterval')}"--}% %{-- placeholder="" title="recur #" style="width: 20px;"/>--}% - %{-- </td>--}% + %{-- --}% %{-- </g:if> --}% <g:if test="${fields.contains('recurringCron')}"> - <td> - <label>Recurrence cron expression: </label> + <div> + <label class="uk-form-label">Recurrence cron expression: </label> <br/> <i>min h dom mon dow y*, e.g. <b>0 8 * * 1</b></i> - <g:textField name="recurringCron" + <g:textField class="uk-width-1-1 uk-input" name="recurringCron" value="${fieldValue(bean: record, field: 'recurringCron')}"/> - - </td> + </div> + </g:if> <g:if test="${fields.contains('fullText')}"> - <td colspan="2"> - <label>Full text</label> - <g:textArea cols="80" rows="5" placeholder="Full text" title="Full text" name="fullText" + <div> + <label class="uk-form-label">Full text</label> + <g:textArea class="uk-width-1-1 uk-textarea" cols="80" rows="5" placeholder="Full text" title="Full text" name="fullText" value="${record?.fullText}" - style="width: 95%; height: 100px;"/> - </td> + style="height: 100px;"/> + </div> </g:if> - </tr> - <tr> + + <g:if test="${fields.contains('shortDescription')}"> - <td colspan="2"> - <label>Short description</label> - <g:textArea cols="80" rows="5" placeholder="Short description" + <div> + <label class="uk-form-label">Short description</label> + <g:textArea class="uk-width-1-1 uk-textarea" cols="80" rows="5" placeholder="Short description" title="Short description" name="shortDescription" value="${record?.shortDescription}" - style="width: 95%; height: 80px;"/> - </td> + style="height: 80px;"/> + </div> </g:if> %{--<g:if test="${fields.contains('descriptionHTML')}">--}% %{--<td colspan="2">--}% - %{--<g:textArea cols="80" rows="5" placeholder="descriptionHTML"--}% + %{--<g:textArea class="uk-width-1-1 uk-textarea" cols="80" rows="5" placeholder="descriptionHTML"--}% %{--title="Description HTML" name="descriptionHTML"--}% %{--value="${record?.descriptionHTML}"--}% %{--style="width: 95%; height: 100px;"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% - </tr> + - %{--<tr>--}% + %{----}% %{--<g:if test="${fields.contains('newFilesPath')}">--}% - %{--<td>--}% - %{--new <g:textField placeholder="Path of its location in the new folder"--}% + %{----}% + %{--new <g:textField class="uk-width-1-1 uk-input" placeholder="Path of its location in the new folder"--}% %{--id="newFilesPath" name="newFilesPath"--}% %{--style="width: 200px"--}% - %{--class="ui-corner-all"--}% + %{----}% %{--value="${record?.newFilesPath ?: null}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% - %{--</tr>--}% - <tr> + %{----}% + %{--<g:if test="${fields.contains('repositoryPath')}">--}% - %{--<td>--}% - %{--rps <g:textField--}% + %{----}% + %{--rps <g:textField class="uk-width-1-1 uk-input" --}% %{--placeholder="Path of its location in the repository"--}% %{--id="repositoryPath" name="repositoryPath" style="width: 200px"--}% - %{--class="ui-corner-all"--}% + %{----}% %{--value="${record?.repositoryPath ?: null}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% %{--<g:if test="${fields.contains('libraryPath')}">--}% - %{--<td>--}% - %{--lib <g:textField--}% + %{----}% + %{--lib <g:textField class="uk-width-1-1 uk-input" --}% %{--placeholder="Path of its location in the library"--}% %{--id="libraryPath" name="libraryPath" style="width: 200px"--}% - %{--class="ui-corner-all"--}% + %{----}% %{--value="${record?.libraryPath ?: null}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% <g:if test="${fields.contains('metaType')}"> - <td> - <g:textField id="metaType" name="metaType" + <div> + <g:textField class="uk-width-1-1 uk-input" id="metaType" name="metaType" placeholder="metaType" title="metaType" style="width: 150px;" value="${record?.metaType}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('path')}"> - <td> + <div> - <g:textField id="path" name="path" + <g:textField class="uk-width-1-1 uk-input" id="path" name="path" placeholder="Path" title="path" style="width: 150px;" value="${record?.path}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('extensions')}"> - <td> - <g:textField id="extensions" name="extensions" + <div> + <g:textField class="uk-width-1-1 uk-input" id="extensions" name="extensions" placeholder="Extensions" title="extensions" style="width: 150px;" value="${record?.extensions}"/> - </td> + </div> </g:if> %{--<g:if test="${fields.contains('blog')}">--}% - %{--<td>--}% - %{--todo <g:select name="blog.id" style="width: 150px;"--}% + %{----}% + %{--todo <g:select class="uk-width-1-1 uk-select" name="blog.id" style="width: 150px;"--}% %{--from="${Blog.list([sort: 'code'])}" optionKey="id" optionValue="summary"--}% %{--value="${record?.blog?.id}"--}% %{--noSelection="${['null': 'No blog']}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% <g:if test="${fields.contains('notes')}"> - <td colspan="1"> - <label>Notes</label> - <g:textArea cols="80" rows="5" id="notes" placeholder="" title="Notes" - name="notes" style="width: 95%; max-width: 390px" class="ui-corner-all" + <div> + <label class="uk-form-label">Notes</label> + <g:textArea class="uk-width-1-1 uk-textarea" cols="80" rows="5" id="notes" placeholder="" title="Notes" + name="notes" style="" value="${record?.notes}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('bibEntry')}"> - <td colspan="1"> - <label>Bib entry</label> - <g:textArea cols="80" rows="5" id="bibEntry" + <div> + <label class="uk-form-label">Bib entry</label> + <g:textArea class="uk-width-1-1 uk-textarea" cols="80" rows="5" id="bibEntry" placeholder="bibEntry" title="bibEntry" name="bibEntry" - style="width: 95%; max-width: 400px" class="ui-corner-all" + style="width: 95%; max-width: 400px" value="${record?.bibEntry}"/> - </td> + </div> </g:if> - </tr> + - <tr> + <g:if test="${fields.contains('entity')}"> - <td> - <label>Entity</label> - <g:textField id="entity" name="entity" placeholder="Entity" title="Entity" style="width: 150px;" + <div> + <label class="uk-form-label">Entity</label> + <g:textField class="uk-width-1-1 uk-input" id="entity" name="entity" placeholder="Entity" title="Entity" style="width: 150px;" value="${record?.entity}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('module')}"> - <td> - <label>Module</label> - <g:textField id="module" name="module" placeholder="" title="Module" style="width: 150px;" + <div> + <label class="uk-form-label">Module</label> + <g:textField class="uk-width-1-1 uk-input" id="module" name="module" placeholder="" title="Module" style="width: 150px;" value="${record?.module}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('prefix')}"> - <td> - <label>Prefix</label> - <g:textField id="prefix" name="prefix" placeholder="" title="Prefix" style="width: 150px;" + <div> + <label class="uk-form-label">Prefix</label> + <g:textField class="uk-width-1-1 uk-input" id="prefix" name="prefix" placeholder="" title="Prefix" value="${record?.prefix}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('priority')}"> - <td> - <label>Priority</label> - <g:select name="priority" placeholder="Priority" style="width: 50px;" + <div> + <label class="uk-form-label">Priority</label> + <g:select class="uk-width-1-1 uk-select" name="priority" placeholder="Priority" from="${[1, 2, 3, 4]}" value="${record?.priority ?: 2}"/> - </td> + </div> </g:if> <g:if test="${fields.contains('language')}"> - <td> - <label>Language</label> - %{--<g:textField placeholder="Lang. code"--}% + <div> + <label class="uk-form-label"> + Language</label> + %{--<g:textField class="uk-width-1-1 uk-input" placeholder="Lang. code"--}% %{--title="Lang. code"--}% %{--name="language" style="width: 100px" value="${record?.language ?: 'ar'}"/>--}% - <g:select name="language" from="${OperationController.getPath('repository.languages').split(',')}" - style="overflow: visible; z-index: 200; background: lightgrey" noSelection="${['': '']}" + <g:select class="uk-width-1-1 uk-select" name="language" from="${OperationController.getPath('repository.languages').split(',')}" + style="overflow: visible; z-index: 200;" noSelection="${['': '']}" value="${record?.language ?: (OperationController.getPath('default.language') ?: '')}"/> - - </td> + </div> + </g:if> <g:if test="${fields.contains('plannedDuration')}"> - <td> - Planned duration (min) - <br/><g:textField name="plannedDuration" value="${fieldValue(bean: record, field: 'plannedDuration')}" + <div> + <label class="uk-form-label"> + Planned duration (min) + </label> + <g:textField class="uk-width-1-1 uk-input" name="plannedDuration" value="${fieldValue(bean: record, field: 'plannedDuration')}" placeholder="" - title="# planned duration" - style="width: 80px;"/> + title="# planned duration"/> + </div> %{--<br/>--}% - %{--Completed steps<g:textField name="completedSteps"--}% + %{--Completed steps<g:textField class="uk-width-1-1 uk-input" name="completedSteps"--}% %{--value="${fieldValue(bean: record, field: 'completedSteps')}"--}% %{--placeholder="# actual steps"--}% %{--title="# actual steps"--}% %{--style="width: 20px;"/>--}% - </td> + </g:if> %{-- <g:if test="${fields.contains('totalSteps')}">--}% -%{-- <td>--}% -%{-- Total steps<g:textField name="totalSteps" value="${fieldValue(bean: record, field: 'totalSteps')}"--}% +%{-- --}% +%{-- Total steps<g:textField class="uk-width-1-1 uk-input" name="totalSteps" value="${fieldValue(bean: record, field: 'totalSteps')}"--}% %{-- placeholder="# total steps"--}% %{-- title="# total steps"--}% %{-- style="width: 20px;"/>--}% %{-- --}%%{--<br/>--}% -%{-- --}%%{--Completed steps<g:textField name="completedSteps"--}% +%{-- --}%%{--Completed steps<g:textField class="uk-width-1-1 uk-input" name="completedSteps"--}% %{-- --}%%{--value="${fieldValue(bean: record, field: 'completedSteps')}"--}% %{-- --}%%{--placeholder="# actual steps"--}% %{-- --}%%{--title="# actual steps"--}% %{-- --}%%{--style="width: 20px;"/>--}% -%{-- </td>--}% +%{-- --}% %{-- </g:if>--}% %{--<g:if test="${fields.contains('percentCompleted')}">--}% - %{--<td>--}% - %{--%<g:select name="percentCompleted" placeholder="percentCompleted" style="width: 50px;"--}% + %{----}% + %{--%<g:select class="uk-width-1-1 uk-select" name="percentCompleted" placeholder="percentCompleted" style="width: 50px;"--}% %{--from="${[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]}"--}% %{--noSelection="${['null': '0']}"--}% %{--value="${record?.percentCompleted ?: 0}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% <g:if test="${fields.contains('level')}"> - <td> - <label>Level</label> - <g:select name="level" value="${record?.level}" + <div> + <label class="uk-form-label">Level</label> + <g:select class="uk-width-1-1 uk-select" name="level" value="${record?.level}" from="${['m', 'd', 'W', 'r', 'M', 'A', 'y', 'e', 'l']}" noSelection="${['null': 'No level']}"/> - </td> + </div> </g:if> %{--<g:if test="${fields.contains('orderInCourse')}">--}% - %{--<td>--}% - %{--<g:textField name="orderInCourse" value="${fieldValue(bean: record, field: 'orderInCourse')}"--}% + %{----}% + %{--<g:textField class="uk-width-1-1 uk-input" name="orderInCourse" value="${fieldValue(bean: record, field: 'orderInCourse')}"--}% %{--placeholder="# crs" title="# crs"--}% %{--style="width: 80px;"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% <g:if test="${fields.contains('orderNumber')}"> - <td> - <label>Order #</label> - <g:textField name="orderNumber" value="${fieldValue(bean: record, field: 'orderNumber')}" + <div> + <label class="uk-form-label">Order #</label> + <g:textField class="uk-width-1-1 uk-input" name="orderNumber" value="${fieldValue(bean: record, field: 'orderNumber')}" placeholder="" title="order #" style="width: 80px;"/> - - </td> + </div> + </g:if> - </tr> + - <tr> + %{--<g:if test="${fields.contains('chapters')}">--}% - %{--<td>--}% - %{--<g:textField name="chapters"--}% + %{----}% + %{--<g:textField class="uk-width-1-1 uk-input" name="chapters"--}% %{--placeholder="Chapters"--}% %{--title="Chapters"--}% %{--value="${fieldValue(bean: record, field: 'chapters')}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% - </tr> + - <tr> + <g:if test="${fields.contains('writtenOn')}"> - <td> + <div> + + <label class="uk-form-label"> Written on - <br/> + </label> + <pkm:datePicker placeholder="Written on" name="writtenOn" value="${record?.writtenOn}"/> <g:checkBox name="approximateDate" id="approximateDate" value="${record?.approximateDate}"/> ~ ? - </td> + </div> </g:if> @@ -931,163 +960,221 @@ <g:if test="${fields.contains('recordId')}"> - <td> - <g:textField name="recordId" value="${fieldValue(bean: record, field: 'recordId')}" + <div> + <label class="uk-form-label"> +Record ID + </label> + + + <g:textField class="uk-width-1-1 uk-input" name="recordId" value="${fieldValue(bean: record, field: 'recordId')}" placeholder="recordId" title="recordId" style="width: 80px;"/> - </td> + </div> </g:if> <g:if test="${fields.contains('date')}"> - <td> - Date <pkm:datePicker name="date" style="width: 70px;-moz-border-radius: 4px;" extraParams="" + <div> + + <label class="uk-form-label"> + Date + </label> + + + <pkm:datePicker name="date" style="width: 70px;-moz-border-radius: 4px;" extraParams="" placeholder="Date" value="${record?.date ?: (session['lastDate'] ?: new Date())}"/> - </td> + </div> </g:if> + <g:if test="${fields.contains('amount')}"> + <div> + <label class="uk-form-label"> + Amount + </label> - <g:if test="${fields.contains('amount')}"> - <td> - Amount <g:textField id="amount" name="amount" placeholder="Amount" title="Amount" - style="width: 90px;" class="ui-corner-all" + <g:textField class="uk-width-1-1 uk-input" id="amount" name="amount" placeholder="Amount" title="Amount" + style="width: 90px;" value="${record?.amount}"/> - </td> + </g:if> - <g:if test="${fields.contains('publishedNodeId')}"> - <td> - Published node Id - <br/> - <g:textField id="publishedNodeId" name="publishedNodeId" - placeholder="" title="Published node Id" - style="width: 90px;" class="ui-corner-all" - value="${record?.publishedNodeId}"/> - </td> - </g:if> + %{--<g:if test="${fields.contains('publishedNodeId')}">--}% + %{--Published node Id--}% + %{--<br/>--}% + %{--<g:textField class="uk-width-1-1 uk-input" id="publishedNodeId" name="publishedNodeId"--}% + %{--placeholder="" title="Published node Id"--}% + %{--style="width: 90px;"--}% + %{--value="${record?.publishedNodeId}"/>--}% + %{----}% + %{--</g:if>--}% - </tr> - <tr> + + <g:if test="${fields.contains('calendarEnabled')}"> - <td> - <g:checkBox name="calendarEnabled" value="${record?.calendarEnabled}"/> Calendar enabled? - </td> + <div> + + <label class="uk-form-label"> + Calendar enabled? + </label> + + + <g:checkBox name="calendarEnabled" value="${record?.calendarEnabled}"/> + + </div> </g:if> <g:if test="${fields.contains('onHomepage')}"> - <td> - <g:checkBox name="onHomepage" value="${record?.onHomepage}"/> On homepage? - </td> + <div> + + <label class="uk-form-label"> + On homepage? + </label> + + + <g:checkBox name="onHomepage" value="${record?.onHomepage}"/> + + </div> </g:if> <g:if test="${fields.contains('onMobile')}"> - <td> - <g:checkBox name="onMobile" value="${record?.onMobile}"/> On mobile? - </td> - - </g:if> <g:if test="${fields.contains('markedAsActive')}"> - <td> - <g:checkBox name="markedAsActive" value="${record?.markedAsActive}"/> Status marked as active? - </td> + <div> + <label class="uk-form-label"> + On mobile? + </label> + + <g:checkBox name="onMobile" value="${record?.onMobile}"/> + </div> + + </g:if> + + + <g:if test="${fields.contains('markedAsActive')}"> + <div> + <label class="uk-form-label"> + Status marked as active? + </label> + + + <g:checkBox name="markedAsActive" value="${record?.markedAsActive}"/> + </div> </g:if> %{--<g:if test="${fields.contains('isDayChallenge')}">--}% - %{--<td>--}% + %{----}% %{--<g:checkBox name="isDayChallenge" value="${record?.isDayChallenge}"/> Is day challenge?--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% <g:if test="${fields.contains('isKeyword')}"> - <td> - <g:checkBox name="isKeyword" value="${record?.isKeyword}"/> Is keyword? - </td> + <div> + <label class="uk-form-label"> + Is keyword? + </label> + + <g:checkBox name="isKeyword" value="${record?.isKeyword}"/> + </div> </g:if> <g:if test="${fields.contains('isCategory')}"> - <td> + <div> + <label class="uk-form-label"> + Is category? + </label> + <g:checkBox id="isCategory" name="isCategory" value="${record?.isCategory}" - style="width: 15px;"/> Is category? - </td> + style="width: 15px;"/> + </div> </g:if> - </tr> - <tr> + + %{--<g:if test="${fields.contains('captureIsbn')}">--}% - %{--<td><g:checkBox id="captureIsbn" name="captureIsbn" value="${record?.captureIsbn}"--}% + %{--<g:checkBox id="captureIsbn" name="captureIsbn" value="${record?.captureIsbn}"--}% %{--style="width: 15px;"/> Capture ISBN in file names?--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% <g:if test="${fields.contains('multiLine')}"> - <td><g:checkBox id="multiLine" name="multiLine" value="${record?.multiLine}" - style="width: 15px;"/> MultiLine - </td> + <div> + <label class="uk-form-label"> + MultiLine + </label> + <g:checkBox id="multiLine" name="multiLine" value="${record?.multiLine}" + style="width: 15px;"/> + + + + </div> </g:if> - </tr> + - %{--<tr>--}% + %{----}% %{--<g:if test="${fields.contains('reality')}">--}% %{--<td colspan="2">--}% - %{--<g:textArea--}% + %{--<g:textArea class="uk-width-1-1 uk-textarea" --}% %{--placeholder="Reality"--}% %{--title="Reality"--}% %{--name="reality" cols="40" rows="5" value="${record?.reality}"/>--}% - %{--</td>--}% + %{----}% %{--</g:if>--}% - %{--</tr>--}% + %{----}% %{--<g:if test="${fields.contains('citationText')}">--}% - %{--<tr>--}% + %{----}% %{--<td colspan="2">--}% - %{--<g:textField placeholder="Citation text"--}% + %{--<g:textField class="uk-width-1-1 uk-input" placeholder="Citation text"--}% %{--title="Citation text"--}% %{--rows="5" name="citationText" value="${record?.citationText}"--}% - %{--style="width: 95%;"/>--}% - %{--</td>--}% + %{--/>--}% + %{----}% - %{--</tr>--}% - %{--<tr>--}% + %{----}% + %{----}% %{--<td colspan="2">--}% - %{--<g:textField placeholder="Citation Html"--}% + %{--<g:textField class="uk-width-1-1 uk-input" placeholder="Citation Html"--}% %{--title="Citation Html"--}% %{--rows="5" name="citationHtml" value="${record?.citationHtml}"--}% - %{--style="width: 95%;"/>--}% - %{--</td>--}% + %{--/>--}% + %{----}% - %{--</tr>--}% - %{--<tr>--}% + %{----}% + %{----}% %{--<td colspan="2">--}% - %{--<g:textField placeholder="Citation Ascii code"--}% + %{--<g:textField class="uk-width-1-1 uk-input" placeholder="Citation Ascii code"--}% %{--title="Citation Ascii code"--}% %{--rows="5" name="citationAsciicode" value="${record?.citationAsciicode}"--}% - %{--style="width: 95%;"/>--}% - %{--</td>--}% + %{--/>--}% + %{----}% - %{--</tr>--}% + %{----}% %{--</g:if>--}% - </table> %{--<hr/>--}% - <g:submitButton class="fg-button ui-icon-left ui-widget ui-state-default ui-corner-all" name="submit" - style="width: 100%; height: 30px;" + <g:submitButton class="uk-button uk-button-primary uk-width-expand" name="submit" + style="height: 40px;" value="Save" onsubmit=""/> - + %{--</div>--}% </g:formRemote> - </div> + <g:if test="${savedRecord && !record}"> + + <br/> + <g:render template="/gTemplates/recordSummary" model="[record: savedRecord]"/> + </g:if> + diff --git a/grails-app/views/gTemplates/_addFormTable.gsp b/grails-app/views/gTemplates/_addFormTable.gsp new file mode 100755 index 0000000..2bef0f1 --- /dev/null +++ b/grails-app/views/gTemplates/_addFormTable.gsp @@ -0,0 +1,1093 @@ +<%@ page import="app.Contact; ker.OperationController; app.parameters.Blog;mcs.Department; mcs.parameters.WorkStatus;" %> + +<g:if test="${record}"> + <g:render template="/gTemplates/recordSummary" model="[record: record]"/> +</g:if> +<div style="margin: 10px; padding: 5px; border: 0.5px solid darkgray !important;"> +<g:formRemote name="genericSearch" id="genericSearch22" url="[controller: 'generics', action: 'saveViaForm']" + update="${updateRegion}" method="post" style="display: inline; " onComplete=""> + + <g:hiddenField name="entityController" value="${entityController}"/> + <g:hiddenField name="updateRegion" value="${updateRegion}"/> + + <g:hiddenField name="id" value="${record?.id}"/> + + + %{--<table>--}% + + <g:if test="${ker.OperationController.getPath('courses.enabled')?.toLowerCase() == 'yes'}"> + %{--<tr>--}% + + <g:if test="${fields.contains('book')}"> + %{--<td>--}% + <label>Resource</label> + <g:select name="book.id" style="width: 200px;" + from="${record?.book ? [record.book] + mcs.Book.executeQuery('from Book r where r.type.code = ? and r.status.code = ? order by r.title asc', ['prd', 'zbk']) : mcs.Book.executeQuery('from Book r where r.type.code = ? and r.status.code = ? order by r.title asc', ['prd', 'zbk'])}" + value="${record?.book?.id}" optionKey="id" + optionValue="title" + noSelection="${['null': 'No book']}"/> + %{--</td>--}% + </g:if> + + <g:if test="${fields.contains('contact')}"> + %{--<td>--}% + <label>Contact</label> + <g:select name="contact.id" class="ui-corner-all" + from="${sources}" optionKey="id" + value="${record?.contact?.id}" + noSelection="${['null': 'No person']}"/> + %{--</td>--}% + </g:if> + + <g:if test="${fields.contains('department')}"> + %{--<td>--}% + <label>Department</label> + <g:select name="department.id" style="width: 200px;" from="${departments}" + value="${record?.department?.id}" optionKey="id" + optionValue="summary" + noSelection="${['null': 'No department']}"/> + %{--</td>--}% + </g:if> + + <g:if test="${fields.contains('course')}"> + <td> + <label>Course</label> + <g:select name="course.id" style="width: 200px;" from="${courses}" + id="chosenCourse${record?.id}" + value="${record?.course?.id}" + optionKey="id" + optionValue="summary" + noSelection="${['null': 'No course']}"/> + + + + <script type="text/javascript"> + jQuery("#chosenCourse${record?.id}").chosen({ + allow_single_deselect: true, + no_results_text: "None found" + }) + </script> + + </td> + </g:if> + + </tr> + </g:if> + <tr> + + <g:if test="${fields.contains('queryType')}"> + <td> + <label>Query type</label> + <g:select name="queryType" from="${['hql', 'lucene', 'adhoc']}" value="${record?.queryType}"/> + </td> + </g:if> + + <g:if test="${fields.contains('code')}"> + <td> + <label>Code</label> + <g:textField name="code" placeholder="Code" title="Code" class="ui-corner-all" + value="${record?.code}"/> + </td> + </g:if> + %{--<g:if test="${fields.contains('slug')}">--}% + %{--<td>--}% + + %{--<g:textField name="slug" placeholder="Slug" title="Slug" class="ui-corner-all"--}% + %{--value="${record?.slug}"/>--}% + %{--</g:if>--}% + %{--<g:if test="${fields.contains('publishedNodeId')}">--}% + %{--<td>--}% + %{--Pub. Id: <g:textField id="publishedNodeId" name="publishedNodeId"--}% + %{--placeholder="Published node Id" title="Published node Id"--}% + %{--style="width: 90px;" class="ui-corner-all"--}% + %{--value="${record?.publishedNodeId}"/>--}% + %{--</g:if>--}% + </td> + + <g:if test="${fields.contains('type')}"> + <td> + <label>Type</label> + <g:select name="type.id" style="width: 150px;" + from="${types}" optionKey="id" optionValue="name" + value="${record?.type?.id}" + id="chosenType${record?.id}" + noSelection="${['null': 'No type']}"/> + </td> + + <script type="text/javascript"> + jQuery("#chosenType${record?.id}").chosen({ + allow_single_deselect: true, + no_results_text: "None found" + }) + </script> + + </g:if> + + <g:if test="${fields.contains('category')}"> + <td> + <label>Category</label> + <g:select name="category.id" style="width: 150px;" + from="${categories}" optionKey="id" + value="${record?.category?.id}" + id="chosenCategory${record?.id}" + noSelection="${['null': 'No category']}"/> + </td> + + <script type="text/javascript"> + jQuery("#chosenCategory${record?.id}").chosen({ + allow_single_deselect: true, + no_results_text: "None found" + }) + </script> + + </g:if> + + + <g:if test="${fields.contains('writing')}"> + <td> + <label>Writing</label> + <g:select name="writing.id" from="${writings}" style="width: 150px;" + optionKey="id" optionValue="summary" + id="chosenWriting${record?.id}" + value="${record?.writing?.id ?: (session['writingId'] ?: null)}" + noSelection="['null': 'No writing']"/> + + + <script type="text/javascript"> + jQuery("#chosenWriting${record?.id}").chosen({ + allow_single_deselect: true, + no_results_text: "None found" + }) + </script> + + </td> + </g:if> + + + + <g:if test="${fields.contains('status')}"> + <td> + + <label>Status</label> + <g:select name="status.id" style="width: 150px;" + from="${statuses}" optionKey="id" optionValue="name" + id="chosenStatus${record?.id}" + data-placeholder="No status" + value="${record?.status?.id}" + noSelection="${['null': 'No status']}"/> + </td> + + <script type="text/javascript"> + jQuery("#chosenStatus${record?.id}").chosen({ + allow_single_deselect: true, + no_results_text: "None found" + }) + </script> + + </g:if> + + <g:if test="${fields.contains('goal')}"> + + <td> + <label>Goal</label> + + <g:select name="goal.id" from="${goals}" style="width: 150px;" + optionKey="id" optionValue="summary" + data-placeholder="No goal" + id="chosenGoal${record?.id}" + value="${record?.goal?.id ?: (session['goalId'] ?: null)}" + noSelection="['null': 'No goal']"/> + + + <script type="text/javascript"> + jQuery("#chosenGoal${record?.id}").chosen({ + allow_single_deselect: true, + no_results_text: "None found" + }) + </script> + + </td> + </g:if> + + %{--<g:if test="${fields.contains('location')}">--}% + %{--<td>--}% + %{--<g:select name="location.id" style="width: 150px;"--}% + %{--from="${locations}" optionKey="id" optionValue="name"--}% + %{--value="${record?.location?.id}"--}% + %{--noSelection="${['null': 'No location']}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + + <g:if test="${fields.contains('context')}"> + <td> + <label>Context</label> + <g:select name="context.id" style="width: 150px;" + from="${contexts}" optionKey="id" optionValue="name" + value="${record?.context?.id}" + noSelection="${['null': 'No context']}"/> + </td> + </g:if> + + </tr> + <tr> + + <g:if test="${fields.contains('numberCode')}"> + <td> + <label>Code (number)</label> + <g:textField name="numberCode" placeholder="Number Code" title="Number Code" class="ui-corner-all" + value="${record?.numberCode}"/> + </td> + </g:if> + + + + + + <g:if test="${fields.contains('username')}"> + <td> + <g:textField name="username" placeholder="Username" title="Username" class="ui-corner-all" + value="${record?.username}"/> + </td> + </g:if> + <g:if test="${fields.contains('password')}"> + <td> + <g:textField name="password" placeholder="Password" title="Password" class="ui-corner-all" + value="${record?.password}"/> + </td> + </g:if> + + + + + <g:if test="${fields.contains('name')}"> + <td> + <label>Name</label> + <g:textField name="name" placeholder="Name" title="Name" class="ui-corner-all" + value="${record?.name}"/> + </td> + + </g:if> + + + <g:if test="${fields.contains('value')}"> + <td> + <label>Value</label> + <g:textArea id="value" name="value" placeholder="Value" title="Value" style="width: 250px;" + class="ui-corner-all" + rows="5" cols="80" + value="${record?.value}"/> + </td> + </g:if> + + </tr> + + <tr> + + <g:if test="${fields.contains('summary')}"> + <td colspan="3"> + <label>Summary</label> + <g:textField id="sumamryField" name="summary" title="summary" value="${record?.summary}" + style="width: 95%;"/> + </td> + </g:if> + + </tr> + <tr> + + + <g:if test="${fields.contains('title')}"> + <td colspan="2"> + <label>Title</label> + <g:textField placeholder="Title" name="title" title="title" value="${record?.title}" + style="width: 95%;"/> + + <g:if test="${fields.contains('authorInfo')}"> + <label>Author info</label> + <g:textField placeholder="Author infor" name="authorInfo" title="Author info" + value="${record?.authorInfo}" + style="width: 95%;"/> + </g:if> + + + <g:if test="${ker.OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> + <g:if test="${fields.contains('legacyTitle')}"> + <br/> + <label>Legacy title</label> + <g:textField placeholder="Legacy title" name="legacyTitle" title="Legacy title" + value="${record?.legacyTitle}" style="width: 95%;"/> + + </g:if> + </g:if> + + </td> + </g:if> + + + + <g:if test="${fields.contains('link')}"> + <td colspan="3"> + <label>Link</label> + <g:textField placeholder="link (should start with http and ends with /xmlrpc.php" name="link" + title="link" + value="${record?.link}" style="width: 350px;"/> + </td> + </g:if> + + + <g:if test="${fields.contains('style')}"> + <td> + <label>Style</label> + <g:textField id="style" name="style" placeholder="CSS Style" title="CSS Style" style="width: 120px;" + class="ui-corner-all" + value="${record?.style}"/> + </td> + </g:if> + + + <g:if test="${fields.contains('color')}"> + <td> + <label>Color</label> + <g:textField id="color" name="color" placeholder="Color" title="Color" color="width: 60px;" + class="ui-corner-all" + value="${record?.color}"/> + </td> + </g:if> + + %{--</tr>--}% + + %{--<tr>--}% + + + <g:if test="${fields.contains('author')}"> + <td> + <label>Author</label> + <g:textField name="author" placeholder="Author" title="Author" class="ui-corner-all" + value="${record?.author}"/> + + <g:if test="${OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> + <br/> + <label>Bib author</label> + <g:textField name="authorInBib" placeholder="Author in Bib" title="Author in Bib" + class="ui-corner-all" + value="${record?.authorInBib}"/> + </g:if> + <br/> + <label>Trans.</label> + <g:textField name="translator" placeholder="Translator" title="Translator" class="ui-corner-all" + value="${record?.translator}"/> + <br/> + <label>Editor</label> + <g:textField name="editor" placeholder="Editor" title="Editor" class="ui-corner-all" + value="${record?.editor}"/> + </td> + </g:if> + + + + + </tr> + <tr> + <g:if test="${fields.contains('publisher')}"> + <td> + <label>Publisher</label> + <g:textField name="publisher" + placeholder="Publisher" + title="Publisher" + style="width: 200px;" value="${fieldValue(bean: record, field: 'publisher')}"/> + </td> + + </g:if> + + <g:if test="${fields.contains('journal')}"> + <td colspan="2"> + <label>Journal</label> + <g:textField placeholder="Journal" name="journal" value="${record?.journal}" + style="width: 95%;"/> + </td> + </g:if> + </tr> + <tr> + + <g:if test="${fields.contains('edition')}"> + <td> + <label>Ed.</label> <g:textField name="edition" + value="${fieldValue(bean: record, field: 'edition')}" + placeholder="Edition" title="Edition" style="width: 80px;"/> + + <br/> + <label>Vol.</label> <g:textField name="volume" value="${fieldValue(bean: record, field: 'volume')}" + placeholder="volume" title="volume" style="width: 80px;"/> + + </td> + </g:if> + <g:if test="${fields.contains('year')}"> + <td> + <label>Year</label> + <g:textField name="year" value="${fieldValue(bean: record, field: 'year')}" + placeholder="year" title="year" style="width: 80px;"/> + <g:if test="${fields.contains('number')}"> + <br/> + <label>Number</label> + <g:textField name="number" value="${fieldValue(bean: record, field: 'number')}" + placeholder="number" title="number" style="width: 80px;"/> + </g:if> + </td> + </g:if> + <g:if test="${fields.contains('month')}"> + <td> + <label>Month</label> + <g:textField name="month" value="${fieldValue(bean: record, field: 'month')}" + placeholder="month" title="month" style="width: 80px;"/> + <g:if test="${fields.contains('series')}"> + <br/> + <label>Series</label> + <g:textField name="series" value="${fieldValue(bean: record, field: 'series')}" + placeholder="series" title="series" style="width: 80px;"/> + </g:if> + </td> + </g:if> + + %{--<g:if test="${fields.contains('indicator')}">--}% + %{--<td>--}% + %{--<g:select name="indicator.id" class="ui-corner-all"--}% + %{--from="${indicators}"--}% + %{--optionKey="id" optionValue="code"--}% + %{--value="${record?.indicator?.id ?: (session['lastIndicatorId'] ?: null)}"--}% + %{--noSelection="${['null': '']}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + + + + %{--<g:if test="${fields.contains('category') && entityCode == 'Q'}">--}% + %{--<td>--}% + %{--<g:select name="category.id" class="ui-corner-all"--}% + %{--from="${app.PaymentCategory.list()}" optionKey="id"--}% + %{--value="${record?.category?.id}"--}% + %{--noSelection="${['null': '']}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + + + </tr> + + <tr> + + <g:if test="${fields.contains('query')}"> + <td colspan="2"> + <label>Query</label> + <g:textField placeholder="Query" title="Query" rows="5" name="query" value="${record?.query}" + style="width: 99%;"/> + </g:if> + + + <g:if test="${fields.contains('countQuery')}"> + <br/> + <label>Count query</label> + <g:textField placeholder="Count query" title="Count query" name="countQuery" + value="${record?.countQuery}" + style="width: 99%;"/> + </td> + </g:if> + + <g:if test="${fields.contains('nbPages')}"> + <td> + <label>Nb. pages</label> + <g:textField placeholder="Nb. pages" title="Nb. pages" id="pages" name="nbPages" + style="width: 150px" + class="ui-corner-all" + value="${record?.nbPages}"/> + <br/> + <g:if test="${fields.contains('isbn')}"> + <label>ISBN</label> + <g:textField placeholder="ISBN" name="isbn" title="isbn" value="${record?.isbn}" + style="width: 150px;"/> + </g:if> + </td> + </g:if> + + + + <g:if test="${fields.contains('pages')}"> + <td> + <label>Pages</label> + <g:textField placeholder="Pages" title="Pages" id="pages" name="pages" style="width: 150px" + class="ui-corner-all" + value="${record?.pages}"/> + </td> + </g:if> + + <g:if test="${fields.contains('sourceFree')}"> + <td colspan="2"> + <label>Source</label> + <g:textField placeholder="Source" + id="sourceFree" name="sourceFree" style="width: 95%;" + class="ui-corner-all" + value="${record?.sourceFree}"/> + <g:if test="${fields.contains('url')}"> + <label>URL</label> + <g:textField placeholder="URL" name="url" value="${record?.url}" + style="width: 95%;"/> + + </g:if> + </td> + </g:if> + + + + + </tr> + <tr> + + <g:if test="${fields.contains('startDate')}"> + <td> + <table> + <tr> + <td> <label>Start date</label> + <pkm:datePicker placeholder="" name="startDate" value="${record?.startDate}"/> + </td> + <td> <label>time</label> + + <g:textField name="startTime" style="width:60px;" placeholder="Start time" title="Start time" + value="${record?.startDate ? record?.startDate?.format('HH.mm') : '00.00'}"/></td> + </tr> + </table> + + + </td> + </g:if> + + <g:if test="${fields.contains('endDate')}"> + <td> + + <table> + <tr> + <td> <label>End date</label> + <pkm:datePicker name="endDate" placeholder="End date" id="asdfasdf" + value="${record?.endDate}"/></td> + <td> <label>time</label> + <g:textField name="endTime" style="width:60px;" placeholder="Time" title="End time" + value="${record?.endDate ? record?.endDate?.format('HH.mm') : '00.00'}"/></td> + </tr> + </table> + + + </td> + </g:if> + + <g:if test="${fields.contains('completedOn')}"> + <td> + + <label>Completed on</label> + <pkm:datePicker name="completedOn" placeholder="" + value="${record?.completedOn}"/> + </td> + </g:if> + %{--<g:if test="${fields.contains('actualEndDate')}">--}% + %{--<td>--}% + %{--Actual end date<pkm:datePicker name="actualEndDate" placeholder="Actual end date" id="234rsdfsdf"--}% + %{--value="${record?.actualEndDate}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + + + <g:if test="${fields.contains('publicationCity')}"> + <td> + <label>Pub. city</label> + <g:textField name="publicationCity" + placeholder="Publication City" + title="Publication City" + style="width: 200px;" value="${fieldValue(bean: record, field: 'publicationCity')}"/> + </td> + + <td> + + <label>Pub. date</label> + <g:textField name="publicationDate" placeholder="Publication date" + value="${record?.publicationDate}"/> + </td> + + <td> + <label>Pub. on</label> + <pkm:datePicker placeholder="Pub. on" name="publishedOn" value="${record?.publishedOn}"/> + + </td> + </g:if> + </tr> + + <tr> + <g:if test="${fields.contains('description')}"> + <td colspan="2"> + <label>Description</label> + <g:textArea cols="80" rows="5" placeholder="Description" title="Description" name="description" + value="${record?.description}" + style="width: 95%; height: 100px;"/> + </td> + </g:if> + + %{-- <g:if test="${fields.contains('recurringInterval')}">--}% + %{-- <td>--}% + %{-- <label>Recurring interval</label>--}% + %{-- <g:textField name="recurringInterval"--}% + %{-- value="${fieldValue(bean: record, field: 'recurringInterval')}"--}% + %{-- placeholder="" title="recur #" style="width: 20px;"/>--}% + + %{-- </td>--}% + %{-- </g:if> --}% + + <g:if test="${fields.contains('recurringCron')}"> + <td> + <label>Recurrence cron expression: </label> + <br/> + <i>min h dom mon dow y*, e.g. <b>0 8 * * 1</b></i> + <g:textField name="recurringCron" + value="${fieldValue(bean: record, field: 'recurringCron')}"/> + + </td> + </g:if> + + + <g:if test="${fields.contains('fullText')}"> + <td colspan="2"> + <label>Full text</label> + <g:textArea cols="80" rows="5" placeholder="Full text" title="Full text" name="fullText" + value="${record?.fullText}" + style="width: 95%; height: 100px;"/> + </td> + </g:if> + + </tr> + <tr> + <g:if test="${fields.contains('shortDescription')}"> + <td colspan="2"> + <label>Short description</label> + <g:textArea cols="80" rows="5" placeholder="Short description" + title="Short description" name="shortDescription" + value="${record?.shortDescription}" + style="width: 95%; height: 80px;"/> + </td> + </g:if> + %{--<g:if test="${fields.contains('descriptionHTML')}">--}% + %{--<td colspan="2">--}% + %{--<g:textArea cols="80" rows="5" placeholder="descriptionHTML"--}% + %{--title="Description HTML" name="descriptionHTML"--}% + %{--value="${record?.descriptionHTML}"--}% + %{--style="width: 95%; height: 100px;"/>--}% + %{--</td>--}% + %{--</g:if>--}% + + </tr> + + %{--<tr>--}% + + %{--<g:if test="${fields.contains('newFilesPath')}">--}% + %{--<td>--}% + %{--new <g:textField placeholder="Path of its location in the new folder"--}% + %{--id="newFilesPath" name="newFilesPath"--}% + %{--style="width: 200px"--}% + %{--class="ui-corner-all"--}% + %{--value="${record?.newFilesPath ?: null}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + %{--</tr>--}% + <tr> + %{--<g:if test="${fields.contains('repositoryPath')}">--}% + %{--<td>--}% + %{--rps <g:textField--}% + %{--placeholder="Path of its location in the repository"--}% + %{--id="repositoryPath" name="repositoryPath" style="width: 200px"--}% + %{--class="ui-corner-all"--}% + %{--value="${record?.repositoryPath ?: null}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + %{--<g:if test="${fields.contains('libraryPath')}">--}% + %{--<td>--}% + %{--lib <g:textField--}% + %{--placeholder="Path of its location in the library"--}% + %{--id="libraryPath" name="libraryPath" style="width: 200px"--}% + %{--class="ui-corner-all"--}% + %{--value="${record?.libraryPath ?: null}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + + + <g:if test="${fields.contains('metaType')}"> + <td> + + <g:textField id="metaType" name="metaType" + placeholder="metaType" + title="metaType" + style="width: 150px;" value="${record?.metaType}"/> + </td> + </g:if> + <g:if test="${fields.contains('path')}"> + <td> + + <g:textField id="path" name="path" + placeholder="Path" + title="path" + style="width: 150px;" value="${record?.path}"/> + </td> + </g:if> + <g:if test="${fields.contains('extensions')}"> + <td> + + <g:textField id="extensions" name="extensions" + placeholder="Extensions" + title="extensions" + style="width: 150px;" value="${record?.extensions}"/> + </td> + </g:if> + + + + %{--<g:if test="${fields.contains('blog')}">--}% + %{--<td>--}% + %{--todo <g:select name="blog.id" style="width: 150px;"--}% + %{--from="${Blog.list([sort: 'code'])}" optionKey="id" optionValue="summary"--}% + %{--value="${record?.blog?.id}"--}% + %{--noSelection="${['null': 'No blog']}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + + + <g:if test="${fields.contains('notes')}"> + + <td colspan="1"> + <label>Notes</label> + <g:textArea cols="80" rows="5" id="notes" placeholder="" title="Notes" + name="notes" style="width: 95%; max-width: 390px" class="ui-corner-all" + value="${record?.notes}"/> + </td> + + </g:if> + <g:if test="${fields.contains('bibEntry')}"> + <td colspan="1"> + <label>Bib entry</label> + <g:textArea cols="80" rows="5" id="bibEntry" + placeholder="bibEntry" + title="bibEntry" + name="bibEntry" + style="width: 95%; max-width: 400px" class="ui-corner-all" + value="${record?.bibEntry}"/> + </td> + </g:if> + </tr> + + + + <tr> + + <g:if test="${fields.contains('entity')}"> + <td> + <label>Entity</label> + <g:textField id="entity" name="entity" placeholder="Entity" title="Entity" style="width: 150px;" + value="${record?.entity}"/> + </td> + </g:if> + + <g:if test="${fields.contains('module')}"> + <td> + <label>Module</label> + <g:textField id="module" name="module" placeholder="" title="Module" style="width: 150px;" + value="${record?.module}"/> + </td> + </g:if> + + <g:if test="${fields.contains('prefix')}"> + <td> + <label>Prefix</label> + <g:textField id="prefix" name="prefix" placeholder="" title="Prefix" style="width: 150px;" + value="${record?.prefix}"/> + </td> + </g:if> + + + + + <g:if test="${fields.contains('priority')}"> + <td> + <label>Priority</label> + <g:select name="priority" placeholder="Priority" style="width: 50px;" + from="${[1, 2, 3, 4]}" + value="${record?.priority ?: 2}"/> + </td> + </g:if> + + <g:if test="${fields.contains('language')}"> + <td> + <label>Language</label> + %{--<g:textField placeholder="Lang. code"--}% + %{--title="Lang. code"--}% + %{--name="language" style="width: 100px" value="${record?.language ?: 'ar'}"/>--}% + + <g:select name="language" from="${OperationController.getPath('repository.languages').split(',')}" + style="overflow: visible; z-index: 200; background: lightgrey" noSelection="${['': '']}" + value="${record?.language ?: (OperationController.getPath('default.language') ?: '')}"/> + + </td> + </g:if> + + + <g:if test="${fields.contains('plannedDuration')}"> + <td> + Planned duration (min) + <br/><g:textField name="plannedDuration" value="${fieldValue(bean: record, field: 'plannedDuration')}" + placeholder="" + title="# planned duration" + style="width: 80px;"/> + %{--<br/>--}% + %{--Completed steps<g:textField name="completedSteps"--}% + %{--value="${fieldValue(bean: record, field: 'completedSteps')}"--}% + %{--placeholder="# actual steps"--}% + %{--title="# actual steps"--}% + %{--style="width: 20px;"/>--}% + + </td> + </g:if> +%{-- <g:if test="${fields.contains('totalSteps')}">--}% +%{-- <td>--}% +%{-- Total steps<g:textField name="totalSteps" value="${fieldValue(bean: record, field: 'totalSteps')}"--}% +%{-- placeholder="# total steps"--}% +%{-- title="# total steps"--}% +%{-- style="width: 20px;"/>--}% +%{-- --}%%{--<br/>--}% +%{-- --}%%{--Completed steps<g:textField name="completedSteps"--}% +%{-- --}%%{--value="${fieldValue(bean: record, field: 'completedSteps')}"--}% +%{-- --}%%{--placeholder="# actual steps"--}% +%{-- --}%%{--title="# actual steps"--}% +%{-- --}%%{--style="width: 20px;"/>--}% + +%{-- </td>--}% +%{-- </g:if>--}% + + %{--<g:if test="${fields.contains('percentCompleted')}">--}% + %{--<td>--}% + %{--%<g:select name="percentCompleted" placeholder="percentCompleted" style="width: 50px;"--}% + %{--from="${[0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]}"--}% + %{--noSelection="${['null': '0']}"--}% + %{--value="${record?.percentCompleted ?: 0}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + + + + <g:if test="${fields.contains('level')}"> + <td> + <label>Level</label> + <g:select name="level" value="${record?.level}" + from="${['m', 'd', 'W', 'r', 'M', 'A', 'y', 'e', 'l']}" + noSelection="${['null': 'No level']}"/> + </td> + </g:if> + %{--<g:if test="${fields.contains('orderInCourse')}">--}% + %{--<td>--}% + %{--<g:textField name="orderInCourse" value="${fieldValue(bean: record, field: 'orderInCourse')}"--}% + %{--placeholder="# crs" title="# crs"--}% + %{--style="width: 80px;"/>--}% + + %{--</td>--}% + %{--</g:if>--}% + <g:if test="${fields.contains('orderNumber')}"> + <td> + <label>Order #</label> + <g:textField name="orderNumber" value="${fieldValue(bean: record, field: 'orderNumber')}" + placeholder="" title="order #" style="width: 80px;"/> + + </td> + </g:if> + + </tr> + + <tr> + + %{--<g:if test="${fields.contains('chapters')}">--}% + %{--<td>--}% + %{--<g:textField name="chapters"--}% + %{--placeholder="Chapters"--}% + %{--title="Chapters"--}% + %{--value="${fieldValue(bean: record, field: 'chapters')}"/>--}% + %{--</td>--}% + + %{--</g:if>--}% + + </tr> + + + <tr> + + <g:if test="${fields.contains('writtenOn')}"> + <td> + Written on + <br/> + <pkm:datePicker placeholder="Written on" name="writtenOn" value="${record?.writtenOn}"/> + <g:checkBox name="approximateDate" id="approximateDate" value="${record?.approximateDate}"/> ~ ? + </td> + </g:if> + + + + + + + <g:if test="${fields.contains('recordId')}"> + <td> + <g:textField name="recordId" value="${fieldValue(bean: record, field: 'recordId')}" + placeholder="recordId" title="recordId" style="width: 80px;"/> + + </td> + </g:if> + + + + + <g:if test="${fields.contains('date')}"> + <td> + Date <pkm:datePicker name="date" style="width: 70px;-moz-border-radius: 4px;" extraParams="" + placeholder="Date" + value="${record?.date ?: (session['lastDate'] ?: new Date())}"/> + </td> + </g:if> + + + + + + + + <g:if test="${fields.contains('amount')}"> + <td> + Amount <g:textField id="amount" name="amount" placeholder="Amount" title="Amount" + style="width: 90px;" class="ui-corner-all" + value="${record?.amount}"/> + </td> + </g:if> + + <g:if test="${fields.contains('publishedNodeId')}"> + <td> + Published node Id + <br/> + <g:textField id="publishedNodeId" name="publishedNodeId" + placeholder="" title="Published node Id" + style="width: 90px;" class="ui-corner-all" + value="${record?.publishedNodeId}"/> + </td> + </g:if> + + </tr> + <tr> + + <g:if test="${fields.contains('calendarEnabled')}"> + <td> + <g:checkBox name="calendarEnabled" value="${record?.calendarEnabled}"/> Calendar enabled? + </td> + </g:if> + <g:if test="${fields.contains('onHomepage')}"> + <td> + <g:checkBox name="onHomepage" value="${record?.onHomepage}"/> On homepage? + </td> + </g:if> + + <g:if test="${fields.contains('onMobile')}"> + <td> + <g:checkBox name="onMobile" value="${record?.onMobile}"/> On mobile? + </td> + + </g:if> <g:if test="${fields.contains('markedAsActive')}"> + <td> + <g:checkBox name="markedAsActive" value="${record?.markedAsActive}"/> Status marked as active? + </td> + </g:if> + + + %{--<g:if test="${fields.contains('isDayChallenge')}">--}% + %{--<td>--}% + %{--<g:checkBox name="isDayChallenge" value="${record?.isDayChallenge}"/> Is day challenge?--}% + %{--</td>--}% + %{--</g:if>--}% + + <g:if test="${fields.contains('isKeyword')}"> + <td> + <g:checkBox name="isKeyword" value="${record?.isKeyword}"/> Is keyword? + </td> + </g:if> + + + <g:if test="${fields.contains('isCategory')}"> + <td> + <g:checkBox id="isCategory" name="isCategory" value="${record?.isCategory}" + style="width: 15px;"/> Is category? + </td> + </g:if> + + </tr> + <tr> + + %{--<g:if test="${fields.contains('captureIsbn')}">--}% + %{--<td><g:checkBox id="captureIsbn" name="captureIsbn" value="${record?.captureIsbn}"--}% + %{--style="width: 15px;"/> Capture ISBN in file names?--}% + %{--</td>--}% + %{--</g:if>--}% + <g:if test="${fields.contains('multiLine')}"> + <td><g:checkBox id="multiLine" name="multiLine" value="${record?.multiLine}" + style="width: 15px;"/> MultiLine + </td> + </g:if> + + </tr> + + %{--<tr>--}% + %{--<g:if test="${fields.contains('reality')}">--}% + %{--<td colspan="2">--}% + %{--<g:textArea--}% + %{--placeholder="Reality"--}% + %{--title="Reality"--}% + %{--name="reality" cols="40" rows="5" value="${record?.reality}"/>--}% + %{--</td>--}% + %{--</g:if>--}% + %{--</tr>--}% + + + %{--<g:if test="${fields.contains('citationText')}">--}% + %{--<tr>--}% + %{--<td colspan="2">--}% + %{--<g:textField placeholder="Citation text"--}% + %{--title="Citation text"--}% + %{--rows="5" name="citationText" value="${record?.citationText}"--}% + %{--style="width: 95%;"/>--}% + %{--</td>--}% + + %{--</tr>--}% + %{--<tr>--}% + %{--<td colspan="2">--}% + %{--<g:textField placeholder="Citation Html"--}% + %{--title="Citation Html"--}% + %{--rows="5" name="citationHtml" value="${record?.citationHtml}"--}% + %{--style="width: 95%;"/>--}% + %{--</td>--}% + + %{--</tr>--}% + %{--<tr>--}% + %{--<td colspan="2">--}% + %{--<g:textField placeholder="Citation Ascii code"--}% + %{--title="Citation Ascii code"--}% + %{--rows="5" name="citationAsciicode" value="${record?.citationAsciicode}"--}% + %{--style="width: 95%;"/>--}% + %{--</td>--}% + + %{--</tr>--}% + %{--</g:if>--}% + + </table> + + %{--<hr/>--}% + <g:submitButton class="fg-button ui-icon-left ui-widget ui-state-default ui-corner-all" name="submit" + style="width: 100%; height: 30px;" + value="Save" + onsubmit=""/> + + </g:formRemote> + </div> + <g:if test="${savedRecord && !record}"> + <g:render template="/gTemplates/recordSummary" model="[record: savedRecord]"/> + </g:if> diff --git a/grails-app/views/gTemplates/_addQuickForm.gsp b/grails-app/views/gTemplates/_addQuickForm.gsp old mode 100644 new mode 100755 index 43293b5..4eda78d --- a/grails-app/views/gTemplates/_addQuickForm.gsp +++ b/grails-app/views/gTemplates/_addQuickForm.gsp @@ -4,8 +4,11 @@ %{--<g:render template="/gTemplates/recordSummary" model="[record: record]"/>--}% %{--</g:if>--}% -<g:formRemote name="genericSearch" id="genericSearch22" url="[controller: 'generics', action: 'saveViaQuickForm']" +<div id="underQuickEditForm"></div> + +<g:formRemote name="genericSearch" id="genericSearch22" url="[controller: 'generics', action: 'saveViaQuickForm']" + class="uk-form-stacked" update="${updateRegion}" method="post" style="display: inline;" onComplete=""> <g:hiddenField name="entityController" value="${entityController}"/> @@ -19,9 +22,13 @@ <g:if test="${fields.contains('name')}"> <tr> <td> - Name:<br/> - <g:textField name="name" placeholder="Name" title="Name" class="ui-corner-all" + + <label class="uk-form-label"> + Name + </label> + <g:textField name="name" placeholder="Name" title="Name" style="width: 99%;" + class="uk-input" onblur="jQuery('#submitUpdate').click();" value="${record?.name}"/> </td> @@ -33,11 +40,12 @@ <g:if test="${fields.contains('value')}"> <tr> <td> - Value: <br/> - <g:textArea id="value" name="value" placeholder="Value" title="Value" - style="width: 99%;" - class="ui-corner-all" - rows="5" cols="80" + + <label class="uk-form-label"> + Value + </label> + <g:textField id="value" name="value" placeholder="Value" title="Value" + class="uk-input uk-width-1-1" onblur="jQuery('#submitUpdate').click();" value="${record?.value}"/> </td> @@ -48,16 +56,28 @@ <tr> <td> <g:if test="${fields.contains('code')}"> - Code:<br/> - <g:textField name="code" placeholder="Code" title="Code" class="ui-corner-all" - style="width: 10%;" + + <label class="uk-form-label"> + Code + </label> + <g:textField name="code" placeholder="Code" title="Code" + class="uk-input uk-width-1-1" + style="width: 20%;" onblur="jQuery('#submitUpdate').click();" value="${record?.code}"/> </g:if> -Summary: <br/> - <g:textField id="sumamryField" name="summary" title="summary" value="${record?.summary}" placeholder="Summary" + + + <label class="uk-form-label" for="sumamryField"> + Summary + </label> + <div class=uk-form-controls"> + + <g:textField id="sumamryField" name="summary" title="summary" value="${record?.summary}" placeholder="Summary" onblur="jQuery('#submitUpdate').click();" - style="width: 89%;"/> + class="uk-input uk-width-1-1" + /> + </div> </td> </tr> @@ -66,13 +86,20 @@ Summary: <br/> <g:if test="${fields.contains('recurringCron')}"> <tr> <td> - Recurring cron expression:<br/> + + <label class="uk-form-label"> + Recurrence cron expression + <br/> + (min h dom mon dow) + </label> + <g:textField id="recurringCron" name="recurringCron" - title="recurring Cron expression" + title="Recurrence Cron expression" value="${record?.recurringCron}" - placeholder="Recurring Unix cron expression" + placeholder="min h dom mon dow, e.g. 0 8 * * 1" onblur="jQuery('#submitUpdate').click();" - style="width: 99%;"/> + class="uk-input uk-width-1-1" + /> </td> </tr> @@ -84,18 +111,31 @@ Summary: <br/> <g:if test="${fields.contains('title')}"> <tr> <td> - Title:<br/> - <g:textField placeholder="Title" name="title" title="title" value="${record?.title}" + <label class="uk-form-label"> + Title + </label> + <div class=uk-form-controls"> + + <g:textField placeholder="Title" name="title" title="title" value="${record?.title}" onblur="jQuery('#submitUpdate').click();" - style="width: 99%;"/> + class="uk-input uk-width-1-1"/> + </div> - %{--<g:if test="${fields.contains('authorInfo')}">--}% - %{--<g:textField placeholder="Author infor" name="authorInfo" title="Author info" value="${record?.authorInfo}"--}% - %{--style="width: 95%;"/>--}% - %{--</g:if>--}% </td> </tr> </g:if> + <g:if test="${fields.contains('url')}"> + <tr> <td> + + <label class="uk-form-label"> + URL + </label> + + <g:textField placeholder="URL" + class="uk-input uk-width-1-1" + name="url" title="URL" value="${record?.url}"/> + </g:if> + @@ -103,22 +143,29 @@ Summary: <br/> <g:if test="${fields.contains('shortDescription')}"> <tr> <td> - Short description:<br/> + + <label class="uk-form-label"> + Short description + </label> <g:textArea cols="80" rows="5" placeholder="Short description" title="Short description" name="shortDescription" value="${record?.shortDescription}" + class="uk-width-1-1 uk-textarea" onblur="jQuery('#submitUpdate').click();" - style="width: 99%; height: 60px;"/> + style="height: 60px;"/> </td></tr> </g:if> <g:if test="${fields.contains('description')}"> <tr> <td> - Description:<br/> + <label class="uk-form-label"> + Short Description + </label> <g:textArea cols="80" rows="5" placeholder="Description" title="Description" name="description" value="${record?.description}" + class="uk-width-1-1 uk-textarea" onblur="jQuery('#submitUpdate').click();" - style="width: 99%; height: 200px;"/> + style="height: 200px;"/> </td></tr> </g:if> @@ -135,11 +182,15 @@ Summary: <br/> <tr> <g:if test="${fields.contains('fullText')}"> <td> - Full text:<br/> + + <label class="uk-form-label"> + Full text + </label> <g:textArea cols="80" rows="5" placeholder="Full text" title="Full text" name="fullText" + class="uk-width-1-1 uk-textarea" value="${record?.fullText}" onblur="jQuery('#submitUpdate').click();" - style="width: 99%; height: 160px;"/> + style="height: 160px;"/> </td> </g:if> @@ -204,9 +255,14 @@ Summary: <br/> <g:if test="${fields.contains('notes')}"> <td colspan="2"> - Notes:<br/> + + + <label class="uk-form-label"> + Notes + </label> <g:textArea cols="80" rows="5" id="notes" placeholder="Notes" title="Notes" - name="notes" style="width: 99%;" class="ui-corner-all" + name="notes" + class="uk-width-1-1 uk-textarea" onblur="jQuery('#submitUpdate').click();" value="${record?.notes}"/> </td> @@ -216,9 +272,11 @@ Summary: <br/> <tr> <g:if test="${fields.contains('mainHighlights')}"> <td colspan="2"> - Highlights:<br/> + <label class="uk-form-label"> + Highlights + </label> <g:textArea cols="80" rows="5" id="mainHighlights" placeholder="Highlights" title="mainHighlights" - name="mainHighlights" style="width: 99%; background: lightgreen;" class="ui-corner-all" + name="mainHighlights" style="background: lightgreen;" class="uk-textarea uk-width-1-1" onblur="jQuery('#submitUpdate').click();" value="${record?.mainHighlights}"/> </td> @@ -262,9 +320,9 @@ Summary: <br/> </table> - <g:submitButton class="fg-button ui-icon-left ui-widget ui-state-default ui-corner-all" name="submit" - style="width: 99%; height: 25px; text-align: center; background: #f0f0f0;" + <g:submitButton class="uk-width-1-1 uk-button uk-button-primary" name="submit" value="Update" + style="height: 40px" id="submitUpdate" onsubmit=""/> </g:formRemote> @@ -274,4 +332,3 @@ Summary: <br/> %{--</g:if>--}% -<div id="underQuickEditForm"></div> \ No newline at end of file diff --git a/grails-app/views/gTemplates/_addRelationships.gsp b/grails-app/views/gTemplates/_addRelationships.gsp old mode 100644 new mode 100755 index 3a71ad9..beb3739 --- a/grails-app/views/gTemplates/_addRelationships.gsp +++ b/grails-app/views/gTemplates/_addRelationships.gsp @@ -3,34 +3,31 @@ <g:formRemote name="addRelationship" url="[controller: 'generics', action: 'addRelationship']" onComplete="jQuery('#newRelationshipField${entity}${record.id}').val('')" update="relationshipRegion${entity}${record.id}" - style="display: inline;"> - - <g:hiddenField name="id" value="${record.id}"/> <g:hiddenField name="entityCode" value="${entity}"/> <g:select name="type" style="width: 90px; display: inline;" from="${mcs.parameters.RelationshipType.list()}" optionKey="id" optionValue="name"/> -<br/> +%{--<br/>--}% <g:textField id="newRelationshipField${entity}${record.id}" name="recordB" class="ui-corner-all" title="[type][id] ([type] [summary] for autocomplete)" placeholder="[type] [summary] to start autocomplete" - style="width:150px; display: inline; " value=""/> + style="width:130px; display: inline; " value=""/> <g:submitButton name="add" value="add" style="display:none;" class="fg-button ui-widget ui-state-default ui-corner-all"/> </g:formRemote> <script type="text/javascript"> - %{--jQuery("#newRelationshipField${entity}${record.id}").find('input').autocomplete("generics/autoCompleteMainEntities", {--}% - %{--mustMatch: false, minChars: 4, highlight: false, autoFill: false,--}% - %{--delay: 100, matchSubset: 0, matchContains: 1, selectFirst: false,--}% -%{--// cacheLength:100,--}% - %{--multiple: false,--}% - %{--formatResult: function (data, p, l) {--}% - %{--return data[1]--}% - %{--}--}% - %{--});--}% - + %{--<!--jQuery("newRelationshipField${entity}${record.id}").find('input').autocomplete("generics/autoCompleteMainEntities", {-->--}% +// mustMatch: false, minChars: 4, highlight: false, autoFill: false, +// delay: 100, matchSubset: 0, matchContains: 1, selectFirst: false, +// cacheLength:100, +// multiple: false, +// formatResult: function (data, p, l) { +// return data[1] +// } +// }); +// var bestPictures = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), @@ -51,9 +48,6 @@ source: bestPictures.ttAdapter() }); - - - </script> @@ -72,33 +66,34 @@ <div id="relationshipRegion${entity}${record.id}"> <g:each in="${RelationshipType.findAll()}" var="type"> - <g:if test="${Relationship.executeQuery('select count(*) from Relationship where (entityA = ? or entityA = ? or entityA = ?) and recordA = ? and type = ? ', - ['mcs.' + record.entityController(), 'app.' + record.entityController(), 'app.parameters.' + record.entityController(), record.id, type])[0] > 0}"> + <g:if test="${Relationship.executeQuery('select count(*) from Relationship where (entityA = ?) and recordA = ? and type = ? ', + [record.entityCode(), record.id, type])[0] > 0}"> <b>${type.name}</b>: <br/> - <g:each in="${Relationship.executeQuery('from Relationship where (entityA = ? or entityA = ? or entityA = ?) and recordA = ? and type = ? ', - ['mcs.' + record.entityController(), 'app.' + record.entityController(), 'app.parameters.' + record.entityController(), record.id, type])}" + <g:each in="${Relationship.executeQuery('from Relationship where (entityA = ?) and recordA = ? and type = ? ', + [record.entityCode(), record.id, type])}" status="c" var="t"> - <table border="0"> - <tr> - <td> + %{--<table border="0">--}% + %{--<tr>--}% + %{--<td>--}% <g:remoteLink controller="relationship" action="delete" id="${t.id}" update="notificationArea" before="if(!confirm('Are you sure you want to delete the relationship?')) return false" title="Logical delete"> x </g:remoteLink> - </td> - <td> + %{--</td>--}% + %{--<td>--}% %{--todo: works only for mcs package --}% <g:render template="/gTemplates/recordSummary" - model="[record: grailsApplication.classLoader.loadClass(t.entityB).get(t.recordB)]"/> + model="[record: mcs.Book.get(t.recordB)]"/> + %{--todo: only linking to resources is now allowed!--}% - </td> - </tr> - </table> + %{--</td>--}% + %{--</tr>--}% + %{--</table>--}% </g:each> @@ -106,7 +101,7 @@ - <g:if test="${Relationship.executeQuery('select count(*) from Relationship where (entityB = ? or entityB = ? or entityB = ?) and recordB = ? and type = ? ', + <g:if test="${1 == 2 && Relationship.executeQuery('select count(*) from Relationship where (entityB = ? or entityB = ? or entityB = ?) and recordB = ? and type = ? ', ['mcs.' + record.entityController(), 'app.' + record.entityController(), 'app.parameters.' + record.entityController(), record.id, type])[0] > 0}"> <b>${type.inverseName ?: '?'}</b>: @@ -115,7 +110,7 @@ status="c" var="t"> - %{--todo: works only for mcs package --}% + %{--todo: works only for mcs package--}% <g:render template="/gTemplates/recordSummary" model="[record: grailsApplication.classLoader.loadClass(t.entityA).get(t.recordA)]"/> </g:each> diff --git a/grails-app/views/gTemplates/_filesListing.gsp b/grails-app/views/gTemplates/_filesListing.gsp old mode 100644 new mode 100755 index e9cf33b..2f25a4a --- a/grails-app/views/gTemplates/_filesListing.gsp +++ b/grails-app/views/gTemplates/_filesListing.gsp @@ -1,8 +1,9 @@ <%@ page import="ker.OperationController" %> -<div class="filesRegion"> +%{--<div class="filesRegion">--}% %{--<g:if test="${record.entityCode() != 'R'}">--}% - <pkm:listRecordFiles module="${entityCode}" fileClass="himFile" recordId="${record.id}" type="${entityCode == 'R' ? record.type?.code : ''}"/> + + <pkm:listRecordFiles module="${entityCode}" fileClass="himFile" recordId="${record.id}" isStatic="${isStatic}" type="${entityCode == 'R' ? record.type?.code : ''}"/> %{--</g:if>--}% %{--<g:else>--}% %{--<pkm:listRecordFiles module="${entityCode}" resource="yes" fileClass="himFile" recordId="${record.id}"/>--}% @@ -75,4 +76,4 @@ %{--<pkm:listPictures fileClass="snsFile"--}% %{--folder="${OperationController.getPath('pictures.repository.path')}/${record.entityCode()}/${record.id}"--}% %{--initial=""/>--}% -</div> \ No newline at end of file +%{--</div>--}% \ No newline at end of file diff --git a/grails-app/views/gTemplates/_oldSummaryCode.gsp b/grails-app/views/gTemplates/_oldSummaryCode.gsp new file mode 100755 index 0000000..68d8d4a --- /dev/null +++ b/grails-app/views/gTemplates/_oldSummaryCode.gsp @@ -0,0 +1,490 @@ + + +%{--todo: move to panel--}% +%{--<g:if test="${record.class.declaredFields.name.contains('password')}">--}% +%{--<span style="font-size: 0.95em; color: #8A5C69">--}% +%{--${record.password}--}% +%{--</span>--}% +%{--</g:if>--}% + +%{--<g:if test="${record.publisher}">--}% +%{--<br/>--}% +%{--<i>${record.publisher ?: ''}</i>--}% +%{--</g:if>--}% + + + + +<g:if test="${entityCode == 'Blog'}"> + <a href="${createLink(controller: 'operation', action: 'htmlPublishedPosts')}" style="border: 1px solid darkgray; margin: 3px;" + target="_blank"> + Export W ?pub + </a> +</g:if> + + +<g:if test="${justUpdated || justSaved}"> + <script type="application/javascript"> + jQuery("#${entityCode}Record${record.id}").hide('fast'); + jQuery("#${entityCode}Record${record.id}").fadeIn('slow'); + %{--jQuery("#${entityCode}Record${record.id}").slideLeft('slow');--}% + </script> +</g:if> + + +<g:if test="${'CGR'.contains(entityCode)}"> + +</g:if> + + +<g:if test="${record.class.declaredFields.name.contains('--writtenOn') && record.writtenOn}"> + + <span style="font-size: 0.95em; font-weight: bold; padding-right: 4px;" + title="${record.writtenOn?.format(OperationController.getPath('datetime.format'))}"> + <g:if test="${record.class.declaredFields.name.contains('approximateDate') && record.approximateDate}"> + ~ + </g:if> + + %{--${record.writtenOn?.format(OperationController.getPath('date.format'))}--}% + w<pkm:weekDate date="${record?.writtenOn}"/> + </span> +</g:if> + + +<g:if test="${'O'.contains(entityCode)}"> + + <br/> +%{--<g:remoteLink controller="generics" action="verifyOperation"--}% +%{--id="${record.id}"--}% +%{--update="below${entityCode}Record${record.id}"--}% + +%{--title="Show parent entity">--}% +%{--<b>Verify</b>--}% +%{--</g:remoteLink>--}% + + + <pkm:operationRecordFiles fileClass="himFile" recordId="${record.id}"/> +%{-- changes for the operation module w08.2022 --}% +%{--update="underQuickEditForm"--}% + + <br/> + <g:remoteLink controller="generics" action="executeOperation" + id="${record.id}" + class="executeOperation" + update="${entityCode}Record${record.id}" + style="padding: 2px; border: 1px solid darkgreen; border-radius: 5px; text-align: center; font-size: 1em; width: 20%;" + title="Show parent entity"> + <b>Execute (x)</b> + </g:remoteLink> + +</g:if> + + + +<tr style="background: #f2f2f2; margin-bottom: 3px; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);"> + + %{--<td class="record-id" style="width: 15px" >--}% + + + + %{--<g:remoteLink controller="generics" action="toggleSelection"--}% + %{--params="${[id: record.id, entityCode: (record.class.declaredFields.name.contains('entityCode') ? record.entityCode : record.class.name)]}"--}% + %{--update="${(record.class.declaredFields.name.contains('entityCode') ? record.entityCode : record.class.name)}Record${record.id}"--}% + %{--title="Edit">--}% + %{--<g:if test="${session['record' + (record.class.declaredFields.name.contains('entityCode') ? record.entityCode : record.class.name) + record.id] == '1'}">--}% + %{--<i><b style="font-size: 10px;">${(record.class.declaredFields.name.contains('entityCode') ? record.entityCode : record.class.name)}</b></i>--}% + %{--</g:if>--}% + %{--<g:else>--}% + + + %{--<sup style="color: #6E6E6E; font-size: 10px; padding-top: 3px;">${record.id}</sup>--}% + + %{--</g:else>--}% + + + + %{--</g:remoteLink>--}% + + %{--</td>--}% + + + + + + <td class="record-summary ${record.class.declaredFields.name.contains('isMerged') && record.isMerged ? 'merged' : '' } ${record.class.declaredFields.name.contains('deletedOn') && record.deletedOn ? 'deleted' : '' } text${record.class.declaredFields.name.contains('language') ? record.language : (entityCode == 'E' ? record?.book?.language : '')} ${record.class.declaredFields.name.contains('status') && record.status ? 'status-' + record?.status?.code : ''}" + + style="width: 98%; font-size: 0.95em; vertical-align: middle; line-height: 1.4em; color: #105CB6; padding-right: 4px; padding-left: 4px; padding-bottom: 2px; padding-top: 2px; text-align: justify !important;"> + + + + + + + + + </td> + + + + + <td class="" style=""> + + %{--<table border="0" style="border: 0">--}% + %{--<tr>--}% + %{--<td>--}% + + + + </td> + + +%{--<g:if test="${new File(OperationController.getPath('root.rps1.path') + '/' + entityCode + '/' + record.id + '/' + 'cover.jpg')?.exists() ||--}% +%{--new File(OperationController.getPath('root.rps2.path') + '/' + entityCode + '/' + record.id + '/' + 'cover.jpg')?.exists()}">--}% + +%{--<td style="">--}% + + + +%{--</td>--}% + +%{--</g:if>--}% +%{--legacy case--}% + + + <g:if test="${entityCode.length() == 1 && (new File(OperationController.getPath('root.rps1.path') + "/${entityCode}/" + record.id + '/' + + record.id + entityCode.toLowerCase() + '.jpg')?.exists() || new File(OperationController.getPath('root.rps2.path') + "/${entityCode}/" + record.id + '/' + + record.id + entityCode.toLowerCase() + '.jpg')?.exists())}"> + + <td style="width: 55px;"> + + <ul class="product-gallery"> + <li class="gallery-img" id="recordImageCover${record.id}"> + <img class="recordCover Photo" + style="height: 80px; display:inline" + src="${createLink(controller: 'indexCard', action: 'viewImage', id: record.id, params: [entityCode: entityCode, date: new Date()])}"/> + </li> + </ul> + <script type="text/javascript"> + jQuery('#recordImageCover${record.id}').Am2_SimpleSlider(); + </script> + </td> + </g:if> + + +%{--</td>--}% + +</tr> + +<g:if test="${1 == 2 && record.description?.length() < OperationController.getPath('description.summarize.thresholdMax')?.toInteger() && + record.description?.length() > OperationController.getPath('description.summarize.threshold')?.toInteger()}"> + + <span id="descriptionArea${record.id}"> + <g:remoteLink controller="generics" action="showFullDescription" + tabindex="-1" + id="${record.id}" + params="[entityCode: entityCode]" + update="descriptionArea${record.id}" + title="Show full description"> + %{--?.replaceAll("\\<.*?>", "")--}% + <pkm:summarize + text="${record?.description?.replace('Product Description', '')}" + + length="${OperationController.getPath('description.summarize.threshold')?.toInteger()}"/> + (${record.description?.count(' ')}) + </g:remoteLink> + </span> + +</g:if> + + +<g:if test="${entityCode == 'R'}"> + <g:if test="${(new File(OperationController.getPath('root.rps1.path') + "/${entityCode}/cvr/" + + '/' + record.id + '')?.exists() || + new File(OperationController.getPath('root.rps2.path') + + "/${entityCode}/cvr/" + '/' + record.id + '')?.exists())}"> + <td style="width: 85px;"> + <ul class="product-gallery"> + <li class="gallery-img" id="recordImageCover${record.id}"> + <img class="recordCover Photo" style="width: 60px; height: 80px; display:inline" + src="${createLink(controller: 'book', action: 'viewImage', id: record.id, params: [date: new Date()])}"/> + </li> + </ul> + <script type="text/javascript"> + jQuery('#recordImageCover${record.id}').Am2_SimpleSlider(); + </script> + </td> + </g:if> +</g:if> + + + + +%{--todo fix and simplify display of start and end dates--}% +%{--<g:if test="${record.class.declaredFields.name.contains('startDate') && record.startDate}">--}% +%{--<span title="s${record.startDate?.format(OperationController.getPath('datetime.format'))} e${record.endDate?.format(OperationController.getPath('datetime.format'))}">--}% + + +%{--<g:if test="${'JP'.contains(entityCode)}">--}% + +%{--<g:if test="${record.level != 'd'}">--}% +%{--<div style="display: inline; padding: 2px; margin: 3px;" class="record-level level${record.level}"--}% +%{--title="Level">--}% +%{--l<sup>${record.level}</sup>--}% +%{--</div>--}% + +%{--</g:if>--}% + + +%{--<g:if test="${record.level == 'm'}">--}% +%{--<span class="hour">${record.startDate?.format('HH')}</span>--}% +%{--←<span--}% +%{--class="hour">${record.endDate?.format('HH')}</span>--}% +%{-- --}% +%{--<i><pkm:weekDate date="${record?.startDate}"/></i>--}% + +%{--</g:if>--}% +%{--<g:elseif test="${'rMWA'.contains(record.level)}">--}% +%{--<i><pkm:weekDate date="${record?.startDate}"/></i>--}% +%{--←<pkm:weekDate date="${record?.endDate}"/>--}% +%{--(${record.level})--}% +%{--</g:elseif>--}% +%{--<g:else>--}% +%{--<i><pkm:weekDate date="${record?.startDate}"/></i>--}% +%{--(${record.level})--}% +%{--</g:else>--}% + +%{--</span>--}% + +%{--</g:if>--}% +%{--<g:else>--}% +%{--<span title="${record.startDate?.format(OperationController.getPath('datetime.format'))}">--}% +%{--<i><pkm:weekDate date="${record?.startDate}"/></i>--}% +%{--</span>--}% +%{--</g:else>--}% +%{--</g:if>--}% + + + +%{--<g:if test="${'J'.contains(entityCode) && new File(OperationController.getPath('jrn.sns.path') + '/J/' + record.id).exists()}">--}% +%{--<b style="color: darkgreen">sns</b>  --}% +%{--</g:if>--}% + +%{--<g:if test="${'J'.contains(entityCode) && new File(OperationController.getPath('jrn.rcd.path') + '/J/' + record.id).exists()}">--}% +%{--<b style="color: darkgreen">rcd</b>  --}% +%{--</g:if>--}% +%{--<g:if test="${'J'.contains(entityCode) && new File(OperationController.getPath('jrn.vjr.path') + '/J/' + record.id).exists()}">--}% +%{--<b style="color: darkgreen">vjr</b>  --}% +%{--</g:if>--}% + + + +%{--<g:if test="${record.class.declaredFields.name.contains('slug') && record.slug}">--}% +%{--<span style="color: #004499; font-family: monospace">${record.slug}</span>--}% +%{--</g:if>--}% + +%{--<span style="direction: rtl; text-align: right;">--}% +%{--<g:if test="${record.class.declaredFields.name.contains('department') && record.department}">--}% +%{-- <span style="margin: 2px; font-size: 1.2em; padding: 3px; border-radius: 4px; color: white; font-weight: bold; background: #0d4f98; font-family: monospace">--}% +%{-- ${record.department?.code}--}% +%{-- </span>--}% +%{--  --}% +%{-- </g:if>--}% + + +%{-- <br/>--}% + + + + + +%{--<g:remoteLink controller="generics" action="showDetails"--}% +%{--params="${[id: record.id, entityCode: entityCode]}"--}% +%{--update="below${entityCode}Record${record.id}"--}% +%{--title="Details">--}% +%{--<g:render template="/gTemplates/summaryField" model="[record: record, entityCode: entityCode]"/>--}% +%{----}% +%{--</g:remoteLink>--}% + + + +<g:if test="${'E'.contains(entityCode)}"> + + Book: + <b style="font-family: Courier"> + ${record?.book?.course?.code}</b> + <br/> +</g:if> + + + +<g:if test="${record.class.declaredFields.name.contains('plannedDuration') && record.plannedDuration}"> + Duration:   + <g:set value="plannedDuration" var="field"></g:set> + + <a href="#" id="${field}${recordId}" class="${field}" + data-type="select" + data-value="${record[field] ?: 0}" + data-name="${field}-${record.entityCode()}" + data-source="${request.contextPath}/operation/getQuickEditValues?entity=${record.entityCode()}&field=${field}&date=${new Date().format('hhmmssDDMMyyyy')}" + data-pk="${record.id}" data-url="${request.contextPath}/operation/quickSave2" + data-title="Edit ${field}"> + +${record[field] ?: ''} + </a> + <script> + %{--jQuery('#${field}${recordId}').editable();--}% + </script> + <br/> +</g:if> + + + + +<g:if test="${entityCode == 'E'}"> + + <g:if test="${(new File(OperationController.getPath('covers.sandbox.path') + '/exr/' + + record?.id + '.jpg')?.exists() || new File(OperationController.getPath('covers.repository.path') + '/exr/' + record?.id + '.jpg')?.exists())}"> + <td> + + <ul class="product-gallery"> + + <li class="gallery-img" id="recordImageCover${record.id}"> + <img class="recordCover Photo" style="width: 50; height: 70; display:inline" + src="${createLink(controller: 'book', action: 'viewExcerptImage', id: record.id, params: [date: new Date()])}"/> + + </li> + </ul> + <script type="text/javascript"> + jQuery('#recordImageCover${record.id}').Am2_SimpleSlider(); + </script> + + </td> + </g:if> + +</g:if> + + + + + + + +%{--<g:if test="${record.class.declaredFields.name.contains('type') && entityCode.length() == 1}">--}% +%{--<g:set value="type" var="field"></g:set>--}% +%{--<span style="min-width: 60px;">--}% +%{--<a href="#" id="${field}${record.id}" class="${field}" data-type="select" data-value="${record[field]?.id}"--}% +%{--style="${record.type ? record.type?.style : ''};font-size: 0.9em; font-weight: bold;margin-left: 5px;"--}% +%{--data-name="${field}-${entityCode}"--}% +%{--data-source="${request.contextPath}/operation/getQuickEditValues?entity=${entityCode}&field=${field}&date=${new Date().format('hhmmssDDMMyyyy')}"--}% +%{--data-pk="${record.id}" data-url="${request.contextPath}/operation/quickSave2" data-title="Edit ${field}">--}% +%{--<br/> ${record[field]?.code ?: ''}--}% +%{--</a>--}% +%{--</span>--}% +%{--<script>--}% +%{--$('#${field}${record.id}').editable();--}% +%{--</script>--}% +%{--</g:if>--}% + + + +%{--<span style="float: right">--}% +%{--<a class="fg-button fg-button-icon-solo ui-widget ui-state-default ui-corner-all"--}% +%{--onclick="jQuery('#appendRow${entityCode}-${record.id}').removeClass('navHidden'); jQuery('#appendTextFor${entityCode}${record.id}').select(); jQuery('#appendTextFor${entityCode}${record.id}').focus();">--}% +%{--<span class="ui-icon ui-icon-arrowreturn-1-e"></span>--}% +%{--</a>--}% + + +%{--<g:remoteLink controller="page" action="panel"--}% +%{--params="${[id: record.id, entityCode: entityCode]}"--}% +%{--update="3rdPanel"--}% +%{--before="jQuery('#accordionEast').accordion({ active: 0});"--}% +%{--class=" fg-button fg-button-icon-solo ui-widget ui-state-default ui-corner-all"--}% +%{--title="Go to page">--}% +%{--<span class="ui-icon ui-icon-extlink"></span>--}% + +%{--</g:remoteLink>--}% + + + +%{--<g:remoteLink controller="generics" action="fetchAddForm"--}% +%{--params="[entityController: i.controller, updateRegion: 'centralArea']"--}% +%{--update="centralArea">--}% +%{--+ note--}% +%{--</g:remoteLink>--}% + + + + +%{--<td colspan="10" class="record-summary text${record.class.declaredFields.name.contains('language') ? record.language : ''} ${record.class.declaredFields.name.contains('status') && record.status ? 'status-' + record?.status?.code: ''}"--}% +%{--onmouseover="jQuery('.temp44').addClass('actionsButtons'); jQuery('#actionsButtons${record.id}').removeClass('actionsButtons')"--}% +%{--style="font-family: Arial; font-size: 0.95em; color: #105CB6; padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 2px;">--}% + + +%{--<g:render template="/gTemplates/summaryField" model="[record: record, entityCode: entityCode]"/>--}% + + + + + +%{--<g:remoteLink controller="generics" action="executeSavedSearch"--}% +%{--tabindex="-1"--}% +%{--style=" color: gray"--}% +%{--before="jQuery.address.value(jQuery(this).attr('href'));"--}% +%{--id="${record.id}" params="[reportType: 'random']"--}% +%{--update="centralArea">--}% +%{--rand--}% + +%{--</g:remoteLink>--}% + + + +<g:if test="${'N'.contains(entityCode)}"> +%{--<g:if test="${record.fileName}">--}% +%{--<a href="${createLink(controller: 'operation', action: 'downloadNoteFile', id: record.id)}"--}% +%{--target="_blank">--}% +%{--<span style="font-size: 0.9em; font-style: italic; text-decoration: underline">--}% +%{--${record.fileName}--}% +%{--</span>--}% +%{--</a>--}% +%{--</g:if>--}% + + + +%{--<g:if test="${record.source}">--}% +%{--<i style="font-size: smaller"><pkm:summarize text="${record.source}"--}% +%{--length="30"/></i>--}% +%{--</g:if>--}% + + +%{--<g:if test="${record.sourceFree}">--}% +%{--<i style="font-size: smaller"><pkm:summarize text="${record.sourceFree}"--}% +%{--length="30"/></i>--}% +%{--</g:if>--}% + +</g:if> + + +%{--<g:if test="${record.class.declaredFields.name.contains('trackSequence') && record.trackSequence}">--}% +%{--<b>${record.trackSequence}</b>--}% +%{--</g:if>--}% + + +<g:if test="${record.class.declaredFields.name.contains('excerpt') && record.excerpt}"> + + <g:remoteLink controller="generics" action="showSummary" id="${record.excerpt.id}" + tabindex="-1" + params="[entityCode: 'R']" + update="below${entityCode}Record${record.id}" + title="Go to record"> + <b>E-${record.excerpt?.title}</b> + </g:remoteLink> + +</g:if> + + + + + +<g:if test="${entityCode == 'R' && record.isPublic}"> + <span>shared</span> +</g:if> + diff --git a/grails-app/views/gTemplates/_recordAppend.gsp b/grails-app/views/gTemplates/_recordAppend.gsp old mode 100644 new mode 100755 index 6224cb0..92311ab --- a/grails-app/views/gTemplates/_recordAppend.gsp +++ b/grails-app/views/gTemplates/_recordAppend.gsp @@ -4,6 +4,8 @@ <g:if test="${record.class.declaredFields.name.contains('description')}"> + <br/> + <br/> <div id="${entityCode}Record${record.id}newText"></div> <g:formRemote name="appendText" url="[controller: 'generics', action: 'appendText']" @@ -14,12 +16,18 @@ <g:textArea id="appendTextFor${entityCode}${record.id}" name="text" class="ui-corner-all" cols="80" placeholder="Append to description..." rows="5" - style="width:98%; display: inline; height: 70px;" value=""/> - <g:submitButton name="add" value="Append text" style="" + style="width:98%; display: inline; height: 50px;" value=""/> + <g:submitButton name="add" value="Append" style="" class="fg-button ui-widget ui-state-default ui-corner-all"/> </g:formRemote> </g:if> <script type="text/javascript"> - // jQuery("#appendTextFor${entityCode}${record.id}").focus(); + %{--jQuery("#appendTextFor${entityCode}${record.id}").select();--}% + setTimeout(function(){ + %{--jQuery("#appendTextFor${entityCode}${record.id}").get(0).focus();--}% + jQuery("#appendTextFor${entityCode}${record.id}").focus(); + }, 200) + + //todo: focus </script> diff --git a/grails-app/views/gTemplates/_recordChildren.gsp b/grails-app/views/gTemplates/_recordChildren.gsp index 75ca186..a2c63c9 100755 --- a/grails-app/views/gTemplates/_recordChildren.gsp +++ b/grails-app/views/gTemplates/_recordChildren.gsp @@ -132,6 +132,25 @@ model="[list: Book.findAllByCourseAndStatusIsNull(record, [sort: 'orderNumber', order: 'asc'])]"/> </g:elseif> +<g:elseif test="${entityCode == 'D'}"> + <g:render template="/gTemplates/recordListing" model="[list: Planner.findAllByDepartment(record)]"/> + <g:render template="/gTemplates/recordListing" model="[list: Journal.findAllByDepartment(record)]"/> + <g:render template="/gTemplates/recordListing" model="[list: Writing.findAllByDepartment(record, [sort: 'orderNumber'])]"/> + <g:render template="/gTemplates/recordListing" model="[list: mcs.Goal.findAllByDepartment(record)]"/> + <g:render template="/gTemplates/recordListing" model="[list: mcs.Task.findAllByDepartment(record)]"/> + <g:render template="/gTemplates/recordListing" + model="[list: IndexCard.findAllByDepartment(record, [sort: 'orderNumber', order: 'asc'])]"/> + <h4>Core resources</h4> + <g:render template="/gTemplates/recordListing" + model="[list: Book.findAllByDepartmentAndStatus(record, ResourceStatus.findByCode('core'), [sort: 'orderNumber', order: 'asc'])]"/> + <h4>Non-core resources</h4> + <g:render template="/gTemplates/recordListing" + model="[list: Book.findAllByDepartmentAndStatusNot(record, ResourceStatus.findByCode('core'), [sort: 'orderNumber', order: 'asc'])]"/> + <h4>Resources without status</h4> + <g:render template="/gTemplates/recordListing" + model="[list: Book.findAllByDepartmentAndStatusIsNull(record, [sort: 'orderNumber', order: 'asc'])]"/> + </g:elseif> + <g:elseif test="${entityCode == 'R'}"> <g:render template="/gTemplates/recordListing" diff --git a/grails-app/views/gTemplates/_recordListing.gsp b/grails-app/views/gTemplates/_recordListing.gsp index 1803074..90bbb4e 100755 --- a/grails-app/views/gTemplates/_recordListing.gsp +++ b/grails-app/views/gTemplates/_recordListing.gsp @@ -12,35 +12,50 @@ %{--</script>--}% %{--Todo--}% -<g:if test="${totalHits != 0}"> + <g:if test="${title && !ssId}"> - <h4 style="font-family: Georgia; font-size: 14px; font-weight: bold; line-height: 20px;"> + <h2 style="line-height: 20px;"> ${title} ${totalHits != null ? ' (' + totalHits + ')' : ''} - </h4> + </h2> %{--<hr/>--}% </g:if> -<g:if test="${1 == 2 && title && ssId}"> +<g:if test="${title && ssId}"> <div id="savedSearch${ssId}"> - <g:remoteLink controller="generics" action="executeSavedSearch" - id="${ssId}" - before="jQuery.address.value(jQuery(this).attr('href'));" - update="centralArea"> - <h1 dir="rtl" style="text-align: center;"> § ${title} - </h1> - </g:remoteLink> + <h4> + <g:remoteLink controller="generics" action="executeSavedSearch" + id="${ssId}" + before="jQuery.address.value(jQuery(this).attr('href'));" + update="centralArea"> + + § ${title} + </g:remoteLink> + <g:remoteLink controller="generics" action="fetchAddForm" id="${ssId}" + params="[entityController: 'mcs.parameters.SavedSearch', + updateRegion: '3rdPanel', + finalRegion: '3rdPanel']" + update="3rdPanel" + title="Edit"> + (Edit) + </g:remoteLink> + </h4> + + <g:if test="${query}"> + <i style="line-height: 20px;"> + (${query}) + </i> + %{--<hr/>--}% + <br/> + </g:if> + + + </div> - <g:remoteLink controller="generics" action="fetchAddForm" id="${ssId}" - params="[entityController: 'mcs.parameters.SavedSearch', - updateRegion: 'centralArea', - finalRegion: 'centralArea']" - update="savedSearch${ssId}" - title="Edit"> - * - </g:remoteLink> + %{--<g:if test="${totalHits != 0}">--}% + <g:if test="${1 == 1}"> <g:if test="${SavedSearch.get(ssId).queryType == 'hql'}"> <sup> <g:remoteLink controller="generics" action="executeSavedSearch" @@ -72,6 +87,7 @@ </sub> </g:if> + </g:if> </g:if> @@ -198,28 +214,36 @@ <g:if test="${session['showLine1Only'] == 'on'}"> <g:each in="${list}" status="i" var="record"> +%{--<div class="uk-margin-medium-right uk-margin-medium-left">--}% <g:render template="/gTemplates/recordSummary" model="[record: record, tabIndex: i, expanded: expanded]"/> + <br/> +%{--</div>--}% + + </g:each> </g:if> <g:else> <g:each in="${list}" status="i" var="record"> + %{--<div class="uk-margin-medium-right uk-margin-medium-left">--}% <g:render template="/gTemplates/recordSummary" model="[ expanded: expanded, record: (record.entityCode() == 'R' ? mcs.Book.findById(record.id): record), tabIndex: i, context: (highlights && highlights[i] ? highlights[i] : null)]"/> + <br/> + %{--</div>--}% </g:each> </g:else> - </g:if> -<g:else> - <br/> - <i style="color: darkgray">No matching + %{--</g:if>--}% +%{--<g:else>--}% + %{--<br/>--}% + %{--<i style="color: darkgray">No matching--}% %{--todo fix ${entity?.toLowerCase()?.split(/\./)[1]}--}% - records found.</i> -</g:else> + %{--records found.</i>--}% +%{--</g:else>--}% <sec:ifLoggedIn> <sec:ifAnyGranted roles="ROLE_ADMIN"> @@ -237,7 +261,6 @@ <g:set var="customId" value="${new Date().format('hhmmss')}"/> - <script type="text/javascript"> jQuery('#selectBasketRegion').load('${request.contextPath}/generics/countSelection'); %{--jQuery('#importFileCount').load('${request.contextPath}/page/importbeat');--}% diff --git a/grails-app/views/gTemplates/_recordRelate.gsp b/grails-app/views/gTemplates/_recordRelate.gsp old mode 100644 new mode 100755 index df2bbb8..9eb693e --- a/grails-app/views/gTemplates/_recordRelate.gsp +++ b/grails-app/views/gTemplates/_recordRelate.gsp @@ -3,12 +3,9 @@ <div class="recordDetailsBody" style="margin-left: 5px;" id="relationshipRegion${entityCode}${record.id}"> - - - <g:if test="${entityCode.length() == 1}"> <!--br/><b>Relate</b--> - <br/> + %{--<br/>--}% <span id="addRelationship${record.id}" style="display: inline;"> <g:render template="/gTemplates/addRelationships" model="[record: record, entity: entityCode]"/> diff --git a/grails-app/views/gTemplates/_recordSummary.gsp b/grails-app/views/gTemplates/_recordSummary.gsp old mode 100644 new mode 100755 index 3ffe891..e3833ef --- a/grails-app/views/gTemplates/_recordSummary.gsp +++ b/grails-app/views/gTemplates/_recordSummary.gsp @@ -1,8 +1,9 @@ -<%@ page import="mcs.parameters.ResourceStatus; ker.OperationController; mcs.Writing; mcs.Book; cmn.Setting; org.apache.commons.lang.StringEscapeUtils; app.Payment; app.IndicatorData; app.IndexCard; mcs.Excerpt; java.text.DecimalFormat; mcs.parameters.WorkStatus; mcs.Goal; mcs.parameters.JournalType; mcs.Journal; mcs.Planner; mcs.Task" %> +<%@ page import="mcs.Course; mcs.parameters.ResourceStatus; ker.OperationController; mcs.Writing; mcs.Book; cmn.Setting; org.apache.commons.lang.StringEscapeUtils; app.Payment; app.IndicatorData; app.IndexCard; mcs.Excerpt; java.text.DecimalFormat; mcs.parameters.WorkStatus; mcs.Goal; mcs.parameters.JournalType; mcs.Journal; mcs.Planner; mcs.Task" %> <!-- gTemplates/recordSummary --> %{--todo: open to become slideOpen--}% %{--${grailsApplication.config.dataSource.dialect.name}--}% + <g:hasErrors bean="${record}"> <div class="errors" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html"> <g:renderErrors bean="${record}" as="list"/> @@ -36,1149 +37,757 @@ <g:if test="${expanded}"> -<div style="line-height: 30px;" class="text${record.class.declaredFields.name.contains('language') ? record.language : (entityCode == 'E' ? record?.book?.language : '')}"> - [${entityCode}${record.id}] - <g:if test="${record.class.declaredFields.name.contains('summary') && record.summary}"> - <b>${record.summary}</b> - </g:if> - <g:if test="${record.class.declaredFields.name.contains('title') && record.title}"> - <b>${record.title}</b> - </g:if> - <g:if test="${record.class.declaredFields.name.contains('description') && record.description}"> - <br/> desc ${raw(record.description?.replaceAll('\n', '<br/>'))} - </g:if> - <g:if test="${record.class.declaredFields.name.contains('fullText') && record.fullText}"> - <br/>full${record.fullText?.replaceAll('\n', '<br/>')} - </g:if> - <g:if test="${record.class.declaredFields.name.contains('notes') && record.notes}"> - <br/> notes <i>${record.notes?.replaceAll('\n', '<br/>')?.decodeHTML()}</i> - </g:if> - <br/> - <br/> - <hr/> - </div> - </g:if> -<g:else> - <table class="recordLine recordContainer recordCard" style="width: 100% !important; padding: 0px !important; margin-bottom: 10px; border-radius: 0px; border-collapse: collapse" id="${entityCode}Record${record.id}"> - <tbody> - - <tr style="background: #f2f2f2; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);"> - - %{--<td class="record-id" style="width: 15px" >--}% - - - - %{--<g:remoteLink controller="generics" action="toggleSelection"--}% - %{--params="${[id: record.id, entityCode: (record.class.declaredFields.name.contains('entityCode') ? record.entityCode : record.class.name)]}"--}% - %{--update="${(record.class.declaredFields.name.contains('entityCode') ? record.entityCode : record.class.name)}Record${record.id}"--}% - %{--title="Edit">--}% - %{--<g:if test="${session['record' + (record.class.declaredFields.name.contains('entityCode') ? record.entityCode : record.class.name) + record.id] == '1'}">--}% - %{--<i><b style="font-size: 10px;">${(record.class.declaredFields.name.contains('entityCode') ? record.entityCode : record.class.name)}</b></i>--}% - %{--</g:if>--}% - %{--<g:else>--}% - - - %{--<sup style="color: #6E6E6E; font-size: 10px; padding-top: 3px;">${record.id}</sup>--}% - - %{--</g:else>--}% - - - - %{--</g:remoteLink>--}% - - %{--</td>--}% - - <td class="record-id" style="line-height: 2.8em; vertical-align: top;"> - <table border="0"> - <tr> - - <td style="padding-right: 3px; line-height: 1.4em;"> - - <div style="font-size: xx-small;"> - ${record.class.declaredFields.name.contains('type') && entityCode != 'O' && record.type ? record.type?.code : ''} - </div> - <g:remoteLink controller="generics" action="showSummary" - tabindex="-1" - class="refresh" - params="${[id: record.id, entityCode: entityCode]}" - update="${entityCode}Record${record.id}" - style="margin-left: 3px;padding-bottom: 1px; display: inline" - title="ID ${record.id}. Click to refresh"> - - - <span class="${entityCode}-bkg ${entityCode == 'N' && record.entityCode != null ? 'non-genuineNote' : ''} ${entityCode == 'T' && record.isTodo ? 'todoTask' : ''} ${entityCode == 'O' ? (record.validOn == true ? 'correctCommand' : 'wrongCommand') : ''} ID-bkg" - style="padding: 2px; margin-right: 2px; color: white; display: inline; border-radius: 4px;" title="${new DecimalFormat("#,###").format(record.id)}"> - <span style="display: inline-block; color: white; padding: 4px;"> - <b>${entityCode}</b><sup style="color: black;font-size: x-small; ">${record.class.declaredFields.name.contains('priority') && record.priority ? record.priority: ''}</sup><sub style="position: relative; top: 0.2em; left: -0.5em;color: black;font-size: x-small; ">${record.class.declaredFields.name.contains('department') && record.department ? record.department?.code: ''}</sub> - </span></g:remoteLink> -%{-- <span style="font-size: x-small">--}% -%{-- ${new DecimalFormat("#,###").format(record.id)}--}% -%{-- </span>--}% - - -%{-- <g:if test="${record.class.declaredFields.name.contains('type') && record.type}">--}% -%{-- <div style="font-size: smaller;margin: 3px; padding: 2px; border-radius: 0px; border: 1px solid darkgray; color: white; font-weight: bold; background: #695b7e; font-family: monospace">${record.type?.code}</div>--}% -%{-- </g:if>--}% - - - </td> - - - - </tr> - - </table> - - %{--</g:if>--}% - </td> - - - - <td class="record-summary ${record.class.declaredFields.name.contains('isMerged') && record.isMerged ? 'merged' : '' } ${record.class.declaredFields.name.contains('deletedOn') && record.deletedOn ? 'deleted' : '' } text${record.class.declaredFields.name.contains('language') ? record.language : (entityCode == 'E' ? record?.book?.language : '')} ${record.class.declaredFields.name.contains('status') && record.status ? 'status-' + record?.status?.code : ''}" - - style="width: 98%; font-size: 0.95em; vertical-align: middle; line-height: 1.4em; color: #105CB6; padding-right: 4px; padding-left: 4px; padding-bottom: 7px; padding-top: 7px; text-align: justify !important;"> - - %{--<g:remoteLink controller="generics" action="showDetails"--}% - %{--params="${[id: record.id, entityCode: entityCode]}"--}% - %{--update="below${entityCode}Record${record.id}"--}% - %{--title="Details">--}% - %{--<g:render template="/gTemplates/summaryField" model="[record: record, entityCode: entityCode]"/>--}% - %{----}% - %{--</g:remoteLink>--}% +<g:render template="/gTemplates/staticRecord" model="[record: record]"/> +</g:if> +<g:else> + %{--margin: 4px 15px 5px 15px;--}% + <table class="recordLine recordContainer recordCard" style="width: 100% !important; border: 1px solid darkgray; border-radius: 4px; border-collapse: collapse" + id="${entityCode}Record${record.id}"> + <tbody> + <tr> + <td colspan="3" style="min-width: 230px; padding: 3px; padding-bottom: 7px; background: rgba(250, 250, 250, 0.94)" + class="${(record.class.declaredFields.name.contains('language') && record.language && OperationController.getPath('repository.languages.RTL').contains(record.language)) ? 'RTLText' : 'LRTText'}"> + <span class="product-gallery" style="float: right;"> + <span class="gallery-img" id="recordImage${record.id}"> + <img class="Photo" style="height: 140px; width: auto; display:inline; padding: 7px;" onerror="this.style.display='none'" + src="${createLink(controller: 'generics', action: 'viewRecordImage', id: record.id, params: [entityCode: entityCode, date: new Date()])}"/> + </span> + </span> + <script type="text/javascript"> + %{--jQuery('#recordImage${record.id}').Am2_SimpleSlider();--}% + </script> + <g:if test="${record.class.declaredFields.name.contains('name')}"> + <span title="${record.name}"> + <b>${record.name}</b> + </span> - %{--<g:if test="${record.class.declaredFields.name.contains('type') && entityCode.length() == 1}">--}% - %{--<g:set value="type" var="field"></g:set>--}% - %{--<span style="min-width: 60px;">--}% - %{--<a href="#" id="${field}${record.id}" class="${field}" data-type="select" data-value="${record[field]?.id}"--}% - %{--style="${record.type ? record.type?.style : ''};font-size: 0.9em; font-weight: bold;margin-left: 5px;"--}% - %{--data-name="${field}-${entityCode}"--}% - %{--data-source="${request.contextPath}/operation/getQuickEditValues?entity=${entityCode}&field=${field}&date=${new Date().format('hhmmssDDMMyyyy')}"--}% - %{--data-pk="${record.id}" data-url="${request.contextPath}/operation/quickSave2" data-title="Edit ${field}">--}% - %{--<br/> ${record[field]?.code ?: ''}--}% - %{--</a>--}% - %{--</span>--}% - %{--<script>--}% - %{--$('#${field}${record.id}').editable();--}% - %{--</script>--}% - %{--</g:if>--}% + </g:if> - %{--<span style="float: right">--}% - %{--<a class="fg-button fg-button-icon-solo ui-widget ui-state-default ui-corner-all"--}% - %{--onclick="jQuery('#appendRow${entityCode}-${record.id}').removeClass('navHidden'); jQuery('#appendTextFor${entityCode}${record.id}').select(); jQuery('#appendTextFor${entityCode}${record.id}').focus();">--}% - %{--<span class="ui-icon ui-icon-arrowreturn-1-e"></span>--}% - %{--</a>--}% - %{--<g:remoteLink controller="page" action="panel"--}% - %{--params="${[id: record.id, entityCode: entityCode]}"--}% - %{--update="3rdPanel"--}% - %{--before="jQuery('#accordionEast').accordion({ active: 0});"--}% - %{--class=" fg-button fg-button-icon-solo ui-widget ui-state-default ui-corner-all"--}% - %{--title="Go to page">--}% - %{--<span class="ui-icon ui-icon-extlink"></span>--}% + <g:if test="${record.class.declaredFields.name.contains('bookmarked')}"> + <g:if test="${!record.bookmarked}"> + <a name="bookmark${record.id}${entityCode}" + title="Toggle bookmark" + class="quickBookmarkButton" + value="${record.bookmarked}" + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/quickBookmark/${entityCode}-${record.id}')"> + %{--<span class="icon-star-gm"></span>--}% + <span class="uk-icon-button" uk-icon="star"></span> + </a> + </g:if> - %{--</g:remoteLink>--}% + %{--</td>--}% + %{--<td> --}% + <g:if test="${record.bookmarked}"> + <a name="bookmark${record.id}${entityCode}" + title="Toggle bookmark" + value="${record.bookmarked}" + class="quickBookmarkButton" + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/quickBookmark/${entityCode}-${record.id}')"> + %{--<span class="icon-starred-gm"></span>--}% + <span class="uk-icon" uk-icon="icon: bookmark; ratio: 1.5"></span> + </a> + </g:if> + </g:if> +   - %{--<g:remoteLink controller="generics" action="fetchAddForm"--}% - %{--params="[entityController: i.controller, updateRegion: 'centralArea']"--}% - %{--update="centralArea">--}% - %{--+ note--}% - %{--</g:remoteLink>--}% + <g:if test="${record.class.declaredFields.name.contains('summary')}"> + %{--<g:remoteLink controller="generics" action="fetchQuickAddForm"--}% + %{--style="padding: 2px; font-size: 0.95em;"--}% + %{--class="${record.class.declaredFields.name.contains('priority') ? 'priorityText' + record.priority : ''}"--}% + %{--id="${record.id}"--}% + %{--params="[entityController: record.class.name,--}% + %{--updateRegion : '3rdPanel',--}% + %{--finalRegion : '3rdPanel']"--}% + %{--update="3rdPanel"--}% + %{--before="jQuery('#accordionEast').accordion({ active: 0});jQuery('#3rdPanel').scrollTop(0)"--}% + %{--title="Edit">--}% + %{--<i style="font-size: 10px;">--}% + %{--...--}% + %{--</i>--}% + %{--</g:remoteLink>--}% - %{--<td colspan="10" class="record-summary text${record.class.declaredFields.name.contains('language') ? record.language : ''} ${record.class.declaredFields.name.contains('status') && record.status ? 'status-' + record?.status?.code: ''}"--}% - %{--onmouseover="jQuery('.temp44').addClass('actionsButtons'); jQuery('#actionsButtons${record.id}').removeClass('actionsButtons')"--}% - %{--style="font-family: Arial; font-size: 0.95em; color: #105CB6; padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 2px;">--}% - %{--<g:render template="/gTemplates/summaryField" model="[record: record, entityCode: entityCode]"/>--}% + <g:remoteLink controller="page" action="panel" + tabindex="-1" + class="openPanelButton" + params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" + update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" + style="padding: 2px; font-size: 1em; font-weight: bold;" + before="myLayout.open('east'); jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);"> + %{--class="${record.class.declaredFields.name.contains('priority') ? 'priorityText' + record.priority : ''}"--}% - %{--before="jQuery('#accordionEast').accordion({ active: 0});jQuery('#3rdPanel').scrollTop(0)"--}% - <g:remoteLink controller="page" action="panel" - tabindex="-1" - params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" - update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" - title="Go to page"> - <g:if test="${record.class.declaredFields.name.contains('keepSecret')}"> - <g:if test="${record.keepSecret}"> - <b>∉∉</b> + <g:if test="${!record.summary}"> + ... </g:if> - </g:if> - + <g:if test="${record.summary}"> + <span title="${record.summary}" style="font-family: Lato !important; color: black; font-weight: normal; font-size: 1.1em;" - <g:if test="${record.class.declaredFields.name.contains('occurence') && record.occurence}"> - o${record.occurence} - </g:if> + class="${(record.class.declaredFields.name.contains('language') && record.language && OperationController.getPath('repository.languages.RTL').contains(record.language)) ? 'RTLText' : 'LRTText'} ${record.class.declaredFields.name.contains('status') && record.status ? 'status-' + record?.status?.code : ''}"> + %{--<g:if test="${entityCode == 'E'}">--}% + %{--<br/>--}% + %{--</g:if>--}% + %{--<g:if test="${record.class.declaredFields.name.contains('publishedNodeId') && record.publishedNodeId && record.status?.code != 'repub'}">--}% + %{--<span style="font-size: large; color: darkgreen"> © </span>--}% + %{--</g:if>--}% + %{--<g:elseif test="${record.class.declaredFields.name.contains('publishedNodeId') && record.publishedNodeId && record.status?.code == 'repub'}">--}% + %{--<span style="font-size: 1em; color: darkred"> © </span>--}% + %{--</g:elseif>--}% + %{--<bdi>--}% + <pkm:summarize text="${record.summary ?: ''}" + length="${OperationController.getPath('summary.summarize.threshold')?.toInteger()}"/> + %{--</bdi>--}% + %{--<br/>--}% + </span> + </g:if> + </g:remoteLink> - %{--todo fix and simplify display of start and end dates--}% - %{--<g:if test="${record.class.declaredFields.name.contains('startDate') && record.startDate}">--}% - %{--<span title="s${record.startDate?.format(OperationController.getPath('datetime.format'))} e${record.endDate?.format(OperationController.getPath('datetime.format'))}">--}% + </g:if> + <g:if test="${entityCode == 'R'}"> - %{--<g:if test="${'JP'.contains(entityCode)}">--}% + <g:remoteLink controller="page" action="panel" + tabindex="-1" + class="openPanelButton ${(record.class.declaredFields.name.contains('language') && record.language && OperationController.getPath('repository.languages.RTL').contains(record.language)) ? 'RTLText' : 'LRTText'}" + params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" + update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" + before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);" + style="padding: 4px; font-size: 1.2em; font-weight: normal;"> - %{--<g:if test="${record.level != 'd'}">--}% - %{--<div style="display: inline; padding: 2px; margin: 3px;" class="record-level level${record.level}"--}% - %{--title="Level">--}% - %{--l<sup>${record.level}</sup>--}% - %{--</div>--}% - %{--</g:if>--}% + <pkm:summarize text="${(record.title ?: '...')}" + length="${OperationController.getPath('summary.summarize.threshold')?.toInteger()}"/> + <g:if test="${record.author}"> + <br/> + <i style="font-size: 0.95em; color: #2d2d2d"><pkm:summarize + text="${record.author ?: ''}" + length="${OperationController.getPath('summary.summarize.threshold')?.toInteger()}"/></i> + </g:if> - %{--<g:if test="${record.level == 'm'}">--}% - %{--<span class="hour">${record.startDate?.format('HH')}</span>--}% - %{--←<span--}% - %{--class="hour">${record.endDate?.format('HH')}</span>--}% - %{-- --}% - %{--<i><pkm:weekDate date="${record?.startDate}"/></i>--}% + %{--</bdi>--}% + <g:if test="${record.legacyTitle}"> + <br/> + <i style="text-decoration: line-through;">${record.legacyTitle}</i> + </g:if> - %{--</g:if>--}% - %{--<g:elseif test="${'rMWA'.contains(record.level)}">--}% - %{--<i><pkm:weekDate date="${record?.startDate}"/></i>--}% - %{--←<pkm:weekDate date="${record?.endDate}"/>--}% - %{--(${record.level})--}% - %{--</g:elseif>--}% - %{--<g:else>--}% - %{--<i><pkm:weekDate date="${record?.startDate}"/></i>--}% - %{--(${record.level})--}% - %{--</g:else>--}% + <g:if test="${record.url}"> + <br/> + <a style="font-size: smaller" href="${record.url}" target="_blank"> + <pkm:summarize text="${record.url}" length="30"/></a> + </g:if> - %{--</span>--}% - %{--</g:if>--}% - %{--<g:else>--}% - %{--<span title="${record.startDate?.format(OperationController.getPath('datetime.format'))}">--}% - %{--<i><pkm:weekDate date="${record?.startDate}"/></i>--}% - %{--</span>--}% - %{--</g:else>--}% - %{--</g:if>--}% + <g:if test="${record.class.declaredFields.name.contains('publicationDate') && record.publicationDate}"> + <span style="font-size: 0.95em; text-weight: bold;"> +   ${record.publicationDate} + </span> + </g:if> + <g:if test="${record.class.declaredFields.name.contains('year') && record.year}"> + <span style="font-size: 0.95em; text-weight: bold;"> +   ${record.year} + </span> + </g:if> + </g:remoteLink> + <br/> + </g:if> - <g:if test="${record.class.declaredFields.name.contains('status') && record.status}"> - <span style="font-size: 1.4em !important; margin: 5px 2px; padding: 2px; border-radius: 5px; border: 1px solid darkgray; color: darkorange; font-style: italic; font-weight: bold;">${record.status?.code} - </span> - </g:if> - <g:if test="${record.class.declaredFields.name.contains('summary')}"> - %{--<g:remoteLink controller="generics" action="fetchQuickAddForm"--}% - %{--style="padding: 2px; font-size: 0.95em;"--}% - %{--class="${record.class.declaredFields.name.contains('priority') ? 'priorityText' + record.priority : ''}"--}% - %{--id="${record.id}"--}% - %{--params="[entityController: record.class.name,--}% - %{--updateRegion : '3rdPanel',--}% - %{--finalRegion : '3rdPanel']"--}% - %{--update="3rdPanel"--}% - %{--before="jQuery('#accordionEast').accordion({ active: 0});jQuery('#3rdPanel').scrollTop(0)"--}% - %{--title="Edit">--}% - %{--<i style="font-size: 10px;">--}% - %{--...--}% - %{--</i>--}% - %{--</g:remoteLink>--}% - <g:if test="${record.class.declaredFields.name.contains('course' + - '') && record.course}"> - <span style="padding: 1px 2px; margin: 0px 2px; font-size: small; border-radius: 3px; border-bottom: 1px solid darkgray; color: black; font-weight: bold; font-family: monospace"> - ${record.course?.code ? record.course?.code : record.course}</span> - </g:if> + <g:if test="${record.class.declaredFields.name.contains('task') && record.task}"> + <div class="recordsTask">T ${record.task}</div> + </g:if> + <g:if test="${record.class.declaredFields.name.contains('shortDescription') && record.shortDescription}"> + <div class="shortDescription"> <g:remoteLink controller="page" action="panel" tabindex="-1" - class="openPanelButton" params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" - style="padding: 2px; font-size: 1em; font-weight: bold;" - before="myLayout.open('east'); jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);"> - %{--class="${record.class.declaredFields.name.contains('priority') ? 'priorityText' + record.priority : ''}"--}% - <g:if test="${!record.summary}"> - ... - </g:if> - <g:if test="${record.summary}"> - <span title="${record.summary}" style="font-family: Lato !important; font-weight: bold; font-size: 0.95em;"> - <g:if test="${entityCode == 'E'}"> - <br/> - </g:if> - <g:if test="${record.class.declaredFields.name.contains('publishedNodeId') && record.publishedNodeId && record.status?.code != 'repub'}"> - <span style="font-size: large; color: darkgreen"> © </span> - </g:if> - <g:elseif test="${record.class.declaredFields.name.contains('publishedNodeId') && record.publishedNodeId && record.status?.code == 'repub'}"> - <span style="font-size: 1em; color: darkred"> © </span> - </g:elseif> - <g:if test="${record.class.declaredFields.name.contains('context') && record.context}"> - <span style="background: 1px solid darkyellow; font-size: 1em; font-weight: bold;color: darkgreen"> @${record.context?.code} </span> - </g:if> - %{--<bdi>--}% - <pkm:summarize text="${record.summary ?: ''}" - length="${OperationController.getPath('summary.summarize.threshold')?.toInteger()}"/> - - %{--</bdi>--}% -%{-- <br/>--}% - </span> - </g:if> + before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);"> + ${record?.shortDescription?.replaceAll('\n', '<br/>')?.decodeHTML()?.replaceAll('\n', '<br/>')} + %{--?.replaceAll("\\<.*?>", "")--}% </g:remoteLink> - - - - - </g:if> - - %{--<g:if test="${record.class.declaredFields.name.contains('context') && record.context}">--}% - %{--<b>@</b><span style="margin: 2px; padding: 2px; border-radius: 5px; border: 1px solid darkolivegreen; color: darkblue; font-style: italic; font-size: normal">@${record.context?.code}</span>--}% - %{--<br/>--}% - %{--</g:if>--}% - - <g:if test="${'JPT'.contains(entityCode) && record?.startDate}"> -   - <span style="margin: 0px; font-size: 0.95em; padding: 2px; border-radius: 3px; border-bottom: 0px solid darkgray; direction: ltr; text-align: left;" - title="${record?.startDate?.format('HH:mm')} - ${record?.endDate?.format('HH:mm')}"> - <b>←</b> - <u>${record?.startDate?.format('EEE dd.MM.yyyy HH:mm')}</u> - %{--<br/>--}% - %{--${record?.endDate ? '-> ' + record?.endDate?.format('dd.MM.yyyy HH:mm'): ''}--}% - </span> - %{--(<i><prettytime:display--}% - %{--date="${record?.startDate}"></prettytime:display></i>)--}% + </div> + </g:if> + <g:if test="${record.class.declaredFields.name.contains('description') && record.description}"> + %{--<br/>--}% + <g:if test="${record.class.declaredFields.name.contains('language') && record.language && record.language}"> + <div class="${(record.class.declaredFields.name.contains('language') && record.language && OperationController.getPath('repository.languages.RTL').contains(record.language)) ? 'RTLText' : 'LRTText'}"> </g:if> - - <g:if test="${record.class.declaredFields.name.contains('endDate') && record.endDate}"> - <br/>   - <span class="${ 'T'.contains(entityCode) && record.endDate < new Date() - 1 && record.completedOn == null ? 'overDueDate' : ''}" - title="e${record.endDate?.format(OperationController.getPath('datetime.format'))}"> - %{--<pkm:weekDate date="${record?.endDate}"/>--}% - <span style="font-size: 0.95em; margin: 2px; padding: 2px; border-radius: 3px; border-bottom: 0px solid darkgray;"> - %{-- >--}% - Due date: ${record?.startDate && record?.endDate - record?.startDate == 0 ? record?.endDate?.format('HH:mm') : record?.endDate?.format('EE dd.MM.yyyy')} + <div style="font-size: 0.95em !important; color: #272727 !important; padding: 5px; line-height: 1.4em;"> + <g:if test="${entityCode == 'N' && record?.type?.code == 'word'}"> + <span id="descriptionArea${record.id}"> + <g:remoteLink controller="generics" action="showAnswer" + tabindex="-1" + id="${record.id}" + params="[entityCode: entityCode]" + update="descriptionArea${record.id}" + title="Show answer"> +  show  + </g:remoteLink> </span> - </span> - <br/> - %{--<span title="s${record.endDate?.format(OperationController.getPath('datetime.format'))}">--}% - %{--<pkm:weekDate date="${record?.endDate}"/>--}% - %{--</span>--}% - %{--</g:else>--}% - </g:if> - - - - <g:if test="${entityCode == 'Blog'}"> - <a href="${createLink(controller: 'operation', action: 'htmlPublishedPosts')}" style="border: 1px solid darkgray; margin: 3px;" - target="_blank"> - Export W ?pub - </a> - </g:if> - - - <g:if test="${entityCode == 'X' && ker.OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> - - - <g:if test="${record.queryType == 'hql'}"> + </g:if> + <g:else> + <g:if test="${record.description?.length() < OperationController.getPath('description.summarize.threshold')?.toInteger() && record.description != '?'}"> + <g:remoteLink controller="page" action="panel" + tabindex="-1" + params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" + update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" + style="padding: 4px; font-size: 0.95em;" + before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);"> + ${raw(record?.description?.trim()?.replaceAll('\n', '<br/>')?.decodeHTML()?.replaceAll('\n', '<br/>')?.replace('Product Description', '')?.trim())} + %{--?.replaceAll("\\<.*?>", "")--}% + </g:remoteLink> + </g:if> - <g:remoteLink controller="generics" action="executeSavedSearch" - tabindex="-1" - style=" color: gray" - before="jQuery.address.value(jQuery(this).attr('href'));" - id="${record.id}" params="[reportType: 'random']" - update="centralArea"> - rand - </g:remoteLink> + <g:if test="${record.description?.length() > OperationController.getPath('description.summarize.threshold')?.toInteger()}"> - <g:link controller="generics" action="executeSavedSearch" - style=" color: gray" - id="${record.id}" params="[reportType: 'tab']" - target="_blank"> - tab - </g:link> + <g:remoteLink controller="page" action="panel" + tabindex="-1" + params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" + update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" + style="padding: 5px; font-size: 0.95em;" + before=" myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0});"> - <g:if test="${record.calendarEnabled}"> - <sub> - <g:link controller="generics" action="executeSavedSearch" - style=" color: gray" - id="${record.id}" params="[reportType: 'cal']" - target="_blank"> - cal - </g:link> + %{--?.replaceAll("\\<.*?>", "")--}% + <pkm:summarize + text="${record?.description?.replace('Product Description', '').encodeAsHTML()}" + length="${OperationController.getPath('description.summarize.threshold')?.toInteger()}"/> + (${new DecimalFormat("#").format(Math.floor(record.description?.count(' ') / 200))}') + </g:remoteLink> - </sub> </g:if> - - </g:if> - - + </g:else> + </div> + <g:if test="${record.class.declaredFields.name.contains('language')}"> + </div> </g:if> - %{--<g:if test="${record.class.declaredFields.name.contains('slug') && record.slug}">--}% - %{--<span style="color: #004499; font-family: monospace">${record.slug}</span>--}% - %{--</g:if>--}% - - <span style="direction: rtl; text-align: right;"> -%{--<g:if test="${record.class.declaredFields.name.contains('department') && record.department}">--}% -%{-- <span style="margin: 2px; font-size: 1.2em; padding: 3px; border-radius: 4px; color: white; font-weight: bold; background: #0d4f98; font-family: monospace">--}% -%{-- ${record.department?.code}--}% -%{-- </span>--}% -%{--  --}% -%{-- </g:if>--}% - - -%{-- <br/>--}% - - - - <g:if test="${record.class.declaredFields.name.contains('task') && record.task}"> - <span style="margin: 2px; padding: 2px; border-radius: 5px; border: 1px solid darkolivegreen; color: darkgreen; font-style: italic; font-size: normal">T ${record.task}</span> </g:if> - </span> - - <g:if test="${record.class.declaredFields.name.contains('entity')}"> - <span title="${record.entity}"> - <i>${record.entity}</i> - </span> - </g:if> - + <g:if test="${record.class.declaredFields.name.contains('fullText') && record.fullText}"> - <g:if test="${record.class.declaredFields.name.contains('name')}"> - <span title="${record.name}"> - <b>${record.name}</b> - </span> + %{--<g:remoteLink controller="page" action="panel"--}% + %{--tabindex="-1"--}% + %{--params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}"--}% + %{--update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}"--}% + %{--style="padding: 4px; font-size: 0.95em;"--}% + %{--before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);">--}% - </g:if> + <span style="font-size: 0.95em; font-style: italic; color: #435d59"> + <pkm:summarize text="${record.fullText?.trim()}" + length="${OperationController.getPath('description.summarize.threshold')?.toInteger()}"/> + %{--(${record.fullText?.count(' ')})--}% - - <g:if test="${record.class.declaredFields.name.contains('value')}"> - <span title="${record.value}"> - <i>${record.value}</i> + (${new DecimalFormat("#").format(Math.floor(record.fullText?.count(' ') / 200))}') </span> + %{--</g:remoteLink>--}% + </g:if> - </g:if> - <g:if test="${entityCode == 'C'}"> - <b>${record.numberCode}</b> + <g:if test="${'N'.contains(entityCode)}"> + <g:if test="${record.pages}"> + <i>pg. ${record.pages}</i> </g:if> + </g:if> + <g:if test="${((!OperationController.getPath('metadataLine.hidden') || OperationController.getPath('metadataLine.hidden') == 'no') && params.reportType != 'tab') && record.class.declaredFields.name.contains('notes') && record.notes}"> + <br/> + <span style="color:#7588b2 "> + <pkm:summarize text="${record.notes}" + length="${OperationController.getPath('notes.summarize.threshold')?.toInteger()}"/> + %{--(${record.notes?.count(' ')})--}% + (${new DecimalFormat("#").format(Math.floor(record.notes?.count(' ') / 200))}') + </span> + %{--</g:if>--}% + </g:if> - <g:if test="${'N'.contains(entityCode)}"> - %{--<g:if test="${record.fileName}">--}% - %{--<a href="${createLink(controller: 'operation', action: 'downloadNoteFile', id: record.id)}"--}% - %{--target="_blank">--}% - %{--<span style="font-size: 0.9em; font-style: italic; text-decoration: underline">--}% - %{--${record.fileName}--}% - %{--</span>--}% - %{--</a>--}% - %{--</g:if>--}% - - - - %{--<g:if test="${record.source}">--}% - %{--<i style="font-size: smaller"><pkm:summarize text="${record.source}"--}% - %{--length="30"/></i>--}% - %{--</g:if>--}% - - - %{--<g:if test="${record.sourceFree}">--}% - %{--<i style="font-size: smaller"><pkm:summarize text="${record.sourceFree}"--}% - %{--length="30"/></i>--}% - %{--</g:if>--}% - - </g:if> + <g:if test="${'JPT'.contains(entityCode) && record?.startDate}"> + <div class="endDate" + title="${record?.startDate?.format('EEE dd.MM.yyyy HH:mm')} - ${record?.endDate?.format('HH:mm')}"> + <b style="font-size: large; color: darkgreen">◊</b> + ${record?.startDate?.format('EEE dd.MM HH:mm')} + %{--<br/>--}% + %{--${record?.endDate ? '-> ' + record?.endDate?.format('dd.MM.yyyy HH:mm'): ''}--}% + </div> + %{--(<i><prettytime:display--}% + %{--date="${record?.startDate}"></prettytime:display></i>)--}% + </g:if> - <g:if test="${record.class.declaredFields.name.contains('reality') && record.reality}"> - <span style="color:#b22222 "> - ${record.reality} + <g:if test="${record.class.declaredFields.name.contains('endDate') && record.endDate}"> + <div class="en En english" + title="e${record.endDate?.format(OperationController.getPath('datetime.format'))}" + style="display: inline-block; margin: 3px; font-size: 0.95em; padding: 2px; border-radius: 5px; border: 1px solid darkgray; direction: ltr; text-align: left;"> + %{--<pkm:weekDate date="${record?.endDate}"/>--}% + %{-- >--}% + %{--<b>End date:</b>--}% + <b style="font-size: large; color: darkorange" class="${'T'.contains(entityCode) && record.endDate < new Date() - 1 && record.completedOn == null ? 'overDueDate' : ''}">◊</b> + <span style="padding: 4px;" title="${record?.endDate?.format('EE MMM dd, yyyy HH:mm')}"> + ${record?.startDate && record?.endDate - record?.startDate == 0 ? record?.endDate?.format('HH:mm') : record?.endDate?.format('EE dd.MM HH:mm')} </span> - </g:if> - - - <g:if test="${record.class.declaredFields.name.contains('trackSequence') && record.trackSequence}"> - <b>${record.trackSequence}</b> - </g:if> - - - - - - <g:if test="${record.class.declaredFields.name.contains('readOn') && record.readOn}"> - <img src="${resource(dir: '/images', file: 'edx-check.png')}" style="width: 15px;" - title="${record.readOn?.format('dd.MM.yyyy HH:mm')}"/> - %{--Read ${record.readOn?.format('dd.MM.yyyy')}--}% - </g:if> - - <g:if test="${record.class.declaredFields.name.contains('reviewCount') && record.reviewCount}"> - ∇ <sup>${record.reviewCount}</sup> - </g:if> - - <g:if test="${record.class.declaredFields.name.contains('chapters') && record.chapters}"> -   - - ch ${record.chapters} - </g:if> - - <g:if test="${record.class.declaredFields.name.contains('fileName') && record.fileName}"> -   - - f:${record.fileName} - </g:if> - - - - <g:if test="${entityCode == 'R'}"> - - <g:remoteLink controller="page" action="panel" - tabindex="-1" - class="openPanelButton" - params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" - update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" - before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);" - style="padding: 4px; font-size: 1em; font-weight: normal"> - - - <pkm:summarize text="${(record.title ?: '...')}" - length="${OperationController.getPath('summary.summarize.threshold')?.toInteger()}"/> - <i style="font-size: 0.95em; color: #2d2d2d"><pkm:summarize - text="${record.author ?: ''}" - length="${OperationController.getPath('summary.summarize.threshold')?.toInteger()}"/></i> - ${record.publisher ?: ''} + </div> + %{--<span title="s${record.endDate?.format(OperationController.getPath('datetime.format'))}">--}% + %{--<pkm:weekDate date="${record?.endDate}"/>--}% + %{--</span>--}% + %{--</g:else>--}% + </g:if> - %{--</bdi>--}% - <g:if test="${record.legacyTitle}"> - <i style="text-decoration: line-through;">${record.legacyTitle}</i> - </g:if> - <g:if test="${record.url}"> + <g:if test="${(!OperationController.getPath('metadataLine.hidden') || OperationController.getPath('metadataLine.hidden') == 'no') && params.reportType != 'tab'}"> + <g:if test="${record.class.declaredFields.name.contains('tags') && record.tags}"> + <br/>   + <g:render template="/tag/tags" model="[instance: record, entity: entityCode]"/> + </g:if> + <g:if test="${record.class.declaredFields.name.contains('contacts') && record.contacts}"> + <br/> +   + <g:render template="/tag/contacts" model="[instance: record, entity: entityCode]"/> + </g:if> + </g:if> - <a style="font-size: smaller" href="${record.url}" target="_blank"> - <pkm:summarize text="${record.url}" length="30"/></a> - </g:if> + %{--<br/>--}% - <g:if test="${record.class.declaredFields.name.contains('publicationDate') && record.publicationDate}"> - <span style="font-size: 0.95em; text-weight: bold;"> -   ${record.publicationDate} - </span> - </g:if> - <g:if test="${record.class.declaredFields.name.contains('year') && record.year}"> - <span style="font-size: 0.95em; text-weight: bold;"> -   ${record.year} - </span> - </g:if> + %{--<br/>--}% - </g:remoteLink> -<br/> - </g:if> + %{--<a style="float: right;"--}% + %{--title="Actions"--}% + %{--class="fg-button ui-widget ui-state-default ui-corner-all" style="padding: 3px 5px; margin: 5px;"--}% + %{--onclick="jQuery('.temp44').addClass('hiddenActions');jQuery('#actionsButtons${entityCode}Record${record.id}').removeClass('hiddenActions')">--}% + %{--…--}% + %{--</a>--}% - <g:if test="${record.class.declaredFields.name.contains('code') && record.code}"> - =<span - style="color: #004499; font-style: italic; font-family: monospace">${record.code}</span> - </g:if> + </td> + </tr> +<g:if test="${(!OperationController.getPath('metadataLine.hidden') || OperationController.getPath('metadataLine.hidden') == 'no') && params.reportType != 'tab'}"> + <tr style="color: white; margin-bottom: 3px; padding: 6px; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);"> + <td style="width: 23%; background: #e5eaed;"> - <g:if test="${'J'.contains(entityCode) && new File(OperationController.getPath('jrn.sns.path') + '/J/' + record.id).exists()}"> - <b style="color: darkgreen">sns</b>   - </g:if> + <div class="record-id" style="vertical-align: top; color: white;"> + %{--<table border="0">--}% + %{--<tr>--}% - <g:if test="${'J'.contains(entityCode) && new File(OperationController.getPath('jrn.rcd.path') + '/J/' + record.id).exists()}"> - <b style="color: darkgreen">rcd</b>   - </g:if> - <g:if test="${'J'.contains(entityCode) && new File(OperationController.getPath('jrn.vjr.path') + '/J/' + record.id).exists()}"> - <b style="color: darkgreen">vjr</b>   - </g:if> + %{--<td style="padding-right: 3px; line-height: 1.4em;">--}% + <g:remoteLink controller="generics" action="showSummary" + tabindex="-1" + class="refresh " + params="${[id: record.id, entityCode: entityCode]}" + update="${entityCode}Record${record.id}" + style="margin-left: 3px;padding-bottom: 1px; display: inline" + title="ID ${record.id}. Click to refresh"> + <span class="${entityCode}-bkg ${entityCode == 'N' && record.entityCode != null ? 'non-genuineNote' : ''} ${entityCode == 'T' && record.isTodo ? 'todoTask' : ''} ${entityCode == 'O' ? (record.validOn == true ? 'correctCommand' : 'wrongCommand') : ''} ID-bkg" + style="padding: 2px; margin-right: 2px; color: white; display: inline; border-radius: 4px;" title="${new DecimalFormat("#,###").format(record.id)}"> + <span style="display: inline-block; color: white; padding: 4px;"> + <b>${entityCode}</b> + </span> + </g:remoteLink> - <g:if test="${record.class.declaredFields.name.contains('excerpt') && record.excerpt}"> - <g:remoteLink controller="generics" action="showSummary" id="${record.excerpt.id}" - tabindex="-1" - params="[entityCode: 'R']" - update="below${entityCode}Record${record.id}" - title="Go to record"> - <b>E-${record.excerpt?.title}</b> - </g:remoteLink> - </g:if> +   + %{--<sup style="color: black;font-size: x-small; ">--}% + %{--</sup>--}% + %{--<sub style="position: relative; top: 0.2em; left: -0.5em;color: black;font-size: x-small; ">--}% + <span class="departmentName"> + ${record.class.declaredFields.name.contains('department') && record.department ? record.department?.code: ''} + </span> +   + <span class="priorityNumber"> + ${record.class.declaredFields.name.contains('priority') && record.priority ? record.priority: ''} + </span> +   - <g:if test="${entityCode == 'R' && record.isPublic}"> - <span>shared</span> + <g:if test="${record.class.declaredFields.name.contains('context') && record.context}"> + <span class="contextName"> + @${record.context?.code} </span> </g:if> + %{--</sub>--}% - <g:if test="${context}"> - ${context} <br/> - </g:if> - + %{-- <span style="font-size: x-small">--}% + %{-- ${new DecimalFormat("#,###").format(record.id)}--}% + %{-- </span>--}% + %{-- <g:if test="${record.class.declaredFields.name.contains('type') && record.type}">--}% + %{-- <div style="font-size: smaller;margin: 3px; padding: 2px; border-radius: 0px; border: 1px solid darkgray; color: white; font-weight: bold; background: #695b7e; font-family: monospace">${record.type?.code}</div>--}% + %{-- </g:if>--}% + %{--</td>--}% - <g:if test="${entityCode == 'Q'}"> - !<b style="color: darkred;">${record?.category?.code}</b> - [${new DecimalFormat('#,###').format(record.amount)}] - </g:if> + %{--</tr>--}% + %{----}% + %{--</table>--}% - <g:if test="${record.class.declaredFields.name.contains('shortDescription') && record.shortDescription}"> - <div style="border-right: 1px solid darkgreen; font-size: 0.90em !important; color: #5b805e !important; padding: 3px; line-height: 1.4em;"> - <g:remoteLink controller="page" action="panel" - tabindex="-1" - params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" - update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" - style="padding: 2px; font-size: 0.95em;" - before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);"> - ${record?.shortDescription?.replaceAll('\n', '<br/>')?.decodeHTML()?.replaceAll('\n', '<br/>')} - %{--?.replaceAll("\\<.*?>", "")--}% - </g:remoteLink> - </div> - </g:if> - <g:if test="${record.class.declaredFields.name.contains('description') && record.description}"> - %{--<br/>--}% - <g:if test="${record.class.declaredFields.name.contains('language') && record.language}"> - <span class="${OperationController.getPath('repository.languages.RTL').contains(record.language) ? 'RTLText' : 'LRTText'}"> - </g:if> - <span style="font-size: 0.95em !important; color: #272727 !important; padding: 3px; line-height: 1.4em;"> - <g:if test="${entityCode == 'N' && record?.type?.code == 'word'}"> - <span id="descriptionArea${record.id}"> - <g:remoteLink controller="generics" action="showAnswer" - tabindex="-1" - id="${record.id}" - params="[entityCode: entityCode]" - update="descriptionArea${record.id}" - title="Show answer"> -  show  - </g:remoteLink> - </span> - </g:if> - <g:else> - <g:if test="${record.description?.length() < OperationController.getPath('description.summarize.threshold')?.toInteger() && record.description != '?'}"> - <g:remoteLink controller="page" action="panel" - tabindex="-1" - params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" - update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" - style="padding: 2px; font-size: 0.95em;" - before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);"> - ${record?.description?.replaceAll('\n', '<br/>')?.decodeHTML()?.replaceAll('\n', '<br/>')?.replace('Product Description', '')} - %{--?.replaceAll("\\<.*?>", "")--}% - </g:remoteLink> - </g:if> - - - <g:if test="${1 == 2 && record.description?.length() < OperationController.getPath('description.summarize.thresholdMax')?.toInteger() && - record.description?.length() > OperationController.getPath('description.summarize.threshold')?.toInteger()}"> - - <span id="descriptionArea${record.id}"> - <g:remoteLink controller="generics" action="showFullDescription" - tabindex="-1" - id="${record.id}" - params="[entityCode: entityCode]" - update="descriptionArea${record.id}" - title="Show full description"> - %{--?.replaceAll("\\<.*?>", "")--}% - <pkm:summarize - text="${record?.description?.replace('Product Description', '')}" - - length="${OperationController.getPath('description.summarize.threshold')?.toInteger()}"/> - (${record.description?.count(' ')}) - </g:remoteLink> - </span> - - </g:if> - <g:if test="${record.description?.length() > OperationController.getPath('description.summarize.threshold')?.toInteger()}"> - - <g:remoteLink controller="page" action="panel" - tabindex="-1" - params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" - update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" - style="padding: 4px; font-size: 0.95em;" - before=" myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0});"> - - - %{--?.replaceAll("\\<.*?>", "")--}% - <pkm:summarize - text="${record?.description?.replace('Product Description', '')}" - length="${OperationController.getPath('description.summarize.threshold')?.toInteger()}"/> - (${record.description?.count(' ')}) - </g:remoteLink> - - </g:if> - </g:else> - </span> - <g:if test="${record.class.declaredFields.name.contains('language')}"> - </span> - </g:if> + %{--</g:if>--}% + </div> - <g:if test="${'O'.contains(entityCode)}"> + </td> + <td style="width: 53%; background: #EDF2F4; border-left: 0px solid white;"> - <br/> - %{--<g:remoteLink controller="generics" action="verifyOperation"--}% - %{--id="${record.id}"--}% - %{--update="below${entityCode}Record${record.id}"--}% + %{--before="jQuery('#accordionEast').accordion({ active: 0});jQuery('#3rdPanel').scrollTop(0)"--}% - %{--title="Show parent entity">--}% - %{--<b>Verify</b>--}% - %{--</g:remoteLink>--}% + <!-- meta region --> + <g:remoteLink controller="page" action="panel" + tabindex="-1" + params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" + update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" + title="Go to page"> + <g:if test="${record.class.declaredFields.name.contains('keepSecret')}"> + <g:if test="${record.keepSecret}"> + <b>∉∉</b> + </g:if> + </g:if> - <pkm:operationRecordFiles fileClass="himFile" recordId="${record.id}"/> - %{-- changes for the operation module w08.2022 --}% - %{--update="underQuickEditForm"--}% - <br/> - <g:remoteLink controller="generics" action="executeOperation" - id="${record.id}" - class="executeOperation" - update="${entityCode}Record${record.id}" - style="padding: 2px; border: 1px solid darkgreen; border-radius: 5px; text-align: center; font-size: 1em; width: 20%;" - title="Show parent entity"> - <b>Execute (x)</b> - </g:remoteLink> + <g:if test="${record.class.declaredFields.name.contains('occurence') && record.occurence}"> + o${record.occurence} + </g:if> - </g:if> - </g:if> + <g:if test="${record.class.declaredFields.name.contains('status') && record.status}"> + <span class="statusName"> + ?${record.status?.code} + </span> + </g:if> - <g:if test="${record.class.declaredFields.name.contains('fullText') && record.fullText}"> + <span class="typeName"> + ${record.class.declaredFields.name.contains('type') && entityCode != 'O' && '#' + record.type ? record.type?.code : ''} + </span> - <g:remoteLink controller="page" action="panel" - tabindex="-1" - params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" - update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" - style="padding: 4px; font-size: 0.95em;" - before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);"> + <g:if test="${record.class.declaredFields.name.contains('course' + + '') && record.course}"> + <span class="courseName"> + ${record.course?.code ? '<b>' + record.course?.code + '</b> ' : record.course}</span> + %{--+ record.course?.summary--}% + </g:if> - <span style="font-size: 0.95em; font-style: italic; color: #435d59"> - <pkm:summarize text="${record.fullText}" - length="${OperationController.getPath('description.summarize.threshold')?.toInteger()}"/> - (${record.fullText?.count(' ')}) - </span> - </g:remoteLink> - </g:if> +%{--</span>--}% - <g:if test="${record.class.declaredFields.name.contains('password')}"> - <span style="font-size: 0.95em; color: #8A5C69"> - ${record.password} - </span> - </g:if> + <g:if test="${record.class.declaredFields.name.contains('entity')}"> + <span title="${record.entity}"> + <i>${record.entity}</i> + </span> + </g:if> - <g:if test="${'N'.contains(entityCode)}"> - <g:if test="${record.pages}"> - <i>pg. ${record.pages}</i> - </g:if> - </g:if> +%{--<g:if test="${record.class.declaredFields.name.contains('context') && record.context}">--}% +%{--<b>@</b><span style="margin: 2px; padding: 2px; border-radius: 5px; border: 1px solid darkolivegreen; color: darkblue; font-style: italic; font-size: normal">@${record.context?.code}</span>--}% +%{--<br/>--}% +%{--</g:if>--}% - <g:if test="${record.class.declaredFields.name.contains('notes') && record.notes}"> - <br/> - <span style="color:#7588b2 "> - <pkm:summarize text="${record.notes}" - length="${OperationController.getPath('notes.summarize.threshold')?.toInteger()}"/> - (${record.notes?.count(' ')}) - </span> - </g:if> + <g:if test="${entityCode == 'X' && ker.OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> - <g:if test="${record.class.declaredFields.name.contains('nbFiles') && record.nbFiles}"> - %{--<g:if test="${record.nbFiles}">--}% - <div title="${record.filesList?.replace('"', '')}" style="display: inline; font-weight: bold; direction: ltr">${record.nbFiles ?: ''} files - </div> - </g:if> -%{-- <span style="">--}% -%{-- <g:if test="${record.class.declaredFields.name.contains('orderInBook')}">--}% -%{-- <g:if test="${record.orderInBook}">--}% -%{-- <span style="font-size: 0.95em;">ib ${record.orderInBook}</span>--}% -%{-- </g:if>--}% -%{-- </g:if>--}% -%{-- </span>--}% + <g:if test="${record.queryType == 'hql'}"> - </g:remoteLink> + %{--<g:remoteLink controller="generics" action="executeSavedSearch"--}% + %{--style=" color: gray"--}% + %{--before="jQuery.address.value(jQuery(this).attr('href'));"--}% + %{--id="${record.id}" params="[reportType: 'random']"--}% + %{--update="centralArea">--}% + %{--rand.--}% - <span id="datesSpan" style="direction: ltr !important; text-align: left !important;"> + %{--</g:remoteLink>--}% - <g:remoteLink controller="page" action="panel" - tabindex="-1" - params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" - update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" - style="padding: 1px; font-size: 0.95em;" - before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);" - title="Created ${record?.dateCreated?.format('dd.MM.yyyy')}"> - <g:if test="${record.class.declaredFields.name.contains('completedOn') && record.completedOn}"> + <g:link controller="generics" action="executeSavedSearch" + style=" color: gray" + id="${record.id}" params="[reportType: 'tab']" + target="_blank"> + tab + </g:link> - <span - title="${record.completedOn?.format(OperationController.getPath('datetime.format'))}" - style="font-size: 0.95em; font-style: italic;"> - c<pkm:weekDate date="${record?.completedOn}"/> - </span> - </g:if> + %{-- <g:if test="${record.calendarEnabled}"> + <g:link controller="generics" action="executeSavedSearch" + style=" color: gray" + id="${record.id}" params="[reportType: 'cal']" + target="_blank"> + cal + </g:link> + </g:if>--}% - %{--<g:if test="${'R'.contains(entityCode)}">--}% - %{--<g:if test="${record.publicationDate}">--}% - %{--<b> ${record.publicationDate ?: record.year}--}% - %{--</b>--}% - %{--</g:if>--}% - %{--</g:if>--}% + </g:if> + </g:if> - <g:if test="${'I'.contains(entityCode)}"> - <pkm:weekDate date="${record?.date}"/> - </g:if> - <g:elseif test="${'Q'.contains(entityCode)}"> - <pkm:weekDate date="${record?.date}"/> - </g:elseif> - %{--<g:else>--}% - %{--<g:else>--}% - %{--<i>--}% - %{--<prettytime:display--}% - %{--date="${record?.dateCreated}"></prettytime:display>--}% - %{--</i>--}% - %{--</g:else>--}% - %{--<pkm:weekDate date="${record?.dateCreated}"/>--}% - %{----}% - %{--</g:else>--}% - </g:remoteLink> - </span> - <g:if test="${record.class.declaredFields.name.contains('tags') && record.tags}"> - <br/>   - <g:render template="/tag/tags" model="[instance: record, entity: entityCode]"/> - </g:if> - <g:if test="${record.class.declaredFields.name.contains('contacts') && record.contacts}"> - <br/> -   - <g:render template="/tag/contacts" model="[instance: record, entity: entityCode]"/> - </g:if> + <g:if test="${record.class.declaredFields.name.contains('value')}"> + <span title="${record.value}"> + <i>${record.value}</i> + </span> + </g:if> - %{--<br/>--}% - %{--<br/>--}% + <g:if test="${entityCode == 'C'}"> + <b>${record.numberCode}</b> - <span id="statisticsSpan" - style="padding-left: 5px; padding-right: 5px;"> + </g:if> - <g:remoteLink controller="generics" action="showChildren" - tabindex="-1" - params="${[id: record.id, entityCode: entityCode]}" - update="below${entityCode}Record${record.id}" - title="Children"> - <g:if test="${entityCode == 'R'}"> - <g:if test="${Excerpt.countByBook(record)}"> - E <sup>${Excerpt.countByBook(mcs.Book.get(record.id))}</sup> - </g:if> - <g:if test="${Book.countByBook(record) > 0}"> - _R<sup>${Book.countByBook(mcs.Book.get(record.id))}</sup> - </g:if> - <g:if test="${IndexCard.countByBook(record)}"> - N<sup>${IndexCard.countByBook(mcs.Book.get(record.id))}</sup> - </g:if> - <g:if test="${Planner.countByBook(record)}"> - P<sup>${Planner.countByBook(record)}</sup> - </g:if> - <g:if test="${Journal.countByBook(record)}"> - J <sup>${Journal.countByBook(record)}</sup> - </g:if> - </g:if> + %{--<g:if test="${record.class.declaredFields.name.contains('reality') && record.reality}">--}% + %{--<span style="color:#b22222 ">--}% + %{--${record.reality}--}% + %{--</span>--}% + %{--</g:if>--}% - <g:if test="${entityCode == 'C'}"> - <g:if test="${Planner.countByCourse(record) > 0}"> - P <sup>${Planner.countByCourse(record)}</sup> - </g:if> - <g:if test="${Journal.countByCourse(record) > 0}"> - J <sup>${Journal.countByCourse(record)}</sup> - </g:if> - <g:if test="${Writing.countByCourse(record) > 0}"> - W <sup>${Writing.countByCourse(record)}</sup> - </g:if> - <g:if test="${IndexCard.countByCourse(record) > 0}"> - N <sup>${IndexCard.countByCourse(record)}</sup> - </g:if> - <g:if test="${Book.countByCourse(record) > 0}"> - R <sup>${Book.countByCourse(record)}</sup> - </g:if> - <g:if test="${Goal.countByCourse(record) > 0}"> - G <sup>${Goal.countByCourse(record)}</sup> - </g:if> - <g:if test="${Task.countByCourse(record) > 0}"> - T <sup>${Task.countByCourse(record)}</sup> - </g:if> - </g:if> - <g:if test="${entityCode == 'T'}"> - <g:if test="${Planner.countByTask(record) > 0}"> - P <sup>${Planner.countByTask(record)}</sup> - </g:if> - <g:if test="${Journal.countByTask(record) > 0}"> - J <sup>${Journal.countByTask(record)}</sup> - </g:if> -%{-- <g:if test="${app.IndexCard.countByEntityCodeAndRecordId(record.entityCode(), record.id) > 0}">--}% -%{-- N <sup>${app.IndexCard.countByEntityCodeAndRecordId(record.entityCode(), record.id)}</sup>--}% -%{-- </g:if>--}% - </g:if> - <g:if test="${entityCode == 'G'}"> + <g:if test="${record.class.declaredFields.name.contains('readOn') && record.readOn}"> + <img src="${resource(dir: '/images', file: 'edx-check.png')}" style="width: 15px;" + title="${record.readOn?.format('dd.MM HH:mm')}"/> + %{--Read ${record.readOn?.format('dd.MM.yyyy')}--}% + </g:if> - <g:if test="${Task.countByGoal(record) > 0}"> - T <sup>${Task.countByGoal(record)}</sup> - </g:if> - </g:if> + <g:if test="${record.class.declaredFields.name.contains('reviewCount') && record.reviewCount}"> + ∇ <sup>${record.reviewCount}</sup> + </g:if> - <g:if test="${app.IndexCard.countByEntityCodeAndRecordId(record.entityCode(), record.id) > 0}"> - N <sup>${app.IndexCard.countByEntityCodeAndRecordId(record.entityCode(), record.id)}</sup> - </g:if> + %{--<g:if test="${record.class.declaredFields.name.contains('chapters') && record.chapters}">--}% + %{--  ---}% + %{--ch ${record.chapters}--}% + %{--</g:if>--}% + %{--<g:if test="${record.class.declaredFields.name.contains('fileName') && record.fileName}">--}% + %{--  ---}% + %{--f:${record.fileName}--}% + %{--</g:if>--}% - <g:if test="${entityCode == 'K'}"> - <i>(${IndicatorData.countByIndicator(record)})</i> - </g:if> - %{--<g:if test="${entityCode == 'Q'}">--}% - %{--# <sup>${PaymentData.countByCategory(record)}</sup>--}% - %{--todo--}% - %{--</g:if>--}% - %{--</g:if>--}% - %{--</span>--}% - %{--</td>--}% + <g:if test="${record.class.declaredFields.name.contains('code') && record.code}"> + =<span + style="color: #004499; font-style: italic; font-family: monospace">${record.code}</span> + </g:if> - %{--<g:if test="${'CW'.contains(entityCode)}">--}% + <g:if test="${context}"> + <b>Context:</b> + ${context} <br/> + </g:if> - %{--<td class="actionTd">--}% - %{--<g:link controller="page" action="publish" target="_blank"--}% - %{--params="${[id: record.id, entityCode: entityCode]}"--}% - %{--class=" fg-button fg-button-icon-solo ui-widget ui-state-default ui-corner-all"--}% - %{--title="Publish">--}% - %{--<span class="ui-icon ui-icon-script"></span>--}% - %{--</g:link>--}% + <g:if test="${entityCode == 'Q'}"> + !<b style="color: darkred;">${record?.category?.code}</b> + [${new DecimalFormat('#,###').format(record.amount)}] + </g:if> - %{--<g:link controller="page" action="presentation" target="_blank"--}% - %{--params="${[id: record.id, entityCode: entityCode]}"--}% - %{--class=" fg-button fg-button-icon-solo ui-widget ui-state-default ui-corner-all"--}% - %{--title="presentation">--}% - %{--<span class="ui-icon ui-icon-script"></span>--}% - %{--</g:link>--}% +%{-- <span style="">--}% +%{-- <g:if test="${record.class.declaredFields.name.contains('orderInBook')}">--}% +%{-- <g:if test="${record.orderInBook}">--}% +%{-- <span style="font-size: 0.95em;">ib ${record.orderInBook}</span>--}% +%{-- </g:if>--}% +%{-- </g:if>--}% +%{-- </span>--}% - %{--</td>--}% +</g:remoteLink> +<span id="datesSpan" style="direction: ltr !important; text-align: left !important;"> - %{--</g:if>--}% +<g:remoteLink controller="page" action="panel" + tabindex="-1" + params="${[id: record.id, entityCode: entityCode, mobileView: mobileView]}" + update="${mobileView == 'true' ? 'below' + entityCode+ 'Record' + record.id : '3rdPanel'}" + style="padding: 1px; font-size: 0.95em;" + before="myLayout.open('east');jQuery('.recordSelected').removeClass('recordSelected');jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); jQuery('#accordionEast').accordion({ active: 0}); jQuery('#3rdPanel').scrollTop(0);" + title="Created ${record.class.declaredFields.name.contains('dateCreated') ? record?.dateCreated?.format('dd.MM.yyyy') : ''}"> + <g:if test="${record.class.declaredFields.name.contains('completedOn') && record.completedOn}"> + <div title="${record.completedOn?.format(OperationController.getPath('datetime.format'))}" + style="display: inline-block; margin: 3px; font-size: 0.95em; padding: 2px; border-radius: 3px; border: 1px solid darkgreen; direction: ltr; text-align: left; text-decoration: line-through;" class="english en En"> + %{--c<pkm:weekDate date="${record?.completedOn}"/>--}% + %{--Completed on:--}% + <b style="font-size: large; color: darkgray">◊</b> + ${record?.completedOn?.format('EE dd.MM HH:mm')} + </div> + </g:if> - %{--<tdclass="actionTd">--}% - %{----}% - %{--</td>--}% - </g:remoteLink> +%{--<g:if test="${'R'.contains(entityCode)}">--}% +%{--<g:if test="${record.publicationDate}">--}% +%{--<b> ${record.publicationDate ?: record.year}--}% +%{--</b>--}% +%{--</g:if>--}% +%{--</g:if>--}% - </span> - %{--<g:if test="${session['showFullCard'] == 'on' || showFull}">--}% - %{--</g:if>--}% - </td> + <g:if test="${'I'.contains(entityCode)}"> + <pkm:weekDate date="${record?.date}"/> + </g:if> + <g:elseif test="${'Q'.contains(entityCode)}"> + <pkm:weekDate date="${record?.date}"/> + </g:elseif> +%{--<g:else>--}% +%{--<g:else>--}% +%{--<i>--}% +%{--<prettytime:display--}% +%{--date="${record?.dateCreated}"></prettytime:display>--}% +%{--</i>--}% +%{--</g:else>--}% +%{--<pkm:weekDate date="${record?.dateCreated}"/>--}% +%{----}% +%{--</g:else>--}% +</g:remoteLink> +</span> - <td class="" style=""> - -<table border="0" style="border: 0"> - <tr> - <td> <g:if test="${record.class.declaredFields.name.contains('bookmarked')}"> - <g:if test="${!record.bookmarked}"> - <a name="bookmark${record.id}${entityCode}" - title="Toggle bookmark" - class="quickBookmarkButton" - value="${record.bookmarked}" - onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/quickBookmark/${entityCode}-${record.id}')"> - <span class="icon-star-gm"></span> - </a> - </g:if></td> - <td> <g:if test="${record.bookmarked}"> - <a name="bookmark${record.id}${entityCode}" - title="Toggle bookmark" - value="${record.bookmarked}" - class="quickBookmarkButton" - onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/quickBookmark/${entityCode}-${record.id}')"> - <span class="icon-starred-gm"></span> - </a> - </g:if> - </g:if> - </td> - <td> <a - title="Actions" - class="fg-button ui-widget ui-state-default ui-corner-all" style="padding: 0px 3px; margin: 2px;" - onclick="jQuery('.temp44').addClass('hiddenActions');jQuery('#actionsButtons${entityCode}Record${record.id}').removeClass('hiddenActions')"> - … - </a> - </td> - </tr> -</table> +%{--<g:if test="${session['showFullCard'] == 'on' || showFull}">--}% +%{--</g:if>--}% </td> + <td style="width: 23%; background: #DEE2E6; color: black; text-align: right !important; border-left: 0px solid white;"> + <!-- statistics region --> - %{--<g:if test="${new File(OperationController.getPath('root.rps1.path') + '/' + entityCode + '/' + record.id + '/' + 'cover.jpg')?.exists() ||--}% - %{--new File(OperationController.getPath('root.rps2.path') + '/' + entityCode + '/' + record.id + '/' + 'cover.jpg')?.exists()}">--}% - - <td style="width: 95px !important;"> + <g:if test="${'R'.contains(entityCode) && record?.publishedNodeId && record?.publishedOn}"> - <ul class="product-gallery"> + <span style="margin: 2px; padding: 2px; border-radius: 3px; border: 1px solid darkgray;"> + %{-- ∠--}% + ¶ + ${record?.publishedOn?.format('dd.MM.yyyy')} - <li class="gallery-img" id="recordImage${record.id}"> - <img class="Photo" style="height: 90px; width: auto; display:inline" onerror="this.style.display='none'" - src="${createLink(controller: 'generics', action: 'viewRecordImage', id: record.id, params: [entityCode: entityCode, date: new Date()])}"/> + </span> + %{--(<i><prettytime:display--}% + %{--date="${record?.startDate}"></prettytime:display></i>)--}% + </g:if> - </li> - </ul> - <script type="text/javascript"> - jQuery('#recordImage${record.id}').Am2_SimpleSlider(); - </script> - </td> + <g:if test="${record.class.declaredFields.name.contains('isPrivate') && record.isPrivate == false}"> + <span style="margin: 2px; padding: 2px; border-radius: 3px;"> + ♥ + </span> + </g:if> - %{--</g:if>--}% -%{--legacy case--}% - <g:if test="${entityCode == 'R'}"> - <g:if test="${(new File(OperationController.getPath('root.rps1.path') + "/${entityCode}/cvr/" + - '/' + record.id + '')?.exists() || - new File(OperationController.getPath('root.rps2.path') + - "/${entityCode}/cvr/" + '/' + record.id + '')?.exists())}"> - <td style="width: 85px;"> - <ul class="product-gallery"> - <li class="gallery-img" id="recordImageCover${record.id}"> - <img class="Photo" style="width: 60px; height: 80px; display:inline" - src="${createLink(controller: 'book', action: 'viewImage', id: record.id, params: [date: new Date()])}"/> - </li> - </ul> - <script type="text/javascript"> - jQuery('#recordImageCover${record.id}').Am2_SimpleSlider(); - </script> - </td> - </g:if> + <g:if test="${record.class.declaredFields.name.contains('user') && !record.user}"> + <span style="margin: 2px; padding: 2px; border-radius: 3px; color: red;"> + No username! + </span> </g:if> - <g:elseif test="${entityCode.length() == 1 && (new File(OperationController.getPath('root.rps1.path') + "/${entityCode}/" + record.id + '/' + - record.id + entityCode.toLowerCase() + '.jpg')?.exists() || new File(OperationController.getPath('root.rps2.path') + "/${entityCode}/" + record.id + '/' + - record.id + entityCode.toLowerCase() + '.jpg')?.exists())}"> - - <td style="width: 55px;"> - - <ul class="product-gallery"> - <li class="gallery-img" id="recordImageCover${record.id}"> - <img class="Photo" - style="height: 80px; display:inline" - src="${createLink(controller: 'indexCard', action: 'viewImage', id: record.id, params: [entityCode: entityCode, date: new Date()])}"/> - </li> - </ul> - <script type="text/javascript"> - jQuery('#recordImageCover${record.id}').Am2_SimpleSlider(); - </script> - </td> - </g:elseif> - <g:if test="${entityCode == 'E'}"> + <% + // just a comment + %> - <g:if test="${(new File(OperationController.getPath('covers.sandbox.path') + '/exr/' + - record?.id + '.jpg')?.exists() || new File(OperationController.getPath('covers.repository.path') + '/exr/' + record?.id + '.jpg')?.exists())}"> - <td> + <div id="statisticsSpan" + style="padding-left: 5px; padding-right: 5px;"> +<g:render template="/gTemplates/statistics" model="[record: record]"/> - <ul class="product-gallery"> + <a class="uk-button-default" style="border: 1px solid darkgray; padding: 1px 3px 1px 3px; margin: 1px 3px 1px 3px; border-radius: 5px; vertical-align: middle;" + title="Actions" + onclick="jQuery('.temp44').addClass('hiddenActions'); jQuery('#actionsButtons${entityCode}Record${record.id}').removeClass('hiddenActions');" + >...</a> - <li class="gallery-img" id="recordImageCover${record.id}"> - <img class="Photo" style="width: 50; height: 70; display:inline" - src="${createLink(controller: 'book', action: 'viewExcerptImage', id: record.id, params: [date: new Date()])}"/> + <g:checkBox name="select-${record.id}-${entityCode}" + title="Select record" + value="${org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes().getSession()[entityCode + record.id] == 1}" + style="height: 20px !important; width: 20px !important; float: right;" + class="uk-checkbox" + onclick="jQuery('#selectBasketRegion').load('${request.contextPath}/generics/select/${entityCode}${record.id}')" /> - </li> - </ul> - <script type="text/javascript"> - jQuery('#recordImageCover${record.id}').Am2_SimpleSlider(); - </script> - </td> - </g:if> + </div> - </g:if> - %{--</td>--}% - </tr> + + </td> + </tr> +</g:if> <tr> - <td colspan="4"> + <td colspan="3"> <div class="recordContainer" id="2ndLine${entityCode}${record.id}" style="opacity: 0.95; padding: 0px; margin: 0px; display: inline;"> @@ -1191,14 +800,6 @@ style="text-align: left; direction: ltr; line-height: 20px;font-size: 0.95em !important; color: darkslategrey !important; column-count: 2"> - <g:if test="${'R'.contains(entityCode) && record?.publishedOn}"> - <br/> <span style="margin: 2px; padding: 2px; border-radius: 3px; border-bottom: 1px solid darkgray;"> - %{-- ∠--}% - p ${record?.publishedOn?.format('dd.MM.yyyy')} - </span> - %{--(<i><prettytime:display--}% - %{--date="${record?.startDate}"></prettytime:display></i>)--}% - </g:if> @@ -1213,8 +814,10 @@ params="[entityController: record.class.name, updateRegion : entityCode + 'Record' + record.id, finalRegion : entityCode + 'Record' + record.id]" - update="${entityCode}Record${record.id}" + + update="3rdPanel" title="Edit"> + %{--update="${entityCode}Record${record.id}"--}% %{--<i style="font-size: 0.95em;">--}% full (e) %{--</i>--}% @@ -1222,7 +825,7 @@ <g:remoteLink controller="generics" action="fetchQuickAddForm" style="padding: 2px; font-size: 0.95em;" - class="${record.class.declaredFields.name.contains('priority') ? 'priorityText' + record.priority : ''} quickEditButton" + class="quickEditButton" id="${record.id}" params="[entityController: record.class.name, updateRegion : '3rdPanel', @@ -1278,8 +881,8 @@ Type: <script type="text/javascript"> jQuery("#2${field}${record.id}").editable( - {showButtons: false, mode: 'popup', placement: 'right', success: function (responce, newValue) { - jQuery('.selectedRecord .refresh').click(); + {showButtons: true, mode: 'popup', placement: 'right', dataType: 'json', success: function (responce, newValue) { + jQuery('.recordSelected .refresh').click(); }} ); </script> @@ -1310,7 +913,11 @@ Type: </div> <script type="text/javascript"> jQuery("#${field}${record.id}").editable( - {showButtons: false, mode: 'popup', placement: 'right'} + {showButtons: true, mode: 'popup', placement: 'right', success: function (responce, newValue) { + console.log('in editable'); + jQuery('.recordSelected .refresh').click(); + }} + ); </script> @@ -1336,7 +943,9 @@ Course: <script type="text/javascript"> jQuery("#${field}${record.id}").editable( - {showButtons: false, mode: 'popup', placement: 'right'} + {showButtons: true, mode: 'popup', placement: 'right', success: function (responce, newValue) { + jQuery('.recordSelected .refresh').click(); + }} ); </script> @@ -1354,6 +963,10 @@ Course: %{-- </g:if>--}% +<% + // just a comment +%> + <g:if test="${entityCode == 'T'}"> <br/> @@ -1374,7 +987,9 @@ Course: %{--<!--jQuery("#${field}${record.id}").editable();-->--}% jQuery("#${field}${record.id}").editable( - {showButtons: false, mode: 'popup', placement: 'right'} + {showButtons: true, mode: 'popup', placement: 'right', success: function (responce, newValue) { + jQuery('.recordSelected .refresh').click(); + }} ); </script> @@ -1403,7 +1018,9 @@ Department: </a>   <script type="text/javascript"> - jQuery("#${field}${record.id}").editable(); + jQuery("#${field}${record.id}").editable( {showButtons: true, mode: 'popup', placement: 'right', success: function (responce, newValue) { + jQuery('.recordSelected .refresh').click(); + }}); </script> <script type="text/javascript"> @@ -1433,45 +1050,14 @@ Department: - <g:if test="${'E'.contains(entityCode)}"> - - Book: - <b style="font-family: Courier"> - ${record?.book?.course?.code}</b> - <br/> - </g:if> - - - - - <g:if test="${record.class.declaredFields.name.contains('plannedDuration') && record.plannedDuration}"> - Duration:   - <g:set value="plannedDuration" var="field"></g:set> - - <a href="#" id="${field}${recordId}" class="${field}" - data-type="select" - data-value="${record[field] ?: 0}" - data-name="${field}-${record.entityCode()}" - data-source="${request.contextPath}/operation/getQuickEditValues?entity=${record.entityCode()}&field=${field}&date=${new Date().format('hhmmssDDMMyyyy')}" - data-pk="${record.id}" data-url="${request.contextPath}/operation/quickSave2" - data-title="Edit ${field}"> - +${record[field] ?: ''} - </a> - <script> - %{--jQuery('#${field}${recordId}').editable();--}% - </script> -<br/> - </g:if> - - <g:if test="${entityCode == 'I'}"> Indicator: ${record.indicator?.code} </g:if> - <g:if test="${entityCode == 'Q'}"> + %{--<g:if test="${entityCode == 'Q'}">--}% - </g:if> + %{--</g:if>--}% <g:if test="${entityCode == 'I'}"> @@ -1498,23 +1084,6 @@ Parent: - <g:if test="${'CGR'.contains(entityCode)}"> - - </g:if> - - - <g:if test="${record.class.declaredFields.name.contains('--writtenOn') && record.writtenOn}"> - - <span style="font-size: 0.95em; font-weight: bold; padding-right: 4px;" - title="${record.writtenOn?.format(OperationController.getPath('datetime.format'))}"> - <g:if test="${record.class.declaredFields.name.contains('approximateDate') && record.approximateDate}"> - ~ - </g:if> - - %{--${record.writtenOn?.format(OperationController.getPath('date.format'))}--}% - w<pkm:weekDate date="${record?.writtenOn}"/> - </span> - </g:if> @@ -1587,7 +1156,9 @@ Parent: ${record.recordId && record.recordId != 'null' && record.entityCode == 'W' ? Writing.get(record.recordId.toLong()) : 'w'} </a> <script type="text/javascript"> - jQuery("#2${field}${record.id}").editable(); + jQuery("#2${field}${record.id}").editable( {showButtons: true, mode: 'popup', placement: 'right', success: function (responce, newValue) { + jQuery('.recordSelected .refresh').click(); + }}); </script> </g:if> @@ -1614,7 +1185,9 @@ Parent: ${record[field] ? (record[field]) : "'"} </a> <script type="text/javascript"> - jQuery("#${field}${record.id}").editable(); + jQuery("#${field}${record.id}").editable( {showButtons: true, mode: 'popup', placement: 'right', success: function (responce, newValue) { + jQuery('.recordSelected .refresh').click(); + }}); </script> %{-- <g:if test="${record.language}">--}% @@ -1657,17 +1230,18 @@ Parent: </span> - - - - %{--<g:remoteLink controller="generics" action="showRelate"--}% - %{--params="${[id: record.id, entityCode: entityCode]}"--}% - %{--update="below${entityCode}Record${record.id}"--}% - %{--title="Details">--}% - %{--rel (${mcs.Relationship.countByEntityACodeAndRecordA(entityCode, record.id)})--}% - %{--ToDo: fix, entityA is entitymapping and not entityCode!!! --}% - %{--</g:remoteLink>--}% - +<br/> +<b>Relations:</b> +%{--<g:if test="${mcs.Relationship.countByEntityACodeAndRecordA(entityCode, record.id)}">--}% + <g:remoteLink controller="generics" action="showRelate" + params="${[id: record.id, entityCode: entityCode]}" + update="below${entityCode}Record${record.id}Relations2" + title="Details"> + ${mcs.Relationship.countByEntityACodeAndRecordA(entityCode, record.id)} rel. + </g:remoteLink> +%{--ToDo: fix, entityA is entitymapping and not entityCode!!! --}% + <div id="below${entityCode}Record${record.id}Relations2"></div> +%{--</g:if>--}% <g:if test="${record.class.declaredFields.name.contains('priority')}"> @@ -1712,7 +1286,7 @@ Parent: <br/> <g:if test="${record.class.declaredFields.name.contains('endDate')}"> - Due date: + End date:   <a name="bookmark${record.id}${entityCode}" value="${record.endDate}" style="background: lightgrey" @@ -1720,16 +1294,66 @@ Parent: onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/increaseEndDate/${entityCode}${record.id}')"> + </a> + + <a name="bookmark${record.id}${entityCode}" value="${record.endDate}" style="background: lightgrey" title="Set due date to today" class="setTodayButton" id="setToday${record.id}${entityCode}" - onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/makeEndDateToday/${entityCode}${record.id}')"> + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/setEndDate/${entityCode}${record.id}?i=0')"> today (0) </a>   <a name="bookmark${record.id}${entityCode}" + value="${record.endDate}" + style="" + title="Set the end date 1 day from now" + class="setDueDate1" + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/setEndDate/${entityCode}${record.id}?i=1')"> + 1 + </a> + <a name="bookmark${record.id}${entityCode}" + value="${record.endDate}" + style="" + title="Set the end date 2 days from now" + class="setDueDate2" + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/setEndDate/${entityCode}${record.id}?i=2')"> + 2 + </a> + <a name="bookmark${record.id}${entityCode}" + value="${record.endDate}" + style="" + class="setDueDate3" + title="Set the end date 3 days from now" + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/setEndDate/${entityCode}${record.id}?i=3')"> + 3 + </a> + <a name="bookmark${record.id}${entityCode}" + value="${record.endDate}" + style="" + class="setDueDate4" + title="Set the end date 4 days from now" + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/setEndDate/${entityCode}${record.id}?i=4')"> + 4 + </a> + <a name="bookmark${record.id}${entityCode}" + value="${record.endDate}" + style="" + class="setDueDate7" + title="Set the end date 3 days from now" + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/setEndDate/${entityCode}${record.id}?i=7')"> + 7 + </a> + <a name="bookmark${record.id}${entityCode}" + value="${record.endDate}" + style="" + class="setDueDate14" + title="Set the end date 14 days from now" + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/setEndDate/${entityCode}${record.id}?i=14')"> + 14 + </a> + <a name="bookmark${record.id}${entityCode}" value="${record.endDate}" style="" title="Decrease end date or set it to yesterday, if not set" @@ -1738,6 +1362,7 @@ Parent: </a> <a name="bookmark${record.id}${entityCode}" value="${record.endDate}" + class="clearEndDate" style="" title="Clear end date" onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/clearEndDate/${entityCode}${record.id}')"> @@ -1784,14 +1409,31 @@ Parent: title="Mark completed"> <b>done (D)</b> </g:remoteLink> - <g:remoteLink controller="generics" action="markDismissed" + <g:remoteLink controller="generics" action="markPublic" id="${record.id}" - class="dismissedButton" + class="publicButton" params="[entityCode: entityCode]" update="${entityCode}Record${record.id}" - title="Mark completed"> - <b>dismissed (ctrl+D)</b> + title="Mark as public"> + <b>public (P)</b> + </g:remoteLink> + + <g:remoteLink controller="generics" action="unmarkCompleted" + id="${record.id}" + class="undoneButton" + params="[entityCode: entityCode]" + update="${entityCode}Record${record.id}" + title="Mark uncompleted"> + <b>undone (U)</b> </g:remoteLink> + %{--<g:remoteLink controller="generics" action="markDismissed"--}% + %{--id="${record.id}"--}% + %{--class="dismissedButton"--}% + %{--params="[entityCode: entityCode]"--}% + %{--update="${entityCode}Record${record.id}"--}% + %{--title="Mark completed">--}% + %{--<b>dismissed (ctrl+D)</b>--}% + %{--</g:remoteLink>--}% </g:if> <g:if test="${'WNJPRE'.contains(entityCode)}"> @@ -1816,6 +1458,11 @@ Parent: </g:remoteLink> </g:if> </g:if> + + <% + // just a comment +%> + <g:if test="${'CTGNWR'.contains(entityCode)}"> <g:remoteLink controller="operation" action="dumpRecordForImport" id="${record.id}" @@ -1837,7 +1484,7 @@ Parent: update="${entityCode}CheckoutLog${record.id}" class="openFolderButton1" style="background: lightgreen;" - title="Open rps1 folder"> + title="Open rps1 folder (f 1)"> Open record's folder </g:remoteLink> <g:remoteLink controller="generics" action="openRpsFolder" @@ -1845,10 +1492,19 @@ Parent: update="${entityCode}CheckoutLog${record.id}" class="openFolderButton2" style="background: lightgreen;" - title="Open rps2 folder"> + title="Open rps2 folder (f 2)"> rps2 </g:remoteLink> + <g:remoteLink controller="generics" action="openRpsFolder" + params="${[id: record.id, entityCode: entityCode, repository: 3]}" + update="${entityCode}CheckoutLog${record.id}" + class="openFolderButton3" + style="background: lightgreen;" + title="Open rps3 folder (f 3)"> + rps3 + </g:remoteLink> + <g:if test="${'NO'.contains(entityCode) && ker.OperationController.getPath('convert-records.enabled')?.toLowerCase() == 'yes'}"> <br/> @@ -1872,29 +1528,27 @@ Parent: <g:remoteLink controller="generics" action="physicalDelete" params="${[id: record.id, entityCode: entityCode]}" update="${entityCode}Record${record.id}" before="if(!confirm('Are you sure you want to permanantly delete the record?')) return false" - class="fg-button ui-widget ui-state-default ui-corner-all physicalDelete" - title="Delete record permanantly"> - Delete (_) + class="uk-button physicalDelete" + title="Delete record permanantly (ctrl + -)"> + Delete </g:remoteLink> </g:if> -<g:remoteLink controller="generics" action="physicalDelete" - params="${[id: record.id, entityCode: entityCode]}" - update="${entityCode}Record${record.id}" - before="if(!confirm('Are you sure you want to permanantly physically delete the record?')) return false" - class="fg-button ui-widget ui-state-default ui-corner-all" - title="Delete record permanantly"> -  x  - </g:remoteLink> +%{--<g:remoteLink controller="generics" action="physicalDelete"--}% + %{--params="${[id: record.id, entityCode: entityCode]}"--}% + %{--update="${entityCode}Record${record.id}"--}% + %{--before="if(!confirm('Are you sure you want to permanantly physically delete the record?')) return false"--}% + %{--class="fg-button ui-widget ui-state-default ui-corner-all"--}% + %{--title="Delete record permanantly">--}% + %{-- x --}% + %{--</g:remoteLink>--}% - <a class="fg-button ui-widget ui-state-default ui-corner-all" title="Hide" - onclick="jQuery('#${entityCode}Record${record.id}').html('');" style="float: right; color: darkgray; margin-right: 4px;">Close</a> - <g:checkBox name="select-${record.id}-${entityCode}" - title="Select record" - value="${org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes().getSession()[entityCode + record.id] == 1}" - style="height: 14px !important; float: right;" - onclick="jQuery('#selectBasketRegion').load('${request.contextPath}/generics/select/${entityCode}${record.id}')" /> + <a class="fg-button ui-widget ui-state-default ui-corner-all" title="Hide actions" + onclick=" jQuery('#actionsButtons${entityCode}Record${record.id}').addClass('hiddenActions');" style="float: right; color: darkgray; margin-right: 4px;">Close</a> + <a class="fg-button ui-widget ui-state-default ui-corner-all" title="Hide all box" + onclick="jQuery('#${entityCode}Record${record.id}').addClass('hiddenActions');" style="float: right; color: darkgray; margin-right: 4px;">x</a> + </div> @@ -1920,49 +1574,44 @@ Parent: </tbody> </table> -</g:else> - %{--</div>--}% +%{--</div>--}% - %{--</div>--}% +%{--</div>--}% %{--</g:elseif>--}% %{--tabindex = "${tabIndex}" id ${record.id}--}% -<g:if test="${justUpdated || justSaved}"> -<script type="application/javascript"> - jQuery("#${entityCode}Record${record.id}").hide('fast'); - jQuery("#${entityCode}Record${record.id}").fadeIn('slow'); - %{--jQuery("#${entityCode}Record${record.id}").slideLeft('slow');--}% -</script> -</g:if> -<script type="application/javascript"> - if ('2340' == "${tabIndex}"){ + <script type="application/javascript"> + + if ('2340' == "${tabIndex}"){ // bindMyKeys(); - console.log('valid if ' + ${record.id}) - jQuery("#${entityCode}Record${record.id}").focus(); - %{--jQuery("#${entityCode}Record${record.id}").select();--}% - } + console.log('valid if ' + ${record.id}) + jQuery("#${entityCode}Record${record.id}").focus(); + %{--jQuery("#${entityCode}Record${record.id}").select();--}% + } - %{--function bindMyKeys${entityCode}${record.id} () {--}% + %{--function bindMyKeys${entityCode}${record.id} () {--}% - if (jQuery('.recordSelected').size() > 0) + // if (jQuery('.recordSelected').size() > 0) jQuery('.recordSelected').removeClass('recordSelected'); - jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); + jQuery('#${entityCode}Record${record.id}').addClass('recordSelected'); - // to test w033.22 - jQuery('.recordSelected')[0].scrollIntoView({block: "center", inline: "nearest", behavior: "smooth", }); + // to test w033.22 + jQuery('.recordSelected')[0].scrollIntoView({block: "center", inline: "nearest", behavior: "smooth", }); -</script> + </script> %{--todo--}% %{--<g:if test="${!noSelection}">--}% - %{--<script type="application/javascript">--}% - %{--jQuery('#${entityCode}Record${record.id}').addClass('recordSelected');--}% - %{--</script>--}% - %{--</g:if>--}% \ No newline at end of file +%{--<script type="application/javascript">--}% +%{--jQuery('#${entityCode}Record${record.id}').addClass('recordSelected');--}% +%{--</script>--}% +%{--</g:if>--}% + +</g:else> diff --git a/grails-app/views/gTemplates/_staticRecord.gsp b/grails-app/views/gTemplates/_staticRecord.gsp new file mode 100755 index 0000000..2788f99 --- /dev/null +++ b/grails-app/views/gTemplates/_staticRecord.gsp @@ -0,0 +1,213 @@ +%{--<div style="line-height: 25px; border-right: 2px solid darkgreen; padding: 7px; margin: 40px 40px;" class="text${record.class.declaredFields.name.contains('language') ? record.language : ''}">--}% + %{--[${entityCode}--}% + %{--${record.id}]--}% + + <article class="uk-article" style=" border: 1px solid darkgray; margin: 10px; padding; 7px; "> + + <div class="uk-article-title" style="background-color: #edf2eb; padding: 7px; font-size: 1.2em;"> + + + <a href="./posts/${record.id}.html" target="_blank" + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Go to page"> + + <g:if test="${record.class.declaredFields.name.contains('summary') && record.summary}"> + ${record.summary} + </g:if> + + <g:if test="${record.class.declaredFields.name.contains('title') && record.title}"> + ${record.title} + </g:if> + </a> + +<g:if test="${new Date() - record.dateCreated < 3}"> + <span class="uk-panel-bady uk-badge rtl" style="font-size: 1.2em;"> + جديد${record.dateCreated - new Date()} + </span> + </g:if> + + </div> + + <p class="uk-article-meta" style="color: black"> + + <g:if test="${record.class.declaredFields.name.contains('author') && record.author}"> + <br/><i>${record.author}</i> +   + </g:if> + + <g:if test="${record.publisher}"> + <b></b> ${record.publisher} +   + </g:if> + <g:if test="${record.journal}"> + <b></b>${record.journal} +   + </g:if> + <g:if test="${record.edition}"> + <b></b>${record.edition} +   + </g:if> + <g:if test="${record.book}"> + <b></b> ${record.book?.title} +   + </g:if> + <g:if test="${record.publicationDate}"> + <b></b>${record.publicationDate} +   + </g:if> + <g:if test="${record.year}"> + <b></b> ${record.year} +   + </g:if> + <g:if test="${record.month}"> + <b>شهر</b>: ${record.month} +   + </g:if> + <g:if test="${record.volume}"> + <b>مجلّد</b> ${record.volume} +   + </g:if> + <g:if test="${record.series}"> + <b>سلسلة</b> ${record.series} +   + </g:if> + <g:if test="${record.number}"> + <b>عدد</b>: ${record.number} +   + </g:if> + + + </p> + + <p class="uk-article-lead" style="background-color: #f8fdf6; padding: 7px"> +%{--g:link controller="page" action="staticPage" target="_blank" id="${record.id}"--}% +<a href="./posts/${record.id}.html" target="_blank" + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Go to page"> + + <img class="Photo" style="width: 120px; height: 160px; display:inline; text-align: right; margin: 7px;" + onerror="this.style.display='none'" + src="https://khuta.org/jabal-amel-4/covers/${record.id}.jpg"/> + + %{--src="${createLink(controller: 'generics', action: 'viewRecordImage', id: (record.id + '.jpg'))}"--}% + + <g:if test="${record.class.declaredFields.name.contains('description') && record.description}"> + ${raw(record.description?.replaceAll('\n', '<br/>'))} + </g:if> + <a> + </p> + + %{--<g:link controller="page" action="staticPage" target="_blank" id="${record.id}"--}% + + %{--class="fg-button ui-widget ui-state-default ui-corner-all"--}% + %{--title="Go to page">--}% + + %{--params: [entityCode: record.entityCode()]--}% + %{--, date: new Date()--}% + %{--</g:link>--}% +<div style="clear: both"></div> + %{--<hr class="uk-article-divider"/>--}% + + + +</article> +<g:if test="${1==2}"> + + <table dir="rtl" style="direction: rtl; background: #f4ffdf; padding: 9px; width: 95%;border: 1px solid lightgoldenrodyellow;"> + <tr> + <td style="width: 120px; vertical-align: top;"> + + %{--<img src="https://localhost:1441/files/R/${record?.type?.code}/${(record.id / 100).toInteger()}/${record.id}/cover.jpg" style="width: 15px;"--}% + %{--title=""/>--}% + %{--params="${[id: record.id, entityCode: record.entityCode()]}"--}% + <g:link controller="page" action="staticPage" target="_blank" id="${record.id}" + + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Go to page"> + + <img class="Photo" style="width: 120px; height: 160px; display:inline" onerror="this.style.display='none'" + src="${createLink(controller: 'generics', action: 'viewRecordImage', id: (record.id + '.jpg'))}"/> + %{--params: [entityCode: record.entityCode()]--}% + %{--, date: new Date()--}% + </g:link> + </td> + + <td style="vertical-align: top; padding-left: 15px;"> + + %{--params="${[id: record.id, entityCode: record.entityCode()]}"--}% + <g:link controller="page" action="staticPage" target="_blank" id="${record.id}" + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Go to page"> + + <g:if test="${record.class.declaredFields.name.contains('summary') && record.summary}"> + <b>${record.summary}</b> + <br/> + </g:if> + + + <g:if test="${record.class.declaredFields.name.contains('title') && record.title}"> + <b style="font-size: 1.3em">${record.title}</b> + </g:if> + + <g:if test="${record.class.declaredFields.name.contains('author') && record.author}"> + <br/><i>${record.author}</i> + <br/> + </g:if> + + <g:if test="${record.publisher}"> + <b></b> ${record.publisher} + <br/> + </g:if> + <g:if test="${record.journal}"> + <b></b>${record.journal} + <br/> + </g:if> + <g:if test="${record.edition}"> + <b></b>${record.edition} + <br/> + </g:if> + <g:if test="${record.book}"> + <b></b> ${record.book?.title} + <br/> + </g:if> + <g:if test="${record.publicationDate}"> + <b></b>${record.publicationDate} + <br/> + </g:if> + <g:if test="${record.year}"> + <b></b> ${record.year} + <br/> + </g:if> + <g:if test="${record.month}"> + <b>شهر</b>: ${record.month} + <br/> + </g:if> + <g:if test="${record.volume}"> + <b>مجلّد</b> ${record.volume} + <br/> + </g:if> + <g:if test="${record.series}"> + <b>سلسلة</b> ${record.series} + <br/> + </g:if> + <g:if test="${record.number}"> + <b>عدد</b>: ${record.number} + <br/> + </g:if> + + + + <g:if test="${record.class.declaredFields.name.contains('description') && record.description}"> + <br/> ${raw(record.description?.replaceAll('\n', '<br/>'))} + </g:if> + + </g:link> + + + + </td> + </tr> + </table> +</g:if> +%{--</div>--}% + diff --git a/grails-app/views/gTemplates/_statistics.gsp b/grails-app/views/gTemplates/_statistics.gsp new file mode 100644 index 0000000..71f3fcc --- /dev/null +++ b/grails-app/views/gTemplates/_statistics.gsp @@ -0,0 +1,152 @@ +<%@ page import="app.IndicatorData; mcs.*; app.IndexCard;" %> + + +<g:remoteLink controller="generics" action="showChildren" + tabindex="-1" + params="${[id: record.id, entityCode: entityCode]}" + update="below${entityCode}Record${record.id}" + title="Children"> + <g:if test="${entityCode == 'R'}"> + <g:if test="${mcs.Excerpt.countByBook(record)}"> + E <sup>${Excerpt.countByBook(mcs.Book.get(record.id))}</sup> + </g:if> + <g:if test="${mcs.Book.countByBook(record) > 0}"> + ${Book.countByBook(mcs.Book.get(record.id))} books + </g:if> + + <g:if test="${IndexCard.countByBook(record)}"> + ${app.IndexCard.countByBook(mcs.Book.get(record.id))} notes + </g:if> + <g:if test="${Planner.countByBook(record)}"> + ${Planner.countByBook(record)} plans + </g:if> + <g:if test="${Journal.countByBook(record)}"> + ${Journal.countByBook(record)} journal + </g:if> + + </g:if> + + <g:if test="${entityCode == 'D'}"> + + <g:if test="${Course.countByDepartment(record) > 0}"> + ${mcs.Course.countByDepartment(record)} courses + </g:if> + <g:if test="${Writing.countByDepartment(record) > 0}"> + ${Writing.countByDepartment(record)} writings + </g:if> + + <g:if test="${Task.countByDepartment(record) > 0}"> + ${Task.countByDepartment(record)} tasks + </g:if> + <g:if test="${Goal.countByDepartment(record) > 0}"> + ${Goal.countByDepartment(record)} goals + </g:if> + <g:if test="${Journal.countByDepartment(record) > 0}"> + ${Journal.countByDepartment(record)} journals + </g:if> + <g:if test="${Planner.countByDepartment(record) > 0}"> + ${Planner.countByDepartment(record)} planners + </g:if> + <g:if test="${Book.countByDepartment(record) > 0}"> + ${Book.countByDepartment(record)} resources + </g:if> + <g:if test="${IndexCard.countByDepartment(record) > 0}"> + ${IndexCard.countByDepartment(record)} notes + </g:if> + + + </g:if> + <g:if test="${entityCode == 'C'}"> + + <g:if test="${mcs.Planner.countByCourse(record) > 0}"> + ${Planner.countByCourse(record)} plans + </g:if> + <g:if test="${Journal.countByCourse(record) > 0}"> + J <sup>${Journal.countByCourse(record)}</sup> + </g:if> + <g:if test="${Writing.countByCourse(record) > 0}"> + W <sup>${Writing.countByCourse(record)}</sup> + </g:if> + <g:if test="${IndexCard.countByCourse(record) > 0}"> + N <sup>${IndexCard.countByCourse(record)}</sup> + </g:if> + <g:if test="${Book.countByCourse(record) > 0}"> + R <sup>${Book.countByCourse(record)}</sup> + </g:if> + <g:if test="${Goal.countByCourse(record) > 0}"> + G <sup>${mcs.Goal.countByCourse(record)}</sup> + </g:if> + <g:if test="${Task.countByCourse(record) > 0}"> + T <sup>${Task.countByCourse(record)}</sup> + </g:if> + </g:if> + + + <g:if test="${entityCode == 'T'}"> + + <g:if test="${Planner.countByTask(record) > 0}"> + ${Planner.countByTask(record)} plans + </g:if> + <g:if test="${Journal.countByTask(record) > 0}"> + ${Journal.countByTask(record)} journal + %{--todo--}% + </g:if> + %{-- <g:if test="${app.IndexCard.countByEntityCodeAndRecordId(record.entityCode(), record.id) > 0}">--}% + %{-- N <sup>${app.IndexCard.countByEntityCodeAndRecordId(record.entityCode(), record.id)}</sup>--}% + %{-- </g:if>--}% + + </g:if> + <g:if test="${entityCode == 'G'}"> + + <g:if test="${Task.countByGoal(record) > 0}"> + ${Task.countByGoal(record)} tasks + </g:if> + </g:if> + + <g:if test="${app.IndexCard.countByEntityCodeAndRecordId(record.entityCode(), record.id) > 0}"> + ${app.IndexCard.countByEntityCodeAndRecordId(record.entityCode(), record.id)} notes + </g:if> + + + + <g:if test="${entityCode == 'K'}"> + ${app.IndicatorData.countByIndicator(record)} instances + </g:if> + +%{--<g:if test="${entityCode == 'Q'}">--}% +%{--# <sup>${PaymentData.countByCategory(record)}</sup>--}% +%{--todo--}% +%{--</g:if>--}% +%{--</g:if>--}% +%{--</span>--}% +%{--</td>--}% + + +%{--<g:if test="${'CW'.contains(entityCode)}">--}% + +%{--<td class="actionTd">--}% + +%{--<g:link controller="page" action="publish" target="_blank"--}% +%{--params="${[id: record.id, entityCode: entityCode]}"--}% +%{--class=" fg-button fg-button-icon-solo ui-widget ui-state-default ui-corner-all"--}% +%{--title="Publish">--}% +%{--<span class="ui-icon ui-icon-script"></span>--}% +%{--</g:link>--}% + +%{--<g:link controller="page" action="presentation" target="_blank"--}% +%{--params="${[id: record.id, entityCode: entityCode]}"--}% +%{--class=" fg-button fg-button-icon-solo ui-widget ui-state-default ui-corner-all"--}% +%{--title="presentation">--}% +%{--<span class="ui-icon ui-icon-script"></span>--}% + +%{--</g:link>--}% + + +</g:remoteLink> + +<g:if test="${record.class.declaredFields.name.contains('nbFiles') && record.nbFiles}"> +%{--<g:if test="${record.nbFiles}">--}% + <span title="${record.filesList?.replace('"', '')}" style="display: inline-block; font-weight: bold; direction: ltr">${record.nbFiles ?: ''} files + </span> + +</g:if> diff --git a/grails-app/views/import/_importLocalFiles.gsp b/grails-app/views/import/_importLocalFiles.gsp old mode 100644 new mode 100755 index 90ece20..b1b69a5 --- a/grails-app/views/import/_importLocalFiles.gsp +++ b/grails-app/views/import/_importLocalFiles.gsp @@ -1,4 +1,4 @@ -<%@ page import="org.apache.commons.lang.StringUtils; ker.OperationController; app.parameters.ResourceType; cmn.Setting; mcs.parameters.PlannerType; mcs.parameters.JournalType; mcs.Planner; mcs.Journal; mcs.parameters.ResourceStatus; mcs.Book" %> +<%@ page import="java.nio.file.Paths; java.nio.file.Files; org.apache.commons.lang.StringUtils; ker.OperationController; app.parameters.ResourceType; cmn.Setting; mcs.parameters.PlannerType; mcs.parameters.JournalType; mcs.Planner; mcs.Journal; mcs.parameters.ResourceStatus; mcs.Book" %> <br/><br/> @@ -22,7 +22,7 @@ <h4>Folders and files in <b>${OperationController.getPath('root.rps' + r + '.path')}/new</b>:</h4> <g:each in="${new java.io.File(OperationController.getPath('root.rps' + r + '.path') + '/new').listFiles()}" var="i"> - <g:if test="${i.isFile() && i.name ==~ /(?i)[a-z] [\S\s ;-_]*\.[\S]*/ && i.name?.contains('--')}"> + <g:if test="${i.isFile() && !java.nio.file.Files.isSymbolicLink(java.nio.file.Paths.get(i.path)) && i.name ==~ /(?i)[a-z] [\S\s ;-_]*\.[\S]*/ && i.name?.contains('--')}"> <div style="display: inline; font-family: monospace;" id="file${i.name.encodeAsMD5()}"> <g:formRemote name="importIndividualFile" url="[controller: 'import', action: 'importIndividualFile']" @@ -37,7 +37,7 @@ <g:hiddenField name="smart" value="yes"></g:hiddenField> <g:hiddenField name="path" value="${i.path}"></g:hiddenField> <g:hiddenField name="rootPath" value="${OperationController.getPath('root.rps' + r + '.path')}"></g:hiddenField> - <g:actionSubmit value="import"/> + <g:actionSubmit value="import" class="uk-button-secondary"/> <script> jQuery("#notificationAreaHidden").load('${request.contextPath}/generics/verifySmartFileName', {'line': "${i.name}"}, function (response, status, xhr) { jQuery("#${i.name.encodeAsMD5()}").attr('class', response); @@ -55,7 +55,7 @@ </g:if> - <g:if test="${i.isFile() && !i.name?.contains('--') && !'desktop.ini,'.contains(i.name + ',')}"> + <g:if test="${i.isFile() && !java.nio.file.Files.isSymbolicLink(Paths.get(i.path)) && !i.name?.contains('--') && !'desktop.ini,'.contains(i.name + ',')}"> <div style="display: inline; font-family: monospace;" id="file${i.name.encodeAsMD5()}"> <g:formRemote name="importIndividualFile" url="[controller: 'import', action: 'importIndividualFile']" @@ -70,7 +70,8 @@ <g:hiddenField name="smart" value="yes"></g:hiddenField> <g:hiddenField name="path" value="${i.path}"></g:hiddenField> <g:hiddenField name="rootPath" value="${OperationController.getPath('root.rps' + r + '.path')}"></g:hiddenField> - <g:actionSubmit value="import"/> + <g:actionSubmit value="import" + class="uk-button-secondary"/> </g:formRemote> </div> <span style="display: inline; font-family: monospace;" @@ -82,7 +83,7 @@ </g:if> - <g:if test="${i.isDirectory() && i.name ==~ /(?i)[a-z] [\S\s ;-_]*/ && i.name?.contains('--') && i.name?.length() > 1 && !i.name?.startsWith('.') && !'scans,later,raw,site,dmp,sns,sch,mbl,'.contains(i.name + ',')}"> + <g:if test="${i.isDirectory() && !java.nio.file.Files.isSymbolicLink(Paths.get(i.path)) && i.name ==~ /(?i)[a-z] [\S\s ;-_]*/ && i.name?.contains('--') && i.name?.length() > 1 && !i.name?.startsWith('.') && !'scans,later,raw,site,dmp,sns,sch,mbl,'.contains(i.name + ',')}"> <div style="display: inline; font-family: monospace;" id="file${i.name.encodeAsMD5()}"> <g:formRemote name="importIndividualFolder" style="display: inline; " @@ -97,7 +98,7 @@ <g:hiddenField name="smart" value="yes"></g:hiddenField> <g:hiddenField name="path" value="${i.path}"></g:hiddenField> <g:hiddenField name="rootPath" value="${OperationController.getPath('root.rps' + r + '.path')}"></g:hiddenField> - <g:actionSubmit value="add"/> + <g:actionSubmit value="add" class="uk-button-secondary"/> <script> jQuery("#notificationAreaHidden").load('${request.contextPath}/generics/verifySmartFileName', {'line': "${i.name}"}, function (response, status, xhr) { jQuery("#${i.name.encodeAsMD5()}").attr('class', response); @@ -112,7 +113,7 @@ <br/> </g:if> - <g:if test="${i.isDirectory() && !i.name?.contains('--') && i.name?.length() > 1 && !i.name?.startsWith('.') && !i.name?.startsWith('.') && !'scans,later,raw,'.contains(i.name + ',')}"> + <g:if test="${i.isDirectory() && !java.nio.file.Files.isSymbolicLink(Paths.get(i.path)) && !i.name?.contains('--') && i.name?.length() > 1 && !i.name?.startsWith('.') && !i.name?.startsWith('.') && !'scans,later,raw,'.contains(i.name + ',')}"> <div style="display: inline; font-family: monospace;" id="file${i.name.encodeAsMD5()}"> <g:formRemote name="importIndividualFolder" style="display: inline; " @@ -127,7 +128,7 @@ <g:hiddenField name="smart" value="yes"></g:hiddenField> <g:hiddenField name="path" value="${i.path}"></g:hiddenField> <g:hiddenField name="rootPath" value="${OperationController.getPath('root.rps' + r + '.path')}"></g:hiddenField> - <g:actionSubmit value="add"/> + <g:actionSubmit value="add" class="uk-button-secondary"/> </g:formRemote> </div> <span style="display: inline; font-family: monospace;" @@ -160,7 +161,7 @@ <g:hiddenField name="smart" value="yes"></g:hiddenField> <g:hiddenField name="path" value="${i.path}"></g:hiddenField> <g:hiddenField name="rootPath" value="${OperationController.getPath('root.rps' + r + '.path')}"></g:hiddenField> - <g:actionSubmit value="import"/> + <g:actionSubmit value="import" class="uk-button-secondary"/> <script> jQuery("#notificationAreaHidden").load('${request.contextPath}/generics/verifySmartFileName', {'line': "${i.name}"}, function (response, status, xhr) { jQuery("#${i.name.encodeAsMD5()}").attr('class', response); diff --git a/grails-app/views/layouts/_commandbar.gsp b/grails-app/views/layouts/_commandbar.gsp old mode 100644 new mode 100755 index 58dd2aa..7bedac1 --- a/grails-app/views/layouts/_commandbar.gsp +++ b/grails-app/views/layouts/_commandbar.gsp @@ -2,11 +2,12 @@ %{--<a style="font-size: smaller; color: gray; margin-buttom: 5px; float: right;" onclick="jQuery('#commandBars').removeClass('navHidden')">+script  </a>--}% +%{--<h4>Batch data entry</h4>--}% <table border="0" style="border: 0"> <tr> - <td style="width: 60%; vertical-align: top;"> - <div id="commandBars" style=""> + <td style="width: 60% !important; vertical-align: top;"> + <div id="commandBars" style="width: 60% !important;"> %{--<a onclick="jQuery('#commandBars').addClass('navHidden')" style="font-size: smaller; color: gray; float: right;">Hide  </a>--}% <div id="top"></div> @@ -17,33 +18,55 @@ method="post"> %{--onComplete="var cdate = 'pkm-' + new Date().toISOString(); jQuery('#quickAddTextField').select();localStorage[cdate] = jQuery('#quickAddTextField').val(); document.getElementById('commandHistory').options.add(new Option(localStorage[cdate], cdate));"--}% <g:hiddenField name="sth2" value="${new java.util.Date()}"/> - <table style="width: 98%; padding: 0px; margin: 0px;"> - %{--</td>--}% - <tr> - <td style=" padding: 0px; margin: 0px; width: 99%; vertical-align: top;"> - <span> - Template: + + <div class="uk-grid uk-grid-small" uk-grid> +<div> + + <label class="uk-form-label"> + Template + </label> +<div class=uk-form-controls"> <g:select name="commandPrefix" + class="uk-select uk-width-auto" from="${CommandPrefix.list([sort: 'orderNumber'])}" optionKey="id" optionValue="summary" style="direction: ltr; text-align: left; display: inline; width: 220px; font-size: normal;" onchange="jQuery.getJSON('${request.contextPath}/generics/commandNotes?q=' + this.value, function(jsdata){jQuery('#quickAddTextField').html('' + jsdata.info);jQuery('#prefixField').val(jsdata.prefix); })" value=""/> - +</div> +</div> %{--if (jsdata.info == null || jsdata.info == 'null' || !jsdata.info) jQuery('#quickAddTextField').addClass('commandMode'); else jQuery('#quickAddTextField').removeClass('commandMode')--}% </span> - (prefix): <g:textField id="prefixField" name="prefix" class="ui-corner-all" cols="80" - style="display: inline; width: 180px; " value=""/> + <div class="uk-width-expand"> + + <label class="uk-form-label"> + Prefix + </label> + + <div class=uk-form-controls"> + <g:textField + class="uk-input uk-width-expand" + id="prefixField" name="prefix" cols="80" + style="" value=""/> + </div> + </div> %{--For each line?--}% %{--<input type="text" name="forEachLine" id="forEachLine"--}% %{--/>--}% - - - +<div class="uk-width-auto"> + <label class="uk-form-label"> + Verify + </label> + <div class=uk-form-controls"> + <g:checkBox name="verifyMode" + class="uk-checkbox uk-form-controls-text" + value="${true}"/> +</div> +</div> %{--History <select id="commandHistory" style="width: 50px;"--}% @@ -52,12 +75,7 @@ %{--</select>--}% - - </td> - </tr> - - <tr> - <td> +</div> %{--(Add, update, search, assign records...) Type ? for more info--}% %{--value="${OperationController.getPath('commandBar.initialText')?.replace('+', '\n')?.replaceAll(/\?date/, ker.OperationController.toWeekDate(new Date() -1))}"--}% %{--value="localStorage['myscratch']"--}% @@ -70,21 +88,23 @@ %{--onblur="jQuery('#hintAreaOneAtATime').html('')"--}% - + <div class="uk-grid uk-grid-small" uk-grid> %{-- onkeyup="verifyCommand()"--}% %{-- onfocus="jQuery('#hintAreaOneAtATime').load('${createLink(controller: 'generics', action: 'commandBarAutocompleteOneAtATime')}?hint=1&q=' + encodeURIComponent(jQuery('#quickAddTextField').val()))"--}% + <div class=uk-form-controls"> <g:textArea cols="120" rows="5" name="block" id="quickAddTextField" - autocomplete="off" + autocomplete="off" style="height: 200px;" onkeydown="localStorage['myscratch'] = jQuery('#quickAddTextField').val();" - class="commandBarTexField"/> + class="commandBarTexField uk-textarea uk-width-expand"/> +</div> + </div> - <g:checkBox name="verifyMode" value="${true}"/> Verify -  -  +   +   <g:submitButton name="batch" value="Execute" - style="margin: 0px; padding: 0 10px; width: 290px !important;" + style="height: 40px !important;" id="quickAddXcdSubmitExecute" - class="fg-button ui-widget ui-state-default"/> + class="uk-button-primary uk-width-expand"/> <div id="quickAddTextFieldInfoNotes" style="color: darkgreen; font-size: medium; font-style: italic; padding: 5px 5px; display: inline-block"></div> @@ -111,7 +131,7 @@ </div> </td> - <td style="width: 50%"> + <td style="width: 40%"> <div id="hintAreaOneAtATime" style="font-size: 12px; padding: 0px; margin: 0px; "></div> </td> </tr> diff --git a/grails-app/views/layouts/_hints.gsp b/grails-app/views/layouts/_hints.gsp index f0d5aee..38520d4 100755 --- a/grails-app/views/layouts/_hints.gsp +++ b/grails-app/views/layouts/_hints.gsp @@ -1,29 +1,33 @@ <style> .hintBox { - background: #FBFBFB; + background: #f5f5f5; position: absolute; - bottom: 50px; + opacity: 0.9 !important; box-shadow: 0 1px 3px 0px; line-height: 27px; border-radius: 2px; /*border: 1px darkgray solid;*/ - z-index: 100; + z-index: 1000000 !important; pointer-events: none; max-height: 350px; - min-height: 150px; - max-width: 900px; + /*min-height: 50px;*/ + max-width: 1000px; min-width: 300px; - left: 100px; + left: 30px; + top: 10px; padding: 7px; - overflow-y: visible; + /*overflow-y: visible;*/ + overflow: visible; /*font-size: small;*/ column-count: 4; + } .hideBox{ display: none; } </style> + <div class="${hints ? 'hintBox' : 'hideBox'}" style=""> %{--<i>Auto-complete suggestions</i>--}% %{--<br/>--}% diff --git a/grails-app/views/layouts/_manageParametersLink.gsp b/grails-app/views/layouts/_manageParametersLink.gsp old mode 100644 new mode 100755 index e10634c..4c517d6 --- a/grails-app/views/layouts/_manageParametersLink.gsp +++ b/grails-app/views/layouts/_manageParametersLink.gsp @@ -2,7 +2,7 @@ params="[entityController: controller, isParameter: true, updateRegion : 'centralArea']" update="centralArea"> - <span style="font-size: 12px;"> + <span style="font-size: 1em;"> ${name} (${grailsApplication.classLoader.loadClass(controller).count()}) </span> </br/> diff --git a/grails-app/views/layouts/_modulesAccordion.gsp b/grails-app/views/layouts/_modulesAccordion.gsp old mode 100644 new mode 100755 index acb60e8..01a3c39 --- a/grails-app/views/layouts/_modulesAccordion.gsp +++ b/grails-app/views/layouts/_modulesAccordion.gsp @@ -3,18 +3,23 @@ %{--<div id="accordionModules"--}% %{--style="width: 95%; padding-left: 4px;">--}% +<g:if test="${1 == 2}"> <div class="panelCard"> <h4> <span class="T-bkg" style="font-family: 'Lucida Console'; margin-right: 3px; padding-right: 2px; font-weight: bold; font-size: 12px;"></span> Main reports<span - class="moduleCount">${Task.count()}</span></h4> + class="moduleCount"> + %{--${Task.count()}--}% + </span></h4> <ul> <g:render template="/layouts/savedSearches" model="[entity: 'M']"/> </ul> </div> +</g:if> + <g:if test="${OperationController.getPath('tasks.enabled')?.toLowerCase() == 'yes' ? true : false}"> <div class="panelCard"> @@ -33,7 +38,15 @@ Main reports<span %{--<br/>--}% <ul> - <g:render template="/layouts/savedSearches" model="[entity: 'T']"/> + <li> + <a href="${createLink(controller: 'page', action: 'tasksTable', id: 0)}" + target="_blank"> + Active tasks table + </a> + + </li> + + <g:render template="/layouts/savedSearches" model="[entity: 'T']"/> </ul> </div> </div> @@ -53,6 +66,8 @@ Main reports<span <div> <ul> + + <g:render template="/layouts/savedSearches" model="[entity: 'G']"/> </ul> </div> @@ -373,7 +388,7 @@ Main reports<span style="font-family: 'Lucida Console'; margin-right: 3px; padding-right: 2px; font-weight: bold;">E</span> ${OperationController.getPath('excerpts.label') ?: 'Excerpts'} <span class="moduleCount">${mcs.Excerpt.countByDeletedOnIsNull()} </span> - </a> + %{--</a>--}% </h4> <div style="font-family: tahoma;"> diff --git a/grails-app/views/layouts/_panel.gsp b/grails-app/views/layouts/_panel.gsp index 26641fd..2543c7d 100755 --- a/grails-app/views/layouts/_panel.gsp +++ b/grails-app/views/layouts/_panel.gsp @@ -17,6 +17,14 @@ <%@ page import="java.time.format.DateTimeFormatter; mcs.Department; cmn.DataChangeAudit; ker.OperationController; app.Indicator; mcs.Goal; mcs.Task; mcs.Planner; mcs.Journal; mcs.Writing; app.IndexCard; mcs.Excerpt; mcs.Book; mcs.Course;" %> +<head> + + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <meta http-equiv="Access-Control-Allow-Origin" content="*"/> + <meta http-equiv="Access-Control-Allow-Methods" content="*"/> + <meta http-equiv="Access-Control-Allow-Headers" content="*"/> +</head> + <script type="text/javascript" src="${resource(dir: 'plugins/uploader', file: 'jquery.uploadr.js')}"></script> <link rel="stylesheet" href="${resource(dir: 'plugins/uploader', file: 'jquery.uploadr.css')}"/> @@ -85,10 +93,9 @@ # ${record.orderNumber} </g:if> <br/> -<div style="direction: rtl !important; text-align: right !important; line-height: 25px;"> +<div style="line-height: 25px; padding: 7px; font-weight: bold;" class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}"> <g:remoteLink controller="page" action="panel" params="${[id: record.id, entityCode: entityCode]}" - class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}" update="3rdPanel" title="Click to refresh"> @@ -98,7 +105,7 @@ <g:if test="${record.class.declaredFields.name.contains('title')}"> ${record.title} </g:if> - </span> + %{--</span>--}% </g:remoteLink> </div> @@ -109,7 +116,7 @@ %{--cal.setFirstDayOfWeek(java.util.Calendar.MONDAY)--}% %{--%>--}% %{--<b>أ${cal.get(Calendar.WEEK_OF_YEAR)}</b>--}% - <td> + %{--<td>--}% %{--<h4>Files</h4>--}% @@ -122,235 +129,163 @@ %{--</uploader:uploader>--}% %{--ToDo--}% - <g:if test="${record.entityCode().length() == 120 && mobileView != 'true'}"> - <div style="display: inline; text-align: right;"> - <table border=0 width="95%"> - <tr> - <td width="50%" style="vertical-align: top;"> - Upload cover - <uploader:uploader id="uploadCover${record.id}" - url="${[controller: 'import', action: 'uploadCover']}" - params="${[recordId: record.id, entityCode: record.entityCode()]}"> - <uploader:onComplete> - jQuery('#subUploadInPanel').load('${request.contextPath}/generics/showSummary/' + responseJSON.id + '?entityCode=' + responseJSON.entityCode) - </uploader:onComplete> - Upload... - </uploader:uploader> - </td> - <td> - Add to wrk folder ('${OperationController.getPath('root.rps1.path')}'): - <g:if test="${new File(OperationController.getPath('root.rps1.path')).exists()}"> - <uploader:uploader id="addToRecordFolder${record.id}" - url="${[controller: 'import', action: 'addToRecordFolder']}" - params="${[recordId: record.id, entityCode: record.entityCode()]}"> - Add to record folder - </uploader:uploader> - </g:if> - <g:else> - Folder 'root.rps1.path' does not exist. - Set: <g:render template="/forms/updateSetting" model="[settingValue: 'root.rps1.path']"/>. - </g:else> - - - <g:if test="${!new File(OperationController.getPath('tmp.path')).exists()}"> - <br/> - Folder 'tmp.path' not found. Set: - <g:render template="/forms/updateSetting" model="[settingValue: 'tmp.path']"/> - </g:if> - </td> - </tr> - </table> - </div> - <div id="subUploadInPanel"></div> - </g:if> +<ul id="accord2" uk-accordion="multiple: true; collapsible: true" class="uk-margin-small-left uk-margin-small-right"> + <li class="uk-open"> + <a class="uk-accordion-title" href="#"> - <g:if test="${entityCode == 'T' && record.recurringCron}"> + Info + </a> + <div class="uk-accordion-content"> - <g:set value="recurringInterval" var="field"></g:set> - <b>Recurrence:</b> - <br/> - <code>${record.recurringCron}</code> - <br/><br/> - <b>Planned duration: </b> - ${record.plannedDuration?.toInteger() ?: 'No set. Default is 30min.'} - <br/> - <br/> -  - <g:remoteLink controller="export" action="showNextRecurringDates" - params="${[id: record.id]}" - update="${entityCode}Record${record.id}NextDates" - style="border: 1px solid darkgray; padding: 1px;" - title=""> - Show upcoming occurrences... - </g:remoteLink>  - <g:remoteLink controller="export" action="generateNextRecurringPlans" - params="${[id: record.id]}" - update="${entityCode}Record${record.id}NextDates" - style="border: 1px solid darkgray ; padding: 1px;" - title=""> - Generate plan records... - </g:remoteLink> -<br/> - <div id="${entityCode}Record${record.id}NextDates"></div> -<br/> -Repeat - <a href="#" id="${field}${record.id}" class="${field}" - data-type="select" title="Recurring interval" - data-value="${record[field]}" - data-name="${field}-${record.entityCode()}" - data-source="${request.contextPath}/operation/getQuickEditValues?entity=${record.entityCode()}&field=${field}&date=${new Date().format('hhmmssDDMMyyyy')}" - data-pk="${record.id}" data-url="${request.contextPath}/operation/quickSave2" - data-title="Edit ${field}"> - ${record[field] ? '--' + record[field] + '--' : '----'} - </a> times. - <script> - jQuery("#${field}${record.id}").editable(); - </script> - - -   -   -</g:if> + <g:if test="${source}"> + <span style="color: green"> + Source: ${source} + </span> + </g:if> - <g:if test="${source}"> -<span style="color: green"> -Source: ${source} -</span> - </g:if> + <g:if test="${authors}"> + <br/> + <span style="color: green"> + Authors: ${authors} + </span> + </g:if> -<g:if test="${authors}"> -<br/> -<span style="color: green"> -Authors: ${authors} -</span> - </g:if> + <g:if test="${'R'.contains(entityCode)}"> + %{--<b>${record.title?.encodeAsHTML()?.replaceAll('\n', '<br/>')}</b>--}% + %{--<br/>--}% + <div style="padding: 2px; font-size: 12px; font-family: tahoma; margin: 2px; line-height: 20px;"> + <g:if test="${record.legacyTitle}"> + <span style="font-size: small"> + <br/> <b>Legacy title:</b> ${record.legacyTitle} + <br/> + </span> + </g:if> + <g:if test="${record.author}"> + <b>Author</b> : ${record.author} + <br/> + </g:if> + <g:if test="${record.isbn}"> + <b>ISBN</b> : ${record.isbn} + <br/> + </g:if> -<g:if test="${'R'.contains(entityCode)}"> -%{--<b>${record.title?.encodeAsHTML()?.replaceAll('\n', '<br/>')}</b>--}% -%{--<br/>--}% - <div style="padding: 2px; font-size: 12px; font-family: tahoma; margin: 2px; line-height: 20px;"> - <g:if test="${record.legacyTitle}"> - <span style="font-size: small"> - <br/> <b>Legacy title:</b> ${record.legacyTitle} - <br/> - </span> - </g:if> - <g:if test="${record.author}"> - <b>Author</b> : ${record.author} - <br/> - </g:if> - <g:if test="${record.isbn}"> - <b>ISBN</b> : ${record.isbn} - <br/> - </g:if> + %{--Extension: ${record.ext}--}% + %{--<br/>--}% + <g:if test="${record.publisher}"> + <b>Publisher</b>: ${record.publisher} + <br/> + </g:if> + <g:if test="${record.journal}"> + <b>Journal</b>: ${record.journal} + <br/> + </g:if> + <g:if test="${record.edition}"> + <b>Edition</b>: ${record.edition} + <br/> + </g:if> + <g:if test="${record.book}"> + <b>From</b>: ${record.book?.title} + <br/> + </g:if> + <g:if test="${record.publicationDate}"> + <b>Publication date</b>: ${record.publicationDate} + <br/> + </g:if> + <g:if test="${record.resourceYear}"> + <b>Year</b>: ${record.resourceYear} + <br/> + </g:if> + <g:if test="${record.month}"> + <b>Month</b>: ${record.month} + <br/> + </g:if> + <g:if test="${record.volume}"> + <b>Volume</b>: ${record.volume} + <br/> + </g:if> + <g:if test="${record.series}"> + <b>Series</b>: ${record.series} + <br/> + </g:if> + <g:if test="${record.number}"> + <b>Number</b>: ${record.number} + <br/> + </g:if> - %{--Extension: ${record.ext}--}% - %{--<br/>--}% - <g:if test="${record.publisher}"> - <b>Publisher</b>: ${record.publisher} - <br/> - </g:if> - <g:if test="${record.journal}"> - <b>Journal</b>: ${record.journal} - <br/> - </g:if> - <g:if test="${record.edition}"> - <b>Edition</b>: ${record.edition} - <br/> - </g:if> - <g:if test="${record.publicationDate}"> - <b>Publication date</b>: ${record.publicationDate} - <br/> - </g:if> - <g:if test="${record.year}"> - <b>Year</b>: ${record.year} - <br/> - </g:if> - <g:if test="${record.month}"> - <b>Month</b>: ${record.month} - <br/> - </g:if> - <g:if test="${record.volume}"> - <b>Volume</b>: ${record.volume} - <br/> - </g:if> - <g:if test="${record.series}"> - <b>Series</b>: ${record.series} - <br/> - </g:if> - <g:if test="${record.number}"> - <b>Number</b>: ${record.number} - <br/> - </g:if> + <g:if test="${record.publicationCity}"> + <b>City</b>: ${record.publicationCity} + <br/> + </g:if> + <g:if test="${record.sourceFree}"> + <b>Source</b>: ${record.sourceFree} + <br/> + </g:if> - <g:if test="${record.publicationCity}"> - <b>City</b>: ${record.publicationCity} - <br/> - </g:if> - <g:if test="${record.sourceFree}"> - <b>Source</b>: ${record.sourceFree} - <br/> - </g:if> + <g:if test="${record.pages}"> + <b>Pages</b>: ${record.pages} + <br/> + </g:if> + <g:if test="${record.nbPages}"> + <b>Nb. pages</b>: ${record.nbPages} + <br/> + </g:if> - <g:if test="${record.nbPages}"> - <b>Nb. pages</b>: ${record.nbPages} - <br/> - </g:if> - <g:if test="${record.pages}"> - <b>Pages</b>: ${record.pages} - <br/> - </g:if> + <g:if test="${record.url}"> + <span style=""> + <b>URL :</b> - <g:if test="${record.url}"> - <span style=""> - <b>URL :</b> - ${record.url} - <span id="linkBloc${record.id}"></span> + <a href="${record.url}" target="_blank"> + <pkm:summarize + text="${record?.url}" + length="60"/> + </a> - </span> - <br/> - %{--${record.author},${record.title ?: record.legacyTitle} ${record.edition} ed--}% - %{--(${record.publisher},--}% - %{--${record.publicationDate})--}% - </g:if> + <span id="linkBloc${record.id}"></span> - %{--<g:if test="${'R'.contains(entityCode)}">--}% - %{--<br/>--}% + </span> + <br/> + %{--${record.author},${record.title ?: record.legacyTitle} ${record.edition} ed--}% + %{--(${record.publisher},--}% + %{--${record.publicationDate})--}% + </g:if> + %{--<g:if test="${'R'.contains(entityCode)}">--}% + %{--<br/>--}% - <g:if test="${record?.url}"> - <br/> - <g:remoteLink controller="import" action="scrapHtmlPage" id="${record.id}" - update="RRecord${record.id}" - class="actionLink" - title="Scrap HTML"> - Scrape HTML page - </g:remoteLink> - <g:remoteLink controller="import" action="scrapHtmlAll" - update="RRecord${record.id}" - class="actionLink" - title="Scrap HTML"> - Scrape ALL pages - </g:remoteLink> - <br/> - <br/> - </g:if> + %{--<g:if test="${record?.url}">--}% + %{--<br/>--}% + %{--<g:remoteLink controller="import" action="scrapHtmlPage" id="${record.id}"--}% + %{--update="RRecord${record.id}"--}% + %{--class="actionLink"--}% + %{--title="Scrap HTML">--}% + %{--Scrape HTML page--}% + %{--</g:remoteLink>--}% + + %{--<g:remoteLink controller="import" action="scrapHtmlAll"--}% + %{--update="RRecord${record.id}"--}% + %{--class="actionLink"--}% + %{--title="Scrap HTML">--}% + %{--Scrape ALL pages--}% + %{--</g:remoteLink>--}% + %{--<br/>--}% + %{--<br/>--}% + %{--</g:if>--}% @@ -359,1168 +294,1271 @@ Authors: ${authors} - <g:if test="${1 == 2 && record.isbn}"> - <g:remoteLink controller="operation" action="addBibtex" id="${record.id}" - update="bibTexBloc${record.id}" - class="actionLink" - title="Update metadata"> - Fetch Bib entry - </g:remoteLink> - </g:if> - %{--Amazon tags: ${record.tags}--}% + <g:if test="${1 == 2 && record.isbn}"> + <g:remoteLink controller="operation" action="addBibtex" id="${record.id}" + update="bibTexBloc${record.id}" + class="actionLink" + title="Update metadata"> + Fetch Bib entry + </g:remoteLink> + </g:if> + %{--Amazon tags: ${record.tags}--}% - <g:if test="${record.withAudiobook}"> - <br/><i>With audiobook</i> - </g:if> - <g:if test="${record.isAudiobook}"> - <br/><i>Is audiobook</i> - </g:if> - <g:if test="${record.isPaperOnly}"> - <br/><i>Paper format only</i> - </g:if> + <g:if test="${record.withAudiobook}"> + <br/><i>With audiobook</i> + </g:if> + <g:if test="${record.isAudiobook}"> + <br/><i>Is audiobook</i> + </g:if> + <g:if test="${record.isPaperOnly}"> + <br/><i>Paper format only</i> + </g:if> - <g:if test="${record.isRead}"> - <br/><i>Has been read</i> - </g:if> + <g:if test="${record.isRead}"> + <br/><i>Has been read</i> + </g:if> - <g:if test="${record.isPublic}"> - <br/><i>To be shared</i> - </g:if> - </div> -</g:if> + </div> + </g:if> -%{--todo: new setting 30.07.2021 10:39 --}% - <g:if test="${'G'.contains(entityCode) && ker.OperationController.getPath('task-steps.enabled')?.toLowerCase() == 'yes'}"> - <g:if test="${record.percentCompleted}"> - <b>Percent completed</b>: ${record.percentCompleted} - <br/> - </g:if> - %{--<g:if test="${record.totalSteps}">--}% - %{--<b>Total steps</b>: ${record.totalSteps}--}% - %{--<br/>--}% - %{--</g:if>--}% - <g:if test="${record.class.declaredFields.name.contains('completedSteps')}"> - <g:formRemote name="saveCompletedSteps" url="[controller: 'operation', action: 'updateCompletedSteps', id: record.id]" - update="displayCompletedSteps" - style="display: inline;"> - %{--<g:hiddenField name="id" value="${record.id}"/>--}% - <g:hiddenField name="entityCode" value="${entityCode}"/> - %{--placeholder="ما اُنجز"--}% - <b>Completed steps</b>: <g:textField id="saveCompletedSteps${entityCode}${record.id}" name="text" class="ui-corner-all" cols="80" - rows="5" - style="width:20%; display: inline; " value="${record.completedSteps}"/> - <g:submitButton name="add" value="=" style="display:none;" - class="fg-button ui-widget ui-state-default ui-corner-all navHidden"/> - %{--<br/>--}% - </g:formRemote> -   <span id="displayCompletedSteps"></span> - <br/> + <g:if test="${record.class.declaredFields.name.contains('shortDescription')}"> + <div class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}" + style="background: #dce5e5; border: 1px solid darkgray; ${ker.OperationController.getPath('description.style')}; text-align: justify !important;"> + <span style=" ; font-style: normal; color: darkred"> + ${record?.shortDescription?.replaceAll('\n', '<br/>')} + </span> + + <g:if test="${record.entityCode() == 'N' && record.type?.code == 'aya'}"> + %{--def list = IndexCard.executeQuery('from IndexCard i where i.type.code = ? and i.orderNumber = ? order by i.orderInBook',['aya', params.id.toInteger()])--}% + (سورة ${mcs.Writing.get(record.recordId.toLong()).summary}, + ${record.orderInWriting}) + </g:if> + </div> </g:if> - <g:if test="${record.class.declaredFields.name.contains('totalSteps')}"> - <g:formRemote name="saveTotalSteps" url="[controller: 'operation', action: 'updateTotalSteps', id: record.id]" - update="displayTotalSteps" - style="display: inline;"> - %{--<g:hiddenField name="id" value="${record.id}"/>--}% - <g:hiddenField name="entityCode" value="${entityCode}"/> - <b>Total steps</b>: - %{--placeholder="عدد الخطوات"--}% - <g:textField id="saveTotalSteps${entityCode}${record.id}" name="text" class="ui-corner-all" cols="80" - rows="5" - style="width:20%; display: inline; " value="${record.totalSteps}"/> - <g:submitButton name="add" value="=" style="display:none;" - class="fg-button ui-widget ui-state-default ui-corner-all navHidden"/> - %{--<br/>--}% - </g:formRemote> -   <span id="displayTotalSteps"></span> - </g:if> - </g:if> + <g:if test="${record.class.declaredFields.name.contains('description')}"> + <h4>Description:</h4> + <div class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}" + style="background: rgba(238, 247, 229, 0.15); ${ker.OperationController.getPath('description.style')}; text-align: justify !important;"> + <g:if test="${record.class.declaredFields.name.contains('descriptionHTML') && record.descriptionHTML}"> + %{--&& record.withMarkdown--}% + <div style="padding: 3px 3px 3px 3px; margin: 3px 4px; border: 1px solid darkgray; "> + ${raw(record.descriptionHTML)} + </div> + </g:if> + <g:else> + %{--ToDo didn't work--}% - %{--<g:if test="${record.class.declaredFields.name.contains('percentCompleted')}">--}% - %{--<a name="bookmark${record.id}${entityCode}" title="percent++"--}% - %{--value="${record.percentCompleted}"--}% - %{--onclick="jQuery('#displayTotalSteps').load('${request.contextPath}/generics/increasePercentCompleted/${entityCode}${record.id}')">--}% - %{--Step++--}% - %{--</a>--}% - %{--<br/>--}% - %{--</g:if>--}% + <div id="descriptionBloc${record.id}" style="font-style: italic; margin: 3px 3px; padding: 5px 3px 7px 3px; border: 0px solid darkgray; "> + ${raw(record.description?.replaceAll('\n', '<br/>')?.replace('Product Description', ''))} + %{--${?.encodeAsHTML()?.replaceAll('\n', '<br/>')}--}% + </div> + </g:else> - <g:if test="${record.class.declaredFields.name.contains('reviewHistory') && record.reviewHistory}"> - <b>Review history:</b> ${record.reviewHistory} - <br/> - </g:if> - <g:if test="${record.class.declaredFields.name.contains('stepsHistory') && record.stepsHistory}"> - <b>Steps history:</b> - <br/>${record.stepsHistory?.replace('-', '<br/>')} - <br/> - </g:if> + %{--${WikiParser.renderXHTML(record.description)?.replaceAll('\n', '<br/>')?.decodeHTML()}--}% -<g:if test="${record.entityCode() == 'R'}"> + </div> - <g:if test="${(new File(OperationController.getPath('root.rps1.path') + '/cvr/' + - record?.type?.code + '/' + record.id + '.jpg')?.exists() || new File(OperationController.getPath('root.rps2.path') + '/cvr/' + record?.type?.code + '/' + record.id + '.jpg')?.exists())}"> - <a href="${createLink(controller: 'book', action: 'viewImage', id: record.id)}" - target="_blank"> - <img class="Photo" style="width: 80px; height:120px; display:inline" - src="${createLink(controller: 'book', action: 'viewImage', id: record.id, params: [date: new Date()])}"/> - </a> - </g:if> + <div id="${entityCode}Record${record.id}newText"></div> + %{--<g:render template="/gTemplates/recordAppend" model="[record: record]"/>--}% + </g:if> -</g:if> + %{--<table style="border: 0px solid; vertical-align: top; border-collapse: collapse; width: 99%" border="0">--}% + %{--<tr>--}% + %{--<td style="vertical-align: top; width: 99%">--}% -<g:if test="${record.class.declaredFields.name.contains('shortDescription')}"> - <div class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}" - style="background: #dce5e5; border: 1px solid darkgray; ${ker.OperationController.getPath('description.style')}; text-align: justify !important;"> -<span style=" ; font-style: normal; color: darkred"> - ${record?.shortDescription?.replaceAll('\n', '<br/>')} -</span> - </div> -</g:if> + %{--<g:if test="${'B'.contains(record.entityCode())}">--}% + %{--<b>Description</b>--}% + %{--<br/>--}% + %{----}% + <div style="padding: 5px 3px 3px 3px; font-size: 1.1em; text-align: justify !important; margin: 1px; line-height: 20px; ; white-space: wrap;"> + <g:if test="${record.class.declaredFields.name.contains('notes') && record.notes}"> + %{--<br/>--}% + <h4>Notes:</h4> + <div class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}" + style="${ker.OperationController.getPath('description.style')}; text-align: justify !important; line-height: 170%"> + <div style="color: #003366 !important">${raw(record.notes?.replace(' وَ ', ' وَ')?.replaceAll(/\nوَ /, ' وَ') + .replaceAll(/\nوَ /, ' وَ') + .replaceAll(/^و /, ' و').replaceAll(/\nو / , '\nو' ) + .replace(/^وَ /, '\n وَ').replace(' و ', ' و').replace('ی', 'ي').replace('ک', 'ك').replaceAll('\n', '<br/>'))}</div> + </div> + %{--<br/>--}% + <br/> + </g:if> + %{--</g:if>--}% + %{--<br/>--}% -%{--direction: ${record?.source?.language == 'ar' ? 'rtl' : 'ltr'}--}% -%{--todo--}% + <g:if test="${'R'.contains(record.entityCode())}"> + <div style="font-family: Lato; text-align: justify; line-height: 20px; font-size: 1.1em; margin: 2px;"> + <g:if test="${record.highlights}"> + <h4>Highlights:</h4> + <div class="text${record.class.declaredFields.name.contains('language') ? record.language : ''}"> + <i style="color: #48802C"> + ${record.highlights?.replaceAll('\n', '<br/>')} + </i> + <br/> + </div> + </g:if> + <g:if test="${record.comments}"> + <br/> + <h4>Comments:</h4> + <i style="color: #1d806f">${record.comments?.replaceAll('\n', '<br/>')}</i> + %{--<br/><hr/><br/>--}% + <br/><hr/><br/> + </g:if> + <g:if test="${record.fullText}"> + <h4>Full text:</h4> + <div class="${record.language == 'ar' ? 'arabicText' : ''}" + style="${ker.OperationController.getPath('description.style')}; text-align: justify !important; line-height: 170%"> + %{--<br/><hr/>--}% + %{-- <markdown:renderHtml>--}% + <g:if test="${record.withMarkdown}"> + ${raw(htmlFullText)} + %{-- </markdown:renderHtml>--}% + </g:if> + <g:else> + ${raw(record.fullText?.replaceAll('\n', '<br/>'))} + </g:else> + </div> + </g:if> + </div> + </g:if> + </div> + %{--</td>--}% + %{----}% + %{--</tr>--}% + %{--</table>--}% + %{----}% + %{----}% -%{--direction: ${record?.source?.language == 'ar' ? 'rtl' : 'ltr'}; text-align: ${record?.source?.language == 'ar' ? 'right' : 'left'}--}% -%{--todo--}% -%{--</div>--}% + </div> + </li> + <li class=""> + <a class="uk-accordion-title" href="#"> + Actions + </a> + <div class="uk-accordion-content"> + <div class="actionsButtons"> -%{--<g:each in="${app.IndexCard.findAllByEntityCodeAndRecordId(entityCode, record.id)}" var="c">--}% -%{--<g:render template="/gTemplates/box" model="[record: c]"/>--}% -%{--</g:each>--}% + <g:link controller="page" action="record" target="_blank" + params="${[id: record.id, entityCode: record.entityCode()]}" + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Go to page"> + Ext. -%{--<g:if test="${'R'.contains(record.entityCode())}">--}% -%{--<g:each in="${app.IndexCard.findAllByBook(record)}" var="c">--}% -%{--<g:render template="/gTemplates/box" model="[record: c]"/>--}% -%{--</g:each>--}% -%{--</g:if>--}% -%{--<g:if test="${'W'.contains(record.entityCode())}">--}% -%{--<g:each in="${app.IndexCard.findAllByWriting(record)}" var="c">--}% -%{--<g:render template="/gTemplates/box" model="[record: c]"/>--}% -%{--</g:each>--}% -%{--</g:if>--}% + </g:link> + <g:remoteLink controller="operation" action="makeSymbolicLink" id="${record.id}" + params="[entityCode: entityCode]" + update="linkLog${record.id}" + class="actionLink" + title=""> + Symbolic link + </g:remoteLink> + <span id="linkLog${record.id}"> + </span> -<g:if test="${record.entityCode() == 'todoR'}"> - <div id="type-4" style=""> + <g:if test="${'R'.contains(entityCode) && ker.OperationController.getPath('bibTex.enabled')?.toLowerCase() == 'yes'}"> - <g:if test="${'R'.contains(record.entityCode())}"> - %{--<h4>Notes</h4>--}% + <g:remoteLink controller="operation" action="generateBibEntry" id="${record.id}" + update="bibTexBloc${record.id}" + class="actionLink" + title="${record.bibEntry?.replace('"', '\'')}"> + Generate bib entry + </g:remoteLink> + </g:if> + <span id="bibTexBloc${record.id}"> + </span> - <h4>Excerpts</h4> - <g:each in="${Excerpt.findAllByBook(record)}" var="r"> - <g:render template="/gTemplates/recordSummary" model="[record: r, expandedView: false]"/> - </g:each> - %{--<g:each in="${Planner.findAllByBook(record)}" var="r">--}% - %{----}% - %{--<g:render template="/gTemplates/recordSummary" model="[record: r]"/>--}% - %{--</g:each>--}% + <g:if test="${'T'.contains(entityCode)}"> - </g:if> + <g:remoteLink controller="task" action="markRecurring" + id="${record.id}" + params="[entityCode: entityCode]" + update="${entityCode}Record${record.id}" + title="Mark recurring"> + <b>rcr.</b> + <g:if test="${record.isRecurring}"> + rci:${record.recurringInterval} + </g:if> + </g:remoteLink> + </g:if> - </div> -</g:if> + <g:if test="${OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> + <g:if test="${'RN'.contains(entityCode)}"> + <g:remoteLink controller="generics" action="fixedFarsiArabic" id="${record.id}" + params="[entityCode: entityCode]" + update="descriptionBloc${record?.id}" + title="descriptionBlocrecord" + style=""> + Fix text + </g:remoteLink> + </g:if> + </g:if> -<g:if test="${record.class.declaredFields.name.contains('description')}"> + <g:if test="${entityCode.size() == 1}"> + %{--|| (record.class.declaredFields.name.contains('deletedOn') && record.deletedOn != null)--}% + <g:remoteLink controller="generics" action="physicalDelete" + params="${[id: record.id, entityCode: entityCode]}" + update="${entityCode}Record${record.id}" + before="if(!confirm('Are you sure you want to permanantly physically delete the record?')) return false" + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Delete record permanantly"> + Delete + </g:remoteLink> + </g:if> - <div class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}" - style="background: #eef7e5; ${ker.OperationController.getPath('description.style')}; text-align: justify !important;" - <g:if test="${record.class.declaredFields.name.contains('descriptionHTML') && record.descriptionHTML && record.withMarkdown}"> + %{--<g:if test="${entityCode.size() > 1}">--}% + %{--<g:remoteLink controller="generics" action="physicalDelete"--}% + %{--params="${[id: record.id, entityCode: entityCode]}"--}% + %{--update="${entityCode}Record${record.id}"--}% + %{--title="Delete record permanantly">--}% + %{--Delete--}% + %{--</g:remoteLink>--}% + %{--</g:if>--}% + <g:if test="${entityCode == 'C'}"> - <div style="background: antiquewhite; border: 1px solid darkgray; "> - ${raw(record.descriptionHTML)} - </div> - </g:if> - <g:else> - %{--ToDo didn't work--}% + %{--<g:link url="[controller: 'export', action: 'generateCourseWritingsAsHtml', id: record.id]"--}% + %{--target="_blank"--}% + %{--title="Convert to HTML">--}% + %{--===--}% + %{--</g:link>--}% + %{--<br/>--}% + <g:remoteLink controller="export" action="combineCourseWritings" + id="${record.id}" + params="[entityCode: entityCode]" + update="${entityCode}CheckoutLog${record.id}" + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Compline course with its writings and their notes"> + md ↵ + </g:remoteLink> +    + <g:remoteLink controller="export" action="combineCourseWritingsAsTex" + id="${record.id}" + params="[entityCode: entityCode]" + update="${entityCode}CheckoutLog${record.id}" + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Comdine course with its writings and their notes"> + tex ↵ + </g:remoteLink> + + + %{----}% + %{--<br/>--}% + %{--<br/>--}% + %{--<g:link url="[controller: 'export', action: 'generateCoursePresentation', id: record.id]"--}% + %{--class="actionLink"--}% + %{--target="_blank"--}% + %{--title="Convert to HTML">--}% + %{--Generate presentation (new tab)--}% + %{--</g:link>--}% - <div id="descriptionBloc${record.id}"> - ${raw(record.description?.replaceAll('\n', '<br/>')?.replace('Product Description', ''))} - %{--${?.encodeAsHTML()?.replaceAll('\n', '<br/>')}--}% - </div> + </g:if> - </g:else> - %{--${WikiParser.renderXHTML(record.description)?.replaceAll('\n', '<br/>')?.decodeHTML()}--}% - </div> - <div id="${entityCode}Record${record.id}newText"></div> - <g:render template="/gTemplates/recordAppend" model="[record: record]"/> + <g:if test="${OperationController.getPath('1=2pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> + <g:if test="${record.class.declaredFields.name.contains('keepSecret')}"> + <br/> + <br/> + <a name="bookmark${record.id}${entityCode}" title="Toggle privacy" + value="${record.keepSecret}" + onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/togglePrivacy/${entityCode}-${record.id}')"> + Make private   + </a> + </g:if> + </g:if> -</g:if> + %{--<g:if test="${'RWNTGJPCD'.contains(entityCode)}">--}% + %{-- <g:if test="${record.class.declaredFields.name.contains('language')}">--}% + %{-- <br/>--}% + %{-- <br/>--}% + %{-- Language:--}% + %{-- <g:select name="language" from="${OperationController.getPath('repository.languages').split(',')}"--}% + %{-- value="${record.language}"--}% + %{-- onchange="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/setLanguage/' + '${record.id}-${entityCode}-' + this.value)"--}% + %{-- style="overflow: visible; z-index: 200; background: lightgrey" noSelection="${['': '']}"/>--}% -%{--<table style="border: 0px solid; vertical-align: top; border-collapse: collapse; width: 99%" border="0">--}% - %{--<tr>--}% - %{--<td style="vertical-align: top; width: 99%">--}% - %{--<g:if test="${'B'.contains(record.entityCode())}">--}% - %{--<b>Description</b>--}% - %{--<br/>--}% - %{----}% - <div style="padding: 1px; font-size: 1.1em; text-align: justify !important; margin: 1px; line-height: 20px; ; white-space: wrap;"> - <g:if test="${record.class.declaredFields.name.contains('notes') && record.notes}"> - %{--<br/>--}% - %{--Notes:--}% - <div class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}" - style="${ker.OperationController.getPath('description.style')}; text-align: justify !important; line-height: 170%"> - <div style="color: #003366 !important">${raw(record.notes?.replace(' وَ ', ' وَ')?.replaceAll(/\nوَ /, ' وَ') - .replaceAll(/\nوَ /, ' وَ') - .replaceAll(/^و /, ' و').replaceAll(/\nو / , '\nو' ) - .replace(/^وَ /, '\n وَ').replace(' و ', ' و').replace('ی', 'ي').replace('ک', 'ك').replaceAll('\n', '<br/>'))}</div> - </div> - %{--<br/>--}% - <br/> - </g:if> + %{--<g:remoteLink controller="generics" action="setArabic"--}% + %{--id="${record.id}"--}% + %{--params="[entityCode: entityCode]"--}% + %{--update="${entityCode}Record${record.id}"--}% + %{--style="background: lightgrey"--}% + %{--title="Mark arabic">--}% + %{--Ar--}% + %{--</g:remoteLink>--}% + %{--<g:if test="${OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}">--}% + %{--<g:remoteLink controller="generics" action="setPersian"--}% + %{--id="${record.id}"--}% + %{--params="[entityCode: entityCode]"--}% + %{--update="${entityCode}Record${record.id}"--}% + %{--title="Mark as Farsi">--}% + %{--Fa--}% + %{--</g:remoteLink>--}% %{--</g:if>--}% - %{--<br/>--}% - <g:if test="${'R'.contains(record.entityCode())}"> - <div style="font-family: Lato; text-align: justify; line-height: 20px; font-size: 1.1em; margin: 4px;"> - <g:if test="${record.highlights}"> - <div class="text${record.class.declaredFields.name.contains('language') ? record.language : ''}"> + %{--<g:remoteLink controller="generics" action="setFrench"--}% + %{--id="${record.id}"--}% + %{--params="[entityCode: entityCode]"--}% + %{--update="${entityCode}Record${record.id}"--}% + %{--title="Mark as French">--}% + %{--Fr--}% + %{--</g:remoteLink>--}% + %{--<g:remoteLink controller="generics" action="setEnglish"--}% + %{--id="${record.id}"--}% + %{--params="[entityCode: entityCode]"--}% + %{--update="${entityCode}Record${record.id}"--}% + %{--title="Mark as English">--}% + %{--En--}% + %{--</g:remoteLink>--}% + %{-- </g:if>--}% + %{----}% + %{-- <br/>--}% + <br/> - <i style="color: #48802C"> - ${record.highlights?.replaceAll('\n', '<br/>')} - </i> - <br/> - </div> - </g:if> - <g:if test="${record.comments}"> - <br/> - <i style="color: #1d806f">${record.comments?.replaceAll('\n', '<br/>')}</i> - %{--<br/><hr/><br/>--}% - <br/><hr/><br/> - </g:if> - <g:if test="${record.fullText}"> - <div class="${record.language == 'ar' ? 'arabicText' : ''}" - style="${ker.OperationController.getPath('description.style')}; text-align: justify !important; line-height: 170%"> - <br/><hr/> -%{-- <markdown:renderHtml>--}% - <g:if test="${record.withMarkdown}"> + %{--todo; case of x ,y--}% - ${raw(htmlFullText)} -%{-- </markdown:renderHtml>--}% - </g:if> - <g:else> - ${raw(record.fullText?.replaceAll('\n', '<br/>'))} - </g:else> - - </div> - </g:if> + <g:if test="${'R'.contains(entityCode) && ker.OperationController.getPath('excerpts.enabled')?.toLowerCase() == 'yes'}"> + <div dir="ltr"> + <br/> + Add excerpt: + <g:formRemote name="appendText" url="[controller: 'book', action: 'addExcerpt']" + update="${entityCode}Record${record.id}" + style="display: inline;"> + <g:hiddenField name="id" value="${record.id}"/> + <g:hiddenField name="entityCode" value="${entityCode}"/> + <g:textField id="appendTextFor${entityCode}${record.id}" name="text" class="ui-corner-all" cols="80" + placeholder="title" + rows="5" + style="width:60%; display: inline; " value=""/> + <g:submitButton name="add" value="+=" style="display:none;" + class="fg-button ui-widget ui-state-default ui-corner-all navHidden"/> + <br/> + </g:formRemote> </div> </g:if> - </div> - %{--</td>--}% -%{----}% - %{--</tr>--}% -%{--</table>--}% -%{----}% -%{----}% -<div id="type-7" style=""> -</div> + <g:if test="${'NO'.contains(entityCode) && ker.OperationController.getPath('convert-records.enabled')?.toLowerCase() == 'yes'}"> + <br/> + <br/> +    <b>Convert to:</b> + <g:each in="${['J', 'P', 'T', 'G', 'R', 'W']}" var="t"> + + <g:remoteLink controller="generics" action="convertNoteToRecord" + params="${[id: record.id, entityCode: entityCode, type: t]}" + update="${entityCode}Record${record.id}" + class="fg-button ui-widget ui-state-default ui-corner-all convertButton${t}" + title="Convert note to ${t}"> +  ${t}   + </g:remoteLink> + </g:each> + </g:if> + <g:if test="${cmn.Setting.findByName('aws.secret.key') && entityCode == 'R' && record.isbn}"> + <g:remoteLink controller="book" action="updateBookInfo" id="${record.id}" + update="RRecord${record.id}" + class="actionLink fg-button ui-widget ui-state-default ui-corner-all" + title="Update metadata from Amazon"> + Update metadata + </g:remoteLink> + <br/> + <br/> + </g:if> + <g:if test="${OperationController.getPath('blog.enabled')?.toLowerCase() == 'yes' ? true : false}"> + <g:if test="${record.class.declaredFields.name.contains('blog')}"> + <br/> + <br/> +   + + <g:set value="blog" var="field"></g:set> + Blog: + <a href="#" id="${field}${record.id}" class="${field}" + data-type="select" + data-value="${record[field]?.id}" + data-name="${field}-${entityCode}" + style=" border-radius: 3px; font-size: 0.9em; font-style: italic; padding-left: 1px; padding-right: 1px;" + data-source="${request.contextPath}/operation/getQuickEditValues?entity=${entityCode}&field=${field}&date=${new Date().format('hhmmssDDMMyyyy')}" + data-pk="${record.id}" data-url="${request.contextPath}/operation/quickSave2" + data-title="Edit ${field}"> + ${record[field] ? (record[field]?.code ? 'blog-' + record[field]?.code : 'blog' + record.blog) : 'blog-'} + </a> + <script type="text/javascript"> + jQuery("#${field}${record.id}").editable(); + </script> + <br/> + <br/> + + %{--<g:if test="${record?.blog?.code && record.descriptionHTML}">--}% + + <g:remoteLink controller="generics" action="publish" id="${record.id}" + params="[entityCode: entityCode]" + update="postResult${record?.id}" + before="jQuery('#postResult${record?.id}').html()" + title="Publish record" + class="fg-button ui-widget ui-state-default ui-corner-all"> + Publish + %{--<b>${record?.blog?.code}</b>--}% + </g:remoteLink> + %{--</g:if>--}% + + + <div id="postResult${record.id}" style="display: inline"> + </div> + <g:if test="${record.publishedNodeId}"> + Published with ID: (${record.publishedNodeId}) + </g:if> + </g:if> -<br/> + <span id="${entityCode}CheckoutLog${record.id}"></span> -<g:if test="${record.entityCode() == 'D'}"> - <div id="OrderTheFields" style="-moz-columns-count:1"> - <h4>Order the courses</h4> - <table id="table1"> - %{--<ul id="item_list" >--}% - <g:each in="${mcs.Course.findAllByDepartment(mcs.Department.get(record.id), [sort: 'orderNumber', order: 'asc'])}" - var="c"> - <tr id="${c.id}"> - <td> - #${c.orderNumber} C-${c.id} - ${c.summary} - </td></tr> - </g:each> - </table> - <a style="font-size: 10px; text-align: right;" href="#" - onclick='jQuery("#OrderTheFields").load("${request.contextPath}/operation/orderRecords?type=D&child=C&tableId=1", jQuery("#table1").tableDnDSerialize())'> - Sort</a> - <hr/> - </div> - <script type="text/javascript"> - jQuery("#table1").tableDnD(); - </script> -</g:if> + <g:if test="${(entityCode == 'W') || entityCode == 'N'}"> -<g:if test="${record.entityCode() == 'C'}"> -<ol style="dir: rtl; text-align: right;"> - <g:each in="${mcs.Writing.findAllByCourseAndPriorityGreaterThan(record, 2, [sort: 'orderNumber', order: 'asc'])}" - var="c"> - <li style="font-weight: normal;"> + %{--|| entityCode == 'N'--}% + %{--<g:remoteLink--}% + %{--url="[controller: 'generics', action: 'convertMarkupToHtml', id: record.id, params: [entityCode: entityCode]]"--}% + %{--update="3rdPanel"--}% + %{--before="jQuery('#accordionEast').accordion({ active: 0});"--}% + %{--class="actionLink"--}% + %{--title="Convert to HTML">--}% + %{--==--}% + %{--</g:remoteLink>--}% - W-${c.id} - <b>${c.summary} - %{--r${c.reviewCount}--}% - </li> -<ol style="dir: rtl; text-align: right;"> - <g:each in="${app.IndexCard.executeQuery('from IndexCard i where i.recordId = ? and i.entityCode = ? and i.priority >= 2 order by i.orderNumber asc', - [c.id.toString(), 'W'])}" - var="n"> - <li style="font-weight: normal;"> - N-${n.id} - ${n.summary} - %{--<pkm:summarize text="${c.description}" length="80"/>--}% - </li> - </g:each> + <g:remoteLink controller="generics" action="notes2Operations" + id="${record.id}" + params="[entityCode: entityCode]" + update="${entityCode}CheckoutLog${record.id}" + title="Checkout record"> + to operations ↵ + </g:remoteLink> + <g:remoteLink controller="generics" action="checkoutRecordText" + id="${record.id}" + params="[entityCode: entityCode]" + update="${entityCode}CheckoutLog${record.id}" + title="Checkout record"> + out ↵ + </g:remoteLink> - </ol> + </g:if> + <g:if test="${entityCode == 'W'}"> + <g:remoteLink controller="export" action="combineWritingNotes" + id="${record.id}" + params="[entityCode: entityCode]" + update="${entityCode}CheckoutLog${record.id}" + title="Compile writing with its notes"> + cmp ↵ + </g:remoteLink> - </g:each> + </g:if> +   + %{-- <g:remoteLink controller="operation" action="pandoc" id="${record.id}"--}% + %{-- params="[entityCode: entityCode]"--}% + %{-- update="postResult${record?.id}"--}% + %{-- title="Publish record"--}% + %{-- class="fg-button ui-widget ui-state-default ui-corner-all">--}% + %{-- pandoc--}% + %{-- </g:remoteLink>--}% + %{--  --}% - <g:each in="${app.IndexCard.executeQuery('from IndexCard i where i.recordId = ? and i.course = ? and i.priority > ? order by orderNumber asc' ,[null, record, 2])}" - var="n"> - <li> - N-${n.id} - ${n.summary} - %{--r${n.reviewCount}--}% - %{--<pkm:summarize text="${c.description}" length="80"/>--}% - </li> - </g:each> - - - - </ol> - - - - - - <div id="OrderTheFields" style="-moz-columns-count:1"> - <h4>Order the goals</h4> - <table id="table1"> - %{--<ul id="item_list" >--}% - <g:each in="${mcs.Goal.findAllByCourse(Course.get(record.id), [sort: 'orderNumber', order: 'asc'])}" - var="c"> - <tr id="${c.id}"> - <td> - #${c.orderNumber} G-${c.id} - ${c.summary} <pkm:summarize text="${c.description}" - length="80"/> - </td></tr> - </g:each> - </table> - <br/> - <a style="font-size: 10px; text-align: right;" href="#" - onclick='jQuery("#OrderTheFields").load("${request.contextPath}/operation/orderRecords?type=C&child=G&tableId=1", jQuery("#table1").tableDnDSerialize())'> - Sort</a> - - <hr/> - - <table id="table2"> - %{--<ul id="item_list" >--}% - <h4>Order the writings</h4> - <g:each in="${mcs.Writing.findAllByCourseAndPriorityGreaterThan(Course.get(record.id), 2, [sort: 'orderNumber', order: 'asc'])}" - var="c"> - <tr id="${c.id}"> - <td> - #${c.orderNumber} W-${c.id} - <b>${c.summary}</b> - - %{--<pkm:summarize--}% - %{--text="${c.description}"--}% - %{--length="80"/>--}% - </td> - </tr> - </g:each> - </table> - <br/> - <a style="font-size: 10px; text-align: right;" href="#" - onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=C&child=W&tableId=2", jQuery("#table2").tableDnDSerialize())'> - Sort</a> - - <hr/> - - <table id="table3"> - <h4>Order the resources</h4> - <g:each in="${mcs.Book.findAllByCourse(Course.get(record.id), [sort: 'orderNumber', order: 'asc'])}" - var="c"> - <tr id="${c.id}"> - <td> - #${c.orderInCourse} B-${c.id} - ${c.title} ${c.legacyTitle}<pkm:summarize - text="${c.description}" length="80"/> - </td></tr> - </g:each> - </table> - <br/> - <a style="font-size: 10px; text-align: right;" href="#" - onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=C&child=R&tableId=3", jQuery("#table3").tableDnDSerialize())'> - Sort</a> - - - - <table id="table4"> - %{--<ul id="item_list" >--}% - <h4>Order the excerpts</h4> - <g:each in="${mcs.Excerpt.executeQuery('from Excerpt r where r.book.course = ? order by orderNumber asc', [Course.get(record.id)])}" - var="c"> - <tr id="${c.id}"> - <td> - #${c.orderNumber} R-${c.id} - <b>${c.book?.title} ${c.book?.legacyTitle}</b>:${c.chapters} ${c.summary} - </td></tr> - </g:each> - </table> - <br/> - <a style="font-size: 10px; text-align: right;" href="#" - onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=C&child=E&tableId=4", jQuery("#table4").tableDnDSerialize())'> - Sort</a> - - <table id="table5"> - %{--<ul id="item_list" >--}% - <h4>Order the tasks</h4> - <g:each in="${mcs.Excerpt.executeQuery('from Task r where r.course = ? and r.bookmarked = ? order by orderNumber asc', [Course.get(record.id), true])}" - var="c"> - <tr id="${c.id}"> - <td> - #${c.orderNumber} T-${c.id} - <b>${c?.summary} - </td></tr> - </g:each> - </table> - <input type="button" id="sortButton5" value="Save sort" - onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=C&child=T&tableId=5", jQuery("#table5").tableDnDSerialize())'/> + %{--<g:if test="${entityCode == 'W' && !record.code}">--}% + %{--<b style="color: red">No code</b>--}% + %{--</g:if>--}% + </g:if> + <br/> + </div> + <br/> + <br/> + <g:if test="${OperationController.getPath('markdown.enabled')?.toLowerCase() == 'yes' ? true : false}"> + <g:if test="${'RN'.contains(entityCode)}"> + <g:if test="${!record.withMarkdown}"> + <br/> + <br/> + <g:remoteLink controller="generics" action="markAsMarkdowned" style="padding: 5px; margin: 5px;" + params="${[id: record.id, entityCode: entityCode]}" + update="notificationLog" + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Mark that the content is markdown"> + Mark contents as markdown + </g:remoteLink> + <br/> + <br/> + <br/> - <script type="text/javascript"> - jQuery("#table1").tableDnD(); - jQuery("#table2").tableDnD(); - jQuery("#table3").tableDnD(); - jQuery("#table4").tableDnD(); - jQuery("#table5").tableDnD(); - </script> - </div> -</g:if> + </g:if> + <g:else> -<g:if test="${record.entityCode() == 'W'}"> - <h4>Order the notes</h4> + <br/> + <br/> - <div id="OrderTheFields" style="direction: rtl; text-align: right !important;"> - <table id="table1"> - %{--<ul id="item_list" >--}% - %{--<g:each in="${app.IndexCard.findAllByWriting(Writing.get(record.id), [sort: 'orderNumber', order: 'asc'])}"--}% - %{--var="c">--}% - %{--<tr id="${c.id}">--}% - %{--<td>--}% - %{--#${c.orderNumber} C-${c.id} - ${c.summary} <pkm:summarize text="${c.description}"--}% - %{--length="80"/>--}% - %{--</td></tr>--}% - %{--</g:each>--}% - <g:each in="${app.IndexCard.executeQuery('from IndexCard i where i.recordId = ? and i.entityCode = ? and i.priority >= 2 order by i.orderNumber asc', - [record.id.toString(), 'W'])}" - var="c"> - <tr id="${c.id}"> - <td style="direction: rtl; text-align: right !important; margin: 5px;"> - #${c.orderNumber} p${c.priority} W-${c.id} - ${c.summary} - %{--<pkm:summarize text="${c.description}" length="80"/>--}% - </td> - </tr> - </g:each> - </table> - <br/> - <a style="font-size: 10px; text-align: right;" href="#" - onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=W&child=N&tableId=1", jQuery("#table1").tableDnDSerialize())'> - Sort</a> + Description in markdown - <script type="text/javascript"> - jQuery("#table1").tableDnD(); - </script> - </div> + <g:remoteLink controller="generics" action="unmarkAsMarkdowned" + params="${[id: record.id, entityCode: entityCode]}" + update="notificationLog" + class="fg-button ui-widget ui-state-default ui-corner-all" + title="Unmark that the content as markdown"> + unset + </g:remoteLink> -</g:if> + <br/> + <br/> + </g:else> + </g:if> + </g:if> + <g:if test="${'R'.contains(entityCode)}"> + <br/> + <div class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}" style="font-size: 11px; background: lightgrey; padding: 3px;"> + <g:set value="${record.language == 'en' ? ',' : '،'}" var="comma"></g:set> + <g:if test="${record.type?.code == 'ebk'}"> + ${record.author}${comma} + ${record.title}${record.translator ? ' - ' + record.translator : ''}${record.editor ? ' - ' + record.editor: ''}${record.edition ? comma + ' ' + record.edition + ' ': ''} + (${record.publicationCity ? record.publicationCity + ': ' : '' }${record.publisher}${comma}${record.resourceYear ?: record.publicationDate}). + </g:if> + <g:if test="${record.type?.code == 'art'}"> + ${record.author}${comma} + "${record.title}" ${record.translator ? ' - ' + record.translator : ''}${record.editor ? ' - ' + record.editor: ''} ${record.journal}. ${record.volume} ${record.number} ${record.pages} + (${record.publicationCity ? record.publicationCity + ': ' : '' }${record.publisher}${comma}${record.resourceYear ?: record.publicationDate}). + ${record.url}${record.sourceFree} + </g:if> + </div> + <br/> + %{--<br/>--}% + </g:if> -  -<br/> -<br/> + <g:if test="${entityCode == 'T' && record.recurringCron}"> + <g:set value="recurringInterval" var="field"></g:set> + <b>Recurrence:</b> + <br/> + <code>${record.recurringCron}</code> + <br/><br/> + <b>Planned duration: </b> + ${record.plannedDuration?.toInteger() ?: 'No set. Default is 30min.'} + <br/> + <br/> + <g:remoteLink controller="export" action="showNextRecurringDates" + params="${[id: record.id]}" + update="${entityCode}Record${record.id}NextDates" + style="border: 1px solid darkgray; padding: 1px;" + title=""> + Show upcoming occurrences... + </g:remoteLink>  + <br/> + <br/> + <div id="${entityCode}Record${record.id}NextDates"></div> + <br/> + <g:remoteLink controller="export" action="generateNextRecurringPlans" + params="${[id: record.id]}" + update="${entityCode}Record${record.id}NextDates" + style="border: 1px solid darkgray ; padding: 1px;" + title=""> + Generate plan records... + </g:remoteLink> -<div class="heading"> - %{--<h2>Create new record...</h2>--}% - <h4 style="user-focus-pointer: hand; cursor: hand;">Actions...</h4> - <br/> -</div> -<div class="content"> + <br/> <br/> + + Repeat + <a href="#" id="${field}${record.id}" class="${field}" + data-type="select" title="Recurring interval" + data-value="${record[field]}" + data-name="${field}-${record.entityCode()}" + data-source="${request.contextPath}/operation/getQuickEditValues?entity=${record.entityCode()}&field=${field}&date=${new Date().format('hhmmssDDMMyyyy')}" + data-pk="${record.id}" data-url="${request.contextPath}/operation/quickSave2" + data-title="Edit ${field}"> + ${record[field] ? '--' + record[field] + '--' : '----'} + </a> times. + <script> + jQuery("#${field}${record.id}").editable(); + </script> + + +   +   + </g:if> - <div class="actionsButtons"> + %{--todo: new setting 30.07.2021 10:39 --}% - <g:link controller="page" action="record" target="_blank" - params="${[id: record.id, entityCode: record.entityCode()]}" - class="fg-button ui-widget ui-state-default ui-corner-all" - title="Go to page"> - Ext. + <g:if test="${'G'.contains(entityCode) && ker.OperationController.getPath('task-steps.enabled')?.toLowerCase() == 'yes'}"> + <g:if test="${record.percentCompleted}"> + <b>Percent completed</b>: ${record.percentCompleted} + <br/> + </g:if> + %{--<g:if test="${record.totalSteps}">--}% + %{--<b>Total steps</b>: ${record.totalSteps}--}% + %{--<br/>--}% + %{--</g:if>--}% + <g:if test="${record.class.declaredFields.name.contains('completedSteps')}"> - </g:link> -<g:if test="${'R'.contains(entityCode) && ker.OperationController.getPath('bibTex.enabled')?.toLowerCase() == 'yes'}"> + <g:formRemote name="saveCompletedSteps" url="[controller: 'operation', action: 'updateCompletedSteps', id: record.id]" + update="displayCompletedSteps" + style="display: inline;"> + %{--<g:hiddenField name="id" value="${record.id}"/>--}% + <g:hiddenField name="entityCode" value="${entityCode}"/> + %{--placeholder="ما اُنجز"--}% + <b>Completed steps</b>: <g:textField id="saveCompletedSteps${entityCode}${record.id}" name="text" class="ui-corner-all" cols="80" + rows="5" + style="width:20%; display: inline; " value="${record.completedSteps}"/> + <g:submitButton name="add" value="=" style="display:none;" + class="fg-button ui-widget ui-state-default ui-corner-all navHidden"/> + %{--<br/>--}% + </g:formRemote> +   <span id="displayCompletedSteps"></span> - <g:remoteLink controller="operation" action="generateBibEntry" id="${record.id}" - update="bibTexBloc${record.id}" - class="actionLink" - title="${record.bibEntry?.replace('"', '\'')}"> - Generate bib entry - </g:remoteLink> - </g:if> - <span id="bibTexBloc${record.id}"> - </span> + <br/> + </g:if> - <g:if test="${'T'.contains(entityCode)}"> + <g:if test="${record.class.declaredFields.name.contains('totalSteps')}"> + <g:formRemote name="saveTotalSteps" url="[controller: 'operation', action: 'updateTotalSteps', id: record.id]" + update="displayTotalSteps" + style="display: inline;"> + %{--<g:hiddenField name="id" value="${record.id}"/>--}% + <g:hiddenField name="entityCode" value="${entityCode}"/> + <b>Total steps</b>: + %{--placeholder="عدد الخطوات"--}% + <g:textField id="saveTotalSteps${entityCode}${record.id}" name="text" class="ui-corner-all" cols="80" + rows="5" + style="width:20%; display: inline; " value="${record.totalSteps}"/> + <g:submitButton name="add" value="=" style="display:none;" + class="fg-button ui-widget ui-state-default ui-corner-all navHidden"/> + %{--<br/>--}% + </g:formRemote> +   <span id="displayTotalSteps"></span> - <g:remoteLink controller="task" action="markRecurring" - id="${record.id}" - params="[entityCode: entityCode]" - update="${entityCode}Record${record.id}" - title="Mark recurring"> - <b>rcr.</b> - <g:if test="${record.isRecurring}"> - rci:${record.recurringInterval} - </g:if> - </g:remoteLink> + </g:if> </g:if> -<g:if test="${OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> - <g:if test="${'RN'.contains(entityCode)}"> - <g:remoteLink controller="generics" action="fixedFarsiArabic" id="${record.id}" - params="[entityCode: entityCode]" - update="descriptionBloc${record?.id}" - title="descriptionBlocrecord" - style=""> - Fix text - </g:remoteLink> + + %{--<g:if test="${record.class.declaredFields.name.contains('percentCompleted')}">--}% + %{--<a name="bookmark${record.id}${entityCode}" title="percent++"--}% + %{--value="${record.percentCompleted}"--}% + %{--onclick="jQuery('#displayTotalSteps').load('${request.contextPath}/generics/increasePercentCompleted/${entityCode}${record.id}')">--}% + %{--Step++--}% + %{--</a>--}% + %{--<br/>--}% + %{--</g:if>--}% + + + + <g:if test="${record.class.declaredFields.name.contains('reviewHistory') && record.reviewHistory}"> + <b>Review history:</b> ${record.reviewHistory} + <br/> </g:if> + <g:if test="${record.class.declaredFields.name.contains('stepsHistory') && record.stepsHistory}"> + <b>Steps history:</b> + <br/>${record.stepsHistory?.replace('-', '<br/>')} + <br/> </g:if> + <g:if test="${record.entityCode() == 'R'}"> + + <g:if test="${(new File(OperationController.getPath('root.rps1.path') + '/cvr/' + + record?.type?.code + '/' + record.id + '.jpg')?.exists() || new File(OperationController.getPath('root.rps2.path') + '/cvr/' + record?.type?.code + '/' + record.id + '.jpg')?.exists())}"> + + <a href="${createLink(controller: 'book', action: 'viewImage', id: record.id)}" + target="_blank"> + <img class="Photo" style="width: 80px; height:120px; display:inline" + src="${createLink(controller: 'book', action: 'viewImage', id: record.id, params: [date: new Date()])}"/> + </a> + </g:if> - <g:if test="${entityCode.size() == 1}"> - %{--|| (record.class.declaredFields.name.contains('deletedOn') && record.deletedOn != null)--}% - <g:remoteLink controller="generics" action="physicalDelete" - params="${[id: record.id, entityCode: entityCode]}" - update="${entityCode}Record${record.id}" - before="if(!confirm('Are you sure you want to permanantly physically delete the record?')) return false" - class="fg-button ui-widget ui-state-default ui-corner-all" - title="Delete record permanantly"> - Delete - </g:remoteLink> </g:if> - %{--<g:if test="${entityCode.size() > 1}">--}% - %{--<g:remoteLink controller="generics" action="physicalDelete"--}% - %{--params="${[id: record.id, entityCode: entityCode]}"--}% - %{--update="${entityCode}Record${record.id}"--}% - %{--title="Delete record permanantly">--}% - %{--Delete--}% - %{--</g:remoteLink>--}% - %{--</g:if>--}% - <g:if test="${entityCode == 'C'}"> - %{--<g:link url="[controller: 'export', action: 'generateCourseWritingsAsHtml', id: record.id]"--}% - %{--target="_blank"--}% - %{--title="Convert to HTML">--}% - %{--===--}% - %{--</g:link>--}% - %{--<br/>--}% - <g:remoteLink controller="export" action="combineCourseWritings" - id="${record.id}" - params="[entityCode: entityCode]" - update="${entityCode}CheckoutLog${record.id}" - class="fg-button ui-widget ui-state-default ui-corner-all" - title="Compline course with its writings and their notes"> - md ↵ - </g:remoteLink> -    - <g:remoteLink controller="export" action="combineCourseWritingsAsTex" - id="${record.id}" - params="[entityCode: entityCode]" - update="${entityCode}CheckoutLog${record.id}" - class="fg-button ui-widget ui-state-default ui-corner-all" - title="Comdine course with its writings and their notes"> - tex ↵ - </g:remoteLink> - %{----}% - %{--<br/>--}% - %{--<br/>--}% - %{--<g:link url="[controller: 'export', action: 'generateCoursePresentation', id: record.id]"--}% - %{--class="actionLink"--}% - %{--target="_blank"--}% - %{--title="Convert to HTML">--}% - %{--Generate presentation (new tab)--}% - %{--</g:link>--}% + %{--direction: ${record?.source?.language == 'ar' ? 'rtl' : 'ltr'}--}% + %{--todo--}% - </g:if> - <g:if test="${OperationController.getPath('1=2pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}"> - <g:if test="${record.class.declaredFields.name.contains('keepSecret')}"> -<br/> -<br/> - <a name="bookmark${record.id}${entityCode}" title="Toggle privacy" - value="${record.keepSecret}" - onclick="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/togglePrivacy/${entityCode}-${record.id}')"> - Make private   - </a> - </g:if> - </g:if> + %{--direction: ${record?.source?.language == 'ar' ? 'rtl' : 'ltr'}; text-align: ${record?.source?.language == 'ar' ? 'right' : 'left'}--}% + %{--todo--}% + %{--</div>--}% - %{--<g:if test="${'RWNTGJPCD'.contains(entityCode)}">--}% -%{-- <g:if test="${record.class.declaredFields.name.contains('language')}">--}% -%{-- <br/>--}% -%{-- <br/>--}% -%{-- Language:--}% -%{-- <g:select name="language" from="${OperationController.getPath('repository.languages').split(',')}"--}% -%{-- value="${record.language}"--}% -%{-- onchange="jQuery('#${entityCode}Record${record.id}').load('${request.contextPath}/generics/setLanguage/' + '${record.id}-${entityCode}-' + this.value)"--}% -%{-- style="overflow: visible; z-index: 200; background: lightgrey" noSelection="${['': '']}"/>--}% + %{--<g:each in="${app.IndexCard.findAllByEntityCodeAndRecordId(entityCode, record.id)}" var="c">--}% + %{--<g:render template="/gTemplates/box" model="[record: c]"/>--}% + %{--</g:each>--}% + %{--<g:if test="${'R'.contains(record.entityCode())}">--}% + %{--<g:each in="${app.IndexCard.findAllByBook(record)}" var="c">--}% + %{--<g:render template="/gTemplates/box" model="[record: c]"/>--}% + %{--</g:each>--}% + %{--</g:if>--}% + %{--<g:if test="${'W'.contains(record.entityCode())}">--}% + %{--<g:each in="${app.IndexCard.findAllByWriting(record)}" var="c">--}% + %{--<g:render template="/gTemplates/box" model="[record: c]"/>--}% + %{--</g:each>--}% + %{--</g:if>--}% - %{--<g:remoteLink controller="generics" action="setArabic"--}% - %{--id="${record.id}"--}% - %{--params="[entityCode: entityCode]"--}% - %{--update="${entityCode}Record${record.id}"--}% - %{--style="background: lightgrey"--}% - %{--title="Mark arabic">--}% - %{--Ar--}% - %{--</g:remoteLink>--}% - %{--<g:if test="${OperationController.getPath('pkm-actions.enabled')?.toLowerCase() == 'yes' ? true : false}">--}% - %{--<g:remoteLink controller="generics" action="setPersian"--}% - %{--id="${record.id}"--}% - %{--params="[entityCode: entityCode]"--}% - %{--update="${entityCode}Record${record.id}"--}% - %{--title="Mark as Farsi">--}% - %{--Fa--}% - %{--</g:remoteLink>--}% - %{--</g:if>--}% - %{--<g:remoteLink controller="generics" action="setFrench"--}% - %{--id="${record.id}"--}% - %{--params="[entityCode: entityCode]"--}% - %{--update="${entityCode}Record${record.id}"--}% - %{--title="Mark as French">--}% - %{--Fr--}% - %{--</g:remoteLink>--}% - %{--<g:remoteLink controller="generics" action="setEnglish"--}% - %{--id="${record.id}"--}% - %{--params="[entityCode: entityCode]"--}% - %{--update="${entityCode}Record${record.id}"--}% - %{--title="Mark as English">--}% - %{--En--}% - %{--</g:remoteLink>--}% -%{-- </g:if>--}% -%{----}% -%{-- <br/>--}% - <br/> - %{--todo; case of x ,y--}% + <g:if test="${record.entityCode() == 'todoR'}"> + <div id="type-4" style=""> + <g:if test="${'R'.contains(record.entityCode())}"> + %{--<h4>Notes</h4>--}% + <h4>Excerpts</h4> + <g:each in="${Excerpt.findAllByBook(record)}" var="r"> + <g:render template="/gTemplates/recordSummary" model="[record: r, expandedView: false]"/> + </g:each> + %{--<g:each in="${Planner.findAllByBook(record)}" var="r">--}% + %{----}% + %{--<g:render template="/gTemplates/recordSummary" model="[record: r]"/>--}% + %{--</g:each>--}% - <g:if test="${'R'.contains(entityCode) && ker.OperationController.getPath('excerpts.enabled')?.toLowerCase() == 'yes'}"> - <div dir="ltr"/> - <br/> - Add excerpt: - <g:formRemote name="appendText" url="[controller: 'book', action: 'addExcerpt']" - update="${entityCode}Record${record.id}" - style="display: inline;"> - <g:hiddenField name="id" value="${record.id}"/> - <g:hiddenField name="entityCode" value="${entityCode}"/> - <g:textField id="appendTextFor${entityCode}${record.id}" name="text" class="ui-corner-all" cols="80" - placeholder="title" - rows="5" - style="width:60%; display: inline; " value=""/> - <g:submitButton name="add" value="+=" style="display:none;" - class="fg-button ui-widget ui-state-default ui-corner-all navHidden"/> - <br/> - </g:formRemote> - %{--</div>--}% - </g:if> - - - <g:if test="${'NO'.contains(entityCode) && ker.OperationController.getPath('convert-records.enabled')?.toLowerCase() == 'yes'}"> - <br/> - <br/> -    <b>Convert to:</b> - <g:each in="${['J', 'P', 'T', 'G', 'R', 'W']}" var="t"> - - <g:remoteLink controller="generics" action="convertNoteToRecord" - params="${[id: record.id, entityCode: entityCode, type: t]}" - update="${entityCode}Record${record.id}" - class="fg-button ui-widget ui-state-default ui-corner-all convertButton${t}" - title="Convert note to ${t}"> -  ${t}   - </g:remoteLink> - </g:each> - </g:if> - - -<g:if test="${cmn.Setting.findByName('aws.secret.key') && entityCode == 'R' && record.isbn}"> - <g:remoteLink controller="book" action="updateBookInfo" id="${record.id}" - update="RRecord${record.id}" - class="actionLink fg-button ui-widget ui-state-default ui-corner-all" - title="Update metadata from Amazon"> - Update metadata - </g:remoteLink> - <br/> - <br/> -</g:if> -<g:if test="${OperationController.getPath('blog.enabled')?.toLowerCase() == 'yes' ? true : false}"> - <g:if test="${record.class.declaredFields.name.contains('blog')}"> - <br/> - <br/> -   - - <g:set value="blog" var="field"></g:set> - Blog: - <a href="#" id="${field}${record.id}" class="${field}" - data-type="select" - data-value="${record[field]?.id}" - data-name="${field}-${entityCode}" - style=" border-radius: 3px; font-size: 0.9em; font-style: italic; padding-left: 1px; padding-right: 1px;" - data-source="${request.contextPath}/operation/getQuickEditValues?entity=${entityCode}&field=${field}&date=${new Date().format('hhmmssDDMMyyyy')}" - data-pk="${record.id}" data-url="${request.contextPath}/operation/quickSave2" - data-title="Edit ${field}"> - ${record[field] ? (record[field]?.code ? 'blog-' + record[field]?.code : 'blog' + record.blog) : 'blog-'} - </a> - <script type="text/javascript"> - jQuery("#${field}${record.id}").editable(); - </script> -<br/> -<br/> + </g:if> - <g:if test="${record?.blog?.code && record.descriptionHTML}"> - <g:remoteLink controller="generics" action="publish" id="${record.id}" - params="[entityCode: entityCode]" - update="postResult${record?.id}" - title="Publish record" - class="fg-button ui-widget ui-state-default ui-corner-all"> - Publish on <b>${record?.blog?.code}</b> - </g:remoteLink> + </div> </g:if> - <div id="postResult${record.id}" style="display: inline"> + <div id="type-7" style=""> + </div> - <g:if test="${record.publishedNodeId}"> - Published with ID: (${record.publishedNodeId}) - </g:if> + + + + %{--<br/>--}% + + + + + <g:if test="${record.entityCode() == 'D'}"> + <div id="OrderTheFields" style="-moz-columns-count:1"> + <h4>Order the courses</h4> + <table id="table1"> + %{--<ul id="item_list" >--}% + <g:each in="${mcs.Course.findAllByDepartment(mcs.Department.get(record.id), [sort: 'orderNumber', order: 'asc'])}" + var="c"> + <tr id="${c.id}"> + <td> + #${c.orderNumber} C-${c.id} - ${c.summary} + </td></tr> + </g:each> + </table> + <a style="font-size: 10px; text-align: right;" href="#" + onclick='jQuery("#OrderTheFields").load("${request.contextPath}/operation/orderRecords?type=D&child=C&tableId=1", jQuery("#table1").tableDnDSerialize())'> + Sort</a> + + <hr/> + </div> + + <script type="text/javascript"> + jQuery("#table1").tableDnD(); + </script> </g:if> + <g:if test="${record.entityCode() == 'C'}"> + <ol style="dir: rtl; text-align: right;"> + <g:each in="${mcs.Writing.findAllByCourseAndPriorityGreaterThan(record, 2, [sort: 'orderNumber', order: 'asc'])}" + var="c"> + <li style="font-weight: normal;"> + W-${c.id} - <b>${c.summary} + %{--r${c.reviewCount}--}% + </li> + <ol style="dir: rtl; text-align: right;"> + <g:each in="${app.IndexCard.executeQuery('from IndexCard i where i.recordId = ? and i.entityCode = ? and i.priority >= 2 order by i.orderNumber asc', + [c.id.toString(), 'W'])}" + var="n"> + <li style="font-weight: normal;"> + N-${n.id} - ${n.summary} + %{--<pkm:summarize text="${c.description}" length="80"/>--}% + </li> + </g:each> - <span id="${entityCode}CheckoutLog${record.id}"></span> + </ol> + </g:each> - <g:if test="${(entityCode == 'W') || entityCode == 'N'}"> - %{--|| entityCode == 'N'--}% - %{--<g:remoteLink--}% - %{--url="[controller: 'generics', action: 'convertMarkupToHtml', id: record.id, params: [entityCode: entityCode]]"--}% - %{--update="3rdPanel"--}% - %{--before="jQuery('#accordionEast').accordion({ active: 0});"--}% - %{--class="actionLink"--}% - %{--title="Convert to HTML">--}% - %{--==--}% - %{--</g:remoteLink>--}% + <g:each in="${app.IndexCard.executeQuery('from IndexCard i where i.recordId = ? and i.course = ? and i.priority > ? order by orderNumber asc' ,[null, record, 2])}" + var="n"> - <g:remoteLink controller="generics" action="notes2Operations" - id="${record.id}" - params="[entityCode: entityCode]" - update="${entityCode}CheckoutLog${record.id}" - title="Checkout record"> - to operations ↵ - </g:remoteLink> - <g:remoteLink controller="generics" action="checkoutRecordText" - id="${record.id}" - params="[entityCode: entityCode]" - update="${entityCode}CheckoutLog${record.id}" - title="Checkout record"> - out ↵ - </g:remoteLink> + <li> + N-${n.id} - ${n.summary} + %{--r${n.reviewCount}--}% + %{--<pkm:summarize text="${c.description}" length="80"/>--}% + </li> + </g:each> - </g:if> - <g:if test="${entityCode == 'W'}"> - <g:remoteLink controller="export" action="combineWritingNotes" - id="${record.id}" - params="[entityCode: entityCode]" - update="${entityCode}CheckoutLog${record.id}" - title="Compile writing with its notes"> - cmp ↵ - </g:remoteLink> - </g:if> + </ol> -   -%{-- <g:remoteLink controller="operation" action="pandoc" id="${record.id}"--}% -%{-- params="[entityCode: entityCode]"--}% -%{-- update="postResult${record?.id}"--}% -%{-- title="Publish record"--}% -%{-- class="fg-button ui-widget ui-state-default ui-corner-all">--}% -%{-- pandoc--}% -%{-- </g:remoteLink>--}% -%{--  --}% - %{--<g:if test="${entityCode == 'W' && !record.code}">--}% - %{--<b style="color: red">No code</b>--}% - %{--</g:if>--}% - </g:if> + + <div id="OrderTheFields" style="-moz-columns-count:1"> + <h4>Order the goals</h4> + <table id="table1"> + %{--<ul id="item_list" >--}% + <g:each in="${mcs.Goal.findAllByCourse(Course.get(record.id), [sort: 'orderNumber', order: 'asc'])}" + var="c"> + <tr id="${c.id}"> + <td> + #${c.orderNumber} G-${c.id} - ${c.summary} <pkm:summarize text="${c.description}" + length="80"/> + </td></tr> + </g:each> + </table> + <br/> + <a style="font-size: 10px; text-align: right;" href="#" + onclick='jQuery("#OrderTheFields").load("${request.contextPath}/operation/orderRecords?type=C&child=G&tableId=1", jQuery("#table1").tableDnDSerialize())'> + Sort</a> + + <hr/> + + <table id="table2"> + %{--<ul id="item_list" >--}% + <h4>Order the writings</h4> + <g:each in="${mcs.Writing.findAllByCourseAndPriorityGreaterThan(Course.get(record.id), 2, [sort: 'orderNumber', order: 'asc'])}" + var="c"> + <tr id="${c.id}"> + <td> + #${c.orderNumber} W-${c.id} - <b>${c.summary}</b> + + %{--<pkm:summarize--}% + %{--text="${c.description}"--}% + %{--length="80"/>--}% + </td> + </tr> + </g:each> + </table> + <br/> + <a style="font-size: 10px; text-align: right;" href="#" + onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=C&child=W&tableId=2", jQuery("#table2").tableDnDSerialize())'> + Sort</a> + + <hr/> + + <table id="table3"> + <h4>Order the resources</h4> + <g:each in="${mcs.Book.findAllByCourse(Course.get(record.id), [sort: 'orderNumber', order: 'asc'])}" + var="c"> + <tr id="${c.id}"> + <td> + #${c.orderInCourse} B-${c.id} - ${c.title} ${c.legacyTitle}<pkm:summarize + text="${c.description}" length="80"/> + </td></tr> + </g:each> + </table> + <br/> + <a style="font-size: 10px; text-align: right;" href="#" + onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=C&child=R&tableId=3", jQuery("#table3").tableDnDSerialize())'> + Sort</a> + + + + <table id="table4"> + %{--<ul id="item_list" >--}% + <h4>Order the excerpts</h4> + <g:each in="${mcs.Excerpt.executeQuery('from Excerpt r where r.book.course = ? order by orderNumber asc', [Course.get(record.id)])}" + var="c"> + <tr id="${c.id}"> + <td> + #${c.orderNumber} R-${c.id} - <b>${c.book?.title} ${c.book?.legacyTitle}</b>:${c.chapters} ${c.summary} + </td></tr> + </g:each> + </table> + <br/> + <a style="font-size: 10px; text-align: right;" href="#" + onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=C&child=E&tableId=4", jQuery("#table4").tableDnDSerialize())'> + Sort</a> + + <table id="table5"> + %{--<ul id="item_list" >--}% + <h4>Order the tasks</h4> + <g:each in="${mcs.Excerpt.executeQuery('from Task r where r.course = ? and r.bookmarked = ? order by orderNumber asc', [Course.get(record.id), true])}" + var="c"> + <tr id="${c.id}"> + <td> + #${c.orderNumber} T-${c.id} - <b>${c?.summary} + </td></tr> + </g:each> + </table> + <input type="button" id="sortButton5" value="Save sort" + onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=C&child=T&tableId=5", jQuery("#table5").tableDnDSerialize())'/> + - <br/> - </div> - <br/> - <br/> - -<g:if test="${OperationController.getPath('markdown.enabled')?.toLowerCase() == 'yes' ? true : false}"> - <g:if test="${'RN'.contains(entityCode)}"> - <g:if test="${!record.withMarkdown}"> - - <g:remoteLink controller="generics" action="markAsMarkdowned" - params="${[id: record.id, entityCode: entityCode]}" - update="notificationLog" - class="fg-button ui-widget ui-state-default ui-corner-all" - title="Mark that the content is markdown"> - Mark contents as markdown - </g:remoteLink> - - </g:if> - <g:else> - Markdowned! - </g:else> - </g:if> - </g:if> - <g:if test="${'R'.contains(entityCode)}"> - - - <div class="${record.class.declaredFields.name.contains('language') ? 'text' + record.language : ''}" style="font-size: 11px; background: lightgrey; padding: 3px;"> - <g:set value="${record.language == 'en' ? ',' : '،'}" var="comma"></g:set> - <g:if test="${record.type?.code == 'ebk'}"> - ${record.author}${comma} - ${record.title}${record.translator ? ' - ' + record.translator : ''}${record.editor ? ' - ' + record.editor: ''}${record.edition ? comma + ' ' + record.edition + ' ': ''} - (${record.publicationCity ? record.publicationCity + ': ' : '' }${record.publisher}${comma}${record.year ?: record.publicationDate}). + + + <script type="text/javascript"> + jQuery("#table1").tableDnD(); + jQuery("#table2").tableDnD(); + jQuery("#table3").tableDnD(); + jQuery("#table4").tableDnD(); + jQuery("#table5").tableDnD(); + </script> + </div> </g:if> - <g:if test="${record.type?.code == 'art'}"> - ${record.author}${comma} - "${record.title}" ${record.translator ? ' - ' + record.translator : ''}${record.editor ? ' - ' + record.editor: ''} ${record.journal}. ${record.volume} ${record.number} ${record.pages} - (${record.publicationCity ? record.publicationCity + ': ' : '' }${record.publisher}${comma}${record.year ?: record.publicationDate}). - ${record.url}${record.sourceFree} + + <g:if test="${record.entityCode() == 'W' && app.IndexCard.executeQuery('select count(*) from IndexCard i where i.recordId = ? and i.entityCode = ? and i.priority >= 2', + [record.id.toString(), 'W'])[0] > 0}"> + <h4>Order the notes</h4> + + <div id="OrderTheFields" style="direction: rtl; text-align: right !important;"> + + <table id="table1"> + %{--<ul id="item_list" >--}% + %{--<g:each in="${app.IndexCard.findAllByWriting(Writing.get(record.id), [sort: 'orderNumber', order: 'asc'])}"--}% + %{--var="c">--}% + %{--<tr id="${c.id}">--}% + %{--<td>--}% + %{--#${c.orderNumber} C-${c.id} - ${c.summary} <pkm:summarize text="${c.description}"--}% + %{--length="80"/>--}% + %{--</td></tr>--}% + %{--</g:each>--}% + <g:each in="${app.IndexCard.executeQuery('from IndexCard i where i.recordId = ? and i.entityCode = ? and i.priority >= 2 order by i.orderNumber asc', + [record.id.toString(), 'W'])}" + var="c"> + <tr id="${c.id}"> + <td style="direction: rtl; text-align: right !important; margin: 5px;"> + #${c.orderNumber} p${c.priority} W-${c.id} - ${c.summary} + %{--<pkm:summarize text="${c.description}" length="80"/>--}% + </td> + </tr> + </g:each> + </table> + <br/> + <a style="font-size: 10px; text-align: right;" href="#" + onclick='jQuery("#OrderTheFields").load("operation/orderRecords?type=W&child=N&tableId=1", jQuery("#table1").tableDnDSerialize())'> + Sort</a> + + <script type="text/javascript"> + jQuery("#table1").tableDnD(); + </script> + </div> </g:if> - </div> - %{--<br/>--}% - </g:if> +   + %{--<br/>--}% + %{--<br/>--}% -<g:if test="${record.class.declaredFields.name.contains('completedOn') && record.completedOn}"> + <g:if test="${record.class.declaredFields.name.contains('completedOn') && record.completedOn}"> - <b>Completed on</b> ${record.completedOn?.format(OperationController.getPath('date.format') ? OperationController.getPath('date.format') + ' HH:mm' : 'dd.MM.yyyy HH:mm')} - %{--(<prettytime:display--}% - %{--date="${record.completedOn}"/>)--}% + <b>Completed on</b> ${record.completedOn?.format(OperationController.getPath('date.format') ? OperationController.getPath('date.format') + ' HH:mm' : 'dd.MM.yyyy HH:mm')} + %{--(<prettytime:display--}% + %{--date="${record.completedOn}"/>)--}% - <g:remoteLink controller="generics" action="resetCompletedOnStatus" - params="${[id: record.id, entityCode: entityCode]}" - update="resetCompletedOn" - title="Reset completion status"> -x - </g:remoteLink> - <span id="resetCompletedOn"></span> + <g:remoteLink controller="generics" action="resetCompletedOnStatus" + params="${[id: record.id, entityCode: entityCode]}" + update="resetCompletedOn" + title="Reset completion status"> + x + </g:remoteLink> + <span id="resetCompletedOn"></span> - <br/> - <br/> - </g:if> - <g:if test="${record.class.declaredFields.name.contains('readOn') && record.readOn}"> + <br/> + <br/> + </g:if> + <g:if test="${record.class.declaredFields.name.contains('readOn') && record.readOn}"> - <b>Read on</b> ${record.readOn?.format(OperationController.getPath('date.format') ? OperationController.getPath('date.format') + ' HH:mm' : 'dd.MM.yyyy HH:mm')} - %{--(<prettytime:display--}% - %{--date="${record.readOn}"/>)--}% + <b>Read on</b> ${record.readOn?.format(OperationController.getPath('date.format') ? OperationController.getPath('date.format') + ' HH:mm' : 'dd.MM.yyyy HH:mm')} + %{--(<prettytime:display--}% + %{--date="${record.readOn}"/>)--}% - <g:remoteLink controller="generics" action="resetReadOnStatus" - params="${[id: record.id, entityCode: entityCode]}" - update="resetReadOn" - title="Reset reading status"> - x - </g:remoteLink> - <span id="resetReadOn"></span> + <g:remoteLink controller="generics" action="resetReadOnStatus" + params="${[id: record.id, entityCode: entityCode]}" + update="resetReadOn" + title="Reset reading status"> + x + </g:remoteLink> + <span id="resetReadOn"></span> - <br/> - <br/> + <br/> + <br/> - </g:if> -</div> -</div> + </g:if> -%{--heading--}% -<div class=""> - %{--<h2>Create new record...</h2>--}% - <h4 style="user-focus-pointer: hand; cursor: hand;">Files...</h4> - <hr/> - <br/> -</div> -%{--content--}% -<div class=""> + %{--heading--}% + %{--<div class="">--}% + %{--<h2>Create new record...</h2>--}% + %{--<hr/>--}% + %{--<br/>--}% + %{--<h3 style="user-focus-pointer: hand; cursor: hand;">Files...</h3>--}% + %{--</div>--}% + %{--content--}% - <g:render template="/gTemplates/filesListing" model="[record: record, entityCode: record.entityCode()]"/> - <pkm:listPictures fileClass="snsFile" - folder="${OperationController.getPath('root.rps1.path')}/${record.entityCode()}/${record.id}" - initial=""/> - <pkm:listPictures fileClass="snsFile" - folder="${OperationController.getPath('root.rps2.path')}/${record.entityCode()}/${record.id}" - initial=""/> - <pkm:listPictures fileClass="snsFile" - folder="${OperationController.getPath('root.rps1.path')}/${record.entityCode()}" - initial="${record.id}"/> + %{--Working--}% + %{----}% - <pkm:listPictures fileClass="snsFile" - folder="${OperationController.getPath('root.rps2.path')}/${record.entityCode()}" - initial="${record.id}"/> + </div> + </li> - <g:if test="${OperationController.getPath('upload-files.enabled')?.toLowerCase() == 'yes' ? true : false}"> -<br/> -<br/> -<b>Upload files to record <i>rps1</i> folder:</b> - %{--(${typeSandboxPath})--}% -%{--<br/>--}% -<br/> -%{--${typeSandboxPath?.replace('/', '-')?.replaceAll(/\\/, '-')}--}% -<uploadr:add id="uploader${new Date()?.format('ddMMyyyyHHmmss')}" - name="uploader${new Date()?.format('ddMMyyyyHHmmss')}" - controller="import" action="upload" path="${typeSandboxPath}" - placeholder="Behold: the drop area!" fileselect="Behold: the fileselect!" - noSound="true" - direction="down" maxVisible="5" unsupported="${request.contextPath}/upload/warning" maxConcurrentUploads="1" class="demo"> - <uploadr:onSuccess> - jQuery('#spinner2').hide(); - jQuery('.info-badge').html('Done uploading files.'); - </uploadr:onSuccess> - -</uploadr:add> - </g:if> - -<g:if test="${1 == 2 && OperationController.getPath('upload-cover.enabled')?.toLowerCase() == 'yes' ? true : false}"> - - <br/> - <br/> - - <b>Upload cover</b>: - <uploadr:add id="uploadCover${record.id}" - name="uploaderCover${new Date()?.format('ddMMyyyyHHmmss')}" - controller="import" action="uploadCover2" path="${coverPath}" - noSound="true" - direction="down" maxVisible="5" unsupported="${request.contextPath}/upload/warning" maxConcurrentUploads="1"> - <uploader:onSuccess> - jQuery('#subUploadInPanel').html('Cover uploaded.')//load('/pkm/generics/showSummary/' + responseJSON.id + '?entityCode=' + responseJSON.entityCode) - </uploader:onSuccess> - Upload... - </uploadr:add> -</g:if> + <li class=""> + <a class="uk-accordion-title" href="#"> + Log + </a> + <div class="uk-accordion-content"> -<g:if test="${OperationController.getPath('open-record-folders.enabled')?.toLowerCase() == 'yes' ? true : false}"> -<br/> -<br/> - <div style="background: #e7eeeb; border: 1px #7dba82; margin: 20px 0"> -Open record's folder: -  -<g:remoteLink controller="generics" action="openRpsFolder" - params="${[id: record.id, entityCode: entityCode, repository: 1]}" - update="${entityCode}Record${record.id}OpenLog" - title="Open rps1 folder: ${OperationController.getPath('root.rps1.path')}"> - <u><b>  repo. 1 </b></u> -</g:remoteLink> -/ -<g:remoteLink controller="generics" action="openRpsFolder" - params="${[id: record.id, entityCode: entityCode, repository: 2]}" - update="${entityCode}Record${record.id}OpenLog" - title="Open rps2 folder: ${OperationController.getPath('root.rps2.path')}"> - <u><b> 2 </b></u> -</g:remoteLink> -/ -<g:remoteLink controller="generics" action="openRpsFolder" - params="${[id: record.id, entityCode: entityCode, repository: 3]}" - update="${entityCode}Record${record.id}OpenLog" - title="Open rps3 folder: ${OperationController.getPath('root.rps3.path')}"> - <u><b> 3 </b></u> -</g:remoteLink>. - - <g:if test="${record.class.declaredFields.name.contains('nbFiles')}"> - <g:if test="${record.nbFiles}"> - %{--<g:if test="${record.nbFiles}">--}% + + %{--<div style="background: #cee2db; border: 1px #206e24">--}% + <b>Updated</b> ${record.lastUpdated?.format(OperationController.getPath('date.format') ? OperationController.getPath('date.format') + ' HH:mm' : 'dd.MM.yyyy HH:mm')} + %{--(<prettytime:display--}% + %{--date="${record.lastUpdated}"/>)--}% + <br/> + %{--(<prettytime:display--}% + %{--date="${record.dateCreated}"/>)--}% + %{--by ${record.insertedBy}--}% + %{--editedBy ${record.editedBy}--}% + <b>Created</b> ${record.dateCreated?.format(OperationController.getPath('date.format') ? OperationController.getPath('date.format') + ' HH:mm' : 'dd.MM.yyyy HH:mm')} + %{--(${new PrettyTime()?.format(record.dateCreated)})--}% <br/> - <b> Number of files: </b><span title="${record.filesList}" style="">${record.nbFiles ?: ''}</span>. - </g:if> + <b>User</b>: ${record?.user?.username} <br/> + <b>Version</b> <span style="font-weight: normal">${record.version}</span> <br/> - <g:remoteLink controller="operation" action="countResourceFiles" id="${record.id}" params="[entityCode: entityCode]" - update="${entityCode}Record${record.id}OpenLog" style="" - title="Update files count"> - Update count <b>↻</b> - </g:remoteLink> -   - <g:remoteLink controller="operation" action="copyToRps1" - params="${[id: record.id, entityCode: entityCode]}" - update="${entityCode}Record${record.id}OpenLog" - title="Copy files from rps2 (${OperationController.getPath('root.rps2.path')}) to rps1 (${OperationController.getPath('root.rps1.path')})"> - Out <b> ↓ + + %{--</div>--}% + %{--<br/>--}% + </div> + + + %{--</div>--}% + + </li> + + + <li class="uk-open"> + <a class="uk-accordion-title" href="#"> + Files + </a> + <div class="uk-accordion-content"> + + + <g:render template="/gTemplates/filesListing" model="[record: record, entityCode: record.entityCode()]"/> + + + <g:if test="${OperationController.getPath('open-record-folders.enabled')?.toLowerCase() == 'yes' ? true : false}"> + + %{--<span style="background: #e7eeeb; border: 0px #7dba82; margin: 10px 5px; padding: 4px;">--}% + + Open record's folder in repository: + + <ul class="uk-subnav uk-subnav-pill" uk-switcher="animation: uk-animation-fade"> + <li> + + <g:remoteLink controller="generics" action="openRpsFolder" + params="${[id: record.id, entityCode: entityCode, repository: 1]}" + update="${entityCode}Record${record.id}OpenLog" + class="uk-button-secondary" + title="Open rps1 folder: ${OperationController.getPath('root.rps1.path')}"> + <u><b>1 </b></u> + </g:remoteLink> + </li> + <li> + <g:remoteLink controller="generics" action="openRpsFolder" + params="${[id: record.id, entityCode: entityCode, repository: 2]}" + update="${entityCode}Record${record.id}OpenLog" + title="Open rps2 folder: ${OperationController.getPath('root.rps2.path')}"> + <u><b> 2 </b></u> + </g:remoteLink> + </li> + <li> + <g:remoteLink controller="generics" action="openRpsFolder" + params="${[id: record.id, entityCode: entityCode, repository: 3]}" + update="${entityCode}Record${record.id}OpenLog" + title="Open rps3 folder: ${OperationController.getPath('root.rps3.path')}"> + <u><b> 3 </b></u> + </g:remoteLink> + </li> + </ul> + + + + + %{--</span>--}% + + <g:if test="${record.class.declaredFields.name.contains('nbFiles')}"> + %{--<g:if test="${record.nbFiles}">--}% + %{--<g:if test="${record.nbFiles}">--}% + %{--<br/>--}% + + %{--<b> Number of files: </b>--}% + %{--<span title="${record.filesList}" style="">${record.nbFiles ?: ''}</span>.--}% + %{--</g:if>--}% + %{--<br/>--}% + <br/> +   + <g:remoteLink controller="operation" action="countResourceFiles" id="${record.id}" params="[entityCode: entityCode]" + update="${entityCode}Record${record.id}OpenLog" style="" + class="uk-button-secondary" + title="Update files count"> + + Update count <b>↻</b> + </g:remoteLink> +   + <g:remoteLink controller="operation" action="copyToRps1" + params="${[id: record.id, entityCode: entityCode]}" + update="${entityCode}Record${record.id}OpenLog" + class="uk-button-secondary" + title="Copy files from rps2 (${OperationController.getPath('root.rps2.path')}) to rps1 (${OperationController.getPath('root.rps1.path')})"> + Out <b> ↓ ↓</b> - </g:remoteLink> - <br/> - <br/> -  <span id="${entityCode}Record${record.id}OpenLog"></span> + </g:remoteLink> + <br/> +  <span id="${entityCode}Record${record.id}OpenLog"></span> -</g:if> -</g:if> -</div> + </g:if> -</div> -<hr/> -<br/> - <br/> -%{-- /--}% -%{-- --}% -<g:if test="${1 == 2}"> -<g:if test="${entityCode == 'R'}"> - <br/> - <br/> -opf ${OperationController.getPath('root.rps1.path')}R/${record.type?.code}/${(record.id / 100).toInteger()}/${record.id} - <br/> -opf ${OperationController.getPath('root.rps2.path')}R/${record.type?.code}/${(record.id / 100).toInteger()}/${record.id} -</g:if> -<g:else> - <br/> - <br/> -opf ${OperationController.getPath('root.rps1.path')}${entityCode}/${record.id} - <br/> -opf ${OperationController.getPath('root.rps2.path')}${entityCode}/${record.id} -</g:else> -</g:if> + </g:if> + + + <g:if test="${OperationController.getPath('upload-files.enabled')?.toLowerCase() == 'yes' ? true : false}"> + <br/> + <br/> + <b>Upload files to record <i>rps1</i> folder:</b> + %{--(${typeSandboxPath})--}% + <br/> + <br/> + %{--${typeSandboxPath?.replace('/', '-')?.replaceAll(/\\/, '-')}--}% + <uploadr:add id="uploader${new Date()?.format('ddMMyyyyHHmmss')}" + name="uploader${new Date()?.format('ddMMyyyyHHmmss')}" + controller="import" action="upload" path="${typeSandboxPath}" + placeholder="Behold: the drop area!" fileselect="Behold: the fileselect!" + noSound="true" + direction="down" maxVisible="3" unsupported="${request.contextPath}/upload/warning" maxConcurrentUploads="1" class="demo"> + <uploadr:onSuccess> + jQuery('#spinner2').hide(); + jQuery('.info-badge').html('Done uploading files.'); + </uploadr:onSuccess> + </uploadr:add> + </g:if> -<div style="background: #cee2db; border: 1px #206e24"> -<b>Updated</b> ${record.lastUpdated?.format(OperationController.getPath('date.format') ? OperationController.getPath('date.format') + ' HH:mm' : 'dd.MM.yyyy HH:mm')} -%{--(<prettytime:display--}% - %{--date="${record.lastUpdated}"/>)--}% - <br/> - %{--(<prettytime:display--}% - %{--date="${record.dateCreated}"/>)--}% - %{--by ${record.insertedBy}--}% - %{--editedBy ${record.editedBy}--}% -<b>Created</b> ${record.dateCreated?.format(OperationController.getPath('date.format') ? OperationController.getPath('date.format') + ' HH:mm' : 'dd.MM.yyyy HH:mm')} -%{--(${new PrettyTime()?.format(record.dateCreated)})--}% - <br/> -<b>Version</b> <span style="font-weight: normal">${record.version}</span> - <br/> -</div> - <br/> -</div> -%{--Working--}% -%{----}% + %{---------------------------}% +</div> + </li> + %{--<li class="uk-open">--}% + %{--<a class="uk-accordion-title" href="#">--}% + %{--Files--}% + %{--</a>--}% + %{--<div class="uk-accordion-content">--}% + %{--</div>--}% + %{----}% + %{--</li>--}% +%{--</ul>--}% +</ul> + <div id="notificationArea"></div> @@ -1546,11 +1584,8 @@ jQuery(".heading").click(function() { window.isHidden = false; }); - -Mousetrap.bind(['q', 'ض'], function (e) { - jQuery(".editButton").click(); -}); - - +//Mousetrap.bind(['q', 'ض'], function (e) { +// jQuery(".editButton").click(); +//}); </script> diff --git a/grails-app/views/layouts/_savedSearches.gsp b/grails-app/views/layouts/_savedSearches.gsp old mode 100644 new mode 100755 index 630cd7e..a1b47e2 --- a/grails-app/views/layouts/_savedSearches.gsp +++ b/grails-app/views/layouts/_savedSearches.gsp @@ -1,6 +1,7 @@ <%@ page import="mcs.parameters.SavedSearch; mcs.Task" %> <g:if test="${!params.disableSavedSearch}"> - <g:each in="${SavedSearch.findAllByEntityLikeAndBookmarked(entity, true, [sort: 'orderNumber'])}" var="i"> + <g:each in="${SavedSearch.findAllByEntityLikeAndBookmarked(entity, true, [sort: 'summary', order: 'asc'])}" var="i"> + <li> <g:set var="split" value="\\{"/> @@ -13,6 +14,7 @@ id="${i.id}" update="centralArea"> + %{--#${i.orderNumber}--}% <span style="font-weight: bold" title="${i.query}"> ${i.summary} </span> <b style="color: darkgray">${i.code}</b> <span style="font-size: small">(${count != null ? '' + count + '' : null})</span> @@ -23,8 +25,9 @@ %{--<br/>--}% </li> </g:each> - <sec:ifAnyGranted roles="ROLE_ADMIN"> - <g:each in="${SavedSearch.findAllByEntityLikeAndBookmarked(entity, false, [sort: 'orderNumber'])}" var="i"> + %{--<sec:ifAnyGranted roles="ROLE_ADMIN">--}% + %{--todo: feature dismissed, to ease sorting--}% + <g:each in="${SavedSearch.findAllByEntityLikeAndBookmarked(entity, false, [sort: 'summary', order: 'asc'])}" var="i"> <li> <g:set var="split" value="\\{"/> @@ -33,12 +36,15 @@ value="${i.countQuery ? Task.executeQuery(i.countQuery)[0] : null}"/> %{--before="jQuery.address.value(jQuery(this).attr('href'));"--}% - <g:remoteLink controller="generics" action="executeSavedSearch" + + %{--#${i.orderNumber}--}% + + <g:remoteLink controller="generics" action="executeSavedSearch" style="direction: rtl; text-align: right; color: #${count > 0 ? '003366' : (count == 0 ? 'ccc' : 'bbb')}; ${i.onHomepage ? 'text-decoration: underline' : ''}" id="${i.id}" update="centralArea"> - <span title="${i.query}"> ${i.summary} </span> <b style="color: darkgray">${i.code}</b> + <span title="${i.query}" style="font-size: small"> ${i.summary} </span> <b style="color: darkgray">${i.code}</b> <span style="font-size: small">(${count != null ? '' + count + '' : null})</span> </g:remoteLink> @@ -48,5 +54,5 @@ %{--<br/>--}% </li> </g:each> - </sec:ifAnyGranted> + %{--</sec:ifAnyGranted>--}% </g:if> diff --git a/grails-app/views/layouts/panel-old.gsp b/grails-app/views/layouts/panel-old.gsp new file mode 100755 index 0000000..87dabe9 --- /dev/null +++ b/grails-app/views/layouts/panel-old.gsp @@ -0,0 +1,111 @@ + + + <pkm:listPictures fileClass="snsFile" + folder="${OperationController.getPath('root.rps1.path')}/${record.entityCode()}/${record.id}" + initial=""/> + + <pkm:listPictures fileClass="snsFile" + folder="${OperationController.getPath('root.rps2.path')}/${record.entityCode()}/${record.id}" + initial=""/> + + <pkm:listPictures fileClass="snsFile" + folder="${OperationController.getPath('root.rps1.path')}/${record.entityCode()}" + initial="${record.id}"/> + + <pkm:listPictures fileClass="snsFile" + folder="${OperationController.getPath('root.rps2.path')}/${record.entityCode()}" + initial="${record.id}"/> + + + + <g:if test="${record.entityCode().length() == 120 && mobileView != 'true'}"> + <div style="display: inline; text-align: right;"> + <table border=0 width="95%"> + <tr> + <td width="50%" style="vertical-align: top;"> + Upload cover + <uploader:uploader id="uploadCover${record.id}" + url="${[controller: 'import', action: 'uploadCover']}" + params="${[recordId: record.id, entityCode: record.entityCode()]}"> + <uploader:onComplete> + jQuery('#subUploadInPanel').load('${request.contextPath}/generics/showSummary/' + responseJSON.id + '?entityCode=' + responseJSON.entityCode) + </uploader:onComplete> + Upload... + </uploader:uploader> + </td> + <td> + Add to wrk folder ('${OperationController.getPath('root.rps1.path')}'): + <g:if test="${new File(OperationController.getPath('root.rps1.path')).exists()}"> + <uploader:uploader id="addToRecordFolder${record.id}" + url="${[controller: 'import', action: 'addToRecordFolder']}" + params="${[recordId: record.id, entityCode: record.entityCode()]}"> + Add to record folder + </uploader:uploader> + </g:if> + <g:else> + Folder 'root.rps1.path' does not exist. + Set: <g:render template="/forms/updateSetting" model="[settingValue: 'root.rps1.path']"/>. + </g:else> + + + <g:if test="${!new File(OperationController.getPath('tmp.path')).exists()}"> + <br/> + Folder 'tmp.path' not found. Set: + <g:render template="/forms/updateSetting" model="[settingValue: 'tmp.path']"/> + </g:if> + + </td> + </tr> + </table> + + </div> + + <div id="subUploadInPanel"></div> + </g:if> + + + + <g:if test="${1 == 2 && OperationController.getPath('upload-cover.enabled')?.toLowerCase() == 'yes' ? true : false}"> + + <br/> + <br/> + + <b>Upload cover</b>: + <uploadr:add id="uploadCover${record.id}" + name="uploaderCover${new Date()?.format('ddMMyyyyHHmmss')}" + controller="import" action="uploadCover2" path="${coverPath}" + noSound="true" + direction="down" maxVisible="5" unsupported="${request.contextPath}/upload/warning" maxConcurrentUploads="1"> + <uploader:onSuccess> + jQuery('#subUploadInPanel').html('Cover uploaded.')//load('/pkm/generics/showSummary/' + responseJSON.id + '?entityCode=' + responseJSON.entityCode) + </uploader:onSuccess> + Upload... + </uploadr:add> + </g:if> + + + + %{-- /--}% + %{-- --}% + <g:if test="${1 == 2}"> + <g:if test="${entityCode == 'R'}"> + <br/> + <br/> + opf ${OperationController.getPath('root.rps1.path')}R/${record.type?.code}/${(record.id / 100).toInteger()}/${record.id} + <br/> + opf ${OperationController.getPath('root.rps2.path')}R/${record.type?.code}/${(record.id / 100).toInteger()}/${record.id} + </g:if> + <g:else> + <br/> + <br/> + opf ${OperationController.getPath('root.rps1.path')}${entityCode}/${record.id} + <br/> + opf ${OperationController.getPath('root.rps2.path')}${entityCode}/${record.id} + </g:else> + </g:if> + + </div> + + + </li> + diff --git a/grails-app/views/page/_settings.gsp b/grails-app/views/page/_settings.gsp old mode 100644 new mode 100755 index 5460660..16d424c --- a/grails-app/views/page/_settings.gsp +++ b/grails-app/views/page/_settings.gsp @@ -17,7 +17,11 @@ <table border="0" style="border-collapse: collapse; width: 99%"> <tr> - <td width="25%" style="width: 25%; max-width: 25%;"> <b>${it.name}</b>:</td> + <td width="25%" style="width: 25%; max-width: 25%; vertical-align: top;"> + + <b>${it.name}</b>: + + </td> <td width="75%" style=""> <g:formRemote name="saveSettings" @@ -26,9 +30,10 @@ method="post"> %{--<g:hiddenField name="sth2" value="${new java.util.Date()}"/>--}% - +Value: <g:if test="${it.allowedValues}"> <g:select name="newValue" from="${it.allowedValues?.split(',')}" value="${it.value}" + class="uk-select uk-width-auto" style="overflow: visible; z-index: 200" noSelection="${['0': '']}"/> </g:if> <g:else> @@ -38,12 +43,13 @@ placeholder="Value" class=""/> </g:else> - +Allowed values: <g:textField name="allowedValues" value="${it.allowedValues ?: 'yes,no'}" autocomplete="off" style="display: inline; direction: ltr; text-align: right; " placeholder="allowedValues" class=""/> + Description: <g:textField name="description" value="${it.description}" style="display: inline; direction: ltr; text-align: right; " placeholder="description" diff --git a/grails-app/views/page/_userInfo.gsp b/grails-app/views/page/_userInfo.gsp old mode 100644 new mode 100755 index 78cce35..c192738 --- a/grails-app/views/page/_userInfo.gsp +++ b/grails-app/views/page/_userInfo.gsp @@ -24,6 +24,30 @@ </g:formRemote> +<br/> +<br/> +<h4>New user:</h4> + +<g:formRemote name="batchAdd3" + url="[controller: 'operation', action: 'createUser']" + update="responceArea" style="display: inline" + method="post"> + +%{--<g:hiddenField name="sth2" value="${new java.util.Date()}"/>--}% + + <g:textField name="username" value="" id="speedsearch" + autocomplete="off" + style="display: inline; width: 220px !important; height: 24px; padding: 3px; margin: 1px; font-size: 11px;" + placeholder="Username" + class=""/> + + <g:submitButton name="Set" value="Create" + style="margin: 0px;" + id=" " + class="ui-widget ui-state-default"/> + +</g:formRemote> + <div id="responceArea"></div> <br/> diff --git a/grails-app/views/page/kanbanCrs.gsp b/grails-app/views/page/kanbanCrs.gsp old mode 100644 new mode 100755 index d60c186..627b943 --- a/grails-app/views/page/kanbanCrs.gsp +++ b/grails-app/views/page/kanbanCrs.gsp @@ -41,6 +41,13 @@ + <script type="text/javascript" src="${resource(dir: 'uikit-min/js', file: 'uikit.min.js')}"></script> + <script type="text/javascript" src="${resource(dir: 'uikit-min/js', file: 'uikit-icons.js')}"></script> + + <link rel="stylesheet" href="${resource(dir: 'uikit-min/css', file: 'uikit.css') }"/> + + + <link rel="stylesheet" href="${resource(dir: 'css', file: 'jquery-ui-1.8.22.custom.css')}"/> @@ -156,20 +163,27 @@ %{--</div>--}% -<div class="ui-layout-center appBkg" style="margin-top: 40px !important; margin-bottom: 5px !important; "> +<div class="ui-layout-center appBkg" style="margin-top: 10px !important; margin-bottom: 5px !important; "> %{--ToDo: display none?!--}% - <div class="ui-layout-content ui-widget-content" onmouseover="jQuery('#hintArea').html('')"> + %{--<div class="ui-layout-content" onmouseover="jQuery('#hintArea').html('')">--}% <div id="notificationArea"></div> <g:if test="${items}"> - <g:render template="/reports/dynamicKanbanTable" - model="[items: items, groups: groups, groupBy: groupBy, title:title, ssId: ssId]"/> + + %{--/reports/dynamicKanbanTable"--}% + <g:render + template="/reports/genericGrouping" + model="[items: items, groups: groups, +// reportType: reportType, + groupBy: groupBy, title:title, ssId: ssId]"/> </g:if> <g:elseif test="${ssId}"> - <g:render template="/gTemplates/recordListing" model="[ + %{--<g:render template="/gTemplates/recordListing" model="[--}% + <g:render template="/reports/genericGrouping" model="[ ssId: ssId, searchResultsTotal: searchResultsTotal, totalHits: totalHits, +// reportType: reportType, box: 1, list: list, title: title]"/> @@ -187,7 +201,7 @@ </div> - </div> + %{--</div>--}% </body> <r:layoutResources/> diff --git a/grails-app/views/page/record.gsp b/grails-app/views/page/record.gsp old mode 100644 new mode 100755 index cef463f..af4c511 --- a/grails-app/views/page/record.gsp +++ b/grails-app/views/page/record.gsp @@ -37,7 +37,16 @@ -%{-- <r:require modules="application"/>--}% + <script type="text/javascript" src="${resource(dir: 'uikit-min/js', file: 'uikit.min.js')}"></script> + <script type="text/javascript" src="${resource(dir: 'uikit-min/js', file: 'uikit-icons.js')}"></script> + + <link rel="stylesheet" href="${resource(dir: 'uikit-min/css', file: 'uikit.css') }"/> + + + + + + %{-- <r:require modules="application"/>--}% %{--<r:require module="fileuploader"/>--}% %{-- <r:require modules="jquery"/>--}% %{-- <r:require modules="jquery-ui"/>--}% diff --git a/grails-app/views/page/staticPage.gsp b/grails-app/views/page/staticPage.gsp new file mode 100755 index 0000000..d4b1caf --- /dev/null +++ b/grails-app/views/page/staticPage.gsp @@ -0,0 +1,118 @@ +%{-- + - Copyright (c) 2018. Mohamad F. Fakih (mail@khuta.org) + - + - This program is free software: you can redistribute it and/or modify + - it under the terms of the GNU General Public License as published by + - the Free Software Foundation, either version 3 of the License, or + - (at your option) any later version. + - + - This program is distributed in the hope that it will be useful, + - but WITHOUT ANY WARRANTY; without even the implied warranty of + - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + - GNU General Public License for more details. + - + - You should have received a copy of the GNU General Public License + - along with this program. If not, see <http://www.gnu.org/licenses/> + --}% + +<%@ page import="mcs.Planner; cmn.DataChangeAudit; ker.OperationController; app.Indicator; mcs.Goal; mcs.Task; mcs.Journal; mcs.Writing; app.IndexCard; mcs.Excerpt; mcs.Book; mcs.Course;" %> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + + <meta name="layout" content="main"/> + <title> + %{--${record.entityCode()}--}% + ${record?.toString()} + + %{--${record.id}--}% + + + + + + %{----}% + %{----}% + %{----}% + %{----}% + %{----}% + + + + + + + + + + + + + + + + + + + +%{----}% + %{--

    Resource page

    --}% +%{--
    --}% +%{----}% +%{----}% + %{--

    Goal page

    --}% +%{--
    --}% +%{----}% +%{----}% + %{--

    Writing page

    --}% +%{--
    --}% + + + + +%{--
    --}% + + + + + + رابط : + + + + + + + + +
    +%{--${record.author},${record.title ?: record.legacyTitle} ${record.edition} ed--}% +%{--(${record.publisher},--}% +%{--${record.publicationDate})--}% +
    + + + +%{----}% + + +
    ${raw(record.fullText?.replaceAll('\n', '
    '))} +
    +%{----}% +%{--
    ${record.notes?.replaceAll('\n', '
    ')?.decodeHTML()}
    --}% +%{--
    --}% +%{--
    --}% + %{----}% + + + + + diff --git a/grails-app/views/reports/_adHocQueryResults.gsp b/grails-app/views/reports/_adHocQueryResults.gsp old mode 100644 new mode 100755 index 35cbbe0..7964e55 --- a/grails-app/views/reports/_adHocQueryResults.gsp +++ b/grails-app/views/reports/_adHocQueryResults.gsp @@ -1,20 +1,58 @@ - -

    + +

    § ${title} -

    +

    + + +
    +

    + + + § ${title} + + + (Edit) + +

    + + + + + (${query}) + +
    + %{--
    --}% +
    + +
    + +
    +
    RTL  -
    - +
    +
    %{--
    --}% - + +
    + ${s + 1} + ${r[c].encodeAsHTML()} diff --git a/grails-app/views/reports/_ayatReport.gsp b/grails-app/views/reports/_ayatReport.gsp old mode 100644 new mode 100755 index 3d3af62..d05b3c7 --- a/grails-app/views/reports/_ayatReport.gsp +++ b/grails-app/views/reports/_ayatReport.gsp @@ -70,7 +70,7 @@
    -
    +
    @@ -205,12 +205,11 @@ %{----}%

    -
    -
    +

    diff --git a/grails-app/views/reports/_dynamicKanbanTable.gsp b/grails-app/views/reports/_dynamicKanbanTable.gsp old mode 100644 new mode 100755 index 67b1951..95e7900 --- a/grails-app/views/reports/_dynamicKanbanTable.gsp +++ b/grails-app/views/reports/_dynamicKanbanTable.gsp @@ -17,7 +17,8 @@ %{--
    --}%
    -

    ${g}

    + %{---moz-column-break-after: column !important;-moz-column-break-before: column !important;--}% +

    ${g}

    diff --git a/grails-app/views/reports/_editBoxShow.gsp b/grails-app/views/reports/_editBoxShow.gsp old mode 100644 new mode 100755 index 87b63e3..5483a8d --- a/grails-app/views/reports/_editBoxShow.gsp +++ b/grails-app/views/reports/_editBoxShow.gsp @@ -3,6 +3,17 @@

    Changed records (${OperationController.getPath('root.rps1.path') + '/edit/'})

    +
    %{--Edit folder: .--}% @@ -28,40 +39,101 @@ - +
    - +
    + + + - - - - - - - - --}% + %{----}% + + + + + - + +
    -
    -
    ${f.name}: +
    +
    - - Commit changes ↵ - -
    -
    - -
    -
    -
    + %{--
    + + + +Edits: + +
    +
    + + + Save edits ↵ + + +%{--id is ${id}--}% + %{--=== "${description?.trim().replace(/\n/, '').replace(/\r\n/, '')}"--}% +
    + + %{--
    --}% + +
    + + + +
    +
    + Database: +
    + ${l}

    @@ -70,7 +142,7 @@
    - +File:
    %{--${?.encodeAsHTML()?.replace('\n', '
    ')}--}% @@ -81,11 +153,12 @@
    - +
    diff --git a/grails-app/views/reports/_genericGrouping.gsp b/grails-app/views/reports/_genericGrouping.gsp old mode 100644 new mode 100755 index 8836e57..667f2cd --- a/grails-app/views/reports/_genericGrouping.gsp +++ b/grails-app/views/reports/_genericGrouping.gsp @@ -1,37 +1,73 @@ <%@ page import="cmn.Setting" %> -%{--

    ${title}

    --}% +

    ${title}

    %{--
    --}% -%{----}% + - %{----}% - %{--Edit--}% - %{----}% -%{----}% + + (Edit) + + + + + (${query}) + +
    + %{--
    --}% +
    + + +
    %{----}% %{--todo: add to settings--}% -
    +
    - %{--
    --}% + + %{--
    --}% %{--
    --}% %{--
    --}% -%{--
    --}% + %{----}% %{--
    --}% %{--* * *--}% %{--
    --}% @@ -42,5 +78,5 @@ %{----}% %{--
    --}% -

    ${g}

    + %{--
    --}% + %{--
    --}% + %{--
    --}% + +%{--
    --}% +%{--SSSSSSSSSSSSSSSSS--}% + + %{--todo: group also < 3 sections--}% + +

    ${g} + (${items.findAll( {it[groupBy] == g}).size()}) +

    +%{--
    --}% - + %{--count===${count}===--}% + + +
    + + + + %{--|| count == items.findAll( {it[groupBy] == g}).size() }">--}% + %{--EEEEEEEEEEEEEE--}% + %{--
    --}% +
    + + -%{--
    --}% %{--
    --}% -
    -
    + %{--
    --}% + %{--
    --}% diff --git a/grails-app/views/reports/_heartbeat.gsp b/grails-app/views/reports/_heartbeat.gsp index 70f2633..6ac8506 100755 --- a/grails-app/views/reports/_heartbeat.gsp +++ b/grails-app/views/reports/_heartbeat.gsp @@ -2,16 +2,25 @@ %{--

    Dashboard

    --}% -

    Data entry over the days

    - -
    - - - + + + -
    -

    Last 24 hours' records

    +
    + +

    Data entry over the days

    + +
    + + %{--
    --}% + + + + +
    +

    Last 24 hours' records

    ${app.IndexCard.countByDateCreatedGreaterThan(new Date() - 1)} notes
    ${mcs.Journal.countByDateCreatedGreaterThan(new Date() - 1)} journal
    @@ -21,8 +30,8 @@
    -

    Last 7 days' records

    +
    +

    Last 7 days' records

    ${IndexCard.countByDateCreatedGreaterThan(new Date() - 7)} notes
    ${Journal.countByDateCreatedGreaterThan(new Date() - 7)} journal
    @@ -36,7 +45,7 @@
    - +

    @@ -44,7 +53,7 @@ - + - - - --}% + %{----}% + %{-- - --}% + %{-- + %{----}% - - - + %{----}% + %{----}% + %{----}% @@ -119,7 +128,7 @@ / ${Course.executeQuery('from Goal e where e.course.bookmarked = true and e.bookmarked = true').size()} - uncompleted / t + uncompleted / total - - - --}% + %{----}% + %{-- - --}% + %{-- + %{----}% - + %{----}%
    1 ${Course.executeQuery('from Course where bookmarked = true').department.unique().size()} D* @@ -60,36 +69,36 @@
    E - - ${Course.executeQuery('from Excerpt e where e.book.course.bookmarked = true and e.readOn != null').size()} - / - ${Course.executeQuery('from Excerpt e where e.book.course.bookmarked = true and e.readOn = null').size()} - / - ${Course.executeQuery('from Excerpt e where e.book.course.bookmarked = true').size()} - - read/unread/total + %{--
    E--}% + %{----}% + %{--${Course.executeQuery('from Excerpt e where e.book.course.bookmarked = true and e.readOn != null').size()}--}% + %{--/--}% + %{--${Course.executeQuery('from Excerpt e where e.book.course.bookmarked = true and e.readOn = null').size()}--}% + %{--/--}% + %{--${Course.executeQuery('from Excerpt e where e.book.course.bookmarked = true').size()}--}% + %{----}% + %{--read/unread/total--}% - + %{----}% - + %{----}% - ${Course.executeQuery('select sum(e.reviewCount) from Excerpt e where e.book.course.bookmarked = true and e.readOn != null')[0]} + %{--${Course.executeQuery('select sum(e.reviewCount) from Excerpt e where e.book.course.bookmarked = true and e.readOn != null')[0]}--}% - - reviews + %{----}% + %{--reviews--}% -
    R @@ -102,10 +111,10 @@ - ${Course.executeQuery('select count(*) from Book e where e.bookmarked = true and e.course.bookmarked = true and e.completedOn != null')[0]} + ${Course.executeQuery('select count(*) from Book e where e.bookmarked = true and e.course.bookmarked = true and e.readOn != null')[0]} - read res. + read resource @@ -140,7 +149,7 @@ / ${Course.executeQuery('from Task e where e.course.bookmarked = true and e.bookmarked = true').size()} - uncompleted / t + uncompleted / total @@ -153,24 +162,24 @@
    E - - ${Course.executeQuery('select e.readOn from Excerpt e where e.book.course.bookmarked = true order by e.readOn desc')[0]?.format('dd.MM')} - - last read + %{--
    E--}% + %{----}% + %{--${Course.executeQuery('select e.readOn from Excerpt e where e.book.course.bookmarked = true order by e.readOn desc')[0]?.format('dd.MM')}--}% + %{----}% + %{--last read --}% - - - ${Course.executeQuery('select e.lastReviewed from Excerpt e where e.book.course.bookmarked = true order by e.lastReviewed desc')[0]?.format('dd.MM')} - - reviewed date + %{----}% + %{----}% + %{--${Course.executeQuery('select e.lastReviewed from Excerpt e where e.book.course.bookmarked = true order by e.lastReviewed desc')[0]?.format('dd.MM')}--}% + %{----}% + %{-- reviewed date --}% -
    N @@ -195,11 +204,45 @@
    - +
    diff --git a/grails-app/views/reports/_homepageSavedSearchesAdhoc.gsp b/grails-app/views/reports/_homepageSavedSearchesAdhoc.gsp new file mode 100755 index 0000000..948d210 --- /dev/null +++ b/grails-app/views/reports/_homepageSavedSearchesAdhoc.gsp @@ -0,0 +1,11 @@ +<%@ page import="mcs.Planner; mcs.Task; mcs.parameters.SavedSearch" %> + + + + + + + + \ No newline at end of file diff --git a/grails-app/views/reports/_homepageSavedSearchesHql.gsp b/grails-app/views/reports/_homepageSavedSearchesHql.gsp new file mode 100755 index 0000000..e150b90 --- /dev/null +++ b/grails-app/views/reports/_homepageSavedSearchesHql.gsp @@ -0,0 +1,11 @@ +<%@ page import="mcs.Planner; mcs.Task; mcs.parameters.SavedSearch" %> + + + + + + + + \ No newline at end of file diff --git a/grails-app/views/reports/_indicatorPanorama.gsp b/grails-app/views/reports/_indicatorPanorama.gsp old mode 100644 new mode 100755 index 135026e..27aa063 --- a/grails-app/views/reports/_indicatorPanorama.gsp +++ b/grails-app/views/reports/_indicatorPanorama.gsp @@ -36,12 +36,15 @@ update="${i.id}Notes" method="post"> - + - - +n -