Skip to content
Snippets Groups Projects
Verified Commit f051432b authored by Damien's avatar Damien
Browse files

Export get copies

parent 5f478a37
No related branches found
No related tags found
No related merge requests found
...@@ -73,7 +73,6 @@ For developper : ...@@ -73,7 +73,6 @@ For developper :
<value>chr_by_category</value> <value>chr_by_category</value>
</ELEMENT> </ELEMENT>
</CHRONO> </CHRONO>
<CHRONO> <CHRONO>
<id>outgoing</id> <id>outgoing</id>
<separator></separator> <separator></separator>
...@@ -98,24 +97,6 @@ For developper : ...@@ -98,24 +97,6 @@ For developper :
<value>chr_by_category</value> <value>chr_by_category</value>
</ELEMENT> </ELEMENT>
</CHRONO> </CHRONO>
<CHRONO>
<id>market_document</id>
<separator>/</separator>
<ELEMENT>
<type>text</type>
<value>market</value>
</ELEMENT>
<ELEMENT>
<type>date</type>
<value>full_date</value>
</ELEMENT>
<ELEMENT>
<type>maarch_functions</type>
<value>chr_by_category</value>
</ELEMENT>
</CHRONO>
<CHRONO> <CHRONO>
<id>internal</id> <id>internal</id>
<separator>/</separator> <separator>/</separator>
...@@ -132,5 +113,4 @@ For developper : ...@@ -132,5 +113,4 @@ For developper :
<value>chr_by_category</value> <value>chr_by_category</value>
</ELEMENT> </ELEMENT>
</CHRONO> </CHRONO>
</root> </root>
...@@ -111,7 +111,7 @@ foreach ($customs as $custom) { ...@@ -111,7 +111,7 @@ foreach ($customs as $custom) {
} elseif ($functionName == 'get_priority') { } elseif ($functionName == 'get_priority') {
$functionName = 'getPriority'; $functionName = 'getPriority';
} elseif ($functionName == 'retrieve_copies') { } elseif ($functionName == 'retrieve_copies') {
$functionName = 'getCopyEntities'; $functionName = 'getCopies';
} elseif ($functionName == 'makeLink_detail') { } elseif ($functionName == 'makeLink_detail') {
$functionName = 'getDetailLink'; $functionName = 'getDetailLink';
} elseif ($functionName == 'get_parent_folder') { } elseif ($functionName == 'get_parent_folder') {
......
...@@ -191,8 +191,8 @@ class ExportController ...@@ -191,8 +191,8 @@ class ExportController
$csvContent[] = $resource['status.label_status']; $csvContent[] = $resource['status.label_status'];
} elseif ($value['value'] == 'getPriority') { } elseif ($value['value'] == 'getPriority') {
$csvContent[] = $resource['priorities.label']; $csvContent[] = $resource['priorities.label'];
} elseif ($value['value'] == 'getCopyEntities') { } elseif ($value['value'] == 'getCopies') {
$csvContent[] = ExportController::getCopyEntities(['resId' => $resource['res_id']]); $csvContent[] = ExportController::getCopies(['resId' => $resource['res_id']]);
} elseif ($value['value'] == 'getDetailLink') { } elseif ($value['value'] == 'getDetailLink') {
$csvContent[] = str_replace('rest/', "apps/maarch_entreprise/index.php?page=details&dir=indexing_searching&id={$resource['res_id']}", \Url::coreurl()); $csvContent[] = str_replace('rest/', "apps/maarch_entreprise/index.php?page=details&dir=indexing_searching&id={$resource['res_id']}", \Url::coreurl());
} elseif ($value['value'] == 'getParentFolder') { } elseif ($value['value'] == 'getParentFolder') {
...@@ -241,27 +241,31 @@ class ExportController ...@@ -241,27 +241,31 @@ class ExportController
return $response->withHeader('Content-Type', 'application/vnd.ms-excel'); return $response->withHeader('Content-Type', 'application/vnd.ms-excel');
} }
private static function getCopyEntities(array $args) private static function getCopies(array $args)
{ {
ValidatorModel::notEmpty($args, ['resId']); ValidatorModel::notEmpty($args, ['resId']);
ValidatorModel::intVal($args, ['resId']); ValidatorModel::intVal($args, ['resId']);
$listInstances = ListInstanceModel::get([ $listInstances = ListInstanceModel::get([
'select' => ['item_id'], 'select' => ['item_id', 'item_type'],
'where' => ['res_id = ?', 'item_type = ?', 'item_mode = ?'], 'where' => ['res_id = ?', 'difflist_type = ?', 'item_mode = ?'],
'data' => [$args['resId'], 'entity_id', 'cc'] 'data' => [$args['resId'], 'entity_id', 'cc']
]); ]);
$copyEntities = ''; $copies = '';
foreach ($listInstances as $listInstance) { foreach ($listInstances as $listInstance) {
$entity = EntityModel::getByEntityId(['entityId' => $listInstance['item_id'], 'select' => ['short_label']]);
if (!empty($copyEntities)) { if (!empty($copyEntities)) {
$copyEntities .= ' ; '; $copies .= ' ; ';
}
if ($listInstance['item_type'] == 'user_id') {
$copies .= UserModel::getLabelledUserById(['login' => $listInstance['item_id']]);
} elseif ($listInstance['item_type'] == 'entity_id') {
$entity = EntityModel::getByEntityId(['entityId' => $listInstance['item_id'], 'select' => ['short_label']]);
$copies .= $entity['short_label'];
} }
$copyEntities .= $entity['short_label'];
} }
return $copyEntities; return $copies;
} }
private static function getTags(array $args) private static function getTags(array $args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment