Skip to content
Snippets Groups Projects
Commit 811ac71c authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FIX #5353 fix if in setradiobutton function

parent 8b9636e4
No related branches found
No related tags found
No related merge requests found
......@@ -60,36 +60,31 @@ function changeStyle(style_id, path_to_script)
function setradiobutton(target)
{
$("html").style.display="inline";
$("office").style.display="inline";
$("txt").style.display="inline";
$("span_html").style.display="inline";
$("span_office").style.display="inline";
$("span_txt").style.display="inline";
$("template_attachment_type_tr").style.display="none";
$j("#html,#office,#txt,#span_html,#span_office,#span_txt").css({"display":"inline"});
$j("#template_attachment_type_tr").hide();
if(target=="notes"|| target=="sendmail") {
$("html").style.display="none";
$("span_html").style.display="none";
$("txt").click();
$("txt").checked = true;
$("office").style.display="none";
$("span_office").style.display="none";
if(target=="notes") {
$j("#html,#span_html,#office,#span_office").hide();
$j("#txt").click();
}else if(target=="sendmail") {
$j("#office,#span_office").hide();
$j("#html").click();
console.log("office caché !");
} else if(target=="notifications") {
$("txt").style.display="none";
$("span_txt").style.display="none";
$("html").click();
$("html").checked = true;
$("office").style.display="none";
$("span_office").style.display="none";
$j("#txt,#span_txt,#office,#span_office").hide();
$j("#html").click();
} else if (target=="attachments"){
$("template_attachment_type_tr").style.display="inline";
$j("#txt,#span_txt,#html,#span_html").hide();
$j("#office").click();
$j("#template_attachment_type_tr").css({"display":"inline"});
} else if(target=="doctypes") {
$j("#txt,#span_txt,#office,#span_office").hide();
$j("#html").click();
}
if (target != "attachments") {
$("template_attachment_type").selectedIndex="0";
$j("#template_attachment_type").selectedIndex="0";
}
}
function select_template(path_to_script, attachment_type)
......
......@@ -137,8 +137,7 @@ if ($mode == 'list') {
?>
<option value="<?php functions::xecho($_SESSION['m_admin']['templatesTargets'][$cptTarget]['id']);?>" <?php
if (isset($_SESSION['m_admin']['templates']['template_target'])
&& $_SESSION['m_admin']['templates']['template_target']
== $_SESSION['m_admin']['templatesTargets'][$cptTarget]['id']
&& $_SESSION['m_admin']['templates']['template_target'] == $_SESSION['m_admin']['templatesTargets'][$cptTarget]['id']
) {
echo 'selected="selected"';
}
......@@ -184,6 +183,7 @@ if ($mode == 'list') {
onClick="javascript:show_special_form_3_elements('txt_div', 'html_div', 'office_div');" <?php
echo $checkedTXT;?>/> <span id="span_txt"><?php echo _TXT;?></span>
</p>
<script>setradiobutton($j("#template_target").val());</script>
<p>
<label for="template_datasource"><?php echo _TEMPLATE_DATASOURCE;?> : </label>
<select name="template_datasource" id="template_datasource">
......@@ -197,8 +197,7 @@ if ($mode == 'list') {
?>
<option value="<?php functions::xecho($_SESSION['m_admin']['templatesDatasources'][$cptDatasource]['id']);?>" <?php
if (isset($_SESSION['m_admin']['templates']['template_datasource'])
&& $_SESSION['m_admin']['templates']['template_datasource']
== $_SESSION['m_admin']['templatesDatasources'][$cptDatasource]['id']
&& $_SESSION['m_admin']['templates']['template_datasource'] == $_SESSION['m_admin']['templatesDatasources'][$cptDatasource]['id']
) {
echo 'selected="selected"';
}
......@@ -257,9 +256,8 @@ if ($mode == 'list') {
functions::xecho($_SESSION['m_admin']['templatesStyles'][$cptStyle]['fileExt']); echo ': ';
functions::xecho($_SESSION['m_admin']['templatesStyles'][$cptStyle]['fileName']);
?>" <?php
if (isset($_SESSION['m_admin']['templates']['template_style'])
&& $_SESSION['m_admin']['templates']['template_style']
== $_SESSION['m_admin']['templatesStyles'][$cptStyle]['fileName']
if(isset($_SESSION['m_admin']['templates']['template_style'])
&& $_SESSION['m_admin']['templates']['template_style'] == $_SESSION['m_admin']['templatesStyles'][$cptStyle]['fileName']
) {
echo 'selected="selected"';
}
......@@ -445,35 +443,6 @@ if ($mode == 'list') {
</script>
<?php
}
if (isset($_SESSION['m_admin']['templates']['template_target'])
&& $_SESSION['m_admin']['templates']['template_target']
== "notes"
) {
?>
<script>
setradiobutton("notes");
</script>
<?php
} else if (isset($_SESSION['m_admin']['templates']['template_target'])
&& $_SESSION['m_admin']['templates']['template_target']
== "notifications"
) {
?>
<script>
setradiobutton("notifications");
</script>
<?php
} else if (isset($_SESSION['m_admin']['templates']['template_target'])
&& $_SESSION['m_admin']['templates']['template_target']
== "attachments"
) {
?>
<script>
setradiobutton("attachments");
</script>
<?php
}
}
?>
</div>
......
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