Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
3ac02f50
Verified
Commit
3ac02f50
authored
6 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FEAT refactoring + indexes by department
parent
4b7a548f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
referential/ban/indexBan.php
+24
-16
24 additions, 16 deletions
referential/ban/indexBan.php
src/app/contact/controllers/ContactController.php
+4
-4
4 additions, 4 deletions
src/app/contact/controllers/ContactController.php
src/core/lang/lang-fr.php
+1
-1
1 addition, 1 deletion
src/core/lang/lang-fr.php
with
29 additions
and
21 deletions
referential/ban/indexBan.php
+
24
−
16
View file @
3ac02f50
<?php
require
'../../vendor/autoload.php'
;
$indexFileDirectory
=
__DIR__
.
'/indexes/'
;
$banDirectory
=
__DIR__
.
'/src/'
;
$filesBan
=
scandir
(
$banDirectory
);
if
(
!
is_dir
(
$indexFileDirectory
))
{
$index
=
Zend_Search_Lucene
::
create
(
$indexFileDirectory
);
}
else
{
if
(
isDirEmpty
(
$indexFileDirectory
))
{
$index
=
Zend_Search_Lucene
::
create
(
$indexFileDirectory
);
}
else
{
$index
=
Zend_Search_Lucene
::
open
(
$indexFileDirectory
);
}
}
$index
->
setFormatVersion
(
Zend_Search_Lucene
::
FORMAT_2_3
);
Zend_Search_Lucene_Analysis_Analyzer
::
setDefault
(
new
Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive
());
$index
->
setMaxBufferedDocs
(
1000
);
$row
=
1
;
foreach
(
$filesBan
as
$fileBan
)
{
...
...
@@ -24,6 +11,28 @@ foreach ($filesBan as $fileBan) {
echo
"
$fileBan
\n
"
;
$duplicateAddresses
=
[];
$currentCity
=
''
;
// Create Folder by department
$folderName
=
str_replace
(
"BAN_licence_gratuite_repartage_"
,
""
,
$fileBan
);
$folderName
=
str_replace
(
".csv"
,
""
,
$folderName
);
$folderName
=
__DIR__
.
'/indexes/'
.
$folderName
;
if
(
!
is_dir
(
$folderName
))
{
mkdir
(
$folderName
);
}
// if (!is_dir($folderName)) {
// $index = Zend_Search_Lucene::create($folderName);
// } else {
if
(
isDirEmpty
(
$folderName
))
{
$index
=
Zend_Search_Lucene
::
create
(
$folderName
);
}
else
{
$index
=
Zend_Search_Lucene
::
open
(
$folderName
);
}
// }
$index
->
setFormatVersion
(
Zend_Search_Lucene
::
FORMAT_2_3
);
Zend_Search_Lucene_Analysis_Analyzer
::
setDefault
(
new
Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive
());
$index
->
setMaxBufferedDocs
(
1000
);
$i
=
1
;
while
((
$data
=
fgetcsv
(
$handle
,
0
,
";"
))
!==
false
)
{
if
(
$i
==
1
)
{
...
...
@@ -60,13 +69,12 @@ foreach ($filesBan as $fileBan) {
$row
++
;
}
fclose
(
$handle
);
$index
->
commit
();
$index
->
optimize
();
}
}
echo
date
(
'c'
);
$index
->
commit
();
$index
->
optimize
();
/**
* Check if a folder is empty
* @param $dir string path of the directory to chek
...
...
This diff is collapsed.
Click to expand it.
src/app/contact/controllers/ContactController.php
+
4
−
4
View file @
3ac02f50
...
...
@@ -82,7 +82,7 @@ class ContactController
return
$response
->
withJson
([
$contact
]);
}
public
function
formatContactAddressAfnor
(
array
$aArgs
)
public
static
function
formatContactAddressAfnor
(
array
$aArgs
)
{
$formattedAddress
=
''
;
...
...
@@ -125,12 +125,12 @@ class ContactController
// $formattedAddress .= "\n";
// Ligne 6
$formattedAddress
.
=
substr
(
$aArgs
[
'address_postal_code'
]
.
' '
.
$aArgs
[
'address_town'
],
0
,
38
)
.
"
\n
"
;
$formattedAddress
.
=
substr
(
$aArgs
[
'address_postal_code'
]
.
' '
.
$aArgs
[
'address_town'
],
0
,
38
);
return
$formattedAddress
;
}
public
function
controlLengthNameAfnor
(
array
$aArgs
)
public
static
function
controlLengthNameAfnor
(
array
$aArgs
)
{
$aCivility
=
ContactController
::
getContactCivility
();
if
(
strlen
(
$aArgs
[
'title'
]
.
' '
.
$aArgs
[
'fullName'
])
>
$aArgs
[
'strMaxLength'
])
{
...
...
@@ -142,7 +142,7 @@ class ContactController
return
substr
(
$aArgs
[
'title'
]
.
' '
.
$aArgs
[
'fullName'
],
0
,
$aArgs
[
'strMaxLength'
]);
}
public
function
getContactCivility
()
public
static
function
getContactCivility
()
{
$loadedXml
=
CoreConfigModel
::
getXmlLoaded
([
'path'
=>
'apps/maarch_entreprise/xml/entreprise.xml'
]);
...
...
This diff is collapsed.
Click to expand it.
src/core/lang/lang-fr.php
+
1
−
1
View file @
3ac02f50
...
...
@@ -73,7 +73,7 @@ define('_USER_ENTITY_MODIFICATION', 'Entité modifiée pour utilisateur');
define
(
'_USER_ENTITY_SUPPRESSION'
,
'Entité supprimée pour utilisateur'
);
define
(
'_VISA_USER'
,
'Pour visa'
);
define
(
'_WRONG_FILE_TYPE'
,
'Ce type de fichier n\'est pas permis'
);
define
(
'_CAN_NOT_MOVE_IN_CHILD_ENTITY'
,
'L\'entité parente
d
e doit pas être une entité fille'
);
define
(
'_CAN_NOT_MOVE_IN_CHILD_ENTITY'
,
'L\'entité parente
n
e doit pas être
dans
une entité fille'
);
define
(
'_DOCUMENTS_LIST_WITH_ATTACHMENTS'
,
'Liste avec filtres et réponses'
);
define
(
'_DOCUMENTS_LIST_WITH_AVIS'
,
'Liste des documents avec avis'
);
...
...
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