[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9057] Merge 9051:9056 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9057] Merge 9051:9056 from trunk |
Date: |
Wed, 28 Mar 2012 11:09:22 +0000 |
Revision: 9057
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9057
Author: sigurdne
Date: 2012-03-28 11:09:03 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
Merge 9051:9056 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
branches/Version-1_0-branch/controller/templates/base/control_item/sort_check_list.xsl
branches/Version-1_0-branch/controller/templates/base/css/base.css
branches/Version-1_0-branch/property/inc/class.botts.inc.php
branches/Version-1_0-branch/property/inc/class.menu.inc.php
branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
branches/Version-1_0-branch/property/inc/class.sotts.inc.php
branches/Version-1_0-branch/property/inc/class.uitts.inc.php
branches/Version-1_0-branch/property/inc/export/default/Basware_X114
branches/Version-1_0-branch/property/templates/base/tts.xsl
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433,7435-7439,7441-7446,7448-7458,7460-7469,7471-7483,7485-7487,7489-7490,7492,7494,7496-7497,7499,7501-7502,7504,7506-7507,7509-7511,7513-7517,7519-7521,7523,7525,7527-7529,7531,7533,7535-7538,7540-7542,7544-7549,7551-7552,7554-7561,7563,7565,7567-7573,7575-7578,7580-7584,7586-7591,7593-7624,7627-7636,7638-7656,7658-7718,7720-7732,7734,7736,7738-7750,7754-7759,7761-7767,7769-7780,7782,7784-7809,7811-7812,7814-7835,7837-7847,7849-7887,7889-7895,7897,7899,7901,7903-7905,7907-7921,7923-7925,7927-7933,7935,7937-7952,7954-7968,7970-7974,7976,7978-7979,7981-7982,7984-7988,7990-7992,7994-8041,8043-8066,8068-8087,8089,8091-8108,8110-8124,8126-8129,8131,8133-8150,8152-8154,8156-8162,8164-8167,8169-8170,8172-8179,8181,8183-8196,8198-8207,8209-8211,8213-8214,8216-8217,8219-8220,8222,8224-8225,8227-8247,8249,8251,8253-8282,8284-8352,8354-8368,8370-8396,8398-8430,8432,8434-8440,8442-8445,8447-8453,8455-8456,8458,8460,8462-8464,8466-8473,8475-8479,8481,8483-8501,8503-8523,8525,8527-8531,8533,8535-8536,8538-8550,8552-8554,8556-8557,8559-8579,8581-8587,8589,8591-8592,8594-8595,8597-8601,8603-8610,8612-8613,8615,8617,8619-8645,8647-8650,8652-8661,8663-8666,8668-8669,8671-8683,8685-8691,8693-8730,8732-8737,8739,8741-8767,8769,8771-8772,8774,8776-8797,8799-8812,8814-8819,8821,8823-8833,8835-8837,8839,8841,8843-8849,8852-8858,8860-8867,8869-8870,8872,8874-8877,8879,8881,8883-8888,8890,8892-8901,8903-8911,8913-8917,8920-8923,8925-8933,8935-8938,8940-8943,8945,8947-8948,8950,8952-8953,8955-8962,8964,8966,8968-8970,8972-8975,8977-8983,8985-8993,8995-9001,9003,9005,9007,9009,9011-9019,9021-9023,9025,9027-9028,9030-9044,9046-9047,9049-9050,9052-9056
Modified:
branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
===================================================================
--- branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
2012-03-28 10:55:10 UTC (rev 9056)
+++ branches/Version-1_0-branch/controller/js/controller/custom_drag_drop.js
2012-03-28 11:09:03 UTC (rev 9057)
@@ -3,39 +3,66 @@
var next_elem;
var prev_elem;
var adj_y;
-var status_drag_group = false;
-var status_drag = false;
-var saveOrderForm;
$(document).ready(function(){
- // Drag row is clicked
- $(".drag").mousedown(function(e){
- placeholder = $(this).parent();
+ // On drag item row
+ $(".drag_item a").mousedown(function(e){
+ // Setting placeholder to the clicked row
+ placeholder = $(this).closest('li');
+ init_drag( placeholder, e );
+ start_drag("item");
- adj_y = e.pageY - $(placeholder).position().top;
+ return false;
+ });
+
+ // On drag group
+ $(".drag_group h3 a").mousedown(function(e){
+ // Setting placeholder to the clicked row
+ placeholder = $(this).closest('li');
+ init_drag( placeholder, e );
+ start_drag("group");
- next_elem = $(placeholder).next();
- prev_elem = $(placeholder).prev();
- drag_elem = $(placeholder).clone();
-
- $(drag_elem).addClass("drag_elem");
- $(drag_elem).removeClass("list_item");
-
- $(drag_elem).insertAfter(placeholder);
-
- $(drag_elem).css("left", $(placeholder).position().left + "px");
- $(drag_elem).css("top", $(placeholder).position().top + "px");
-
- saveOrderForm = $(this).parents("form");
-
- start_drag();
+ return false;
});
- // Drag row is clicked
- $(".drag_group h3").mousedown(function(e){
- placeholder = $(this).parent();
+ // Saves group and item order
+ $("#frmSaveOrder").submit(function(e){
+ e.preventDefault();
+
+ var group_order_str = "";
+ var item_order_str = "";
+ $('ul.groups li.drag_group').each(function(){
+
+ var group_order_nr =
$(this).find("span.group_order_nr").text();
+ var group_id =
$(this).find("input[name=group_id]").val();
+
+ group_order_str += group_id + ":" + group_order_nr +
",";
+ //alert("Group id: " + group_id + ", " + "Order nr: "
+ group_order_nr);
+
+ $(this).find("ul.items li").each(function(){
+ var item_order_nr =
$(this).find("span.item_order_nr").text();
+ var item_id =
$(this).find("input[name=item_id]").val();
+
+ item_order_str += item_id + ":" + item_order_nr
+ ",";
+
+ //alert("Item id: " + item_id + ", " + "Item
nr: " + item_order_nr);
+ });
+ });
+ var requestUrl =
"index.php?menuaction=controller.uicontrol_group.save_group_and_item_order";
+
+ $.ajax({
+ type: 'POST',
+ url: requestUrl + "&group_order=" + group_order_str +
"&item_order=" + item_order_str,
+ success: function() {
+ alert("Lagret");
+ }
+ });
+ });
+});
+
+function init_drag(placeholder, e){
adj_y = e.pageY - $(placeholder).position().top;
next_elem = $(placeholder).next();
@@ -49,43 +76,12 @@
$(drag_elem).css("left", $(placeholder).position().left + "px");
$(drag_elem).css("top", $(placeholder).position().top + "px");
-
- start_drag_group();
- });
-});
+}
-//Delete a control item list
-$(".delete").live("click", function(){
- var clickElem = $(this);
- var clickRow = $(this).parent();
-
- var url = $(clickElem).attr("href");
-
- // Sending request for deleting a control item list
- $.ajax({
- type: 'POST',
- url: url,
- success: function() {
- $(clickRow).fadeOut("slow");
-
- var next_row = $(clickRow).next();
-
- // Updating order numbers for rows below deleted row
- while( $(next_row).length > 0){
- update_order_nr(next_row, "-");
- next_row = $(next_row).next();
- }
- }
- });
-
- return false;
-});
-
-function start_drag(){
+function start_drag(drag_type){
$(document).bind("mouseup", stop_drag);
$(document).bind("mousemove", function(e){
-
var x = 0;
var y = e.pageY - adj_y;
@@ -93,16 +89,14 @@
$(drag_elem).css("top", y + "px");
// Move drag element over next element
- if( $(next_elem).length > 0 && e.pageY >
$(next_elem).offset().top + $(next_elem).height()/2 ){
+ if( $(next_elem).length > 0 && e.pageY >
$(next_elem).offset().top ){
$(placeholder).insertAfter(next_elem);
next_elem = $(placeholder).next();
prev_elem = $(placeholder).prev();
// Updating order number for drag element and previous
element
- update_order_nr(placeholder, "+");
- update_order_nr(prev_elem, "-");
-
- status_drag = true;
+ update_order_nr($(placeholder).find("span." + drag_type
+ "_order_nr"), "+");
+ update_order_nr($(prev_elem).find("span." + drag_type +
"_order_nr"), "-");
}
// Move drag element over previous element
else if( $(prev_elem).length > 0 && e.pageY <
$(prev_elem).offset().top + $(prev_elem).height()/2 ){
@@ -111,11 +105,11 @@
next_elem = $(placeholder).next();
// Updating order number for drag element and next
element
- update_order_nr(placeholder, "-");
- update_order_nr(next_elem, "+");
-
- status_drag = true;
+ update_order_nr($(placeholder).find("span." + drag_type
+ "_order_nr"), "-");
+ update_order_nr($(next_elem).find("span." + drag_type +
"_order_nr"), "+");
}
+
+ return false;
});
}
@@ -125,116 +119,17 @@
$(document).unbind("mousemove");
$(document).unbind("mouseup");
-
- if(status_drag)
- {
- var this_submit_btn =
$(saveOrderForm).find("input[type='submit']");
- $(this_submit_btn).css({opacity: 1 });
- $(this_submit_btn).removeAttr('disabled');
- }
}
-function start_drag_group(){
- $(document).bind("mouseup", stop_drag_group);
-
- $(document).bind("mousemove", function(e){
-
- var x = 0;
- var y = e.pageY - adj_y;
-
- $(drag_elem).css("left", x + "px");
- $(drag_elem).css("top", y + "px");
-
- // Move drag element over next element
- if( $(next_elem).length > 0 && e.pageY >
$(next_elem).offset().top ){
- $(placeholder).insertAfter(next_elem);
- next_elem = $(placeholder).next();
- prev_elem = $(placeholder).prev();
-
- // Updating order number for drag element and previous
element
- update_group_order_nr(placeholder, "+");
- update_group_order_nr(prev_elem, "-");
-
- status_drag_group = true;
- }
- // Move drag element over previous element
- else if( $(prev_elem).length > 0 && e.pageY <
$(prev_elem).offset().top + $(prev_elem).height()/2 ){
-
- $(placeholder).insertBefore(prev_elem);
- prev_elem = $(placeholder).prev();
- next_elem = $(placeholder).next();
-
- // Updating order number for drag element and next
element
- update_group_order_nr(placeholder, "-");
- update_group_order_nr(next_elem, "+");
-
- status_drag_group = true;
- }
- });
-}
-
-//Release binding for mouse events
-function stop_drag_group(){
- $(drag_elem).remove();
-
- if(status_drag_group){
- $('li.drag_group').each(function() {
- var group_order_nr =
$(this).find("span.group_order_nr").text();
- var control_group_id =
$(this).find("input[name='control_group_id']").val();
- var control_id = $("#control_id").val();
-
- var requestUrl =
"index.php?menuaction=controller.uicontrol_group.save_group_order";
-
- $.ajax({
- type: 'POST',
- url: requestUrl + "&control_id=" + control_id
+ "&control_group_id=" + control_group_id + "&group_order_nr=" + group_order_nr,
- success: function() {
-
- }
- });
-
- });
- }
-
-
- $(document).unbind("mousemove");
- $(document).unbind("mouseup");
-}
-
// Updates order number for hidden field and number in front of row
function update_order_nr(element, sign){
- var hidden_order_nr = $(element).find("input");
- var order_value = $(hidden_order_nr).attr("value");
-
- var span_order_nr = $(element).find("span.order_nr");
+ var order_nr = $(element).text();
- var order_nr = order_value.substring( 0, order_value.indexOf(":") );
-
if(sign == "+")
var updated_order_nr = parseInt(order_nr) + 1;
else
var updated_order_nr = parseInt(order_nr) - 1;
- var id = order_value.substring( order_value.indexOf(":")+1,
order_value.length );
- updated_order_value = updated_order_nr + ":" + id;
-
- // Updating order number for hidden field
- $(hidden_order_nr).val(updated_order_value);
-
// Updating order number in front of row
- $(span_order_nr).text(updated_order_nr);
-}
-
-//Updates order number for hidden field and number in front of row
-function update_group_order_nr(element, sign){
- var span_order_nr = $(element).find("span.group_order_nr");
- var order_nr = $(span_order_nr).text();
-
- if(sign == "+")
- var updated_order_nr = parseInt(order_nr) + 1;
- else
- var updated_order_nr = parseInt(order_nr) - 1;
-
- // Updating order number in front of row
- $(span_order_nr).text(updated_order_nr);
+ $(element).text(updated_order_nr);
}
\ No newline at end of file
Modified:
branches/Version-1_0-branch/controller/templates/base/control_item/sort_check_list.xsl
===================================================================
---
branches/Version-1_0-branch/controller/templates/base/control_item/sort_check_list.xsl
2012-03-28 10:55:10 UTC (rev 9056)
+++
branches/Version-1_0-branch/controller/templates/base/control_item/sort_check_list.xsl
2012-03-28 11:09:03 UTC (rev 9057)
@@ -8,65 +8,37 @@
<!-- =========================== SHOWS CONTROL ITEMS RECEIPT
=============================== -->
<input type="hidden" id="control_id" name="control_id"
value="{$control_id}" />
- <ul class="groups">
- <xsl:for-each select="saved_groups_with_items_array">
- <xsl:choose>
- <xsl:when test="control_items/child::node()">
- <li class="drag_group list_item">
- <h3><span
class="group_order_nr"><xsl:number/></span>. <xsl:value-of
select="control_group/group_name"/></h3>
-
- <form
action="index.php?menuaction=controller.uicontrol_item.save_item_order"
class="frm_save_order">
- <xsl:variable
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
+ <form action="#" id="frmSaveOrder">
+ <ul class="groups">
+ <xsl:for-each
select="saved_groups_with_items_array">
+ <xsl:choose>
+ <xsl:when
test="control_items/child::node()">
+ <li class="drag_group
list_item">
+ <xsl:variable
name="control_group_id"><xsl:value-of select="control_group/id"/></xsl:variable>
<input type="hidden"
name="control_group_id" value="{$control_group_id}" />
-
- <ul id="list">
+
+ <h3><a href="#"><span
class="group_order_nr"><xsl:number/></span>. <xsl:value-of
select="control_group/group_name"/><input type="hidden" name="group_id"
value="{$control_group_id}" /></a></h3>
+ <ul class="items">
<xsl:for-each
select="control_items">
<xsl:variable name="control_item_id"><xsl:value-of select="id"/></xsl:variable>
-
<xsl:variable name="order_tag">
-
<xsl:choose>
-
<xsl:when test="order_nr > 0">
-
<xsl:value-of select="order_nr"/>
-
</xsl:when>
-
<xsl:otherwise>
-
<xsl:number/>
-
</xsl:otherwise>
-
</xsl:choose>:<xsl:value-of select="id"/>
-
</xsl:variable>
-
- <li
class="list_item">
-
<span class="drag">
-
<span class="order_nr"><xsl:number/></span>. <xsl:value-of
select="title"/><input type="hidden" name="order_tags[]" value="{$order_tag}" />
-
</span>
-
<!--
-
<a class="delete">
-
<xsl:attribute name="href">
-
<xsl:text>index.php?menuaction=controller.uicontrol_item.delete_item_list</xsl:text>
-
<xsl:text>&control_id=</xsl:text>
-
<xsl:value-of select="//control_id"/>
-
<xsl:text>&control_item_id=</xsl:text>
-
<xsl:value-of select="id"/>
-
</xsl:attribute>
-
<span>x</span>
-
</a>
-
-->
- </li>
+
+ <li
class="drag_item list_item">
+
<a href="#"><span class="item_order_nr"><xsl:number/></span>. <xsl:value-of
select="title"/><input type="hidden" name="item_id" value="{$control_item_id}"
/></a>
+ </li>
</xsl:for-each>
</ul>
- <div>
- <xsl:variable
name="lang_save"><xsl:value-of select="php:function('lang', 'save_order')"
/></xsl:variable>
- <input
type="submit" id="save_order" name="save_order" value="{$lang_save}" title =
"{$lang_save}" style="opacity: 0.5;" disabled="disabled"/>
- </div>
- </form>
- </li>
- </xsl:when>
- <xsl:otherwise>
- <li class="drag_group list_item">
- <h3><span
class="group_order_nr"><xsl:number/></span>. <xsl:value-of
select="control_group/group_name"/></h3>
- <div>Ingen kontrollpunkt for
denne gruppen</div>
- </li>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </ul>
+ </li>
+ </xsl:when>
+ <xsl:otherwise>
+ <li class="drag_group
list_item">
+ <h3><span
class="group_order_nr"><xsl:number/></span>. <xsl:value-of
select="control_group/group_name"/></h3>
+ <div>Ingen
kontrollpunkt for denne gruppen</div>
+ </li>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </ul>
+ <input type="submit" value="Lagre rekkefølge" />
+ </form>
</div>
</xsl:template>
Modified: branches/Version-1_0-branch/controller/templates/base/css/base.css
===================================================================
--- branches/Version-1_0-branch/controller/templates/base/css/base.css
2012-03-28 10:55:10 UTC (rev 9056)
+++ branches/Version-1_0-branch/controller/templates/base/css/base.css
2012-03-28 11:09:03 UTC (rev 9057)
@@ -473,7 +473,7 @@
/* ======================================= ITEM LIST
========================================= */
-
+/*
ul.itemlist {
position: relative;
}
@@ -509,7 +509,63 @@
.drag_group {
width: 650px;
}
+*/
+/* ======================================= ITEM LIST
========================================= */
+ul.groups {
+ padding: 0;
+ margin:0;
+ position: relative;
+}
+ul.groups li {
+ padding: 3px 0;
+}
+ul.groups li.odd{
+ background: none repeat scroll 0 0 #DBE7F5;
+}
+ul.groups h3 {
+ font-size: 18px;
+ margin: 0 0 5px;
+}
+
+ul.groups a{
+ text-decoration:none;
+ color:#000;
+}
+ul.groups a:visited{
+ color:#000;
+}
+
+.drag_group a:hover{
+ cursor: move;
+}
+
+.drag_elem{
+ z-index: 100;
+ position:absolute;
+ opacity: .50;
+ filter: alpha(opacity=50);
+ margin-left:0;
+ padding-left:0;
+ background: #dedede;
+}
+
+ul.items {
+ list-style: none outside none;
+ margin: 0 20px;
+ padding: 0;
+ position: relative;
+}
+
+ul.items li.list_item{
+ position:relative;
+ z-index: 1;
+ opacity: 1;
+ filter: alpha(opacity=100);
+ top: 0px;
+ left: 0px;
+}
+
/* ======================================= EXPAND LIST
========================================= */
ul.expand_list h4 {
Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php
2012-03-28 10:55:10 UTC (rev 9056)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php
2012-03-28 11:09:03 UTC (rev 9057)
@@ -64,6 +64,7 @@
function property_botts($session=false)
{
$this->so =
CreateObject('property.sotts');
+ $this->custom = &
$this->so->custom;
$this->bocommon =
CreateObject('property.bocommon');
$this->historylog = &
$this->so->historylog;
$this->config =
CreateObject('phpgwapi.config','property');
@@ -454,11 +455,13 @@
return $tickets;
}
- function read_single($id)
+ function read_single($id, $values = array(), $view = false)
{
$this->so->update_view($id);
- $ticket = $this->so->read_single($id);
+ $values['attributes'] = $this->custom->find('property',
'.ticket', 0, '', 'ASC', 'attrib_sort', true, true);
+ $ticket = $this->so->read_single($id, $values);
+ $ticket = $this->custom->prepare($ticket, 'property',
'.ticket', $view);
$ticket['user_lid'] =
$GLOBALS['phpgw']->accounts->id2name($ticket['user_id']);
$ticket['group_lid'] =
$GLOBALS['phpgw']->accounts->id2name($ticket['group_id']);
@@ -775,7 +778,7 @@
return (int)$result['id'];
}
- function add($ticket)
+ function add($ticket, $values_attribute = array())
{
if((!isset($ticket['location_code']) || !
$ticket['location_code']) && isset($ticket['location']) &&
is_array($ticket['location']))
{
@@ -791,8 +794,13 @@
$ticket['finnish_date'] =
$this->bocommon->date_to_timestamp($ticket['finnish_date']);
- $receipt = $this->so->add($ticket);
+ if($values_attribute && is_array($values_attribute))
+ {
+ $values_attribute =
$this->custom->convert_attribute_save($values_attribute);
+ }
+ $receipt = $this->so->add($ticket, $values_attribute);
+
$this->config->read();
if ( (isset($ticket['send_mail']) &&
$ticket['send_mail'])
@@ -1147,9 +1155,14 @@
return $receipt;
}
- public function update_ticket($data, $id,$receipt = array())
+ public function update_ticket($data, $id,$receipt =
array(),$values_attribute = array())
{
- $receipt = $this->so->update_ticket($data, $id,
$receipt);
+ if($values_attribute && is_array($values_attribute))
+ {
+ $values_attribute =
$this->custom->convert_attribute_save($values_attribute);
+ }
+
+ $receipt = $this->so->update_ticket($data, $id,
$receipt, $values_attribute);
$this->fields_updated = $this->so->fields_updated;
$criteria = array
@@ -1346,4 +1359,11 @@
$fileuploader->upload("fmticket/{$id}");
}
}
+
+ public function get_attributes($values)
+ {
+ $values['attributes'] = $this->custom->find('property',
'.ticket', 0, '', 'ASC', 'attrib_sort', true, true);
+ $values = $this->custom->prepare($values, 'property',
'.ticket', false);
+ return $values;
+ }
}
Modified: branches/Version-1_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.menu.inc.php 2012-03-28
10:55:10 UTC (rev 9056)
+++ branches/Version-1_0-branch/property/inc/class.menu.inc.php 2012-03-28
11:09:03 UTC (rev 9057)
@@ -149,6 +149,31 @@
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' =>
'.vendor', 'menu_selection' => 'admin::property::vendor::vendor_attribs') )
)
);
+
+ $admin_children_ticket = array
+ (
+ 'ticket_cats' => array
+ (
+ 'text' => lang('Ticket
Categories'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uicategories.index', 'appname' => 'property', 'location' => '.ticket',
'global_cats' => 'true', 'menu_selection' =>
'admin::property::ticket::ticket_cats') )
+ ),
+ 'ticket_status' => array
+ (
+ 'text' => lang('Ticket
status'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'ticket_status') )
+ ),
+ 'ticket_config' => array
+ (
+ 'text' => lang('ticket
config'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig2.index', 'location_id' =>
$GLOBALS['phpgw']->locations->get_id('property', '.ticket')) )
+ ),
+ 'ticket_attribs' => array
+ (
+ 'text' => lang('ticket
Attributes'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_attribute', 'appname' => 'property', 'location' =>
'.ticket', 'menu_selection' => 'admin::property::ticket::ticket_attribs') )
+ )
+ );
+
$admin_children_owner = array
(
'owner_cats' => array
@@ -347,21 +372,12 @@
'text' =>
lang('Workorder Detail Categories'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'wo_hours') )
),
- 'ticket_cats' => array
+ 'ticket' => array
(
- 'text' => lang('Ticket
Categories'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uicategories.index', 'appname' => 'property', 'location' => '.ticket',
'global_cats' => 'true', 'menu_selection' => 'admin::property::ticket_cats') )
+ 'text' =>
lang('helpdesk'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uicategories.index', 'appname' => 'property', 'location' => '.ticket',
'global_cats' => 'true', 'menu_selection' =>
'admin::property::ticket::ticket_cats') ),
+ 'children' =>
$admin_children_ticket
),
- 'ticket_status' => array
- (
- 'text' => lang('Ticket
status'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'ticket_status') )
- ),
- 'ticket_config' => array
- (
- 'text' => lang('ticket
config'),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig2.index', 'location_id' =>
$GLOBALS['phpgw']->locations->get_id('property', '.ticket')) )
- ),
'tenant' => array
(
'text' =>
lang('Tenant'),
Modified: branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
2012-03-28 10:55:10 UTC (rev 9056)
+++ branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
2012-03-28 11:09:03 UTC (rev 9057)
@@ -1679,7 +1679,7 @@
'name'
=> lang('event action'),
'acl_app'
=> 'property',
'acl_location' =>
'.admin',
- 'menu_selection' =>
'admin::property::ticket_status'
+ 'menu_selection' =>
'admin::property::ticket::ticket_status'
);
break;
Modified: branches/Version-1_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sotts.inc.php
2012-03-28 10:55:10 UTC (rev 9056)
+++ branches/Version-1_0-branch/property/inc/class.sotts.inc.php
2012-03-28 11:09:03 UTC (rev 9057)
@@ -65,6 +65,7 @@
{
$this->account =
(int)$GLOBALS['phpgw_info']['user']['account_id'];
$this->historylog =
CreateObject('property.historylog','tts');
+ $this->custom =
createObject('property.custom_fields');
$this->db = &
$GLOBALS['phpgw']->db;
$this->like = & $this->db->like;
$this->join = & $this->db->join;
@@ -566,7 +567,7 @@
return $entity;
}
- function read_single($id)
+ function read_single($id, $values = array())
{
$id = (int) $id;
$sql = "SELECT * FROM fm_tts_tickets WHERE id = {$id}";
@@ -615,6 +616,15 @@
{
$ticket['assignedto_name'] =
$GLOBALS['phpgw']->accounts->get($ticket['assignedto'])->__toString();
}
+
+ if ( isset($values['attributes']) &&
is_array($values['attributes']) )
+ {
+ $ticket['attributes'] =
$values['attributes'];
+ foreach ( $ticket['attributes'] as
&$attr )
+ {
+ $attr['value'] =
$this->db->f($attr['column_name']);
+ }
+ }
}
return $ticket;
@@ -635,8 +645,10 @@
}
}
- function add(&$ticket)
+ function add(&$ticket , $values_attribute = array())
{
+ $table = 'fm_tts_tickets';
+
if(isset($ticket['location']) &&
is_array($ticket['location']))
{
foreach ($ticket['location'] as $input_name =>
$value)
@@ -648,6 +660,18 @@
}
}
+ $data_attribute = $this->custom->prepare_for_db($table,
$values_attribute);
+ if(isset($data_attribute['value_set']))
+ {
+ foreach($data_attribute['value_set'] as
$input_name => $value)
+ {
+ if(isset($value) && $value)
+ {
+ $value_set[$input_name] =
$value;
+ }
+ }
+ }
+
if(isset($ticket['extra']) &&
is_array($ticket['extra']))
{
foreach ($ticket['extra'] as $input_name =>
$value)
@@ -716,7 +740,6 @@
$values =
$this->db->validate_insert(array_values($value_set));
$this->db->transaction_begin();
- $table = 'fm_tts_tickets';
$this->db->query("INSERT INTO {$table} ({$cols}) VALUES
({$values})",__LINE__,__FILE__);
$id = $this->db->get_last_insert_id($table,'id');
@@ -887,7 +910,7 @@
return $receipt;
}
- function update_ticket(&$ticket,$id = 0, $receipt = array())
+ function update_ticket(&$ticket,$id = 0, $receipt = array(),
$values_attribute = array())
{
$this->fields_updated = array();
$id = (int) $id;
@@ -1267,6 +1290,19 @@
}
$value_set =
array();
+
+ $data_attribute =
$this->custom->prepare_for_db('fm_tts_tickets', $values_attribute);
+ if(isset($data_attribute['value_set']))
+ {
+ foreach($data_attribute['value_set'] as
$input_name => $value)
+ {
+ if(isset($value) && $value)
+ {
+ $value_set[$input_name] =
$value;
+ }
+ }
+ }
+
$value_set['vendor_id'] = $ticket['vendor_id'];
$value_set['b_account_id'] =
$ticket['b_account_id'];
$value_set['order_descr'] =
$this->db->db_addslashes($ticket['order_descr']);
Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2012-03-28 10:55:10 UTC (rev 9056)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2012-03-28 11:09:03 UTC (rev 9057)
@@ -1767,6 +1767,8 @@
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uitts.index'));
}
+ $values_attribute =
phpgw::get_var('values_attribute');
+
//------------------- start ticket from other location
$bypass = phpgw::get_var('bypass',
'bool');
// if(isset($_POST) && $_POST && isset($bypass) && $bypass)
@@ -1883,9 +1885,20 @@
unset($_priority);
}
+ if(isset($values_attribute) &&
is_array($values_attribute))
+ {
+ foreach ($values_attribute as
$attribute )
+ {
+ if($attribute['nullable'] != 1
&& (!$attribute['value'] && !$values['extra'][$attribute['name']]))
+ {
+
$receipt['error'][]=array('msg'=>lang('Please enter value for attribute %1',
$attribute['input_text']));
+ }
+ }
+ }
+
if(!isset($receipt['error']))
{
- $receipt = $this->bo->add($values);
+ $receipt = $this->bo->add($values,
$values_attribute);
//------------ files
$values['file_name'] = @str_replace('
','_',$_FILES['file']['name']);
@@ -1948,6 +1961,33 @@
}
}
+ /* Preserve attribute values from post */
+ if(isset($receipt['error']) && (isset(
$values_attribute) && is_array( $values_attribute)))
+ {
+ $values =
$this->bocommon->preserve_attribute_values($values,$values_attribute);
+ }
+
+ $values = $this->bo->get_attributes($values);
+
+ if (isset($values['attributes']) &&
is_array($values['attributes']))
+ {
+ foreach ($values['attributes'] as & $attribute)
+ {
+ if($attribute['history'] == true)
+ {
+ $link_history_data = array
+ (
+ 'menuaction'
=> 'property.uiproject.attrib_history',
+ 'attrib_id'
=> $attribute['id'],
+ 'id'
=> $id,
+ 'edit'
=> true
+ );
+
+ $attribute['link_history'] =
$GLOBALS['phpgw']->link('/index.php',$link_history_data);
+ }
+ }
+ }
+
$location_data=$bolocation->initiate_ui_location(array(
'values' =>
isset($values['location_data'])?$values['location_data']:'',
'type_id' => -1, // calculated from
location_types
@@ -2001,6 +2041,7 @@
$data = array
(
+ 'custom_attributes'
=> array('attributes' => $values['attributes']),
'contact_data'
=> $contact_data,
'simple'
=> $this->_simple,
'show_finnish_date'
=> $this->_show_finnish_date,
@@ -2058,7 +2099,7 @@
$GLOBALS['phpgw']->js->validate_file( 'yahoo',
'tts.add', 'property' );
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
-
$GLOBALS['phpgw']->xslttpl->add_file(array('tts','files'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('tts','files','attributes_form'));
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('add'
=> $data));
// $GLOBALS['phpgw']->xslttpl->pp();
}
@@ -2304,6 +2345,8 @@
$values['b_account_id'] =
phpgw::get_var('b_account_id', 'int', 'POST');
$values['b_account_name'] =
phpgw::get_var('b_account_name', 'string', 'POST');
+ $values_attribute =
phpgw::get_var('values_attribute');
+
$receipt =
$GLOBALS['phpgw']->session->appsession('receipt','property');
$GLOBALS['phpgw']->session->appsession('receipt','property','');
if(!$receipt)
@@ -2311,7 +2354,7 @@
$receipt = array();
}
- $GLOBALS['phpgw']->xslttpl->add_file(array('tts',
'files'));
+ $GLOBALS['phpgw']->xslttpl->add_file(array('tts',
'files', 'attributes_form'));
$historylog =
CreateObject('property.historylog','tts');
@@ -2379,8 +2422,20 @@
{
$values['assignedto'] = $this->account;
}
- $receipt =
$this->bo->update_ticket($values,$id, $receipt);
+ if(isset($values_attribute) &&
is_array($values_attribute))
+ {
+ foreach ($values_attribute as
$attribute )
+ {
+ if($attribute['nullable'] != 1
&& (!$attribute['value'] && !$values['extra'][$attribute['name']]))
+ {
+
$receipt['error'][]=array('msg'=>lang('Please enter value for attribute %1',
$attribute['input_text']));
+ }
+ }
+ }
+
+ $receipt =
$this->bo->update_ticket($values,$id, $receipt, $values_attribute);
+
if ( (isset($values['send_mail']) &&
$values['send_mail'])
||
(isset($this->bo->config->config_data['mailnotification'])
&&
$this->bo->config->config_data['mailnotification']
@@ -2443,9 +2498,35 @@
}
+
+ /* Preserve attribute values from post */
+ if(isset($receipt['error']) && (isset(
$values_attribute) && is_array( $values_attribute)))
+ {
+ $values =
$this->bocommon->preserve_attribute_values($values,$values_attribute);
+ }
+
//---------end files
- $ticket = $this->bo->read_single($id);
+ $ticket = $this->bo->read_single($id, $values);
+ if (isset($ticket['attributes']) &&
is_array($ticket['attributes']))
+ {
+ foreach ($ticket['attributes'] as & $attribute)
+ {
+ if($attribute['history'] == true)
+ {
+ $link_history_data = array
+ (
+ 'menuaction'
=> 'property.uiproject.attrib_history',
+ 'attrib_id'
=> $attribute['id'],
+ 'id'
=> $id,
+ 'edit'
=> true
+ );
+
+ $attribute['link_history'] =
$GLOBALS['phpgw']->link('/index.php',$link_history_data);
+ }
+ }
+ }
+
$order_link = '';
$add_to_project_link = '';
$request_link ='';
@@ -3085,6 +3166,7 @@
$order_catetory =
$this->cats->formatted_xslt_list(array('select_name' =>
'values[cat_id]','selected' => $ticket['order_cat_id']));
$data = array
(
+ 'custom_attributes'
=> array('attributes' => $ticket['attributes']),
'send_response'
=> isset($this->bo->config->config_data['tts_send_response']) ?
$this->bo->config->config_data['tts_send_response'] : '',
'value_sms_phone'
=> $ticket['contact_phone'],
'access_order'
=> $access_order,
Modified: branches/Version-1_0-branch/property/inc/export/default/Basware_X114
===================================================================
--- branches/Version-1_0-branch/property/inc/export/default/Basware_X114
2012-03-28 10:55:10 UTC (rev 9056)
+++ branches/Version-1_0-branch/property/inc/export/default/Basware_X114
2012-03-28 11:09:03 UTC (rev 9057)
@@ -712,7 +712,8 @@
return $message;
}
*/
- $amount = $line[$BelopFelt] * 100;
+ $amount = $line[$BelopFelt] * 100;
+ $amount = number_format($amount,0,'','');
if($line['order_id'])
{
Modified: branches/Version-1_0-branch/property/templates/base/tts.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/tts.xsl 2012-03-28
10:55:10 UTC (rev 9056)
+++ branches/Version-1_0-branch/property/templates/base/tts.xsl 2012-03-28
11:09:03 UTC (rev 9057)
@@ -641,6 +641,7 @@
</xsl:choose>
</xsl:when>
</xsl:choose>
+ <xsl:apply-templates
select="custom_attributes/attributes"/>
<tr>
<td valign="top">
<xsl:value-of
select="php:function('lang', 'subject')"/>
@@ -1103,6 +1104,7 @@
<input
type="hidden" name="values[billable_hour]" value="{value_billable_hours}"/>
</xsl:otherwise>
</xsl:choose>
+ <xsl:apply-templates
select="custom_attributes/attributes"/>
<tr>
<td
valign="top">
<xsl:value-of select="php:function('lang', 'new note')"/>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9057] Merge 9051:9056 from trunk,
Sigurd Nes <=