<%@ Page Language="C#" Buffer="true" CodeFile="albumEdit.aspx.cs" Inherits="_albumEdit" 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"; %> " /> Album <% SqlObject resource = (SqlObject) (new SqlObject("alb:resource", @"SELECT this.`_oid` AS this FROM alb_resource AS this WHERE (this.iso_sid <> '') AND (this.`_oid` = #V_0&;)", new Map("#V_0&;|integer", EC.itl.toInteger(EC.itl.getParameterValue("object:alb:resource", "resource"))),true)); string label = (string) ((string)EC.itl.getParameterValue("string", "label")); string description = (string) ((string)EC.itl.getParameterValue("string", "description")); string keywords = (string) ((string)EC.itl.getParameterValue("string", "keywords")); bool? autocommit = (bool?) ((bool?)EC.itl.getParameterValue("boolean", "autocommit", false)); string cmd = (string) ((string)EC.itl.getParameterValue("string", "cmd", "")); string type = (string) ((string)EC.itl.getParameterValue("string", "type", "")); int? resourceOid = (int?) ((int?)resource.get("this")); if(cmd == "save") { if(ITL.isNotNull((int?)resource.get("this"))) { ItlUpdateObject c2 = new ItlUpdateObject("alb:resource", "resource", resource); ; c2.setField("label_fr", label, "string", "alb:resource", 64); c2.setField("description_fr", description, "string", "alb:resource", 255); c2.setField("label_fr", label, "string", "alb:resource", 64); c2.setAssociation("keywords", keywords, "collection:kwd:keyword", "alb:resource", true, true); c2.exec();; } else { resourceOid = AlbAlbumManager.createResource("file", label, description); SqlObject resource__1 = (SqlObject) (new SqlObject("alb:resource", @"SELECT this.`_oid` AS this FROM alb_resource AS this WHERE (this.iso_sid <> '') AND (this.`_oid` = #V_0&;)", new Map("#V_0&;|integer", resourceOid),false)); if(ITL.isNotNull((int?)resource__1.get("this"))) { SqlObject _t0 = new SqlObject("alb:resource", @"SELECT this.`_oid` AS this FROM alb_resource AS this WHERE (this.iso_sid <> '') AND (this.`_oid` = #V_0&;)", new Map("#V_0&;|integer", resourceOid),false); ItlUpdateObject c6 = new ItlUpdateObject("alb:resource", null, _t0); ; c6.setAssociation("keywords", keywords, "collection:kwd:keyword", "alb:resource", true, true); c6.exec();; } resource__1.close(); } } SqlObject resource__2 = (SqlObject) (new SqlObject("alb:resource", @"SELECT this.`_oid` AS this, this_c_alb_image.`_oid` AS this_c_alb_image, this.urlDir AS this_p_urlDir, this.filename AS this_p_filename, this.extension AS this_p_extension, this.filesize AS this_p_filesize, this.label_fr AS this_p_label_fr, this.description_fr AS this_p_description_fr, this_c_alb_image.width AS this_c_alb_image_p_width, this_c_alb_image.height AS this_c_alb_image_p_height, this_c_alb_image.frames AS this_c_alb_image_p_frames FROM alb_resource AS this LEFT JOIN (alb_image AS this_c_alb_image INNER JOIN alb_resource AS this_c_alb_image_z On ((this_c_alb_image.`_oid` = this_c_alb_image_z.`_oid`) AND (this_c_alb_image_z.iso_sid <> ''))) On ((this.`_oid` = this_c_alb_image.`_oid`) AND (this_c_alb_image.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this.`_oid` = #V_0&;)", new Map("#V_0&;|integer", resourceOid),false)); if(ITL.b(autocommit) && EC.itl.toBoolean(resource__2)) { %><% } else {%>
<% if(type == "show" && !ITL.isNotNull((int?)resource__2.get("this"))) { %>

Sélectionner un fichier dans la liste principale pour pouvoir l'éditer.

<% } else {%><%ItlForm form8 = new ItlForm("form8", EC.itl.getId(), "./albumEdit.aspx", "G00010002_9"); form8.setProperty("name", "edit"); form8.setProperty("enctype", "multipart/form-data"); form8.setProperty("forcevisibility", true); form8.setProperty("target", "editor"); form8.setProperty("hasProcessing", false); form8.addParameter("resource", EC.itl.makeParameter(resource__2, "object")); form8.addParameter("cmd", "save"); form8.addParameter("autocommit", "false"); form8.show(); %><% if(ITL.isNotNull((int?)resource__2.get("this"))) { %><% } else {%><% } %>
<% if(ITL.isNotNull((int?)resource__2.get("this_c_alb_image"))) { %> style="width:214px;height:254px;"> <% if(ITL.isNotNull((int?)resource__2.get("this_c_alb_image"))) { int effectiveWidth = (int) (EC.itl.getEffectiveWidth((int?)resource__2.get("this_c_alb_image_p_width"), (int?)resource__2.get("this_c_alb_image_p_height"), 214, 214)); int effectiveHeight = (int) (EC.itl.getEffectiveHeight((int?)resource__2.get("this_c_alb_image_p_width"), (int?)resource__2.get("this_c_alb_image_p_height"), 214, 214)); %>

> > <% ItlLink link11 = new ItlLink(""); link11.setProperty("class", "link"); link11.show(); %> class="image"<%ITL.showAttributeWithName("title", ITL.S((string)resource__2.get("this_p_filename")) + ITL.S((string)resource__2.get("this_p_extension")));ITL.showAttributeWithName("alt", ITL.S((string)resource__2.get("this_p_filename")) + ITL.S((string)resource__2.get("this_p_extension")));ITL.showAttributeWithName("height", effectiveHeight);ITL.showAttributeWithName("width", effectiveWidth);%>/><% link11.close(); %>

<% } else { } %>

<% ITL.show(ITL.S((string)resource__2.get("this_p_filename")) + ITL.S((string)resource__2.get("this_p_extension")), "string", "html", "string"); %> - <% ITL.show((ITL.S((int?)resource__2.get("this_c_alb_image_p_width")) + " x ") + ITL.S((int?)resource__2.get("this_c_alb_image_p_height")), "string", "html", "string"); %> - <% ITL.show((int?)resource__2.get("this_p_filesize"), "ko", "html", "integer"); %>

<% } else {%> style="width:214px;height:254px;">
<% ITL.show(ITL.S((string)resource__2.get("this_p_filename")) + ITL.S((string)resource__2.get("this_p_extension")), "string", "html", "string"); %> - <% ITL.show((int?)resource__2.get("this_p_filesize"), "ko", "html", "integer"); %>

<% } %>
<%OdfControl input14 = OdfControlFactory.create("generic", "c_label", "label", null); input14.setForm(form8); input14.setProperty("width", "264"); input14.setProperty("kind", "required"); input14.setProperty("label", "Libellé"); input14.setProperty("onchange", "modifyResource();"); input14.setProperty("value", EC.itl.makeParameter((string)resource__2.get("this_p_label_fr"), "string")); input14.show(); %>
<%OdfControl input15 = OdfControlFactory.create("textArea", "c_description", "description", null); input15.setForm(form8); input15.setProperty("width", "264"); input15.setProperty("height", "40"); input15.setProperty("onchange", "modifyResource();"); input15.setProperty("value", EC.itl.makeParameter((string)resource__2.get("this_p_description_fr"), "string")); input15.show(); %>
<%OdfControl input16 = OdfControlFactory.create("keyword", "c_keywords", "keywords", null); input16.setForm(form8); input16.setProperty("width", "264"); input16.setProperty("height", "40"); input16.setProperty("onclick", "modifyResource();"); input16.setProperty("value", EC.itl.makeParameter(resource__2.getCollection("keywords", "kwd:keyword", true, true), "collection")); input16.setProperty("popupLink", "./kwdPopup.aspx"); input16.show(); %>
 
<% if(ITL.isNotNull((int?)resource__2.get("this"))) { %>
<% ItlLink link17 = new ItlLink("#"); link17.setProperty("renderstyle", "admButton"); link17.setProperty("onclick", "document.forms.edit.submitButton.click();return false;"); link17.setProperty("title", "Enregistrer les modifications"); link17.show(); %> Modifier <% link17.close(); %>><% if(ITL.isNotNull((int?)resource__2.get("this"))) { ItlLink link19 = new ItlLink("#"); link19.setProperty("renderstyle", "admButton"); link19.setProperty("onclick", "return selectResource();"); link19.setProperty("title", "Enregistrer les modifications"); link19.show(); %> Sélectionner <% link19.close(); } %>
<% } else {%><% ItlLink link20 = new ItlLink("#"); link20.setProperty("renderstyle", "admButton"); link20.setProperty("onclick", "document.forms.edit.submitButton.click();return false;"); link20.setProperty("title", "Enregistrer les modifications"); link20.show(); %> Ajouter dans l'album <% link20.close(); %><% } %>
<%form8.close(); } %>
<% if(ITL.isNotNull((int?)resource__2.get("this"))) { %><% } } resource__2.close(); resource.close();%>