Ticket #2151 (closed enhancement: duplicate)
Adding javascript calender to custom field
| Reported by: | zgantar@… | Owned by: | jonas |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | ticket system | Version: | |
| Severity: | major | Keywords: | |
| Cc: | zgantar@…, whueskes@…, bithika@… |
Description
It would be nice to be able to append javascript calendar to custom field in ticket! I tried it myself but I'm having some problems. First I added javascript and css to header.cs:
<link rel="stylesheet" href="<?cs var:chrome.href ?>/common/css/datepickercontrol_mozilla.css" type="text/css" /> <script type="text/javascript" src="<?cs var:chrome.href ?>/common/js/datepickercontrol.js"></script>
Then added some more code, that is needed for this javascript datepickercontrol.js to newticket.cs: (day and month names are in slovene so don't bother with them!)
<input type="hidden" id="DPC_TODAY_TEXT" value="danes"> <input type="hidden" id="DPC_BUTTON_TITLE" value="Odpri koledar..."> <input type="hidden" id="DPC_MONTH_NAMES" value="['januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december']"> <input type="hidden" id="DPC_DAY_NAMES" value="['ned', 'pon', 'tor', 'sre', 'čet', 'pet', 'sob']"> <input type="hidden" id="DPC_BUTTON_POSITION" value="out">
But the real problem bigins next, how to append this datepickercontrol to inputfield!
- in Trac 8.4:
The datepickercontrol showed after adding some more code in macros.cs to ticket_custom_props:
if c.type == 'text' ?><?cs
if c.name == 'datum'?>
<input type="text" name="custom_<?cs var c.name ?>" value="<?cs var c.value ?>" id="custom_<?cs var c.name ?>" datepicker="true"/>(oblika: dd.mm.llll)
<?cs else ?>
<input type="text" name="custom_<?cs var c.name ?>" value="<?cs var c.value ?>" id="custom_<?cs var c.name ?>"<?cs
/if ?><?cs
But it was in the wrong place, not where it was soposed to be, and I couldn't fix it. Everything else worked like it was soposed to!
- in Trac 0.9b2
The problem here is that I can't write something like I did in macros.cs because the code moved to newticket.cs and was also changed a bit! So I don't know how to write an if statement because of this changes, mainly because I can't seem to get the right name out of:
var:name(field)
Please help!!


