Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SinergiaCRM 1.7.0 Release merge #404

Merged
merged 24 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e7b7eb5
Hotfix - General - No permitr edición en campos que no son de texto d…
jordiSTIC Sep 20, 2024
7e5a488
Feature - Subvenciones - Subvenciones grupales (#39)
jordiSTIC Sep 20, 2024
d7979b0
Hotfix - Calendario laboral - Mostrar el resumen por usuario de todo…
ManuSinergiaCRM Sep 20, 2024
9ca04e6
Hotfix - Calendario laboral - Calcular nombre en actualización masiva…
ManuSinergiaCRM Sep 20, 2024
435a799
Enhancement - General - Incluir version del repositorio en el readme …
PaulaaSTIC Sep 20, 2024
7ec708a
Hotfix - Plantillas PDF - No aplicar configuración TinyMCE en vista d…
ManuSinergiaCRM Sep 20, 2024
25579bf
Improvement - Formularios Web - Inclusión de nombre y apellidos del p…
jordiSTIC Sep 20, 2024
bec648c
Enhancement - Traducciones - Traducciones de Galego 1.6.2 (#368)
jordiSTIC Sep 20, 2024
9584033
Hotfix - Formularios Web - Eliminar información no necesaria en formu…
jordiSTIC Sep 20, 2024
75df0f0
Hotfix - Correo - No se muestra el valor del campo De: en la vista de…
ManuSinergiaCRM Sep 20, 2024
2e54ff0
Hotfix - General - Usar el delimitador de decimales configurado en ca…
ManuSinergiaCRM Sep 20, 2024
83bda77
Hotfix - Campañas - Cargar información relacionada a la cuenta de ent…
ManuSinergiaCRM Sep 20, 2024
b1e73fe
Enhacement - Registro horario - Mostrar el botón aunque el usuario no…
ManuSinergiaCRM Sep 23, 2024
e4d7389
Hotfix - Administración - Mostrar editor enriquecido de HTML tras Clo…
ManuSinergiaCRM Sep 23, 2024
c522b66
Hotfix - Grupos de Seguridad - Índice para consultas de roles a parti…
enricsinergia Sep 23, 2024
79331e0
Enhancement - Encuestas - Mensaje agradecimiento en el idioma selecci…
ainaraRT Sep 23, 2024
6a0e587
Hotfix - General - Ver nombre de fichero en vista de lista de un módu…
ManuSinergiaCRM Sep 24, 2024
be8a252
Enhancement - SinergiaDA - Algunas mejoras (#373)
juanSTIC Sep 24, 2024
f211a4f
Feature - Subvenciones - Alerta nuevas convocatorias (Notificaciones)…
jordiSTIC Sep 24, 2024
39d8b18
Enhancement - Calendario laboral - Encadenar creaciones periódicas si…
ManuSinergiaCRM Sep 24, 2024
ada1e24
Hotfix - Calendario de recursos - Evitar la regeneración de ficheros …
AlbertoSTIC Sep 25, 2024
1c9ab3e
Improvement - Plantillas PDF - Añadir PR Id en comentario (#398)
ManuSinergiaCRM Sep 25, 2024
08201fb
Hotfix - Notificaciones - Mostrar panel notificaciones aunque se pers…
AlbertoSTIC Sep 25, 2024
41e7eb1
SinergiaCRM 1.7.0 Release (#403)
jordiSTIC Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<img width="180px" height="60px" src="https://github.com/SinergiaTIC/SinergiaCRM-SuiteCRM/assets/125350097/af3300d0-1b17-427c-b681-1971d39a1528" align="right" />
</a>

# SinergiaCRM 1.1.0
# SinergiaCRM

![Version (latest by date)](https://img.shields.io/github/v/release/SinergiaTIC/SinergiaCRM?label=Version)
[![Wiki](https://img.shields.io/badge/Information-Wiki-lightgray)](https://wikisuite.sinergiacrm.org)
[![LICENSE](https://img.shields.io/badge/License-AGPL_v3-orange.svg)](./LICENSE.txt)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5)](https://twitter.com/SinergiaCRM)
Expand Down
39 changes: 23 additions & 16 deletions SticInclude/SinergiaDA.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,14 @@ public function createViews($callUpdateModel = true, $rebuildFilter = 'all')
// add column to index list
$indexesToCreate[] = "{$fieldV['id_name']}";

//Add relate record name
if (in_array($fieldV['module'], ['Contacts', 'Leads'])) {
//Add relate record name
if (in_array($fieldV['module'], ['Contacts', 'Leads']) || (Beanfactory::newBean($fieldV['module'])->field_defs['last_name']) && $fieldV['module'] != 'Users') {
$relatedName = " concat_ws(' ', {$leftJoinAlias}.first_name, {$leftJoinAlias}.last_name) ";
} elseif ($fieldV['module'] == 'Users') {
$relatedName = "{$leftJoinAlias}.user_name";
} else { $relatedName = "{$leftJoinAlias}.name";}
} else {
$relatedName = "{$leftJoinAlias}.name";
}

$fieldSrc .= " IFNULL($relatedName,'') AS {$fieldV['name']}";

Expand Down Expand Up @@ -1727,9 +1729,8 @@ public function getAndSaveUserACL($modules)

// Get list of active users
$res = $db->query("SELECT id,user_name, is_admin FROM users join users_cstm on users.id = users_cstm.id_c WHERE status='Active' AND deleted=0 AND sda_allowed_c=1;");

while ($u = $db->fetchByAssoc($res, false)) {

while ($u = $db->fetchByAssoc($res, false)) {
$allModulesACL = array_intersect_key(ACLAction::getUserActions($u['id'], true), $modules);
foreach ($allModulesACL as $key => $value) {
unset($aclSource);
Expand Down Expand Up @@ -1771,11 +1772,11 @@ public function getAndSaveUserACL($modules)
$userGroupsRes = $db->query("SELECT distinct(name) as 'group' FROM sda_def_user_groups ug WHERE user_name='{$u['user_name']}';");

while ($userGroups = $db->fetchByAssoc($userGroupsRes, false)) {

$crmGroupName = explode('SDA_', $userGroups['group'])[1];

// Verify whether or not the group has access to the module for their roles
$groupHasAccessToModule = groupHasAccess($crmGroupName, $key, 'view');
// Verify whether or not the group or user has access to the module for their roles
$groupHasAccessToModule = groupHasAccess($crmGroupName, $u['id'], $key, 'view');

if ($groupHasAccessToModule) {

Expand All @@ -1788,7 +1789,7 @@ public function getAndSaveUserACL($modules)
'global' => 0,
];

// Additionally we insert a record that allows each user's access to the records in which coinicide
// Additionally we insert a record that allows each user's access to the records in which match
// the user_name with the assigned_user_name field content in each module in which the user has group permission
$userModuleAccessMode["{$u['user_name']}_{$aclSource}_{$userGroups['group']}_private_{$currentTable}"] = [
'user_name' => $u['user_name'],
Expand Down Expand Up @@ -1946,13 +1947,14 @@ public function checkSdaTablesInViews()
}

/**
* Checks if a security group has access to a specific action in a given module.
* Checks if a security group or user has access to a specific action in a given module.
*
* This function determines whether a security group, identified by its name, has the necessary
* This function determines whether a security group, identified by its name, or an user, identified by its id has the necessary
* permissions to perform a specific action in a given module. It looks up the roles associated
* with the group and checks the highest access levels available for those roles.
* with the group or user and checks the highest access levels available for those roles.
*
* @param string $group_name The name of the security group to check.
* @param string $userId The id of the user to check.
* @param string $category The name of the module or category (e.g., 'Accounts', 'Contacts').
* @param string $action The specific action to check (e.g., 'view', 'edit', 'delete').
* @param string $type The type of ACL, defaults to 'module'.
Expand All @@ -1963,7 +1965,7 @@ public function checkSdaTablesInViews()
*
* @throws SQLException If there's an error in executing the SQL queries.
*/
function groupHasAccess($group_name, $category, $action, $type = 'module')
function groupHasAccess($group_name, $userId, $category, $action, $type = 'module')
{
global $db;

Expand All @@ -1981,9 +1983,14 @@ function groupHasAccess($group_name, $category, $action, $type = 'module')

$group_id = $row['id'];

// Get the roles associated with this security group
$query = "SELECT role_id FROM securitygroups_acl_roles
WHERE securitygroup_id = '$group_id' AND deleted = 0";
// Get the roles associated with this security group or user
$query = "SELECT role_id FROM (
SELECT role_id FROM securitygroups_acl_roles
WHERE securitygroup_id = '$group_id' AND deleted = 0
UNION SELECT role_id from acl_roles_users aru
WHERE aru.user_id='$userId' AND deleted=false ) m
LIMIT 1
";
$result = $db->query($query);

$roles = array();
Expand Down
8 changes: 8 additions & 0 deletions SticInclude/js/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ function setEnabledStatus(elementId, clearField) {
} else {
$("#" + elementId, $form)
.prop("readonly", false);
$("#" + elementId, $form)
.prop("disabled", false);
$("#" + elementId, $form).parent().find("button")
.prop("disabled", false);
}
$("#" + elementId, $form)
.closest(".edit-view-row-item")
Expand Down Expand Up @@ -313,6 +317,10 @@ function setDisabledStatus(elementId, clearField) {
} else {
$("#" + elementId, $form)
.prop("readonly", true);
$("#" + elementId, $form)
.prop("disabled", true);
$("#" + elementId, $form).parent().find("button")
.prop("disabled", true);
}
$("#" + elementId, $form)
.closest(".edit-view-row-item")
Expand Down
5 changes: 4 additions & 1 deletion SticInstall/sql/ca/EmailTemplates.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ DELETE FROM email_templates;

INSERT INTO `email_templates` (`id`, `date_entered`, `date_modified`, `modified_user_id`, `created_by`, `published`, `name`, `description`, `subject`, `body`, `body_html`, `deleted`, `assigned_user_id`, `text_only`, `type`) VALUES
('d3b49c38-eeba-b910-2590-5b4069caaac1', NOW(), NOW(), '1', '1', NULL, 'Exemple - Donació', 'Exemple de plantilla de correu electrònic per confirmar i agrair una donació', 'Gràcies per la teva donació!', 'Benvolgut/da $contact_first_name $contact_last_name:\r\n\r\nHem rebut la teva donació de $stic_payments_amount €.\r\n\r\nMoltes gràcies pel teu suport!\r\n\r\n', '<p>Benvolgut/da $contact_first_name $contact_last_name:</p>\n<p>Hem rebut la teva donació de $stic_payments_amount €.</p>\n<p>Moltes gràcies pel teu suport!</p>', 0, '1', 0, 'email'),
('dba65685-d26f-6ecd-802c-5b406983c9b5', NOW(), NOW(), '1', '1', NULL, 'Exemple - Inscripció', 'Exemple de plantilla de correu electrònic per confirmar la inscripció a un esdeveniment', '$stic_events_name: Inscripció confirmada', 'Benvolgut/da $contact_first_name $contact_last_name:\r\n\r\nHem rebut la teva inscripció a $stic_events_name.\r\n\r\nA dia $stic_registrations_registration_date la teva inscripció consta com a $stic_registrations_status.\r\n\r\nEns veiem el $stic_events_start_date!', '<p>Benvolgut/da $contact_first_name $contact_last_name:</p>\n<p>Hem rebut la teva inscripció a $stic_events_name.</p>\n<p>A dia $stic_registrations_registration_date la teva tu inscripció consta com a $stic_registrations_status.</p>\n<p>Ens veiem el $stic_events_start_date!</p>', 0, '1', 0, 'email');
('dba65685-d26f-6ecd-802c-5b406983c9b5', NOW(), NOW(), '1', '1', NULL, 'Exemple - Inscripció', 'Exemple de plantilla de correu electrònic per confirmar la inscripció a un esdeveniment', '$stic_events_name: Inscripció confirmada', 'Benvolgut/da $contact_first_name $contact_last_name:\r\n\r\nHem rebut la teva inscripció a $stic_events_name.\r\n\r\nA dia $stic_registrations_registration_date la teva inscripció consta com a $stic_registrations_status.\r\n\r\nEns veiem el $stic_events_start_date!', '<p>Benvolgut/da $contact_first_name $contact_last_name:</p>\n<p>Hem rebut la teva inscripció a $stic_events_name.</p>\n<p>A dia $stic_registrations_registration_date la teva tu inscripció consta com a $stic_registrations_status.</p>\n<p>Ens veiem el $stic_events_start_date!</p>', 0, '1', 0, 'email'),
('52cdc554-bd90-f8f9-e2e0-66d718ae8fe9', NOW(), NOW(), '1', '1', NULL, 'Exemple - Nova subvenció', 'Exemple de plantilla de correu electrònic per notificar la convocatòria d''una nova subvenció', 'Nova convocatòria de subvenció: $opportunity_name', 'Nova convocatòria de subvenció: $opportunity_name\r\n\r\n$opportunity_stic_additional_information_c\r\nPodeu trobar més informació a: $opportunity_stic_opportunity_url_c', '<p>Nova convocatòria de subvenció: $opportunity_name</p><p></p><p>$opportunity_stic_additional_information_c</p><p>Podeu trobar més informació a: $opportunity_stic_opportunity_url_c</p>', 0, '1', 0, 'notification'),
('9f118e85-13f2-baa9-4ee3-66d80c674dea', NOW(), NOW(), '1', '1', NULL, 'Exemple - Nou esdeveniment', 'Exemple de plantilla de correu electrònic per notificar un nou esdeveniment', 'Nou esdeveniment: $stic_events_name', '$stic_events_name\r\n\r\nData d''inici: $stic_events_start_date\r\nData de finalització: $stic_events_end_date\r\nUbicació: $stic_events_stic_events_fp_event_locations_name', '<p>$stic_events_name</p><p></p><p>Data d''inici: $stic_events_start_date</p><p>Data de finalització: $stic_events_end_date</p><p>Ubicació: $stic_events_stic_events_fp_event_locations_name</p>', 0, '1', 0, 'notification');


-- SuiteCRM Base: Exemples de plantilles de correu electrònic

Expand Down
7 changes: 7 additions & 0 deletions SticInstall/sql/common/FieldsMetadata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ INSERT INTO `fields_meta_data` (`id`, `custom_module`, `name`) VALUES
('Accountsinc_state_c', 'Accounts', 'inc_state_c'),
('Accountsinc_municipality_c', 'Accounts', 'inc_municipality_c'),
('Accountsinc_town_c', 'Accounts', 'inc_town_c'),
-- Campaigns
('Campaignsparent_id', 'Campaigns', 'parent_id'),
('Campaignsparent_name', 'Campaigns', 'parent_name'),
('Campaignsparent_type', 'Campaigns', 'parent_type'),
('Campaignsstic_notification_prospect_list_names_c', 'Campaigns', 'stic_notification_prospect_list_names_c'),
-- Contacts
('Contactsstic_acquisition_channel_c', 'Contacts', 'stic_acquisition_channel_c'),
('Contactsstic_age_c', 'Contacts', 'stic_age_c'),
Expand Down Expand Up @@ -187,6 +192,8 @@ INSERT INTO `fields_meta_data` (`id`, `custom_module`, `name`) VALUES
('Opportunitiesstic_resolution_date_c', 'Opportunities', 'stic_resolution_date_c'),
('Opportunitiesstic_status_c', 'Opportunities', 'stic_status_c'),
('Opportunitiesstic_type_c', 'Opportunities', 'stic_type_c'),
('Opportunitiesstic_opportunity_url_c', 'Opportunities', 'stic_opportunity_url_c'),
('Opportunitiesstic_additional_information_c', 'Opportunities', 'stic_additional_information_c'),
-- FP_Event_Locations
('FP_Event_Locationsstic_address_county_c','FP_Event_Locations','stic_address_county_c'),
('FP_Event_Locationsstic_address_region_c','FP_Event_Locations','stic_address_region_c'),
Expand Down
Loading
Loading