Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vtigercrm
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Welcome to Vtiger Community. To gain access for account, please contact [ community @ vtiger.com ]
Show more breadcrumbs
Stefan Warnat
vtigercrm
Commits
aeefb5df
Commit
aeefb5df
authored
8 years ago
by
Prasad
Browse files
Options
Downloads
Patches
Plain Diff
Merged migration changes
parent
cf52a4ac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Migration/schema/650_to_660.php
+27
-0
27 additions, 0 deletions
modules/Migration/schema/650_to_660.php
wip-migration-split-create-edit-permissions.php
+0
-38
0 additions, 38 deletions
wip-migration-split-create-edit-permissions.php
with
27 additions
and
38 deletions
modules/Migration/schema/650_to_660.php
+
27
−
0
View file @
aeefb5df
...
...
@@ -11,6 +11,33 @@
if
(
defined
(
'VTIGER_UPGRADE'
))
{
global
$adb
;
$db
=
$adb
;
// Migration for - #141 - Separating Create/Edit into 2 separate Role/Profile permissions
$actionMappingResult
=
$adb
->
pquery
(
'SELECT 1 FROM vtiger_actionmapping WHERE actionname=?'
,
array
(
'CreateView'
));
if
(
!
$adb
->
num_rows
(
$actionMappingResult
))
{
$adb
->
pquery
(
'INSERT INTO vtiger_actionmapping VALUES(?, ?, ?)'
,
array
(
7
,
'CreateView'
,
0
));
}
$createActionResult
=
$adb
->
pquery
(
'SELECT * FROM vtiger_profile2standardpermissions WHERE operation=?'
,
array
(
1
));
$query
=
'INSERT INTO vtiger_profile2standardpermissions VALUES'
;
while
(
$rowData
=
$adb
->
fetch_array
(
$createActionResult
))
{
$tabId
=
$rowData
[
'tabid'
];
$profileId
=
$rowData
[
'profileid'
];
$permissions
=
$rowData
[
'permissions'
];
$query
.
=
"('
$profileId
', '
$tabId
', '7', '
$permissions
'),"
;
}
$adb
->
pquery
(
trim
(
$query
,
','
),
array
());
require_once
'modules/Users/CreateUserPrivilegeFile.php'
;
$usersResult
=
$adb
->
pquery
(
'SELECT id FROM vtiger_users'
,
array
());
$numOfRows
=
$adb
->
num_rows
(
$usersResult
);
$userIdsList
=
array
();
for
(
$i
=
0
;
$i
<
$numOfRows
;
$i
++
)
{
$userId
=
$adb
->
query_result
(
$usersResult
,
$i
,
'id'
);
createUserPrivilegesfile
(
$userId
);
}
echo
'<br>#141 - Successfully updated create and edit permissions<br>'
;
// Migration for - #117 - Convert lead field mapping NULL values and redundant rows
$phoneFieldId
=
getFieldid
(
getTabid
(
'Leads'
),
'phone'
);
$db
->
pquery
(
'UPDATE vtiger_convertleadmapping SET editable=? WHERE leadfid=?'
,
array
(
1
,
$phoneFieldId
));
...
...
This diff is collapsed.
Click to expand it.
wip-migration-split-create-edit-permissions.php
deleted
100644 → 0
+
0
−
38
View file @
cf52a4ac
<?php
/*+**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
************************************************************************************/
require_once
'include/utils/utils.php'
;
$adb
=
PearDatabase
::
getInstance
();
$actionMappingResult
=
$adb
->
pquery
(
'SELECT 1 FROM vtiger_actionmapping WHERE actionname=?'
,
array
(
'CreateView'
));
if
(
!
$adb
->
num_rows
(
$actionMappingResult
))
{
$adb
->
pquery
(
'INSERT INTO vtiger_actionmapping VALUES(?, ?, ?)'
,
array
(
7
,
'CreateView'
,
0
));
}
$createActionResult
=
$adb
->
pquery
(
'SELECT * FROM vtiger_profile2standardpermissions WHERE operation=?'
,
array
(
1
));
$query
=
'INSERT INTO vtiger_profile2standardpermissions VALUES'
;
while
(
$rowData
=
$adb
->
fetch_array
(
$createActionResult
))
{
$tabId
=
$rowData
[
'tabid'
];
$profileId
=
$rowData
[
'profileid'
];
$permissions
=
$rowData
[
'permissions'
];
$query
.
=
"('
$profileId
', '
$tabId
', '7', '
$permissions
'),"
;
}
$adb
->
pquery
(
trim
(
$query
,
','
),
array
());
require_once
'./modules/Users/CreateUserPrivilegeFile.php'
;
$usersResult
=
$adb
->
pquery
(
'SELECT id FROM vtiger_users'
,
array
());
$numOfRows
=
$adb
->
num_rows
(
$usersResult
);
$userIdsList
=
array
();
for
(
$i
=
0
;
$i
<
$numOfRows
;
$i
++
)
{
$userId
=
$adb
->
query_result
(
$usersResult
,
$i
,
'id'
);
createUserPrivilegesfile
(
$userId
);
}
echo
'<br>Successfully updated create and edit permissions<br>'
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment