The problem was, that the script was looking for the first
and second <a> tag in the code. When using plugins in the framework
this can't work. The patch changes the script to select the correct
<a> tags by using a class.
Also changes + and - to 'Add' and 'Delete' to make the meaning clearer
and clicking on them a bit easier.
To test:
1) AcqCreateItem = order
- Create a basket
- Create an order line
- Create more than one item
- Delete items
- Check quantity is calculated correctly
- Check items are created correctly
2) AcqCreateItem = receive
- Create basket
- Create 2 order lines, order >1 items
- Do a partial item by removing items from the receive form
- Receive all missing items
- Receive more items than ordered
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
var CloneButtonPlus;
var CloneButtonMinus;
// try{
- CloneButtonPlus = clone.getElementsByTagName('a')[0];
+ var jclone = $(clone);
+ CloneButtonPlus = $("a.addItem", jclone).get(0);
CloneButtonPlus.setAttribute('onclick',"cloneItemBlock('" + index + random + "')");
- CloneButtonMinus = clone.getElementsByTagName('a')[1];
+ CloneButtonMinus = $("a.delItem", jclone).get(0);
CloneButtonMinus.setAttribute('onclick',"deleteItemBlock('" + index + random + "')");
CloneButtonMinus.setAttribute('style',"display:inline");
// change itemids of the clone
</div></li>
[% END %]
</ol>
- <a style="cursor: pointer; color: grey; font-size: 180%;" onclick="cloneItemBlock('itemblock[% item.itemBlockIndex %]')">+</a>
- <a style="display:none; cursor: pointer; color: grey; font-size: 180%;" onclick="deleteItemBlock('itemblock[% item.itemBlockIndex %]')">-</a>
+ <a class="addItem" onclick="cloneItemBlock('itemblock[% item.itemBlockIndex %]')">Add</a>
+ <a class="delItem" style="display:none;" onclick="deleteItemBlock('itemblock[% item.itemBlockIndex %]')">Delete</a>
</div><!-- /iteminformation -->
</div>
</div></li>
[% END %]
</ol>
- <a style="cursor: pointer; color: grey; font-size: 180%;" onclick="cloneItemBlock('itemblock[% item.itemBlockIndex %]')">+</a>
- <a style="display:none; cursor: pointer; color: grey; font-size: 180%;" onclick="deleteItemBlock('itemblock[% item.itemBlockIndex %]')">-</a>
+ <a class="addItem" onclick="cloneItemBlock('itemblock[% item.itemBlockIndex %]')">Add</a>
+ <a class="delItem" style="display:none;" onclick="deleteItemBlock('itemblock[% item.itemBlockIndex %]')">Delete</a>
</div><!-- /iteminformation -->
</div>