<%@ Page Language="C#" Buffer="true" CodeFile="gestion_entreprises.aspx.cs" Inherits="_gestion_entreprises" CodePage="65001" UICulture="fr" Culture="fr-FR" ValidateRequest="false" %> <%@ Import Namespace="ItlRuntime" %> <%@ Import Namespace="System.Collections.Generic" %> <%@ Import Namespace="System.Linq" %> <% EC.linkableClassMap = (Map) EC.newMap(new Map() , "ocsNewsEvent:news", new ClassLink("./page00013329.aspx?card=object", "linkTable.aspx?GID=00013329&card=object", "Actualité")); %><% EC.imageProviderUrl = "./imageProvider.aspx"; %><% EC.albumDialogUrl = "./albumDialog.aspx"; %><% EC.albumPrivateDialogUrl = "./albumPrivateDialog.aspx"; %><% string mode = (string) ((string)EC.itl.getParameterValue("string", "mode", "list")); string action = (string) ((string)EC.itl.getParameterValue("string", "action", "")); int? statusFilter = (int?) ((int?)EC.itl.getParameterValue("integer", "statusFilter", -1)); string searchFilter = (string) ((string)EC.itl.getParameterValue("string", "searchFilter")); string logComment = (string) ((string)EC.itl.getParameterValue("string", "logComment")); string creatorFilter = (string) ((string)EC.itl.getParameterValue("string", "creatorFilter")); string ocsNotificationForActionMessage = (string) ((string)EC.itl.getParameterValue("string", "ocsNotificationForActionMessage")); string ocsNotificationForInfoMessage = (string) ((string)EC.itl.getParameterValue("string", "ocsNotificationForInfoMessage")); SqlObject card = (SqlObject) (new SqlObject("ocsCol:association", @"SELECT this.`_oid` AS this FROM ocsCol_association AS this INNER JOIN ocs_card AS this_z On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` = #V_0&;)", new Map("#V_0&;|integer", EC.itl.toInteger(EC.itl.getParameterValue("object:ocsCol:association", "card"))),true)); %> " /> Entreprises

Annuaires

<% if (EC.currentUser != null) { EC.Page.Response.Write(EC.itl.login()); EC.Page.Response.Write(" "); } { DateTime date = DateTime.Now; EC.Page.Response.Write(EC.itl.formatTimestamp(date, "date")); EC.Page.Response.Write(" "); EC.Page.Response.Write(EC.itl.formatTimestamp(date, "hours")); } %>


  • Accueil
  • <% if(ItlRuntime.XRM.AuthorizeUtils.isAllowed("00000000")) { %>
  • Associations
  • <% } else { %><% } %><% if(ItlRuntime.XRM.AuthorizeUtils.isAllowed("00000000")) { %>
  • Commerces
  • <% } else { %><% } %><% if(ItlRuntime.XRM.AuthorizeUtils.isAllowed("00000000")) { %>
  • Entreprises
  • <% } else { %><% } %><% if(ItlRuntime.XRM.AuthorizeUtils.isAllowed("00000000")) { %>
  • Hébergement
  • <% } else { %><% } %><% if(ItlRuntime.XRM.AuthorizeUtils.isAllowed("00000000")) { %>
  • Restauration
  • <% } else { %><% } %>
 
<% string mode__1 = (string) ((string)EC.itl.getParameterValue("string", "mode", "list")); string cmd = (string) ((string)EC.itl.getParameterValue("string", "cmd")); string oids = (string) ((string)EC.itl.getParameterValue("string", "oids")); int? newStatus = (int?) ((int?)EC.itl.getParameterValue("integer", "newStatus")); string action__1 = (string) ((string)EC.itl.getParameterValue("string", "action", "")); string cardType = (string) ((string)EC.itl.getParameterValue("string", "cardType", "current")); int? statusFilter__1 = (int?) ((int?)EC.itl.getParameterValue("integer", "statusFilter", -1)); string searchFilter__1 = (string) ((string)EC.itl.getParameterValue("string", "searchFilter", "")); string logComment__1 = (string) ((string)EC.itl.getParameterValue("string", "logComment")); string creatorFilter__1 = (string) ((string)EC.itl.getParameterValue("string", "creatorFilter", "")); string ocsNotificationForActionMessage__1 = (string) ((string)EC.itl.getParameterValue("string", "ocsNotificationForActionMessage")); string ocsNotificationForInfoMessage__1 = (string) ((string)EC.itl.getParameterValue("string", "ocsNotificationForInfoMessage")); string ocsNotificationForActionMailSubject = (string) ((string)EC.itl.getParameterValue("string", "ocsNotificationForActionMailSubject")); string ocsNotificationForInfoMailSubject = (string) ((string)EC.itl.getParameterValue("string", "ocsNotificationForInfoMailSubject")); SqlObject card__1 = (SqlObject) (new SqlObject("ocsCol:association", @"SELECT this.`_oid` AS this, this_z_s_ocsCatalog.`_oid` AS this_z_s_ocsCatalog, #V_1&; AS this_z_x_ocsVisibility_masks, this_s_image.`_oid` AS this_s_image, this.title AS this_p_title, this.creationDate AS this_p_creationDate, this.object AS this_p_object, this.headOffice AS this_p_headOffice, this.person_in_charge AS this_p_person_in_charge, this.person_title AS this_p_person_title, this.address AS this_p_address, this.contact AS this_p_contact, this.phoneNumber AS this_p_phoneNumber, this.mobilePhone AS this_p_mobilePhone, this.fax AS this_p_fax, this.email AS this_p_email, this.website AS this_p_website, this.comment AS this_p_comment, this_s_image.width AS this_s_image_p_width, this_s_image.height AS this_s_image_p_height, this_s_image.frames AS this_s_image_p_frames, this_s_image_z.urlDir AS this_s_image_z_p_urlDir, this_s_image_z.filename AS this_s_image_z_p_filename, this_s_image_z.extension AS this_s_image_z_p_extension, this_s_image_z.filesize AS this_s_image_z_p_filesize, this_s_image_z.filedate AS this_s_image_z_p_filedate, this_s_image_z.label_fr AS this_s_image_z_p_label_fr, this_s_image_z.description_fr AS this_s_image_z_p_description_fr, this_z.ocsStatus AS this_z_p_ocsStatus, this_z.ocsCreationDate AS this_z_p_ocsCreationDate, this_z.ocsCreationLogin AS this_z_p_ocsCreationLogin, this_z.ocsModificationDate AS this_z_p_ocsModificationDate, this_z.ocsModificationLogin AS this_z_p_ocsModificationLogin, this_z_s_ocsCatalog.useValidation AS this_z_s_ocsCatalog_p_useValidation, this_z_s_ocsCatalog.editRightsMode AS this_z_s_ocsCatalog_p_editRightsMode FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> '')) LEFT JOIN xrm_object_mask_view AS this_z_x_ocsVisibility On ((this_z_x_ocsVisibility.verb = 'ocsVisibility') AND (this_z_x_ocsVisibility.objectOID = this_z.`_oid`))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) LEFT JOIN (alb_image AS this_s_image INNER JOIN alb_resource AS this_s_image_z On ((this_s_image.`_oid` = this_s_image_z.`_oid`) AND (this_s_image_z.iso_sid <> ''))) On ((this.image = this_s_image.`_oid`) AND (this_s_image.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` = #V_0&;)", new Map("#V_0&;|integer", EC.itl.toInteger(EC.itl.getParameterValue("object:ocsCol:association", "card")), "#V_1&;|xrmMasks", EC.sqlEngine.generateXrmFilterGids("this_z_x_ocsVisibility")),true)); SqlObject catalogObject = (SqlObject) (new SqlObject("ocs:catalog", @"SELECT this.`_oid` AS this, this.useValidation AS this_p_useValidation, this.useXRM AS this_p_useXRM, this.editRightsMode AS this_p_editRightsMode FROM ocs_catalog AS this WHERE (this.iso_sid <> '') AND (this.name = 'entreprises')", new Map(),false)); bool useValidation = (bool) (ITL.b((bool?)catalogObject.get("this_p_useValidation"))); bool hasNewCardRight = (bool) (EC.itl.toInteger(new SqlCollection("xrm:category", @"SELECT COUNT(DISTINCT this.data) AS result FROM (SELECT c0.`_oid` AS origin, this.label_fr AS this_p_label_fr, this.`_oid` AS this, this.`_oid` AS data FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '') AND (c0.`_oid` = #V_0&;))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;))) AS this", new Map("#V_0&;|integer", (int?)catalogObject.get("this"), "#V_1&;|oids", EC.itl.categoryOids(true)), (List) EC.newList(new List(), "this_p_label_fr")).get("result")) > 0); bool? hasValidateRight = (bool?) (ITL.b(useValidation)?EC.itl.toInteger(new SqlCollection("xrm:category", @"SELECT COUNT(DISTINCT this.data) AS result FROM (SELECT c0.`_oid` AS origin, this.label_fr AS this_p_label_fr, this.`_oid` AS this, this.`_oid` AS data FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '') AND (c0.`_oid` = #V_0&;))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;))) AS this", new Map("#V_0&;|integer", (int?)catalogObject.get("this"), "#V_1&;|oids", EC.itl.categoryOids(true)), (List) EC.newList(new List(), "this_p_label_fr")).get("result")) > 0:hasNewCardRight); bool useXRM = (bool) (ITL.b((bool?)catalogObject.get("this_p_useXRM"))); compiledMode = (string)(ITL.gv["compiledMode"] = mode__1 == "new" && !ITL.b(hasNewCardRight)?"list":(mode__1 == "modify" && !(EC.itl.toBoolean(card__1) && ((ITL.b((bool?)card__1.get("this_z_s_ocsCatalog_p_useValidation"))?EC.itl.toInteger(new SqlCollection("xrm:category", @"SELECT COUNT(DISTINCT this.data) AS result FROM (SELECT c1.`_oid` AS origin, this.label_fr AS this_p_label_fr, this.`_oid` AS this, this.`_oid` AS data FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> '') AND (c1.`_oid` = #V_0&;))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;))) AS this", new Map("#V_0&;|integer", (int?)card__1.get("this"), "#V_1&;|oids", EC.itl.categoryOids(true)), (List) EC.newList(new List(), "this_p_label_fr")).get("result")) > 0:EC.itl.toInteger(new SqlCollection("xrm:category", @"SELECT COUNT(DISTINCT this.data) AS result FROM (SELECT c1.`_oid` AS origin, this.label_fr AS this_p_label_fr, this.`_oid` AS this, this.`_oid` AS data FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> '') AND (c1.`_oid` = #V_0&;))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;))) AS this", new Map("#V_0&;|integer", (int?)card__1.get("this"), "#V_1&;|oids", EC.itl.categoryOids(true)), (List) EC.newList(new List(), "this_p_label_fr")).get("result")) > 0 && ((string)card__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)card__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && ((bool?)card__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)card__1.get("this_z_p_ocsStatus"):((int?)card__1.get("this_z_p_ocsStatus") == 2 || (int?)card__1.get("this_z_p_ocsStatus") == 3?(int?)card__1.get("this_z_p_ocsStatus"):0)) != 0 || EC.itl.toInteger(new SqlCollection("xrm:category", @"SELECT COUNT(DISTINCT this.data) AS result FROM (SELECT c1.`_oid` AS origin, this.label_fr AS this_p_label_fr, this.`_oid` AS this, this.`_oid` AS data FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> '') AND (c1.`_oid` = #V_0&;))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;))) AS this", new Map("#V_0&;|integer", (int?)card__1.get("this"), "#V_1&;|oids", EC.itl.categoryOids(true)), (List) EC.newList(new List(), "this_p_label_fr")).get("result")) > 0 && ((string)card__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)card__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) && ((bool?)card__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)card__1.get("this_z_p_ocsStatus"):((int?)card__1.get("this_z_p_ocsStatus") == 2 || (int?)card__1.get("this_z_p_ocsStatus") == 3?(int?)card__1.get("this_z_p_ocsStatus"):0)) != 2))?"card":mode__1)); if(!EC.itl.isReplay()) { if(action__1 == "new") { int catOID = (int) (EC.itl.toInteger(catalogObject)); ItlCreate c9 = new ItlCreate("ocsCol:association", "card", card__1); ; c9.setField("ocsCreationDate", EC.itl.now(), "date", "ocs:card"); c9.setField("ocsCreationLogin", EC.itl.login(), "string", "ocs:card", 255); c9.setField("ocsModificationDate", EC.itl.now(), "date", "ocs:card"); c9.setField("ocsModificationLogin", EC.itl.login(), "string", "ocs:card", 255); c9.setAssociation("ocsCatalog", catOID, "object:ocs:catalog", "ocs:card", true, false); if(c9.exec()) { int? newCompiledStatus = (int?) ((bool?)card__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)card__1.get("this_z_p_ocsStatus"):((int?)card__1.get("this_z_p_ocsStatus") == 2 || (int?)card__1.get("this_z_p_ocsStatus") == 3?(int?)card__1.get("this_z_p_ocsStatus"):0)); ItlCreate c11 = new ItlCreate("ocs:log", null, null); ; c11.setAssociation("card", card__1, "object:ocs:card", "ocs:log", true, false); c11.setField("userLogin", EC.itl.login(), "string", "ocs:log", 255); c11.setField("date", EC.itl.now(), "date", "ocs:log"); c11.setField("comment", logComment__1, "string", "ocs:log", 255); c11.setField("cardStatus", newCompiledStatus, "integer", "ocs:log"); if(c11.exec()) { } else { } string cardUrl = (string) (((EC.destination["httpURL"] + "linkTable.aspx?GID=00011380") + "&mode=card&card=") + ITL.S((int?)card__1.get("this"))); string modifyUrl = (string) (((EC.destination["httpURL"] + "linkTable.aspx?GID=00011380") + "&mode=modify&card=") + ITL.S((int?)card__1.get("this"))); string recipient = (string) (EC.itl.login()); { OcsMailLoop _mailLoop = new OcsMailLoop("action"); while(_mailLoop.next()) { recipient = _mailLoop.getValue(); ItlMail mail12 = new ItlMail(); mail12.setProperty("to", recipient); mail12.setProperty("from", EC.itl.userProperty("email")); mail12.setProperty("subject", ocsNotificationForActionMailSubject); mail12.addToBody( @"

Demande émise par : "); ITL.show(EC.itl.login(), "string", "html", "string"); mail12.addToBody( @" ("); ITL.show(EC.itl.userProperty("email"), "string", "html", "string"); mail12.addToBody( @")

Message :

"); ITL.show(ocsNotificationForActionMessage__1, "string", "memo", "string"); mail12.addToBody( @"

>> Voir la fiche
>> Modifier la fiche

"); if(ITL.b(logComment__1)) { mail12.addToBody( @"

Note d'historique :
"); ITL.show(logComment__1, "string", "html", "string"); mail12.addToBody( @"

"); } mail12.addToBody( @"
"); mail12.exec();; } } { OcsMailLoop _mailLoop = new OcsMailLoop("info"); while(_mailLoop.next()) { recipient = _mailLoop.getValue(); ItlMail mail15 = new ItlMail(); mail15.setProperty("to", recipient); mail15.setProperty("from", EC.itl.userProperty("email")); mail15.setProperty("subject", ocsNotificationForInfoMailSubject); mail15.addToBody( @"

Information émise par : "); ITL.show(EC.itl.login(), "string", "html", "string"); mail15.addToBody( @" ("); ITL.show(EC.itl.userProperty("email"), "string", "html", "string"); mail15.addToBody( @")

Message :

"); ITL.show(ocsNotificationForInfoMessage__1, "string", "memo", "string"); mail15.addToBody( @"

>> Voir la fiche

"); if(ITL.b(logComment__1)) { mail15.addToBody( @"

Note d'historique :
"); ITL.show(logComment__1, "string", "html", "string"); mail15.addToBody( @"

"); } mail15.addToBody( @"
"); mail15.exec();; } } } else { } } else if(action__1 == "modify") { int? previousStatus = (int?) ((bool?)card__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)card__1.get("this_z_p_ocsStatus"):((int?)card__1.get("this_z_p_ocsStatus") == 2 || (int?)card__1.get("this_z_p_ocsStatus") == 3?(int?)card__1.get("this_z_p_ocsStatus"):0)); ItlUpdateObject c18 = new ItlUpdateObject("ocsCol:association", "card", card__1); ; c18.setField("ocsModificationDate", EC.itl.now(), "date", "ocs:card"); c18.setField("ocsModificationLogin", EC.itl.login(), "string", "ocs:card", 255); if(c18.exec()) { int? newCompiledStatus__1 = (int?) ((bool?)card__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)card__1.get("this_z_p_ocsStatus"):((int?)card__1.get("this_z_p_ocsStatus") == 2 || (int?)card__1.get("this_z_p_ocsStatus") == 3?(int?)card__1.get("this_z_p_ocsStatus"):0)); ItlCreate c20 = new ItlCreate("ocs:log", null, null); ; c20.setAssociation("card", card__1, "object:ocs:card", "ocs:log", true, false); c20.setField("userLogin", EC.itl.login(), "string", "ocs:log", 255); c20.setField("date", EC.itl.now(), "date", "ocs:log"); c20.setField("comment", logComment__1, "string", "ocs:log", 255); c20.setField("cardStatus", newCompiledStatus__1, "integer", "ocs:log"); if(c20.exec()) { } else { } string cardUrl__1 = (string) (((EC.destination["httpURL"] + "linkTable.aspx?GID=00011380") + "&mode=card&card=") + ITL.S((int?)card__1.get("this"))); string modifyUrl__1 = (string) (((EC.destination["httpURL"] + "linkTable.aspx?GID=00011380") + "&mode=modify&card=") + ITL.S((int?)card__1.get("this"))); string recipient__1 = (string) (EC.itl.login()); { OcsMailLoop _mailLoop = new OcsMailLoop("action"); while(_mailLoop.next()) { recipient__1 = _mailLoop.getValue(); ItlMail mail21 = new ItlMail(); mail21.setProperty("to", recipient__1); mail21.setProperty("from", EC.itl.userProperty("email")); mail21.setProperty("subject", ocsNotificationForActionMailSubject); mail21.addToBody( @"

Demande émise par : "); ITL.show(EC.itl.login(), "string", "html", "string"); mail21.addToBody( @" ("); ITL.show(EC.itl.userProperty("email"), "string", "html", "string"); mail21.addToBody( @")

Message :

"); ITL.show(ocsNotificationForActionMessage__1, "string", "memo", "string"); mail21.addToBody( @"

>> Voir la fiche
>> Modifier la fiche

"); if(ITL.b(logComment__1)) { mail21.addToBody( @"

Note d'historique :
"); ITL.show(logComment__1, "string", "html", "string"); mail21.addToBody( @"

"); } mail21.addToBody( @"
"); mail21.exec();; } } { OcsMailLoop _mailLoop = new OcsMailLoop("info"); while(_mailLoop.next()) { recipient__1 = _mailLoop.getValue(); ItlMail mail24 = new ItlMail(); mail24.setProperty("to", recipient__1); mail24.setProperty("from", EC.itl.userProperty("email")); mail24.setProperty("subject", ocsNotificationForInfoMailSubject); mail24.addToBody( @"

Information émise par : "); ITL.show(EC.itl.login(), "string", "html", "string"); mail24.addToBody( @" ("); ITL.show(EC.itl.userProperty("email"), "string", "html", "string"); mail24.addToBody( @")

Message :

"); ITL.show(ocsNotificationForInfoMessage__1, "string", "memo", "string"); mail24.addToBody( @"

>> Voir la fiche

"); if(ITL.b(logComment__1)) { mail24.addToBody( @"

Note d'historique :
"); ITL.show(logComment__1, "string", "html", "string"); mail24.addToBody( @"

"); } mail24.addToBody( @"
"); mail24.exec();; } } } else { } } else if(action__1 == "delete") { ItlDelete c30 = new ItlDelete("ocs:log", new SqlCollection("ocs:log", @"SELECT this.`_oid` AS this FROM ocs_log AS this LEFT JOIN ocs_card AS this_s_card On ((this.card = this_s_card.`_oid`) AND (this_s_card.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_s_card.`_oid` = #V_0&;)", new Map("#V_0&;|integer", (int?)card__1.get("this")), (List) EC.newList(new List()))); ; if(c30.exec()) { } else { } ItlDelete c31 = new ItlDelete("ocsCol:association", card__1); ; if(c31.exec()) { } else { } } else if(action__1 == "changeStatus") { int? previousStatus__1 = (int?) ((bool?)card__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)card__1.get("this_z_p_ocsStatus"):((int?)card__1.get("this_z_p_ocsStatus") == 2 || (int?)card__1.get("this_z_p_ocsStatus") == 3?(int?)card__1.get("this_z_p_ocsStatus"):0)); ItlUpdateObject c32 = new ItlUpdateObject("ocsCol:association", "card", card__1); ; if(c32.exec()) { int? newCompiledStatus__2 = (int?) ((bool?)card__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)card__1.get("this_z_p_ocsStatus"):((int?)card__1.get("this_z_p_ocsStatus") == 2 || (int?)card__1.get("this_z_p_ocsStatus") == 3?(int?)card__1.get("this_z_p_ocsStatus"):0)); ItlCreate c34 = new ItlCreate("ocs:log", null, null); ; c34.setAssociation("card", card__1, "object:ocs:card", "ocs:log", true, false); c34.setField("userLogin", EC.itl.login(), "string", "ocs:log", 255); c34.setField("date", EC.itl.now(), "date", "ocs:log"); c34.setField("comment", logComment__1, "string", "ocs:log", 255); c34.setField("cardStatus", newCompiledStatus__2, "integer", "ocs:log"); if(c34.exec()) { } else { } string cardUrl__2 = (string) (((EC.destination["httpURL"] + "linkTable.aspx?GID=00011380") + "&mode=card&card=") + ITL.S((int?)card__1.get("this"))); string modifyUrl__2 = (string) (((EC.destination["httpURL"] + "linkTable.aspx?GID=00011380") + "&mode=modify&card=") + ITL.S((int?)card__1.get("this"))); string recipient__2 = (string) (EC.itl.login()); { OcsMailLoop _mailLoop = new OcsMailLoop("action"); while(_mailLoop.next()) { recipient__2 = _mailLoop.getValue(); ItlMail mail35 = new ItlMail(); mail35.setProperty("to", recipient__2); mail35.setProperty("from", EC.itl.userProperty("email")); mail35.setProperty("subject", ocsNotificationForActionMailSubject); mail35.addToBody( @"

Demande émise par : "); ITL.show(EC.itl.login(), "string", "html", "string"); mail35.addToBody( @" ("); ITL.show(EC.itl.userProperty("email"), "string", "html", "string"); mail35.addToBody( @")

Message :

"); ITL.show(ocsNotificationForActionMessage__1, "string", "memo", "string"); mail35.addToBody( @"

>> Voir la fiche
>> Modifier la fiche

"); if(ITL.b(logComment__1)) { mail35.addToBody( @"

Note d'historique :
"); ITL.show(logComment__1, "string", "html", "string"); mail35.addToBody( @"

"); } mail35.addToBody( @"
"); mail35.exec();; } } { OcsMailLoop _mailLoop = new OcsMailLoop("info"); while(_mailLoop.next()) { recipient__2 = _mailLoop.getValue(); ItlMail mail38 = new ItlMail(); mail38.setProperty("to", recipient__2); mail38.setProperty("from", EC.itl.userProperty("email")); mail38.setProperty("subject", ocsNotificationForInfoMailSubject); mail38.addToBody( @"

Information émise par : "); ITL.show(EC.itl.login(), "string", "html", "string"); mail38.addToBody( @" ("); ITL.show(EC.itl.userProperty("email"), "string", "html", "string"); mail38.addToBody( @")

Message :

"); ITL.show(ocsNotificationForInfoMessage__1, "string", "memo", "string"); mail38.addToBody( @"

>> Voir la fiche

"); if(ITL.b(logComment__1)) { mail38.addToBody( @"

Note d'historique :
"); ITL.show(logComment__1, "string", "html", "string"); mail38.addToBody( @"

"); } mail38.addToBody( @"
"); mail38.exec();; } } } else { } } else if(EC.itl.startsWith(ITL.S(action__1), "multiple-")) { string oids__1 = (string) ((string)EC.itl.getParameterValue("string", "oids")); ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = 0); ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = 0); ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = 0); if(oids__1 == "all") { int? statusFilter__2 = (int?) ((int?)EC.itl.getParameterValue("integer", "statusFilter")); string cardType__1 = (string) ((string)EC.itl.getParameterValue("string", "cardType")); string searchFilter__2 = (string) ((string)EC.itl.getParameterValue("string", "searchFilter")); string creatorFilter__2 = (string) ((string)EC.itl.getParameterValue("string", "creatorFilter")); if(statusFilter__2 == -1) { if(cardType__1 != "archive") { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = 0); ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = 0); ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = 0); if(action__1 == "multiple-delete") { ItlEnumerator e42 = new ItlEnumerator("G00011380_41", null, false); string _t0 = ITL.S(searchFilter__2); e42.add(new SqlEnumerator(new ItlRuntime.SQL.Collection("ocsCol:association", @"SELECT this.`_oid` AS this FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z_s_ocsCatalog.name = 'entreprises') AND (#V_0&; OR (this_z.ocsCreationLogin = #V_1&;)) AND (#V_2&; OR ((this.title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.object LIKE CONCAT('%', #V_3&;, '%')) OR ((this.headOffice LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_in_charge LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.address LIKE CONCAT('%', #V_3&;, '%')) OR ((this.contact LIKE CONCAT('%', #V_3&;, '%')) OR ((this.phoneNumber LIKE CONCAT('%', #V_3&;, '%')) OR ((this.mobilePhone LIKE CONCAT('%', #V_3&;, '%')) OR ((this.fax LIKE CONCAT('%', #V_3&;, '%')) OR ((this.email LIKE CONCAT('%', #V_3&;, '%')) OR (this.website LIKE CONCAT('%', #V_3&;, '%')))))))))))))) AND (IF((this_z_s_ocsCatalog.useValidation = 1),this_z.ocsStatus,IF(((this_z.ocsStatus = 2) OR (this_z.ocsStatus = 3)),this_z.ocsStatus,0)) <> 3)", new ItlRuntime.SQL.Parameters( new ItlRuntime.SQL.Parameter("#V_0&;", (creatorFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_1&;", creatorFilter__2, "string"), new ItlRuntime.SQL.Parameter("#V_2&;", (searchFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_3&;", _t0, "string")), new ItlRuntime.SQL.OrderAliases(), new ItlRuntime.SQL.OptionalOrderAliases(), null, null), @"SELECT this.`_oid` AS this, this_z_s_ocsCatalog.`_oid` AS this_z_s_ocsCatalog, this_k_1.result1 AS this_k_1_1, this_k_2.result1 AS this_k_2_1, this_z.ocsStatus AS this_z_p_ocsStatus, this_z.ocsCreationLogin AS this_z_p_ocsCreationLogin, this_z_s_ocsCatalog.useValidation AS this_z_s_ocsCatalog_p_useValidation, this_z_s_ocsCatalog.editRightsMode AS this_z_s_ocsCatalog_p_editRightsMode FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;)) GROUP BY c1.`_oid`) AS this_k_1 On (this.`_oid` = this_k_1.origin) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;)) GROUP BY c1.`_oid`) AS this_k_2 On (this.`_oid` = this_k_2.origin) WHERE (this.iso_sid <> '')", new Map("#V_0&;|oids", EC.itl.categoryOids(true), "#V_1&;|oids", EC.itl.categoryOids(true)), false, (List) EC.newList(new List()), null, null)); ItlEnumerator e = (ItlEnumerator) (e42); e.reset(); if(e.isNotEmpty()) { e.resetGroup(); for(e.start();e.test();e.fetch()) { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionCount"]) + 1); if((ITL.b((bool?)e.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e.get("this_k_1_1")) > 0:ITL.countDefault((int?)e.get("this_k_2_1")) > 0 && ((string)e.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && ((bool?)e.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e.get("this_z_p_ocsStatus"):((int?)e.get("this_z_p_ocsStatus") == 2 || (int?)e.get("this_z_p_ocsStatus") == 3?(int?)e.get("this_z_p_ocsStatus"):0)) != 0 || ITL.countDefault((int?)e.get("this_k_2_1")) > 0 && ((string)e.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) && ((bool?)e.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e.get("this_z_p_ocsStatus"):((int?)e.get("this_z_p_ocsStatus") == 2 || (int?)e.get("this_z_p_ocsStatus") == 3?(int?)e.get("this_z_p_ocsStatus"):0)) != 2) { ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionOkCount"]) + 1); ItlDelete c48 = new ItlDelete("ocs:log", new SqlCollection("ocs:log", @"SELECT this.`_oid` AS this FROM ocs_log AS this LEFT JOIN ocs_card AS this_s_card On ((this.card = this_s_card.`_oid`) AND (this_s_card.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_s_card.`_oid` = #V_0&;)", new Map("#V_0&;|integer", (int?)e.get("this")), (List) EC.newList(new List()))); ; if(c48.exec()) { } else { } ItlDelete c49 = new ItlDelete("ocsCol:association", e); ; if(c49.exec()) { } else { } } else { ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionNotOkCount"]) + 1); } } } e.finish(); } else if(action__1 == "multiple-changeStatus") { int? newStatus__1 = (int?) ((int?)EC.itl.getParameterValue("integer", "newStatus")); ItlEnumerator e52 = new ItlEnumerator("G00011380_51", null, false); string _t1 = ITL.S(searchFilter__2); e52.add(new SqlEnumerator(new ItlRuntime.SQL.Collection("ocsCol:association", @"SELECT this.`_oid` AS this FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z_s_ocsCatalog.name = 'entreprises') AND (#V_0&; OR (this_z.ocsCreationLogin = #V_1&;)) AND (#V_2&; OR ((this.title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.object LIKE CONCAT('%', #V_3&;, '%')) OR ((this.headOffice LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_in_charge LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.address LIKE CONCAT('%', #V_3&;, '%')) OR ((this.contact LIKE CONCAT('%', #V_3&;, '%')) OR ((this.phoneNumber LIKE CONCAT('%', #V_3&;, '%')) OR ((this.mobilePhone LIKE CONCAT('%', #V_3&;, '%')) OR ((this.fax LIKE CONCAT('%', #V_3&;, '%')) OR ((this.email LIKE CONCAT('%', #V_3&;, '%')) OR (this.website LIKE CONCAT('%', #V_3&;, '%')))))))))))))) AND (IF((this_z_s_ocsCatalog.useValidation = 1),this_z.ocsStatus,IF(((this_z.ocsStatus = 2) OR (this_z.ocsStatus = 3)),this_z.ocsStatus,0)) <> 3)", new ItlRuntime.SQL.Parameters( new ItlRuntime.SQL.Parameter("#V_0&;", (creatorFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_1&;", creatorFilter__2, "string"), new ItlRuntime.SQL.Parameter("#V_2&;", (searchFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_3&;", _t1, "string")), new ItlRuntime.SQL.OrderAliases(), new ItlRuntime.SQL.OptionalOrderAliases(), null, null), @"SELECT this.`_oid` AS this, this_z_s_ocsCatalog.`_oid` AS this_z_s_ocsCatalog, this_k_1.result1 AS this_k_1_1, this_k_2.result1 AS this_k_2_1, this_z.ocsStatus AS this_z_p_ocsStatus, this_z.ocsCreationLogin AS this_z_p_ocsCreationLogin, this_z_s_ocsCatalog.useValidation AS this_z_s_ocsCatalog_p_useValidation, this_z_s_ocsCatalog.editRightsMode AS this_z_s_ocsCatalog_p_editRightsMode FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;)) GROUP BY c1.`_oid`) AS this_k_1 On (this.`_oid` = this_k_1.origin) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;)) GROUP BY c1.`_oid`) AS this_k_2 On (this.`_oid` = this_k_2.origin) WHERE (this.iso_sid <> '')", new Map("#V_0&;|oids", EC.itl.categoryOids(true), "#V_1&;|oids", EC.itl.categoryOids(true)), false, (List) EC.newList(new List()), null, null)); ItlEnumerator e__1 = (ItlEnumerator) (e52); e__1.reset(); if(e__1.isNotEmpty()) { e__1.resetGroup(); for(e__1.start();e__1.test();e__1.fetch()) { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionCount"]) + 1); if(((ITL.b((bool?)e__1.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__1.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__1.get("this_k_2_1")) > 0 && ((string)e__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && ((bool?)e__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__1.get("this_z_p_ocsStatus"):((int?)e__1.get("this_z_p_ocsStatus") == 2 || (int?)e__1.get("this_z_p_ocsStatus") == 3?(int?)e__1.get("this_z_p_ocsStatus"):0)) != 0 || ITL.countDefault((int?)e__1.get("this_k_2_1")) > 0 && ((string)e__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) && ((bool?)e__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__1.get("this_z_p_ocsStatus"):((int?)e__1.get("this_z_p_ocsStatus") == 2 || (int?)e__1.get("this_z_p_ocsStatus") == 3?(int?)e__1.get("this_z_p_ocsStatus"):0)) != 2) && ((ITL.countDefault((int?)e__1.get("this_k_2_1")) > 0 && ((string)e__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__1.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__1.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__1.get("this_k_2_1")) > 0 && ((string)e__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__1 == 0 || (ITL.countDefault((int?)e__1.get("this_k_2_1")) > 0 && ((string)e__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__1.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__1.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__1.get("this_k_2_1")) > 0 && ((string)e__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__1 == 1 || (ITL.b((bool?)e__1.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__1.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__1.get("this_k_2_1")) > 0 && ((string)e__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && newStatus__1 == 2 || (ITL.countDefault((int?)e__1.get("this_k_2_1")) > 0 && ((string)e__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__1.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__1.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__1.get("this_k_2_1")) > 0 && ((string)e__1.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__1.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__1 == 3)) { ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionOkCount"]) + 1); if(((bool?)e__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__1.get("this_z_p_ocsStatus"):((int?)e__1.get("this_z_p_ocsStatus") == 2 || (int?)e__1.get("this_z_p_ocsStatus") == 3?(int?)e__1.get("this_z_p_ocsStatus"):0)) != newStatus__1) { int? previousStatus__2 = (int?) ((bool?)e__1.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__1.get("this_z_p_ocsStatus"):((int?)e__1.get("this_z_p_ocsStatus") == 2 || (int?)e__1.get("this_z_p_ocsStatus") == 3?(int?)e__1.get("this_z_p_ocsStatus"):0)); ItlUpdateObject c68 = new ItlUpdateObject("ocsCol:association", null, e__1); ; c68.setField("ocsStatus", newStatus__1, "integer", "ocs:card"); if(c68.exec()) { ItlCreate c70 = new ItlCreate("ocs:log", null, null); ; c70.setAssociation("card", e__1, "object:ocs:card", "ocs:log", true, false); c70.setField("userLogin", EC.itl.login(), "string", "ocs:log", 255); c70.setField("date", EC.itl.now(), "date", "ocs:log"); c70.setField("comment", "", "string", "ocs:log", 255); c70.setField("cardStatus", newStatus__1, "integer", "ocs:log"); if(c70.exec()) { } else { } } else { } } } else { ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionNotOkCount"]) + 1); } } } e__1.finish(); } } else { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = 0); ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = 0); ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = 0); if(action__1 == "multiple-delete") { ItlEnumerator e73 = new ItlEnumerator("G00011380_72", null, false); string _t2 = ITL.S(searchFilter__2); e73.add(new SqlEnumerator(new ItlRuntime.SQL.Collection("ocsCol:association", @"SELECT this.`_oid` AS this FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z_s_ocsCatalog.name = 'entreprises') AND (#V_0&; OR (this_z.ocsCreationLogin = #V_1&;)) AND (#V_2&; OR ((this.title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.object LIKE CONCAT('%', #V_3&;, '%')) OR ((this.headOffice LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_in_charge LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.address LIKE CONCAT('%', #V_3&;, '%')) OR ((this.contact LIKE CONCAT('%', #V_3&;, '%')) OR ((this.phoneNumber LIKE CONCAT('%', #V_3&;, '%')) OR ((this.mobilePhone LIKE CONCAT('%', #V_3&;, '%')) OR ((this.fax LIKE CONCAT('%', #V_3&;, '%')) OR ((this.email LIKE CONCAT('%', #V_3&;, '%')) OR (this.website LIKE CONCAT('%', #V_3&;, '%')))))))))))))) AND (IF((this_z_s_ocsCatalog.useValidation = 1),this_z.ocsStatus,IF(((this_z.ocsStatus = 2) OR (this_z.ocsStatus = 3)),this_z.ocsStatus,0)) = 3)", new ItlRuntime.SQL.Parameters( new ItlRuntime.SQL.Parameter("#V_0&;", (creatorFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_1&;", creatorFilter__2, "string"), new ItlRuntime.SQL.Parameter("#V_2&;", (searchFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_3&;", _t2, "string")), new ItlRuntime.SQL.OrderAliases(), new ItlRuntime.SQL.OptionalOrderAliases(), null, null), @"SELECT this.`_oid` AS this, this_z_s_ocsCatalog.`_oid` AS this_z_s_ocsCatalog, this_k_1.result1 AS this_k_1_1, this_k_2.result1 AS this_k_2_1, this_z.ocsStatus AS this_z_p_ocsStatus, this_z.ocsCreationLogin AS this_z_p_ocsCreationLogin, this_z_s_ocsCatalog.useValidation AS this_z_s_ocsCatalog_p_useValidation, this_z_s_ocsCatalog.editRightsMode AS this_z_s_ocsCatalog_p_editRightsMode FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;)) GROUP BY c1.`_oid`) AS this_k_1 On (this.`_oid` = this_k_1.origin) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;)) GROUP BY c1.`_oid`) AS this_k_2 On (this.`_oid` = this_k_2.origin) WHERE (this.iso_sid <> '')", new Map("#V_0&;|oids", EC.itl.categoryOids(true), "#V_1&;|oids", EC.itl.categoryOids(true)), false, (List) EC.newList(new List()), null, null)); ItlEnumerator e__2 = (ItlEnumerator) (e73); e__2.reset(); if(e__2.isNotEmpty()) { e__2.resetGroup(); for(e__2.start();e__2.test();e__2.fetch()) { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionCount"]) + 1); if((ITL.b((bool?)e__2.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__2.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__2.get("this_k_2_1")) > 0 && ((string)e__2.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__2.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && ((bool?)e__2.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__2.get("this_z_p_ocsStatus"):((int?)e__2.get("this_z_p_ocsStatus") == 2 || (int?)e__2.get("this_z_p_ocsStatus") == 3?(int?)e__2.get("this_z_p_ocsStatus"):0)) != 0 || ITL.countDefault((int?)e__2.get("this_k_2_1")) > 0 && ((string)e__2.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__2.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) && ((bool?)e__2.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__2.get("this_z_p_ocsStatus"):((int?)e__2.get("this_z_p_ocsStatus") == 2 || (int?)e__2.get("this_z_p_ocsStatus") == 3?(int?)e__2.get("this_z_p_ocsStatus"):0)) != 2) { ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionOkCount"]) + 1); ItlDelete c79 = new ItlDelete("ocs:log", new SqlCollection("ocs:log", @"SELECT this.`_oid` AS this FROM ocs_log AS this LEFT JOIN ocs_card AS this_s_card On ((this.card = this_s_card.`_oid`) AND (this_s_card.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_s_card.`_oid` = #V_0&;)", new Map("#V_0&;|integer", (int?)e__2.get("this")), (List) EC.newList(new List()))); ; if(c79.exec()) { } else { } ItlDelete c80 = new ItlDelete("ocsCol:association", e__2); ; if(c80.exec()) { } else { } } else { ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionNotOkCount"]) + 1); } } } e__2.finish(); } else if(action__1 == "multiple-changeStatus") { int? newStatus__2 = (int?) ((int?)EC.itl.getParameterValue("integer", "newStatus")); ItlEnumerator e83 = new ItlEnumerator("G00011380_82", null, false); string _t3 = ITL.S(searchFilter__2); e83.add(new SqlEnumerator(new ItlRuntime.SQL.Collection("ocsCol:association", @"SELECT this.`_oid` AS this FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z_s_ocsCatalog.name = 'entreprises') AND (#V_0&; OR (this_z.ocsCreationLogin = #V_1&;)) AND (#V_2&; OR ((this.title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.object LIKE CONCAT('%', #V_3&;, '%')) OR ((this.headOffice LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_in_charge LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.address LIKE CONCAT('%', #V_3&;, '%')) OR ((this.contact LIKE CONCAT('%', #V_3&;, '%')) OR ((this.phoneNumber LIKE CONCAT('%', #V_3&;, '%')) OR ((this.mobilePhone LIKE CONCAT('%', #V_3&;, '%')) OR ((this.fax LIKE CONCAT('%', #V_3&;, '%')) OR ((this.email LIKE CONCAT('%', #V_3&;, '%')) OR (this.website LIKE CONCAT('%', #V_3&;, '%')))))))))))))) AND (IF((this_z_s_ocsCatalog.useValidation = 1),this_z.ocsStatus,IF(((this_z.ocsStatus = 2) OR (this_z.ocsStatus = 3)),this_z.ocsStatus,0)) = 3)", new ItlRuntime.SQL.Parameters( new ItlRuntime.SQL.Parameter("#V_0&;", (creatorFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_1&;", creatorFilter__2, "string"), new ItlRuntime.SQL.Parameter("#V_2&;", (searchFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_3&;", _t3, "string")), new ItlRuntime.SQL.OrderAliases(), new ItlRuntime.SQL.OptionalOrderAliases(), null, null), @"SELECT this.`_oid` AS this, this_z_s_ocsCatalog.`_oid` AS this_z_s_ocsCatalog, this_k_1.result1 AS this_k_1_1, this_k_2.result1 AS this_k_2_1, this_z.ocsStatus AS this_z_p_ocsStatus, this_z.ocsCreationLogin AS this_z_p_ocsCreationLogin, this_z_s_ocsCatalog.useValidation AS this_z_s_ocsCatalog_p_useValidation, this_z_s_ocsCatalog.editRightsMode AS this_z_s_ocsCatalog_p_editRightsMode FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;)) GROUP BY c1.`_oid`) AS this_k_1 On (this.`_oid` = this_k_1.origin) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;)) GROUP BY c1.`_oid`) AS this_k_2 On (this.`_oid` = this_k_2.origin) WHERE (this.iso_sid <> '')", new Map("#V_0&;|oids", EC.itl.categoryOids(true), "#V_1&;|oids", EC.itl.categoryOids(true)), false, (List) EC.newList(new List()), null, null)); ItlEnumerator e__3 = (ItlEnumerator) (e83); e__3.reset(); if(e__3.isNotEmpty()) { e__3.resetGroup(); for(e__3.start();e__3.test();e__3.fetch()) { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionCount"]) + 1); if(((ITL.b((bool?)e__3.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__3.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__3.get("this_k_2_1")) > 0 && ((string)e__3.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__3.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && ((bool?)e__3.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__3.get("this_z_p_ocsStatus"):((int?)e__3.get("this_z_p_ocsStatus") == 2 || (int?)e__3.get("this_z_p_ocsStatus") == 3?(int?)e__3.get("this_z_p_ocsStatus"):0)) != 0 || ITL.countDefault((int?)e__3.get("this_k_2_1")) > 0 && ((string)e__3.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__3.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) && ((bool?)e__3.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__3.get("this_z_p_ocsStatus"):((int?)e__3.get("this_z_p_ocsStatus") == 2 || (int?)e__3.get("this_z_p_ocsStatus") == 3?(int?)e__3.get("this_z_p_ocsStatus"):0)) != 2) && ((ITL.countDefault((int?)e__3.get("this_k_2_1")) > 0 && ((string)e__3.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__3.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__3.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__3.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__3.get("this_k_2_1")) > 0 && ((string)e__3.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__3.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__2 == 0 || (ITL.countDefault((int?)e__3.get("this_k_2_1")) > 0 && ((string)e__3.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__3.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__3.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__3.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__3.get("this_k_2_1")) > 0 && ((string)e__3.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__3.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__2 == 1 || (ITL.b((bool?)e__3.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__3.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__3.get("this_k_2_1")) > 0 && ((string)e__3.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__3.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && newStatus__2 == 2 || (ITL.countDefault((int?)e__3.get("this_k_2_1")) > 0 && ((string)e__3.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__3.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__3.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__3.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__3.get("this_k_2_1")) > 0 && ((string)e__3.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__3.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__2 == 3)) { ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionOkCount"]) + 1); if(((bool?)e__3.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__3.get("this_z_p_ocsStatus"):((int?)e__3.get("this_z_p_ocsStatus") == 2 || (int?)e__3.get("this_z_p_ocsStatus") == 3?(int?)e__3.get("this_z_p_ocsStatus"):0)) != newStatus__2) { int? previousStatus__3 = (int?) ((bool?)e__3.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__3.get("this_z_p_ocsStatus"):((int?)e__3.get("this_z_p_ocsStatus") == 2 || (int?)e__3.get("this_z_p_ocsStatus") == 3?(int?)e__3.get("this_z_p_ocsStatus"):0)); ItlUpdateObject c99 = new ItlUpdateObject("ocsCol:association", null, e__3); ; c99.setField("ocsStatus", newStatus__2, "integer", "ocs:card"); if(c99.exec()) { ItlCreate c101 = new ItlCreate("ocs:log", null, null); ; c101.setAssociation("card", e__3, "object:ocs:card", "ocs:log", true, false); c101.setField("userLogin", EC.itl.login(), "string", "ocs:log", 255); c101.setField("date", EC.itl.now(), "date", "ocs:log"); c101.setField("comment", "", "string", "ocs:log", 255); c101.setField("cardStatus", newStatus__2, "integer", "ocs:log"); if(c101.exec()) { } else { } } else { } } } else { ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionNotOkCount"]) + 1); } } } e__3.finish(); } } } else { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = 0); ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = 0); ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = 0); if(action__1 == "multiple-delete") { ItlEnumerator e104 = new ItlEnumerator("G00011380_103", null, false); string _t4 = ITL.S(searchFilter__2); e104.add(new SqlEnumerator(new ItlRuntime.SQL.Collection("ocsCol:association", @"SELECT this.`_oid` AS this FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z_s_ocsCatalog.name = 'entreprises') AND (#V_0&; OR (this_z.ocsCreationLogin = #V_1&;)) AND (#V_2&; OR ((this.title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.object LIKE CONCAT('%', #V_3&;, '%')) OR ((this.headOffice LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_in_charge LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.address LIKE CONCAT('%', #V_3&;, '%')) OR ((this.contact LIKE CONCAT('%', #V_3&;, '%')) OR ((this.phoneNumber LIKE CONCAT('%', #V_3&;, '%')) OR ((this.mobilePhone LIKE CONCAT('%', #V_3&;, '%')) OR ((this.fax LIKE CONCAT('%', #V_3&;, '%')) OR ((this.email LIKE CONCAT('%', #V_3&;, '%')) OR (this.website LIKE CONCAT('%', #V_3&;, '%')))))))))))))) AND (IF((this_z_s_ocsCatalog.useValidation = 1),this_z.ocsStatus,IF(((this_z.ocsStatus = 2) OR (this_z.ocsStatus = 3)),this_z.ocsStatus,0)) = #V_4&;)", new ItlRuntime.SQL.Parameters( new ItlRuntime.SQL.Parameter("#V_0&;", (creatorFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_1&;", creatorFilter__2, "string"), new ItlRuntime.SQL.Parameter("#V_2&;", (searchFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_3&;", _t4, "string"), new ItlRuntime.SQL.Parameter("#V_4&;", statusFilter__2, "integer")), new ItlRuntime.SQL.OrderAliases(), new ItlRuntime.SQL.OptionalOrderAliases(), null, null), @"SELECT this.`_oid` AS this, this_z_s_ocsCatalog.`_oid` AS this_z_s_ocsCatalog, this_k_1.result1 AS this_k_1_1, this_k_2.result1 AS this_k_2_1, this_z.ocsStatus AS this_z_p_ocsStatus, this_z.ocsCreationLogin AS this_z_p_ocsCreationLogin, this_z_s_ocsCatalog.useValidation AS this_z_s_ocsCatalog_p_useValidation, this_z_s_ocsCatalog.editRightsMode AS this_z_s_ocsCatalog_p_editRightsMode FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;)) GROUP BY c1.`_oid`) AS this_k_1 On (this.`_oid` = this_k_1.origin) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;)) GROUP BY c1.`_oid`) AS this_k_2 On (this.`_oid` = this_k_2.origin) WHERE (this.iso_sid <> '')", new Map("#V_0&;|oids", EC.itl.categoryOids(true), "#V_1&;|oids", EC.itl.categoryOids(true)), false, (List) EC.newList(new List()), null, null)); ItlEnumerator e__4 = (ItlEnumerator) (e104); e__4.reset(); if(e__4.isNotEmpty()) { e__4.resetGroup(); for(e__4.start();e__4.test();e__4.fetch()) { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionCount"]) + 1); if((ITL.b((bool?)e__4.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__4.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__4.get("this_k_2_1")) > 0 && ((string)e__4.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__4.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && ((bool?)e__4.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__4.get("this_z_p_ocsStatus"):((int?)e__4.get("this_z_p_ocsStatus") == 2 || (int?)e__4.get("this_z_p_ocsStatus") == 3?(int?)e__4.get("this_z_p_ocsStatus"):0)) != 0 || ITL.countDefault((int?)e__4.get("this_k_2_1")) > 0 && ((string)e__4.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__4.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) && ((bool?)e__4.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__4.get("this_z_p_ocsStatus"):((int?)e__4.get("this_z_p_ocsStatus") == 2 || (int?)e__4.get("this_z_p_ocsStatus") == 3?(int?)e__4.get("this_z_p_ocsStatus"):0)) != 2) { ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionOkCount"]) + 1); ItlDelete c110 = new ItlDelete("ocs:log", new SqlCollection("ocs:log", @"SELECT this.`_oid` AS this FROM ocs_log AS this LEFT JOIN ocs_card AS this_s_card On ((this.card = this_s_card.`_oid`) AND (this_s_card.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_s_card.`_oid` = #V_0&;)", new Map("#V_0&;|integer", (int?)e__4.get("this")), (List) EC.newList(new List()))); ; if(c110.exec()) { } else { } ItlDelete c111 = new ItlDelete("ocsCol:association", e__4); ; if(c111.exec()) { } else { } } else { ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionNotOkCount"]) + 1); } } } e__4.finish(); } else if(action__1 == "multiple-changeStatus") { int? newStatus__3 = (int?) ((int?)EC.itl.getParameterValue("integer", "newStatus")); ItlEnumerator e114 = new ItlEnumerator("G00011380_113", null, false); string _t5 = ITL.S(searchFilter__2); e114.add(new SqlEnumerator(new ItlRuntime.SQL.Collection("ocsCol:association", @"SELECT this.`_oid` AS this FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z_s_ocsCatalog.name = 'entreprises') AND (#V_0&; OR (this_z.ocsCreationLogin = #V_1&;)) AND (#V_2&; OR ((this.title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.object LIKE CONCAT('%', #V_3&;, '%')) OR ((this.headOffice LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_in_charge LIKE CONCAT('%', #V_3&;, '%')) OR ((this.person_title LIKE CONCAT('%', #V_3&;, '%')) OR ((this.address LIKE CONCAT('%', #V_3&;, '%')) OR ((this.contact LIKE CONCAT('%', #V_3&;, '%')) OR ((this.phoneNumber LIKE CONCAT('%', #V_3&;, '%')) OR ((this.mobilePhone LIKE CONCAT('%', #V_3&;, '%')) OR ((this.fax LIKE CONCAT('%', #V_3&;, '%')) OR ((this.email LIKE CONCAT('%', #V_3&;, '%')) OR (this.website LIKE CONCAT('%', #V_3&;, '%')))))))))))))) AND (IF((this_z_s_ocsCatalog.useValidation = 1),this_z.ocsStatus,IF(((this_z.ocsStatus = 2) OR (this_z.ocsStatus = 3)),this_z.ocsStatus,0)) = #V_4&;)", new ItlRuntime.SQL.Parameters( new ItlRuntime.SQL.Parameter("#V_0&;", (creatorFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_1&;", creatorFilter__2, "string"), new ItlRuntime.SQL.Parameter("#V_2&;", (searchFilter__2 == ""), "boolean"), new ItlRuntime.SQL.Parameter("#V_3&;", _t5, "string"), new ItlRuntime.SQL.Parameter("#V_4&;", statusFilter__2, "integer")), new ItlRuntime.SQL.OrderAliases(), new ItlRuntime.SQL.OptionalOrderAliases(), null, null), @"SELECT this.`_oid` AS this, this_z_s_ocsCatalog.`_oid` AS this_z_s_ocsCatalog, this_k_1.result1 AS this_k_1_1, this_k_2.result1 AS this_k_2_1, this_z.ocsStatus AS this_z_p_ocsStatus, this_z.ocsCreationLogin AS this_z_p_ocsCreationLogin, this_z_s_ocsCatalog.useValidation AS this_z_s_ocsCatalog_p_useValidation, this_z_s_ocsCatalog.editRightsMode AS this_z_s_ocsCatalog_p_editRightsMode FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;)) GROUP BY c1.`_oid`) AS this_k_1 On (this.`_oid` = this_k_1.origin) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;)) GROUP BY c1.`_oid`) AS this_k_2 On (this.`_oid` = this_k_2.origin) WHERE (this.iso_sid <> '')", new Map("#V_0&;|oids", EC.itl.categoryOids(true), "#V_1&;|oids", EC.itl.categoryOids(true)), false, (List) EC.newList(new List()), null, null)); ItlEnumerator e__5 = (ItlEnumerator) (e114); e__5.reset(); if(e__5.isNotEmpty()) { e__5.resetGroup(); for(e__5.start();e__5.test();e__5.fetch()) { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionCount"]) + 1); if(((ITL.b((bool?)e__5.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__5.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__5.get("this_k_2_1")) > 0 && ((string)e__5.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__5.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && ((bool?)e__5.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__5.get("this_z_p_ocsStatus"):((int?)e__5.get("this_z_p_ocsStatus") == 2 || (int?)e__5.get("this_z_p_ocsStatus") == 3?(int?)e__5.get("this_z_p_ocsStatus"):0)) != 0 || ITL.countDefault((int?)e__5.get("this_k_2_1")) > 0 && ((string)e__5.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__5.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) && ((bool?)e__5.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__5.get("this_z_p_ocsStatus"):((int?)e__5.get("this_z_p_ocsStatus") == 2 || (int?)e__5.get("this_z_p_ocsStatus") == 3?(int?)e__5.get("this_z_p_ocsStatus"):0)) != 2) && ((ITL.countDefault((int?)e__5.get("this_k_2_1")) > 0 && ((string)e__5.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__5.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__5.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__5.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__5.get("this_k_2_1")) > 0 && ((string)e__5.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__5.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__3 == 0 || (ITL.countDefault((int?)e__5.get("this_k_2_1")) > 0 && ((string)e__5.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__5.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__5.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__5.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__5.get("this_k_2_1")) > 0 && ((string)e__5.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__5.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__3 == 1 || (ITL.b((bool?)e__5.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__5.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__5.get("this_k_2_1")) > 0 && ((string)e__5.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__5.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && newStatus__3 == 2 || (ITL.countDefault((int?)e__5.get("this_k_2_1")) > 0 && ((string)e__5.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__5.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__5.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__5.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__5.get("this_k_2_1")) > 0 && ((string)e__5.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__5.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__3 == 3)) { ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionOkCount"]) + 1); if(((bool?)e__5.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__5.get("this_z_p_ocsStatus"):((int?)e__5.get("this_z_p_ocsStatus") == 2 || (int?)e__5.get("this_z_p_ocsStatus") == 3?(int?)e__5.get("this_z_p_ocsStatus"):0)) != newStatus__3) { int? previousStatus__4 = (int?) ((bool?)e__5.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__5.get("this_z_p_ocsStatus"):((int?)e__5.get("this_z_p_ocsStatus") == 2 || (int?)e__5.get("this_z_p_ocsStatus") == 3?(int?)e__5.get("this_z_p_ocsStatus"):0)); ItlUpdateObject c130 = new ItlUpdateObject("ocsCol:association", null, e__5); ; c130.setField("ocsStatus", newStatus__3, "integer", "ocs:card"); if(c130.exec()) { ItlCreate c132 = new ItlCreate("ocs:log", null, null); ; c132.setAssociation("card", e__5, "object:ocs:card", "ocs:log", true, false); c132.setField("userLogin", EC.itl.login(), "string", "ocs:log", 255); c132.setField("date", EC.itl.now(), "date", "ocs:log"); c132.setField("comment", "", "string", "ocs:log", 255); c132.setField("cardStatus", newStatus__3, "integer", "ocs:log"); if(c132.exec()) { } else { } } else { } } } else { ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionNotOkCount"]) + 1); } } } e__5.finish(); } } } else { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = 0); ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = 0); ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = 0); if(action__1 == "multiple-delete") { ItlEnumerator e135 = new ItlEnumerator("G00011380_134", null, false); e135.add(new SqlEnumerator(new ItlRuntime.SQL.Collection("ocsCol:association", @"SELECT this.`_oid` AS this FROM ocsCol_association AS this INNER JOIN ocs_card AS this_z On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;))", new ItlRuntime.SQL.Parameters( new ItlRuntime.SQL.Parameter("#V_0&;", ITL.S(oids__1), "oids")), new ItlRuntime.SQL.OrderAliases(), new ItlRuntime.SQL.OptionalOrderAliases(), null, null), @"SELECT this.`_oid` AS this, this_z_s_ocsCatalog.`_oid` AS this_z_s_ocsCatalog, this_k_1.result1 AS this_k_1_1, this_k_2.result1 AS this_k_2_1, this_z.ocsStatus AS this_z_p_ocsStatus, this_z.ocsCreationLogin AS this_z_p_ocsCreationLogin, this_z_s_ocsCatalog.useValidation AS this_z_s_ocsCatalog_p_useValidation, this_z_s_ocsCatalog.editRightsMode AS this_z_s_ocsCatalog_p_editRightsMode FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;)) GROUP BY c1.`_oid`) AS this_k_1 On (this.`_oid` = this_k_1.origin) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;)) GROUP BY c1.`_oid`) AS this_k_2 On (this.`_oid` = this_k_2.origin) WHERE (this.iso_sid <> '')", new Map("#V_0&;|oids", EC.itl.categoryOids(true), "#V_1&;|oids", EC.itl.categoryOids(true)), false, (List) EC.newList(new List()), null, null)); ItlEnumerator e__6 = (ItlEnumerator) (e135); e__6.reset(); if(e__6.isNotEmpty()) { e__6.resetGroup(); for(e__6.start();e__6.test();e__6.fetch()) { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionCount"]) + 1); if((ITL.b((bool?)e__6.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__6.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__6.get("this_k_2_1")) > 0 && ((string)e__6.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__6.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && ((bool?)e__6.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__6.get("this_z_p_ocsStatus"):((int?)e__6.get("this_z_p_ocsStatus") == 2 || (int?)e__6.get("this_z_p_ocsStatus") == 3?(int?)e__6.get("this_z_p_ocsStatus"):0)) != 0 || ITL.countDefault((int?)e__6.get("this_k_2_1")) > 0 && ((string)e__6.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__6.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) && ((bool?)e__6.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__6.get("this_z_p_ocsStatus"):((int?)e__6.get("this_z_p_ocsStatus") == 2 || (int?)e__6.get("this_z_p_ocsStatus") == 3?(int?)e__6.get("this_z_p_ocsStatus"):0)) != 2) { ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionOkCount"]) + 1); ItlDelete c141 = new ItlDelete("ocs:log", new SqlCollection("ocs:log", @"SELECT this.`_oid` AS this FROM ocs_log AS this LEFT JOIN ocs_card AS this_s_card On ((this.card = this_s_card.`_oid`) AND (this_s_card.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_s_card.`_oid` = #V_0&;)", new Map("#V_0&;|integer", (int?)e__6.get("this")), (List) EC.newList(new List()))); ; if(c141.exec()) { } else { } ItlDelete c142 = new ItlDelete("ocsCol:association", e__6); ; if(c142.exec()) { } else { } } else { ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionNotOkCount"]) + 1); } } } e__6.finish(); } else if(action__1 == "multiple-changeStatus") { int? newStatus__4 = (int?) ((int?)EC.itl.getParameterValue("integer", "newStatus")); ItlEnumerator e145 = new ItlEnumerator("G00011380_144", null, false); e145.add(new SqlEnumerator(new ItlRuntime.SQL.Collection("ocsCol:association", @"SELECT this.`_oid` AS this FROM ocsCol_association AS this INNER JOIN ocs_card AS this_z On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;))", new ItlRuntime.SQL.Parameters( new ItlRuntime.SQL.Parameter("#V_0&;", ITL.S(oids__1), "oids")), new ItlRuntime.SQL.OrderAliases(), new ItlRuntime.SQL.OptionalOrderAliases(), null, null), @"SELECT this.`_oid` AS this, this_z_s_ocsCatalog.`_oid` AS this_z_s_ocsCatalog, this_k_1.result1 AS this_k_1_1, this_k_2.result1 AS this_k_2_1, this_z.ocsStatus AS this_z_p_ocsStatus, this_z.ocsCreationLogin AS this_z_p_ocsCreationLogin, this_z_s_ocsCatalog.useValidation AS this_z_s_ocsCatalog_p_useValidation, this_z_s_ocsCatalog.editRightsMode AS this_z_s_ocsCatalog_p_editRightsMode FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_validationRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_0&;)) GROUP BY c1.`_oid`) AS this_k_1 On (this.`_oid` = this_k_1.origin) LEFT JOIN (SELECT c1.`_oid` AS origin, COUNT(DISTINCT this.`_oid`) AS result1 FROM xrm_category AS this INNER JOIN (ocs_catalog AS c0 INNER JOIN ocs_catalog_redactionRights AS c0_l On ((c0.`_oid` = c0_l.`_from`) AND (c0.iso_sid <> '')) INNER JOIN (ocs_card AS c1 INNER JOIN ocs_card AS c1_z On ((c1.`_oid` = c1_z.`_oid`) AND (c1_z.iso_sid <> ''))) On ((c0.`_oid` = c1.ocsCatalog) AND (c1.iso_sid <> ''))) On ((this.`_oid` = c0_l.`_to`) AND (c0_l.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` IN (#V_1&;)) GROUP BY c1.`_oid`) AS this_k_2 On (this.`_oid` = this_k_2.origin) WHERE (this.iso_sid <> '')", new Map("#V_0&;|oids", EC.itl.categoryOids(true), "#V_1&;|oids", EC.itl.categoryOids(true)), false, (List) EC.newList(new List()), null, null)); ItlEnumerator e__7 = (ItlEnumerator) (e145); e__7.reset(); if(e__7.isNotEmpty()) { e__7.resetGroup(); for(e__7.start();e__7.test();e__7.fetch()) { ocsMultipleActionCount = (int?)(ITL.gv["ocsMultipleActionCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionCount"]) + 1); if(((ITL.b((bool?)e__7.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__7.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__7.get("this_k_2_1")) > 0 && ((string)e__7.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__7.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && ((bool?)e__7.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__7.get("this_z_p_ocsStatus"):((int?)e__7.get("this_z_p_ocsStatus") == 2 || (int?)e__7.get("this_z_p_ocsStatus") == 3?(int?)e__7.get("this_z_p_ocsStatus"):0)) != 0 || ITL.countDefault((int?)e__7.get("this_k_2_1")) > 0 && ((string)e__7.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__7.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) && ((bool?)e__7.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__7.get("this_z_p_ocsStatus"):((int?)e__7.get("this_z_p_ocsStatus") == 2 || (int?)e__7.get("this_z_p_ocsStatus") == 3?(int?)e__7.get("this_z_p_ocsStatus"):0)) != 2) && ((ITL.countDefault((int?)e__7.get("this_k_2_1")) > 0 && ((string)e__7.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__7.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__7.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__7.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__7.get("this_k_2_1")) > 0 && ((string)e__7.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__7.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__4 == 0 || (ITL.countDefault((int?)e__7.get("this_k_2_1")) > 0 && ((string)e__7.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__7.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__7.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__7.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__7.get("this_k_2_1")) > 0 && ((string)e__7.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__7.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__4 == 1 || (ITL.b((bool?)e__7.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__7.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__7.get("this_k_2_1")) > 0 && ((string)e__7.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__7.get("this_z_p_ocsCreationLogin") == EC.itl.login():true)) && newStatus__4 == 2 || (ITL.countDefault((int?)e__7.get("this_k_2_1")) > 0 && ((string)e__7.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__7.get("this_z_p_ocsCreationLogin") == EC.itl.login():true) || (ITL.b((bool?)e__7.get("this_z_s_ocsCatalog_p_useValidation"))?ITL.countDefault((int?)e__7.get("this_k_1_1")) > 0:ITL.countDefault((int?)e__7.get("this_k_2_1")) > 0 && ((string)e__7.get("this_z_s_ocsCatalog_p_editRightsMode") == "author"?(string)e__7.get("this_z_p_ocsCreationLogin") == EC.itl.login():true))) && newStatus__4 == 3)) { ocsMultipleActionOkCount = (int?)(ITL.gv["ocsMultipleActionOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionOkCount"]) + 1); if(((bool?)e__7.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__7.get("this_z_p_ocsStatus"):((int?)e__7.get("this_z_p_ocsStatus") == 2 || (int?)e__7.get("this_z_p_ocsStatus") == 3?(int?)e__7.get("this_z_p_ocsStatus"):0)) != newStatus__4) { int? previousStatus__5 = (int?) ((bool?)e__7.get("this_z_s_ocsCatalog_p_useValidation") == true?(int?)e__7.get("this_z_p_ocsStatus"):((int?)e__7.get("this_z_p_ocsStatus") == 2 || (int?)e__7.get("this_z_p_ocsStatus") == 3?(int?)e__7.get("this_z_p_ocsStatus"):0)); ItlUpdateObject c161 = new ItlUpdateObject("ocsCol:association", null, e__7); ; c161.setField("ocsStatus", newStatus__4, "integer", "ocs:card"); if(c161.exec()) { ItlCreate c163 = new ItlCreate("ocs:log", null, null); ; c163.setAssociation("card", e__7, "object:ocs:card", "ocs:log", true, false); c163.setField("userLogin", EC.itl.login(), "string", "ocs:log", 255); c163.setField("date", EC.itl.now(), "date", "ocs:log"); c163.setField("comment", "", "string", "ocs:log", 255); c163.setField("cardStatus", newStatus__4, "integer", "ocs:log"); if(c163.exec()) { } else { } } else { } } } else { ocsMultipleActionNotOkCount = (int?)(ITL.gv["ocsMultipleActionNotOkCount"] = ITL.i((int?)ITL.gv["ocsMultipleActionNotOkCount"]) + 1); } } } e__7.finish(); } } } } %>

Entreprises (<% ITL.show(EC.itl.toInteger(new SqlCollection("ocsCol:association", @"SELECT COUNT(DISTINCT this.data) AS result FROM (SELECT this.title AS this_p_title, this.`_oid` AS this, this.`_oid` AS data FROM ocsCol_association AS this INNER JOIN (ocs_card AS this_z LEFT JOIN ocs_catalog AS this_z_s_ocsCatalog On ((this_z.ocsCatalog = this_z_s_ocsCatalog.`_oid`) AND (this_z_s_ocsCatalog.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z_s_ocsCatalog.name = 'entreprises')) AS this", new Map(), (List) EC.newList(new List(), "this_p_title")).get("result")), "string", "html", "integer"); %>)