|
Lines 1503-1508
Link Here
|
| 1503 |
</select> |
1503 |
</select> |
| 1504 |
<div class="hint">Select which authorized value category the user will choose from.</div> |
1504 |
<div class="hint">Select which authorized value category the user will choose from.</div> |
| 1505 |
</div> |
1505 |
</div> |
|
|
1506 |
<div id="runtime_param_options" style="display:none"> |
| 1507 |
<label>Parameter options:</label> |
| 1508 |
<div class="form-check-inline"> |
| 1509 |
<input type="radio" class="form-check-input" id="include_all_check" name="param_option" value=":all"> |
| 1510 |
<label class="form-check-label" for="include_all_check">Include option for all</label> |
| 1511 |
<input type="radio" class="form-check-input" id="multi_select_check" name="param_option" value=":in"> |
| 1512 |
<label class="form-check-label" for="multi_select_check">Allow multiple selections</label> |
| 1513 |
</div> |
| 1514 |
</div> |
| 1506 |
</div> <!-- /.modal-body --> |
1515 |
</div> <!-- /.modal-body --> |
| 1507 |
<div class="modal-footer"> |
1516 |
<div class="modal-footer"> |
| 1508 |
<button type="submit" id="sendParam" class="btn btn-default approve">Insert parameter</button> |
1517 |
<button type="submit" id="sendParam" class="btn btn-default approve">Insert parameter</button> |
|
Lines 1690-1705
Link Here
|
| 1690 |
$("#authorised_value_category").show(); |
1699 |
$("#authorised_value_category").show(); |
| 1691 |
$("label[for='authorised_value']").addClass("required"); |
1700 |
$("label[for='authorised_value']").addClass("required"); |
| 1692 |
$("#authorised_value").prop("required", true ).attr("required", "required").addClass("required"); |
1701 |
$("#authorised_value").prop("required", true ).attr("required", "required").addClass("required"); |
|
|
1702 |
$("#runtime_param_options").show(); |
| 1693 |
break; |
1703 |
break; |
| 1694 |
case "insertCnSource": |
1704 |
case "insertCnSource": |
| 1695 |
modalTitle.text( _("Insert classification source parameter") ); |
1705 |
modalTitle.text( _("Insert classification source parameter") ); |
| 1696 |
$("#paramLabel").val( _("Source of classification or shelving scheme") ); |
1706 |
$("#paramLabel").val( _("Source of classification or shelving scheme") ); |
| 1697 |
$("#param_category").val("cn_source"); |
1707 |
$("#param_category").val("cn_source"); |
|
|
1708 |
$("#runtime_param_options").show(); |
| 1698 |
break; |
1709 |
break; |
| 1699 |
case "insertFramework": |
1710 |
case "insertFramework": |
| 1700 |
modalTitle.text( _("Insert bibliographic framework parameter") ); |
1711 |
modalTitle.text( _("Insert bibliographic framework parameter") ); |
| 1701 |
$("#paramLabel").val( _("Framework") ); |
1712 |
$("#paramLabel").val( _("Framework") ); |
| 1702 |
$("#param_category").val("biblio_framework"); |
1713 |
$("#param_category").val("biblio_framework"); |
|
|
1714 |
$("#runtime_param_options").show(); |
| 1703 |
break; |
1715 |
break; |
| 1704 |
case "insertDate": |
1716 |
case "insertDate": |
| 1705 |
modalTitle.text( _("Insert date parameter") ); |
1717 |
modalTitle.text( _("Insert date parameter") ); |
|
Lines 1710-1740
Link Here
|
| 1710 |
modalTitle.text( _("Insert item types parameter") ); |
1722 |
modalTitle.text( _("Insert item types parameter") ); |
| 1711 |
$("#paramLabel").val( _("Item type") ); |
1723 |
$("#paramLabel").val( _("Item type") ); |
| 1712 |
$("#param_category").val("itemtypes"); |
1724 |
$("#param_category").val("itemtypes"); |
|
|
1725 |
$("#runtime_param_options").show(); |
| 1713 |
break; |
1726 |
break; |
| 1714 |
case "insertBranches": |
1727 |
case "insertBranches": |
| 1715 |
modalTitle.text( _("Insert libraries parameter") ); |
1728 |
modalTitle.text( _("Insert libraries parameter") ); |
| 1716 |
$("#paramLabel").val( _("Library") ); |
1729 |
$("#paramLabel").val( _("Library") ); |
| 1717 |
$("#param_category").val("branches"); |
1730 |
$("#param_category").val("branches"); |
|
|
1731 |
$("#runtime_param_options").show(); |
| 1718 |
break; |
1732 |
break; |
| 1719 |
case "insertCategorycode": |
1733 |
case "insertCategorycode": |
| 1720 |
modalTitle.text( _("Insert patron category parameter") ); |
1734 |
modalTitle.text( _("Insert patron category parameter") ); |
| 1721 |
$("#paramLabel").val( _("Patron category") ); |
1735 |
$("#paramLabel").val( _("Patron category") ); |
| 1722 |
$("#param_category").val("categorycode"); |
1736 |
$("#param_category").val("categorycode"); |
|
|
1737 |
$("#runtime_param_options").show(); |
| 1723 |
break; |
1738 |
break; |
| 1724 |
case "insertCashregister": |
1739 |
case "insertCashregister": |
| 1725 |
modalTitle.text( _("Insert cash register parameter") ); |
1740 |
modalTitle.text( _("Insert cash register parameter") ); |
| 1726 |
$("#paramLabel").val( _("Cash register") ); |
1741 |
$("#paramLabel").val( _("Cash register") ); |
| 1727 |
$("#param_category").val("cash_registers"); |
1742 |
$("#param_category").val("cash_registers"); |
|
|
1743 |
$("#runtime_param_options").show(); |
| 1728 |
break; |
1744 |
break; |
| 1729 |
case "insertDebittypes": |
1745 |
case "insertDebittypes": |
| 1730 |
modalTitle.text( _("Insert debit type parameter") ); |
1746 |
modalTitle.text( _("Insert debit type parameter") ); |
| 1731 |
$("#paramLabel").val( _("Debit type") ); |
1747 |
$("#paramLabel").val( _("Debit type") ); |
| 1732 |
$("#param_category").val("debit_types"); |
1748 |
$("#param_category").val("debit_types"); |
|
|
1749 |
$("#runtime_param_options").show(); |
| 1733 |
break; |
1750 |
break; |
| 1734 |
case "insertCredittypes": |
1751 |
case "insertCredittypes": |
| 1735 |
modalTitle.text( _("Insert credit type parameter") ); |
1752 |
modalTitle.text( _("Insert credit type parameter") ); |
| 1736 |
$("#paramLabel").val( _("Credit type") ); |
1753 |
$("#paramLabel").val( _("Credit type") ); |
| 1737 |
$("#param_category").val("credit_types"); |
1754 |
$("#param_category").val("credit_types"); |
|
|
1755 |
$("#runtime_param_options").show(); |
| 1738 |
break; |
1756 |
break; |
| 1739 |
case "insertList": |
1757 |
case "insertList": |
| 1740 |
modalTitle.text( _("Insert list parameter") ); |
1758 |
modalTitle.text( _("Insert list parameter") ); |
|
Lines 2149-2154
Link Here
|
| 2149 |
$("#runtime_parameters").on("hide.bs.modal", function(){ |
2167 |
$("#runtime_parameters").on("hide.bs.modal", function(){ |
| 2150 |
$("#send_runtime_parameter")[0].reset(); |
2168 |
$("#send_runtime_parameter")[0].reset(); |
| 2151 |
$("#authorised_value_category").val("").hide(); |
2169 |
$("#authorised_value_category").val("").hide(); |
|
|
2170 |
$("#runtime_param_options").val("").hide(); |
| 2152 |
$("label[for='authorised_value']").removeClass("required"); |
2171 |
$("label[for='authorised_value']").removeClass("required"); |
| 2153 |
$("#authorised_value").prop("required", false ).removeAttr("required").removeClass("required"); |
2172 |
$("#authorised_value").prop("required", false ).removeAttr("required").removeClass("required"); |
| 2154 |
}); |
2173 |
}); |
|
Lines 2159-2164
Link Here
|
| 2159 |
var paramLabel = $("#paramLabel").val(); |
2178 |
var paramLabel = $("#paramLabel").val(); |
| 2160 |
var param_category = $("#param_category").val(); |
2179 |
var param_category = $("#param_category").val(); |
| 2161 |
var categoryLabel = $("#authorised_value").val(); |
2180 |
var categoryLabel = $("#authorised_value").val(); |
|
|
2181 |
var param_option = $('#runtime_param_options input[name="param_option"]:checked').val(); |
| 2162 |
// Get CodeMirror environment variables |
2182 |
// Get CodeMirror environment variables |
| 2163 |
var selection = editor.getSelection(); |
2183 |
var selection = editor.getSelection(); |
| 2164 |
var doc = editor.getDoc(); |
2184 |
var doc = editor.getDoc(); |
|
Lines 2176-2181
Link Here
|
| 2176 |
} else if( param_category ){ |
2196 |
} else if( param_category ){ |
| 2177 |
text += param_category; |
2197 |
text += param_category; |
| 2178 |
} |
2198 |
} |
|
|
2199 |
if( param_option ){ |
| 2200 |
text += param_option; |
| 2201 |
} |
| 2179 |
if( text != "" ){ |
2202 |
if( text != "" ){ |
| 2180 |
text = " <<" + text + ">> "; |
2203 |
text = " <<" + text + ">> "; |
| 2181 |
if( selection.length > 0){ |
2204 |
if( selection.length > 0){ |
| 2182 |
- |
|
|