Skip to content
Snippets Groups Projects
Commit c7c884a8 authored by Andreas Schindlbeck's avatar Andreas Schindlbeck
Browse files

#1063997 Favorites: Filter offer by favorites

parent 70ff8a85
No related branches found
No related tags found
No related merge requests found
......@@ -1308,6 +1308,14 @@
<filterConditionProcess>%aditoprj%/entity/Offer_entity/recordcontainers/db/filterextensions/attribute_filter/filterConditionProcess.js</filterConditionProcess>
<filtertype>BASIC</filtertype>
</filterExtensionSet>
<filterExtension>
<name>Favorite_filter</name>
<title>Favoritegroup</title>
<contentType>TEXT</contentType>
<filterValuesProcess>%aditoprj%/entity/Offer_entity/recordcontainers/db/filterextensions/favorite_filter/filterValuesProcess.js</filterValuesProcess>
<filterConditionProcess>%aditoprj%/entity/Offer_entity/recordcontainers/db/filterextensions/favorite_filter/filterConditionProcess.js</filterConditionProcess>
<filtertype>BASIC</filtertype>
</filterExtension>
</filterExtensions>
</dbRecordContainer>
<indexRecordContainer>
......
import("Favorites_lib");
import("system.result");
import("Sql_lib");
var favoFilterCond = newWhere();
var rowIds = FavoritesUtil.getRowIdsOfFavoriteGroup();
for(i = 0; i < rowIds.length; i++)
favoFilterCond.or("OFFER.OFFERID", rowIds[i], SqlBuilder.EQUAL());
result.string(favoFilterCond.toString());
\ No newline at end of file
import("system.result");
import("Favorites_lib");
result.object(FavoritesUtil.getUserNotificationGroups());
......@@ -7,13 +7,13 @@ var rowIds = FavoritesUtil.getRowIdsOfFavoriteGroup();
for(i = 0; i < rowIds.length; i++)
{
var orga_id = new SqlBuilder().select("CONTACT.PERSON_ID")
var orga_id = new SqlBuilder().select("CONTACT.ORGANISATION_ID")
.from("CONTACT")
.where(newWhere("CONTACT.CONTACTID", rowIds[i]))
.arrayColumn();
if(orga_id.length > 0)
favoFilterCond.or("PERSON.PERSONID", orga_id[0], SqlBuilder.EQUAL());
favoFilterCond.or("ORGANISATION.ORGANISATIONID", orga_id[0], SqlBuilder.EQUAL());
}
result.string(favoFilterCond.toString());
\ No newline at end of file
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