csoc-de / Shifts

MIT License
30 stars 7 forks source link

usage per team #47

Open punkyard opened 1 year ago

punkyard commented 1 year ago

hi i think i understand the app creates one single shift plan for everybody in next cloud instance, as only one email admin address can be added, is this correct?

What about when we have 12 teams with different people in each, and would like to have a custom shift plan for each team?

for instance, if the admin group is not set as permitted to use this app, users/team manages can't access Shifts settings. Is this correct too?

so far I can't add a user-group, an email and save .. error: Could not save Settings one AIO v7 shift 193

thanks for the update to NC27 !!

punkyard commented 1 year ago

my logs

`[index] Error: OC\DB\Exceptions\DbalException: An exception occurred while executing a query: SQLSTATE[42803]: Grouping error: 7 ERROR: column "oc_shifts_type.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT "id", "skill_group_id" FROM "oc_shifts_type" GROUP BY... ^ at <>

  1. /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php line 295 OC\DB\Exceptions\DbalException::wrap(["Doctrine\DBAL ... "])
  2. /var/www/html/lib/public/AppFramework/Db/QBMapper.php line 335 OC\DB\QueryBuilder\QueryBuilder->executeQuery()
  3. /var/www/html/custom_apps/shifts/lib/Db/ShiftsTypeMapper.php line 74 OCP\AppFramework\Db\QBMapper->findEntities(["OC\DB\QueryBuilder\QueryBuilder"])
  4. /var/www/html/custom_apps/shifts/lib/Controller/SettingsController.php line 79 OCA\Shifts\Db\ShiftsTypeMapper->findAllSkillGroupIds()
  5. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\Shifts\Controller\SettingsController->saveSettings("", true, "lerez0", "email@mine.net", "Europe/Paris", "réz0s", "Analyst", "1", [[0,"Level 1"]])
  6. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController(["OCA\Shifts\C ... "], "saveSettings")
  7. /var/www/html/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch(["OCA\Shifts\C ... "], "saveSettings")
  8. /var/www/html/lib/private/Route/Router.php line 315 OC\AppFramework\App::main("OCA\Shifts\Co ... r", "saveSettings", ["OC\AppFramewo ... "], ["shifts.settings.saveSettings"])
  9. /var/www/html/lib/base.php line 1071 OC\Route\Router->match("/apps/shifts/settings")
  10. /var/www/html/index.php line 36 OC::handleRequest()

Caused by:

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing a query: SQLSTATE[42803]: Grouping error: 7 ERROR: column "oc_shifts_type.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT "id", "skill_group_id" FROM "oc_shifts_type" GROUP BY... ^ at <>

  1. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1814 Doctrine\DBAL\Driver\API\PostgreSQL\ExceptionConverter->convert(["Doctrine\DBAL ... "], ["Doctrine\DBAL\Query"])
  2. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1749 Doctrine\DBAL\Connection->handleDriverException(["Doctrine\DBAL ... "], ["Doctrine\DBAL\Query"])
  3. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1055 Doctrine\DBAL\Connection->convertExceptionDuringQuery(["Doctrine\DBAL ... "], "SELECT \"id\", ... "", [], [])
  4. /var/www/html/lib/private/DB/Connection.php line 262 Doctrine\DBAL\Connection->executeQuery("SELECT \"id\", ... "", [], [], null)
  5. /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php line 345 OC\DB\Connection->executeQuery("SELECT \"id\", ... "", [], [])
  6. /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php line 280 Doctrine\DBAL\Query\QueryBuilder->execute()
  7. /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php line 293 OC\DB\QueryBuilder\QueryBuilder->execute()
  8. /var/www/html/lib/public/AppFramework/Db/QBMapper.php line 335 OC\DB\QueryBuilder\QueryBuilder->executeQuery()
  9. /var/www/html/custom_apps/shifts/lib/Db/ShiftsTypeMapper.php line 74 OCP\AppFramework\Db\QBMapper->findEntities(["OC\DB\QueryBuilder\QueryBuilder"])
  10. /var/www/html/custom_apps/shifts/lib/Controller/SettingsController.php line 79 OCA\Shifts\Db\ShiftsTypeMapper->findAllSkillGroupIds()
    1. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\Shifts\Controller\SettingsController->saveSettings("", true, "lerez0", "email@myweb.test", "Europe/Paris", "réz0s", "Analyst", "1", [[0,"Level 1"]])
    2. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController(["OCA\Shifts\C ... "], "saveSettings")
    3. /var/www/html/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch(["OCA\Shifts\C ... "], "saveSettings")
    4. /var/www/html/lib/private/Route/Router.php line 315 OC\AppFramework\App::main("OCA\Shifts\Co ... r", "saveSettings", ["OC\AppFramewo ... "], ["shifts.settings.saveSettings"])
    5. /var/www/html/lib/base.php line 1071 OC\Route\Router->match("/apps/shifts/settings")
    6. /var/www/html/index.php line 36 OC::handleRequest()

Caused by:

Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[42803]: Grouping error: 7 ERROR: column "oc_shifts_type.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT "id", "skill_group_id" FROM "oc_shifts_type" GROUP BY... ^ at <>

  1. /var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php line 77 Doctrine\DBAL\Driver\PDO\Exception::new(["PDOException", ... ]])
  2. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1050 Doctrine\DBAL\Driver\PDO\Connection->query("SELECT \"id\", ... "")
  3. /var/www/html/lib/private/DB/Connection.php line 262 Doctrine\DBAL\Connection->executeQuery("SELECT \"id\", ... "", [], [], null)
  4. /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php line 345 OC\DB\Connection->executeQuery("SELECT \"id\", ... "", [], [])
  5. /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php line 280 Doctrine\DBAL\Query\QueryBuilder->execute()
  6. /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php line 293 OC\DB\QueryBuilder\QueryBuilder->execute()
  7. /var/www/html/lib/public/AppFramework/Db/QBMapper.php line 335 OC\DB\QueryBuilder\QueryBuilder->executeQuery()
  8. /var/www/html/custom_apps/shifts/lib/Db/ShiftsTypeMapper.php line 74 OCP\AppFramework\Db\QBMapper->findEntities(["OC\DB\QueryBuilder\QueryBuilder"])
  9. /var/www/html/custom_apps/shifts/lib/Controller/SettingsController.php line 79 OCA\Shifts\Db\ShiftsTypeMapper->findAllSkillGroupIds()
  10. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\Shifts\Controller\SettingsController->saveSettings("", true, "lerez0", "email@myweb.test", "Europe/Paris", "réz0s", "Analyst", "1", [[0,"Level 1"]])
    1. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController(["OCA\Shifts\C ... "], "saveSettings")
    2. /var/www/html/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch(["OCA\Shifts\C ... "], "saveSettings")
    3. /var/www/html/lib/private/Route/Router.php line 315 OC\AppFramework\App::main("OCA\Shifts\Co ... r", "saveSettings", ["OC\AppFramewo ... "], ["shifts.settings.saveSettings"])
    4. /var/www/html/lib/base.php line 1071 OC\Route\Router->match("/apps/shifts/settings")
    5. /var/www/html/index.php line 36 OC::handleRequest()

Caused by:

PDOException: SQLSTATE[42803]: Grouping error: 7 ERROR: column "oc_shifts_type.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT "id", "skill_group_id" FROM "oc_shifts_type" GROUP BY... ^ at <>

  1. /var/www/html/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php line 72 PDO->query("SELECT \"id\", ... "")
  2. /var/www/html/3rdparty/doctrine/dbal/src/Connection.php line 1050 Doctrine\DBAL\Driver\PDO\Connection->query("SELECT \"id\", ... "")
  3. /var/www/html/lib/private/DB/Connection.php line 262 Doctrine\DBAL\Connection->executeQuery("SELECT \"id\", ... "", [], [], null)
  4. /var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php line 345 OC\DB\Connection->executeQuery("SELECT \"id\", ... "", [], [])
  5. /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php line 280 Doctrine\DBAL\Query\QueryBuilder->execute()
  6. /var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php line 293 OC\DB\QueryBuilder\QueryBuilder->execute()
  7. /var/www/html/lib/public/AppFramework/Db/QBMapper.php line 335 OC\DB\QueryBuilder\QueryBuilder->executeQuery()
  8. /var/www/html/custom_apps/shifts/lib/Db/ShiftsTypeMapper.php line 74 OCP\AppFramework\Db\QBMapper->findEntities(["OC\DB\QueryBuilder\QueryBuilder"])
  9. /var/www/html/custom_apps/shifts/lib/Controller/SettingsController.php line 79 OCA\Shifts\Db\ShiftsTypeMapper->findAllSkillGroupIds()
  10. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\Shifts\Controller\SettingsController->saveSettings("", true, "lerez0", "email@myweb.test", "Europe/Paris", "réz0s", "Analyst", "1", [[0,"Level 1"]])
    1. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController(["OCA\Shifts\C ... "], "saveSettings")
    2. /var/www/html/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch(["OCA\Shifts\C ... "], "saveSettings")
    3. /var/www/html/lib/private/Route/Router.php line 315 OC\AppFramework\App::main("OCA\Shifts\Co ... r", "saveSettings", ["OC\AppFramewo ... "], ["shifts.settings.saveSettings"])
    4. /var/www/html/lib/base.php line 1071 OC\Route\Router->match("/apps/shifts/settings")
    5. /var/www/html/index.php line 36 OC::handleRequest()

PUT /apps/shifts/settings from 185.252.235.96 by lerez0 at 2023-09-03T22:59:01+00:00`

punkyard commented 1 year ago

in fact, the search function does not work in the config page in admin settings

csoc-kevink commented 1 year ago

Hi @punkyard,

yes, currently there is only one plan for everybody. Multiple plans for differen groups would be a nice feature. I've added it to our todo. I think we will implement this feature together with the refactored backend since the current structure of the backend (and frontend) do not allow such a feature.

The admin settings are only accessible for Nextcloud-Admins, regardless of your shifts app user status. For the new feature it would be good when the shift admins can create new plans.

I think you have the same issue as described in #45 A quick fix will be to remove 'only_full_group_by' from your SQL_MODE (SHOW VARIABLES LIKE 'sql_mode').