fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [15336] Stable: Merge 15311:15335 from trunk


From: sigurdne
Subject: [Fmsystem-commits] [15336] Stable: Merge 15311:15335 from trunk
Date: Fri, 24 Jun 2016 10:51:22 +0000 (UTC)

Revision: 15336
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15336
Author:   sigurdne
Date:     2016-06-24 10:51:21 +0000 (Fri, 24 Jun 2016)
Log Message:
-----------
Stable: Merge 15311:15335 from trunk

Modified Paths:
--------------
    branches/Version-2_0-branch/activitycalendar/inc/class.soactivity.inc.php
    branches/Version-2_0-branch/activitycalendar/inc/class.soarena.inc.php
    branches/Version-2_0-branch/activitycalendar/inc/class.socommon.inc.php
    
branches/Version-2_0-branch/activitycalendar/inc/class.socontactperson.inc.php
    branches/Version-2_0-branch/activitycalendar/inc/class.sogroup.inc.php
    
branches/Version-2_0-branch/activitycalendar/inc/class.soorganization.inc.php
    branches/Version-2_0-branch/activitycalendar/inc/class.uiactivities.inc.php
    branches/Version-2_0-branch/activitycalendar/inc/class.uiarena.inc.php
    
branches/Version-2_0-branch/activitycalendar/inc/class.uiorganization.inc.php
    branches/Version-2_0-branch/booking/inc/class.soallocation.inc.php
    branches/Version-2_0-branch/booking/inc/class.sobooking.inc.php
    branches/Version-2_0-branch/booking/inc/class.socommon.inc.php
    branches/Version-2_0-branch/booking/inc/class.soevent.inc.php
    branches/Version-2_0-branch/booking/inc/class.soseason.inc.php
    branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php
    branches/Version-2_0-branch/booking/inc/class.uicommon.inc.php
    branches/Version-2_0-branch/booking/inc/class.uidocument.inc.php
    branches/Version-2_0-branch/booking/inc/class.uidocumentation.inc.php
    branches/Version-2_0-branch/booking/inc/class.uievent.inc.php
    branches/Version-2_0-branch/booking/inc/class.uipermission.inc.php
    branches/Version-2_0-branch/booking/inc/class.uiseason.inc.php
    branches/Version-2_0-branch/booking/js/booking/application.js
    branches/Version-2_0-branch/booking/js/booking/schedule.js
    branches/Version-2_0-branch/booking/setup/phpgw_no.lang
    branches/Version-2_0-branch/booking/templates/base/application.xsl
    branches/Version-2_0-branch/booking/templates/base/application_edit.xsl
    branches/Version-2_0-branch/booking/templates/base/building.xsl
    branches/Version-2_0-branch/booking/templates/base/resource.xsl
    branches/Version-2_0-branch/booking/templates/base/season.xsl
    branches/Version-2_0-branch/bookingfrontend/inc/class.bosearch.inc.php
    
branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/application.js
    branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/schedule.js
    branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/search.js
    branches/Version-2_0-branch/phpgwapi/js/jquery/common.js
    branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl
    branches/Version-2_0-branch/property/inc/class.sotts.inc.php

Property Changed:
----------------
    branches/Version-2_0-branch/
    branches/Version-2_0-branch/booking/
    branches/Version-2_0-branch/bookingfrontend/


Property changes on: branches/Version-2_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243,15245-15250,15254-15257
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310
   + /branches/dev-syncromind:13653
/branches/dev-syncromind-2:14937-15027,15165-15215,15223-15228,15230-15243,15245-15250,15254-15257
/branches/stavangerkommune:12743-12875,12986
/trunk:14721-14732,14734-14735,14737,14739,14741,14743-14744,14746-14749,14751,14753,14755-14757,14759,14761-14764,14766-14768,14770-14783,14785-14792,14794-14813,14815-14816,14818,14820-14822,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14847,14849-14866,14868-14869,14871,14873-14875,14877-14878,14880-14884,14886-14896,14898,14900-14902,14904,14906-14909,14911-14915,14917-14919,14921-14922,14924-14978,14980-15258,15260-15261,15263-15264,15266-15285,15287-15288,15290-15291,15293,15295,15297,15299-15305,15307-15310,15312-15335

Modified: 
branches/Version-2_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-2_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/activitycalendar/inc/class.soactivity.inc.php   
2016-06-24 10:51:21 UTC (rev 15336)
@@ -107,6 +107,9 @@
                                //$order = "ORDER BY id $dir";
                                $order = "ORDER BY $sort_field $dir";
                        }
+
+                       $this->sort_field = str_ireplace(" {$dir}", '', 
$sort_field);
+
                        /* else
                          {
                          $dir = $ascending ? 'ASC' : 'DESC';
@@ -1046,7 +1049,7 @@
 
                function get_targetgroups()
                {
-                       $sql = "SELECT * FROM bb_agegroup where active=1 AND 
NOT name like 'Tilskuer%' ORDER BY sort";
+                       $sql = "SELECT * FROM bb_agegroup where active=1 AND 
activity_id = 1 AND NOT name like 'Tilskuer%' ORDER BY sort";
                        $this->db->query($sql, __LINE__, __FILE__);
                        while ($this->db->next_record())
                        {

Modified: branches/Version-2_0-branch/activitycalendar/inc/class.soarena.inc.php
===================================================================
--- branches/Version-2_0-branch/activitycalendar/inc/class.soarena.inc.php      
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/activitycalendar/inc/class.soarena.inc.php      
2016-06-24 10:51:21 UTC (rev 15336)
@@ -41,10 +41,10 @@
 
                        //Add columns to this array to include them in the query
                        $columns = array();
+                       $dir = $ascending ? 'ASC' : 'DESC';
 
                        if ($sort_field != null)
                        {
-                               $dir = $ascending ? 'ASC' : 'DESC';
                                if ($sort_field == 'arena_id')
                                {
                                        $sort_field = 'id';
@@ -53,9 +53,10 @@
                        }
                        else if (!$return_count)
                        {
-                               $dir = $ascending ? 'ASC' : 'DESC';
-                               $order = "ORDER BY arena.arena_name $dir";
+                               $sort_field = 'arena.arena_name';
+                               $order = "ORDER BY $sort_field $dir";
                        }
+                       $this->sort_field = str_ireplace(" {$dir}", '', 
$sort_field);
 
                        if ($search_for)
                        {

Modified: 
branches/Version-2_0-branch/activitycalendar/inc/class.socommon.inc.php
===================================================================
--- branches/Version-2_0-branch/activitycalendar/inc/class.socommon.inc.php     
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/activitycalendar/inc/class.socommon.inc.php     
2016-06-24 10:51:21 UTC (rev 15336)
@@ -1,324 +1,14 @@
 <?php
+       phpgw::import_class('rental.socommon');
 
-       abstract class activitycalendar_socommon
+       abstract class activitycalendar_socommon extends rental_socommon
        {
 
-               protected $db;
-               protected $like;
-               protected $join;
-               protected $left_join;
-
                public function __construct()
                {
-                       $this->db = clone $GLOBALS['phpgw']->db;
-                       $this->like = & $this->db->like;
-                       $this->join = & $this->db->join;
-                       $this->left_join = & $this->db->left_join;
+                       parent::__construct();
                }
-
-               /**
-                * Marshal values according to type
-                * @param $value the value
-                * @param $type the type of value
-                * @return database value
-                */
-               protected function marshal( $value, $type )
-               {
-                       if ($value === null)
-                       {
-                               return 'NULL';
-                       }
-                       else if ($type == 'int')
-                       {
-                               if ($value == '')
-                               {
-                                       return 'NULL';
-                               }
-                               return intval($value);
-                       }
-                       else if ($type == 'float')
-                       {
-                               return str_replace(',', '.', $value);
-                       }
-                       else if ($type == 'field')
-                       {
-                               return $this->db->db_addslashes($value);
-                       }
-                       return "'" . $this->db->db_addslashes($value) . "'";
-               }
-
-               /**
-                * Unmarchal database values according to type
-                * @param $value the field value
-                * @param $type a string dictating value type
-                * @return the php value
-                */
-               protected function unmarshal( $value, $type )
-               {
-                       if ($type == 'bool')
-                       {
-                               return (bool)$value;
-                       }
-                       elseif ($type == 'int')
-                       {
-                               return (int)$value;
-                       }
-                       elseif ($value === null || $value == 'NULL')
-                       {
-                               return null;
-                       }
-                       elseif ($type == 'float')
-                       {
-                               return floatval($value);
-                       }
-                       return $value;
-               }
-
-               /**
-                * Get the count of the specified query. Query must return a 
signel column
-                * called count.
-                *
-                * @param $sql the sql query
-                * @return the count value
-                */
-               protected function get_query_count( $sql )
-               {
-                       $result = $this->db->query($sql);
-                       if ($result && $this->db->next_record())
-                       {
-                               return $this->unmarshal($this->db->f('count', 
true), 'int');
-                       }
-               }
-
-               /**
-                * Implementing classes must return an instance of itself.
-                *  
-                * @return the class instance.
-                */
-               public abstract static function get_instance();
-
-               /**
-                * Convenience method for getting one single object. Calls 
get() with the
-                * specified id as a filter.
-                *
-                * @param $id int with id of object to return.
-                * @return object with the specified id, null if not found.
-                */
-               public function get_single( int $id )
-               {
-                       $objects = $this->get(0, 0, '', false, '', '', 
array($this->get_id_field_name() => $id));
-                       if (count($objects) > 0)
-                       {
-                               $keys = array_keys($objects);
-                               return $objects[$keys[0]];
-                       }
-                       return null;
-               }
-
-               /**
-                * Method for retrieving the db-object (security "forgotten")
-                */
-               public function get_db()
-               {
-                       return $this->db;
-               }
-
-               /**
-                * Method for retreiving objects.
-                *
-                * @param $start_index int with index of first object.
-                * @param $num_of_objects int with max number of objects to 
return.
-                * @param $sort_field string representing the object field to 
sort on.
-                * @param $ascending bool true for ascending sort on sort 
field, false
-                * for descending.
-                * @param $search_for string with free text search query.
-                * @param $search_type string with the query type.
-                * @param $filters array with key => value of filters.
-                * @return array of objects. May return an empty
-                * array, never null. The array keys are the respective index 
numbers.
-                */
-               public function get( int $start_index, int $num_of_objects, 
string $sort_field, bool $ascending, string $search_for, string $search_type, 
array $filters )
-               {
-                       $results = array();   // Array to store result objects
-                       $map = array(); // Array to hold number of records per 
target object
-                       $check_map = array();  // Array to hold the actual 
number of record read per target object
-                       $object_ids = array();   // All of the object ids 
encountered
-                       $added_object_ids = array();// All of the added objects 
ids
-                       // Retrieve information about the table name and the 
name and alias of id column
-                       // $break_on_limit -    flag indicating whether to 
break the loop when the number of records
-                       //                                              for all 
the result objects are traversed
-                       $id_field_name_info = $this->get_id_field_name(true);
-                       if (is_array($id_field_name_info))
-                       {
-                               $break_on_limit = true;
-                               $id_field_name = 
$id_field_name_info['translated'];
-                       }
-                       else
-                       {
-                               $break_on_limit = false;
-                               $id_field_name = $id_field_name_info;
-                       }
-
-                       // Special case: Sort on id field. Always changed to 
the id field name.
-                       // $break_when_num_of_objects_reached - flag indicating 
to break the loop when the number of
-                       //              results are reached and we are sure 
that the records are ordered by the id
-                       if ($sort_field == null || $sort_field == 'id' || 
$sort_field == '')
-                       {
-                               $sort_field = $id_field_name;
-                               $break_when_num_of_objects_reached = true;
-                       }
-                       else
-                       {
-                               $break_when_num_of_objects_reached = false;
-                       }
-
-                       // Only allow positive start index
-                       if ($start_index < 0)
-                       {
-                               $start_index = 0;
-                       }
-
-
-                       // test-input for break on ordered queries
-                       $db2 = clone($this->db);
-
-                       $sql = $this->get_query($sort_field, $ascending, 
$search_for, $search_type, $filters, false);
-                       $sql_parts = explode('1=1', $sql); // Split the query 
to insert extra condition on test for break
-                       $this->db->query($sql, __LINE__, __FILE__, false, true);
-
-                       while ($this->db->next_record()) // Runs through all of 
the results
-                       {
-                               $should_populate_object = false; // Default 
value - we won't populate object
-                               $result_id = 
$this->unmarshal($this->db->f($id_field_name), 'int'); // The id of object
-                               if (in_array($result_id, $added_object_ids)) // 
Object with this id already added
-                               {
-                                       $should_populate_object = true; // We 
should populate this object as we already have it in our result array
-                               }
-                               else // Object isn't already added to array
-                               {
-                                       if (!in_array($result_id, $object_ids)) 
// Haven't already added this id
-                                       {
-                                               $object_ids[] = $result_id; // 
We have to add the new id
-                                       }
-                                       // We have to check if we should 
populate this object
-                                       if (count($object_ids) > $start_index) 
// We're at index above start index
-                                       {
-                                               if ($num_of_objects == null || 
count($results) < $num_of_objects) // We haven't found all the objects we're 
looking for
-                                               {
-                                                       $should_populate_object 
= true; // We should populate this object
-                                                       $added_object_ids[] = 
$result_id; // We keep the id
-                                               }
-                                       }
-                               }
-                               if ($should_populate_object)
-                               {
-                                       $result = &$results[$result_id];
-                                       $results[$result_id] = 
$this->populate($result_id, $result);
-                                       $last_result_id = $result_id;
-                                       $map[$result_id] = 
(int)$map[$result_id] + 1;
-                               }
-
-                               //Stop looping when array not sorted on other 
then id and wanted number of results is reached
-                               if (count($results) == $num_of_objects && 
$last_result_id != $result_id && $break_when_num_of_objects_reached)
-                               {
-                                       break;
-                               }
-                               // else stop looping when wanted number of 
results is reached all records for result objects are read
-                               else if ($break_on_limit && (count($results) == 
$num_of_objects) && $last_result_id != $result_id)
-                               {
-                                       $id_ok = 0;
-                                       foreach ($map as $_result_id => $_count)
-                                       {
-                                               if 
(!isset($check_map[$_result_id]))
-                                               {
-                                                       // Query the number of 
records for the specific object in question
-                                                       $sql2 = 
"{$sql_parts[0]} 1=1 AND 
{$id_field_name_info['table']}.{$id_field_name_info['field']} = {$_result_id} 
{$sql_parts[1]}";
-                                                       $db2->query($sql2, 
__LINE__, __FILE__);
-                                                       $db2->next_record();
-                                                       $check_map[$_result_id] 
= $db2->num_rows();
-                                               }
-                                               if ($check_map[$_result_id] == 
$_count)
-                                               {
-                                                       $id_ok++;
-                                               }
-                                       }
-                                       if ($id_ok == $num_of_objects)
-                                       {
-                                               break;
-                                       }
-                               }
-                       }
-                       return $results;
-               }
-
-               /**
-                * Returns count of matching objects.
-                *
-                * @param $search_for string with free text search query.
-                * @param $search_type string with the query type.
-                * @param $filters array with key => value of filters.
-                * @return int with object count.
-                */
-               public function get_count( string $search_for, string 
$search_type, array $filters )
-               {
-                       return $this->get_query_count($this->get_query('', 
false, $search_for, $search_type, $filters, true));
-               }
-
-               /**
-                * Implementing classes must return the name of the field used 
in the query
-                * returned from get_query().
-                * 
-                * @return string with name of id field.
-                */
-               protected abstract function get_id_field_name();
-
-               /**
-                * Returns SQL for retrieving matching objects or object count.
-                *
-                * @param $start_index int with index of first object.
-                * @param $num_of_objects int with max number of objects to 
return.
-                * @param $sort_field string representing the object field to 
sort on.
-                * @param $ascending bool true for ascending sort on sort 
field, false
-                * for descending.
-                * @param $search_for string with free text search query.
-                * @param $search_type string with the query type.
-                * @param $filters array with key => value of filters.
-                * @param $return_count bool telling to return only the count 
of the
-                * matching objects, or the objects themself.
-                * @return string with SQL.
-                */
-               protected abstract function get_query( string $sort_field, bool 
$ascending, string $search_for, string $search_type, array $filters, bool 
$return_count );
-
-               protected abstract function populate( int $object_id, &$object 
);
-
-               protected abstract function add( &$object );
-
-               protected abstract function update( $object );
-
-               /**
-                * Store the object in the database.  If the object has no ID 
it is assumed to be new and
-                * inserted for the first time.  The object is then updated 
with the new insert id.
-                */
-               public function store( &$object )
-               {
-                       if ($object->validates())
-                       {
-                               if ($object->get_id() > 0)
-                               {
-                                       // We can assume this composite came 
from the database since it has an ID. Update the existing row
-                                       return $this->update($object);
-                               }
-                               else
-                               {
-                                       // This object does not have an ID, so 
will be saved as a new DB row
-                                       return $this->add($object);
-                               }
-                       }
-
-                       // The object did not validate
-                       return false;
-               }
-
+       
                protected function generate_secret( $length = 10 )
                {
                        return substr(base64_encode(rand(1000000000, 
9999999999)), 0, $length);

Modified: 
branches/Version-2_0-branch/activitycalendar/inc/class.socontactperson.inc.php
===================================================================
--- 
branches/Version-2_0-branch/activitycalendar/inc/class.socontactperson.inc.php  
    2016-06-24 10:49:35 UTC (rev 15335)
+++ 
branches/Version-2_0-branch/activitycalendar/inc/class.socontactperson.inc.php  
    2016-06-24 10:51:21 UTC (rev 15336)
@@ -49,6 +49,8 @@
                          $order = "ORDER BY id $dir";
                          }
                         */
+//                     $this->sort_field = str_ireplace(" {$dir}", '', 
$sort_field);
+
                        if ($search_for)
                        {
                                $query = $this->marshal($search_for, 'string');

Modified: branches/Version-2_0-branch/activitycalendar/inc/class.sogroup.inc.php
===================================================================
--- branches/Version-2_0-branch/activitycalendar/inc/class.sogroup.inc.php      
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/activitycalendar/inc/class.sogroup.inc.php      
2016-06-24 10:51:21 UTC (rev 15336)
@@ -46,8 +46,11 @@
                        if ($sort_field != null)
                        {
                                $dir = $ascending ? 'ASC' : 'DESC';
-                               $order = "ORDER BY bb_group.id $dir";
+                               $sort_field = 'bb_group.id';
+                               $order = "ORDER BY $sort_field $dir";
                        }
+
+                       $this->sort_field = str_ireplace(" {$dir}", '', 
$sort_field);
                        if ($search_for)
                        {
                                $query = $this->marshal($search_for, 'string');

Modified: 
branches/Version-2_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
--- 
branches/Version-2_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2016-06-24 10:49:35 UTC (rev 15335)
+++ 
branches/Version-2_0-branch/activitycalendar/inc/class.soorganization.inc.php   
    2016-06-24 10:51:21 UTC (rev 15336)
@@ -47,14 +47,19 @@
 
                        //Add columns to this array to include them in the query
                        $columns = array();
+                       $dir = $ascending ? 'ASC' : 'DESC';
 
                        if ($sort_field != null && !$return_count)
                        {
-                               if ($sort_field == 'identifier')
+                               if ($sort_field == 'identifier' )
                                {
                                        $sort_field = 'org.id';
                                }
-                               $dir = $ascending ? 'ASC' : 'DESC';
+                               else if ( $sort_field == 'organization_number')
+                               {
+                                       $sort_field = 'org.orgno';
+                               }
+
                                $order = "ORDER BY $sort_field $dir";
                        }
                        else if (!$return_count)
@@ -62,6 +67,9 @@
                                $dir = $ascending ? 'ASC' : 'DESC';
                                $order = "ORDER BY org.name $dir";
                        }
+
+                       $this->sort_field = str_ireplace(" {$dir}", '', 
$sort_field);
+
                        if ($search_for)
                        {
                                $query = $this->marshal($search_for, 'string');

Modified: 
branches/Version-2_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-2_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/activitycalendar/inc/class.uiactivities.inc.php 
2016-06-24 10:51:21 UTC (rev 15336)
@@ -705,7 +705,6 @@
                        $columns = phpgw::get_var('columns');
 
                        $start_index = phpgw::get_var('start', 'int', 
'REQUEST', 0);
-                       $num_of_objects = (phpgw::get_var('length', 'int') <= 
0) ? $this->user_rows_per_page : phpgw::get_var('length', 'int');
                        $sort_field = ($columns[$order[0]['column']]['data']) ? 
$columns[$order[0]['column']]['data'] : 'id';
                        $sort_ascending = ($order[0]['dir'] == 'desc') ? false 
: true;
                        // Form variables
@@ -716,6 +715,10 @@
                        $result_objects = array();
                        $result_count = 0;
 
+                       $length = phpgw::get_var('length', 'int');
+                       $user_rows_per_page = $length > 0 ? $length : 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       $num_of_objects = $length == -1 ? null : 
$user_rows_per_page;
+
                        $export = phpgw::get_var('export', 'bool');
                        if ($export)
                        {

Modified: branches/Version-2_0-branch/activitycalendar/inc/class.uiarena.inc.php
===================================================================
--- branches/Version-2_0-branch/activitycalendar/inc/class.uiarena.inc.php      
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/activitycalendar/inc/class.uiarena.inc.php      
2016-06-24 10:51:21 UTC (rev 15336)
@@ -234,7 +234,6 @@
                        $columns = phpgw::get_var('columns');
 
                        $start_index = phpgw::get_var('start', 'int', 
'REQUEST', 0);
-                       $num_of_objects = (phpgw::get_var('length', 'int') <= 
0) ? $this->user_rows_per_page : phpgw::get_var('length', 'int');
                        $sort_field = ($columns[$order[0]['column']]['data']) ? 
$columns[$order[0]['column']]['data'] : 'id';
                        $sort_ascending = ($order[0]['dir'] == 'desc') ? false 
: true;
                        // Form variables
@@ -247,6 +246,10 @@
                        //Retrieve the type of query and perform type specific 
logic
                        $query_type = phpgw::get_var('type');
 
+                       $length = phpgw::get_var('length', 'int');
+                       $user_rows_per_page = $length > 0 ? $length : 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       $num_of_objects = $length == -1 ? null : 
$user_rows_per_page;
+
                        $export = phpgw::get_var('export', 'bool');
                        if ($export)
                        {

Modified: 
branches/Version-2_0-branch/activitycalendar/inc/class.uiorganization.inc.php
===================================================================
--- 
branches/Version-2_0-branch/activitycalendar/inc/class.uiorganization.inc.php   
    2016-06-24 10:49:35 UTC (rev 15335)
+++ 
branches/Version-2_0-branch/activitycalendar/inc/class.uiorganization.inc.php   
    2016-06-24 10:51:21 UTC (rev 15336)
@@ -538,7 +538,6 @@
                        $columns = phpgw::get_var('columns');
 
                        $start_index = phpgw::get_var('start', 'int', 
'REQUEST', 0);
-                       $num_of_objects = (phpgw::get_var('length', 'int') <= 
0) ? $this->user_rows_per_page : phpgw::get_var('length', 'int');
                        $sort_field = ($columns[$order[0]['column']]['data']) ? 
$columns[$order[0]['column']]['data'] : 'identifier';
                        $sort_ascending = ($order[0]['dir'] == 'desc') ? false 
: true;
                        // Form variables
@@ -549,6 +548,10 @@
                        $result_objects = array();
                        $result_count = 0;
 
+                       $length = phpgw::get_var('length', 'int');
+                       $user_rows_per_page = $length > 0 ? $length : 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       $num_of_objects = $length == -1 ? null : 
$user_rows_per_page;
+
                        $export = phpgw::get_var('export', 'bool');
                        if ($export)
                        {


Property changes on: branches/Version-2_0-branch/booking
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305,15307-15310
   + /branches/stavangerkommune/booking:9468-12740,12743-12875,12986
/trunk/booking:14721-14732,14824-14825,14827-14829,14831-14834,14836,14838,14840-14842,14844-14845,14871,14886-14896,14900-14902,14917-14919,14924-14978,14980-15258,15266-15285,15287-15288,15297,15299-15305,15307-15310,15312-15335

Modified: branches/Version-2_0-branch/booking/inc/class.soallocation.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.soallocation.inc.php  
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.soallocation.inc.php  
2016-06-24 10:51:21 UTC (rev 15336)
@@ -270,6 +270,7 @@
 
                function check_for_booking( $id )
                {
+                       $id = (int) $id;
                        $sql = "SELECT id FROM bb_booking  WHERE allocation_id 
= ($id)";
 
                        $this->db->limit_query($sql, 0, __LINE__, __FILE__, 1);
@@ -282,14 +283,16 @@
 
                public function delete_allocation( $id )
                {
+                       $id = (int) $id;
                        $db = $this->db;
+                       $db->transaction_begin();
                        $table_name = $this->table_name . '_resource';
                        $sql = "DELETE FROM $table_name WHERE allocation_id = 
($id)";
                        $db->query($sql, __LINE__, __FILE__);
                        $table_name = $this->table_name;
                        $sql = "DELETE FROM $table_name WHERE id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
-                       return True;
+                       return  $db->transaction_commit();
                }
 
                public function update_id_string()

Modified: branches/Version-2_0-branch/booking/inc/class.sobooking.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.sobooking.inc.php     
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.sobooking.inc.php     
2016-06-24 10:51:21 UTC (rev 15336)
@@ -165,8 +165,8 @@
                                $this->db->query("SELECT e.id FROM bb_event e 
                                                                        WHERE 
e.active = 1 AND 
                                                                        e.id IN 
(SELECT event_id FROM bb_event_resource WHERE resource_id IN ($rids)) AND
-                                                                       
((e.from_ >= '$start' AND e.from_ < '$end') OR 
-                                                                        (e.to_ 
> '$start' AND e.to_ <= '$end') OR 
+                                                                       
((e.from_ > '$start' AND e.from_ < '$end') OR 
+                                                                        (e.to_ 
> '$start' AND e.to_ < '$end') OR 
                                                                         
(e.from_ < '$start' AND e.to_ > '$end'))", __LINE__, __FILE__);
                                if ($this->db->next_record())
                                {
@@ -176,8 +176,8 @@
                                $this->db->query("SELECT a.id FROM 
bb_allocation a 
                                                                        WHERE 
a.active = 1 AND a.id<>$allocation_id AND 
                                                                        a.id IN 
(SELECT allocation_id FROM bb_allocation_resource WHERE resource_id IN ($rids)) 
AND
-                                                                       
((a.from_ >= '$start' AND a.from_ < '$end') OR 
-                                                                        (a.to_ 
> '$start' AND a.to_ <= '$end') OR 
+                                                                       
((a.from_ > '$start' AND a.from_ < '$end') OR 
+                                                                        (a.to_ 
> '$start' AND a.to_ < '$end') OR 
                                                                         
(a.from_ < '$start' AND a.to_ > '$end'))", __LINE__, __FILE__);
                                if ($this->db->next_record())
                                {
@@ -188,8 +188,8 @@
                                $this->db->query("SELECT b.id FROM bb_booking b 
                                                                        WHERE  
b.active = 1 AND b.id<>$booking_id AND 
                                                                        b.id IN 
(SELECT booking_id FROM bb_booking_resource WHERE resource_id IN ($rids)) AND
-                                                                       
((b.from_ >= '$start' AND b.from_ < '$end') OR 
-                                                                        (b.to_ 
> '$start' AND b.to_ <= '$end') OR 
+                                                                       
((b.from_ > '$start' AND b.from_ < '$end') OR 
+                                                                        (b.to_ 
> '$start' AND b.to_ < '$end') OR 
                                                                         
(b.from_ < '$start' AND b.to_ > '$end'))", __LINE__, __FILE__);
                                if ($this->db->next_record())
                                {
@@ -434,6 +434,7 @@
                public function delete_booking( $id )
                {
                        $db = $this->db;
+                       $db->transaction_begin();
                        $table_name = $this->table_name . '_resource';
                        $sql = "DELETE FROM $table_name WHERE booking_id = 
($id)";
                        $db->query($sql, __LINE__, __FILE__);
@@ -446,15 +447,18 @@
                        $table_name = $this->table_name;
                        $sql = "DELETE FROM $table_name WHERE id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
+                       return  $db->transaction_commit();
                }
 
                public function delete_allocation( $id )
                {
                        $db = $this->db;
+                       $db->transaction_begin();
                        $sql = "DELETE FROM bb_allocation_resource WHERE 
allocation_id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
                        $sql = "DELETE FROM bb_allocation WHERE id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
+                       return  $db->transaction_commit();
                }
 
                public function got_no_allocation( $booking )

Modified: branches/Version-2_0-branch/booking/inc/class.socommon.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.socommon.inc.php      
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.socommon.inc.php      
2016-06-24 10:51:21 UTC (rev 15336)
@@ -641,6 +641,7 @@
                {
                        $values = 
$this->marshal_field_values($this->get_table_values($entry, __FUNCTION__));
 
+                       $this->db->transaction_begin();
                        $this->db->query('INSERT INTO ' . $this->table_name . ' 
(' . join(',', array_keys($values)) . ') VALUES(' . join(',', $values) . ')', 
__LINE__, __FILE__);
                        $id = $this->db->get_last_insert_id($this->table_name, 
'id');
                        foreach ($this->fields as $field => $params)
@@ -699,6 +700,9 @@
                                        }
                                }
                        }
+
+                       $this->db->transaction_commit();
+
                        $receipt['id'] = $id;
                        $receipt['message'][] = array('msg' => lang('Entity %1 
has been saved', $receipt['id']));
                        return $receipt;

Modified: branches/Version-2_0-branch/booking/inc/class.soevent.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.soevent.inc.php       
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.soevent.inc.php       
2016-06-24 10:51:21 UTC (rev 15336)
@@ -312,6 +312,10 @@
                public function delete_event( $id )
                {
                        $db = $this->db;
+                       $db->transaction_begin();
+                       $table_name = $this->table_name . '_cost';
+                       $sql = "DELETE FROM $table_name WHERE event_id = ($id)";
+                       $db->query($sql, __LINE__, __FILE__);
                        $table_name = $this->table_name . '_comment';
                        $sql = "DELETE FROM $table_name WHERE event_id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
@@ -330,7 +334,7 @@
                        $table_name = $this->table_name;
                        $sql = "DELETE FROM $table_name WHERE id = ($id)";
                        $db->query($sql, __LINE__, __FILE__);
-                       return True;
+                       return  $db->transaction_commit();
                }
 
                public function update_id_string()

Modified: branches/Version-2_0-branch/booking/inc/class.soseason.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.soseason.inc.php      
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.soseason.inc.php      
2016-06-24 10:51:21 UTC (rev 15336)
@@ -389,7 +389,9 @@
 
                function delete( $id )
                {
+                       $this->db->transaction_begin();
                        $this->db->query("DELETE FROM 
bb_wtemplate_alloc_resource WHERE allocation_id=" . intval($id), __LINE__, 
__FILE__);
                        $this->db->query("DELETE FROM bb_wtemplate_alloc WHERE 
id=" . intval($id), __LINE__, __FILE__);
+                       return  $this->db->transaction_commit();
                }
        }
\ No newline at end of file

Modified: branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php 
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.uiapplication.inc.php 
2016-06-24 10:51:21 UTC (rev 15336)
@@ -955,7 +955,7 @@
                        );
                        foreach ($copy as $f)
                        {
-                               $event[] = array($f, 
htmlentities($application[$f]));
+                               $event[] = array($f, 
htmlentities(html_entity_decode($application[$f])), ENT_QUOTES | 
ENT_SUBSTITUTE);
                        }
                        foreach ($application['agegroups'] as $ag)
                        {

Modified: branches/Version-2_0-branch/booking/inc/class.uicommon.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uicommon.inc.php      
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.uicommon.inc.php      
2016-06-24 10:51:21 UTC (rev 15336)
@@ -780,28 +780,28 @@
                        $js = <<<JS
 
                        $(function() {
-                                
-                                $.each($('.newaddedpicker'), function(i, v){
-                                var id = v.id;
-                                v.classList.remove('newaddedpicker');
-                                $( "#"+id ).{$type}picker({
-                                    dateFormat: '{$dateformat}',
-                                    showWeek: true,
-                                    changeMonth: true,
-                                    changeYear: true,
-                                    showOn: "button",
-                                    showButtonPanel:true,
-                                    buttonImage: "{$img_cal}",
-                                    buttonText: "{$lang_select_date}",
-                                    buttonImageOnly: true
-                                });
-                            });
 
+                                       $.each($('.newaddedpicker'), 
function(i, v){
+                                       var id = v.id;
+                                       v.classList.remove('newaddedpicker');
+                                       $( "#"+id ).{$type}picker({
+                                               dateFormat: '{$dateformat}',
+                                               showWeek: true,
+                                               changeMonth: true,
+                                               changeYear: true,
+                                               showOn: "button",
+                                               showButtonPanel:true,
+                                               buttonImage: "{$img_cal}",
+                                               buttonText: 
"{$lang_select_date}",
+                                               buttonImageOnly: true
+                                       });
+                               });
+
                                $('#add-date-link').click(function(){
                                        var add = $(this);
                                        var html = '';
                                     
-                                        this.counter = 
$('.date-container').length - 1;
+                                       this.counter = 
$('.date-container').length - 1;
 
                                        if (!this.counter) { this.counter = 0; }
                                     

Modified: branches/Version-2_0-branch/booking/inc/class.uidocument.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uidocument.inc.php    
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.uidocument.inc.php    
2016-06-24 10:51:21 UTC (rev 15336)
@@ -171,13 +171,13 @@
                                                        'label' => 
lang('Category'),
                                                ),
                                                array(
-                                                       'key' => 'opcion_edit',
+                                                       'key' => 'option_edit',
                                                        'label' => lang('Edit'),
                                                        'formatter' => 
'JqueryPortico.formatLinkGeneric',
                                                        'sortable' => false
                                                ),
                                                array(
-                                                       'key' => 
'opcion_delete',
+                                                       'key' => 
'option_delete',
                                                        'label' => 
lang('Delete'),
                                                        'formatter' => 
'JqueryPortico.formatLinkGeneric',
                                                        'sortable' => false
@@ -214,9 +214,13 @@
 //                             $document['actions'] = $document_actions;
 
                                if ($this->bo->allow_write($document))
-                                       $document['opcion_edit'] = 
$this->get_owner_typed_link('edit', array('id' => $document['id']));
+                               {
+                                       $document['option_edit'] = 
$this->get_owner_typed_link('edit', array('id' => $document['id']));
+                               }
                                if ($this->bo->allow_delete($document))
-                                       $document['opcion_delete'] = 
$this->get_owner_typed_link('delete', array('id' => $document['id']));
+                               {
+                                       $document['option_delete'] = 
$this->get_owner_typed_link('delete', array('id' => $document['id']));
+                               }
                        }
                        if (phpgw::get_var('no_images'))
                        {

Modified: branches/Version-2_0-branch/booking/inc/class.uidocumentation.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uidocumentation.inc.php       
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.uidocumentation.inc.php       
2016-06-24 10:51:21 UTC (rev 15336)
@@ -62,13 +62,13 @@
                                                        'label' => 
lang('Category'),
                                                ),
                                                array(
-                                                       'key' => 'opcion_edit',
+                                                       'key' => 'option_edit',
                                                        'label' => lang('Edit'),
                                                        'formatter' => 
'JqueryPortico.formatLinkGeneric',
                                                        'sortable' => false
                                                ),
                                                array(
-                                                       'key' => 
'opcion_delete',
+                                                       'key' => 
'option_delete',
                                                        'label' => 
lang('Delete'),
                                                        'formatter' => 
'JqueryPortico.formatLinkGeneric',
                                                        'sortable' => false
@@ -101,9 +101,9 @@
 //                             $document_actions[] = 
 //                             $document_actions[] = 
 
-                               $document['opcion_edit'] = 
self::link(array('menuaction' => $this->module . '.uidocumentation.edit',
+                               $document['option_edit'] = 
self::link(array('menuaction' => $this->module . '.uidocumentation.edit',
                                                'id' => $document['id']));
-                               $document['opcion_delete'] = 
self::link(array('menuaction' => $this->module . '.uidocumentation.delete',
+                               $document['option_delete'] = 
self::link(array('menuaction' => $this->module . '.uidocumentation.delete',
                                                'id' => $document['id']));
                        }
                        return $this->jquery_results($documents);

Modified: branches/Version-2_0-branch/booking/inc/class.uievent.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uievent.inc.php       
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.uievent.inc.php       
2016-06-24 10:51:21 UTC (rev 15336)
@@ -676,6 +676,10 @@
 
                        list($event, $errors) = 
$this->extract_and_validate($event);
 
+                       if ($event['description'])
+                       {
+                               $event['description'] =  
html_entity_decode($event['description']);
+                       }
                        if ($event['customer_organization_number'])
                        {
                                $orginfo = 
$this->bo->so->get_org($event['customer_organization_number']);
@@ -1023,7 +1027,7 @@
 
                public function delete()
                {
-                       $event_id = phpgw::get_var('event_id', 'int');
+                       $event_id = phpgw::get_var('id', 'int');
                        $application_id = phpgw::get_var('application_id', 
'int');
 
                        if ($GLOBALS['phpgw']->acl->check('admin', 
phpgwapi_acl::ADD, 'booking'))

Modified: branches/Version-2_0-branch/booking/inc/class.uipermission.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uipermission.inc.php  
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.uipermission.inc.php  
2016-06-24 10:51:21 UTC (rev 15336)
@@ -157,13 +157,13 @@
                                                        'label' => lang('Role'),
                                                ),
                                                array(
-                                                       'key' => 'opcion_edit',
+                                                       'key' => 'option_edit',
                                                        'label' => lang('Edit'),
                                                        'formatter' => 
'JqueryPortico.formatLinkGeneric',
                                                        'sortable' => false
                                                ),
                                                array(
-                                                       'key' => 
'opcion_delete',
+                                                       'key' => 
'option_delete',
                                                        'label' => 
lang('Delete'),
                                                        'formatter' => 
'JqueryPortico.formatLinkGeneric',
                                                        'sortable' => false
@@ -203,10 +203,14 @@
 
                                $permission_actions = array();
                                if ($this->bo->allow_write($permission))
-                                       $permission['opcion_edit'] = 
$this->get_object_typed_link('edit', array('id' => $permission['id']));
+                               {
+                                       $permission['option_edit'] = 
$this->get_object_typed_link('edit', array('id' => $permission['id']));
+                               }
                                if ($this->bo->allow_delete($permission))
-                                       $permission['opcion_delete'] = 
$this->get_object_typed_link('delete', array(
+                               {
+                                       $permission['option_delete'] = 
$this->get_object_typed_link('delete', array(
                                                'id' => $permission['id']));
+                               }
 
                                $account_id = 
$GLOBALS['phpgw']->accounts->name2id($permission['subject_name']);
                                if($account_id)

Modified: branches/Version-2_0-branch/booking/inc/class.uiseason.inc.php
===================================================================
--- branches/Version-2_0-branch/booking/inc/class.uiseason.inc.php      
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/inc/class.uiseason.inc.php      
2016-06-24 10:51:21 UTC (rev 15336)
@@ -340,7 +340,18 @@
                        $active_tab = 'generic';
 
                        $season['tabs'] = 
phpgwapi_jquery::tabview_generate($tabs, $active_tab);
+                       //exclude the seconds
+                       if(isset($boundary['from_']))
+                       {
+                               $from_arr = explode(':',$boundary['from_']);
+                               $to_arr = explode(':',$boundary['to_']);
+                               $boundary['from_'] = 
"{$from_arr[0]}:{$from_arr[1]}";
+                               $boundary['to_'] = "{$to_arr[0]}:{$to_arr[1]}";
+                       }
 
+                       $GLOBALS['phpgw']->jqcal->add_listener('field_from', 
'time');
+                       $GLOBALS['phpgw']->jqcal->add_listener('field_to', 
'time');
+
                        self::render_template('season_boundaries', 
array('boundary' => $boundary, 'boundaries' => $boundaries,
                                'season' => $season));
                }

Modified: branches/Version-2_0-branch/booking/js/booking/application.js
===================================================================
--- branches/Version-2_0-branch/booking/js/booking/application.js       
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/js/booking/application.js       
2016-06-24 10:51:21 UTC (rev 15336)
@@ -3,6 +3,12 @@
 
 $(document).ready(function ()
 {
+       $("#start_date").change(function ()
+       {
+               $("#end_date").val($("#start_date").val());
+       });
+
+
        
JqueryPortico.autocompleteHelper('bookingfrontend/?menuaction=bookingfrontend.uibuilding.index&phpgw_return_as=json&',
                'field_building_name', 'field_building_id', 
'building_container');
 

Modified: branches/Version-2_0-branch/booking/js/booking/schedule.js
===================================================================
--- branches/Version-2_0-branch/booking/js/booking/schedule.js  2016-06-24 
10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/js/booking/schedule.js  2016-06-24 
10:51:21 UTC (rev 15336)
@@ -12,18 +12,38 @@
        var datestr = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + 
date.getDate();
        url += '&date=' + datestr;
 
-       var lang = {
-               WEEKDAYS_FULL: [
-                       'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 
'Friday', 'Saturday'
-               ],
-               MONTHS_LONG: [
-                       'January', 'February', 'March', 'April', 'May', 'June', 
'July', 'August', 'September', 'October', 'November', 'December'
-               ],
-               LBL_TIME: 'Time',
-               LBL_RESOURCE: 'Resource',
-               LBL_WEEK: 'Week'
-       };
+       var detected_lang = navigator.language || navigator.userLanguage;
+       var lang = {};
 
+       if(detected_lang == 'no' || detected_lang == 'nn' || detected_lang == 
'nb')
+       {
+               lang = {
+                       WEEKDAYS_FULL: [
+                               'Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 
'Torsdag', 'Fredag', 'Lørdag'
+                       ],
+                       MONTHS_LONG: [
+                               'Januar', 'Februar', 'Mars', 'April', 'May', 
'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember'
+                       ],
+                       LBL_TIME: 'Tidsrom',
+                       LBL_RESOURCE: 'Ressurs',
+                       LBL_WEEK: 'Uke'
+               };
+       }
+       else
+       {
+               lang = {
+                       WEEKDAYS_FULL: [
+                               'Sunday', 'Monday', 'Tuesday', 'Wednesday', 
'Thursday', 'Friday', 'Saturday'
+                       ],
+                       MONTHS_LONG: [
+                               'January', 'February', 'March', 'April', 'May', 
'June', 'July', 'August', 'September', 'October', 'November', 'December'
+                       ],
+                       LBL_TIME: 'Time',
+                       LBL_RESOURCE: 'Resource',
+                       LBL_WEEK: 'Week'
+               };
+       }
+
        var colDefs = [
                {key: 'time', label: date.getFullYear() + '<br/>' + 
lang['LBL_TIME']}];
        if (includeResource)

Modified: branches/Version-2_0-branch/booking/setup/phpgw_no.lang
===================================================================
--- branches/Version-2_0-branch/booking/setup/phpgw_no.lang     2016-06-24 
10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/setup/phpgw_no.lang     2016-06-24 
10:51:21 UTC (rev 15336)
@@ -588,7 +588,6 @@
 Cancelation of bookings from   booking no      Avbestilling av bookinger fra
 Booking system settings        booking no      Bookingmodul systeminnstillinger
 Frontend users can delete bookings and allocations     booking no      Brukere 
av frontend kan slette bookinger og tildelinger direkte
-All that borrow premises from Stavanger Kommune must verify that they have 
read the terms and conditions, this is usually fire regulations and house 
rules.    booking no      Alle som leier lokaler hos Bergen kommune må bekrefte 
at de har lest betingelsene, dette gjelder som regel brannforskrifter og 
husreglement.
 Delete Information     booking no      Hvis du kun skal slette tildeling på 
valgt dato, velg Slett-knappen nederst og tiden blir vist som ledig i 
kalenderen, og kan tildeles andre klubber/org.
 Delete information2    booking no      Skal du slette flere kan du velge Ut 
sesong eller Slett til og velg en dato, du kan også velge intervall (f.eks. 
annen hver uke).
 Booking Delete information     booking no      Hvis du skal slette booking på 
valgt dato, velg Slett-knappen nederst.
@@ -682,4 +681,5 @@
 Mail text for comment added    booking no      Ekstra epost tekst for kommentar
 organzations_ids_description   booking no      Her kan du legge inn en komma 
separert liste med organisasjons IDer som vil få epost viss noen avbestiller 
denne ressursen.
 organzations_ids       booking no      Organisasjons IDer
-cost history   booking no      Prishistorikk
\ No newline at end of file
+cost history   booking no      Prishistorikk
+extra info     booking no      Tileggsinformasjon
\ No newline at end of file

Modified: branches/Version-2_0-branch/booking/templates/base/application.xsl
===================================================================
--- branches/Version-2_0-branch/booking/templates/base/application.xsl  
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/templates/base/application.xsl  
2016-06-24 10:51:21 UTC (rev 15336)
@@ -205,12 +205,14 @@
                                                                        
<xsl:value-of select="application/description"/>
                                                                </span>
                                                        </div>
-                                                       <!--<div 
class="pure-control-group">
+                                                       <div 
class="pure-control-group">
                                                                <label>
-                                                                       
<h4><xsl:value-of select="config/application_equipment"/></h4>
+                                                                       <h4>
+                                                                               
<xsl:value-of select="php:function('lang', 'Extra info')" />
+                                                                       </h4>
                                                                </label>
                                                                <xsl:value-of 
select="application/equipment"/>
-                                                       </div>-->
+                                                       </div>
                                                </div>
 
                                                <div class="pure-u-1 
pure-u-md-1-2 pure-u-lg-1-3">
@@ -450,9 +452,11 @@
                                                                </legend>
                                                        </div>
                                                        <div 
class="pure-control-group">
-                                                               <p>
-                                                                       
<xsl:value-of select="php:function('lang', 'All that borrow premises from 
Stavanger Kommune must verify that they have read the terms and conditions, 
this is usually fire regulations and house rules.')" />
-                                                               </p>
+                                                               <xsl:if 
test="config/application_terms">
+                                                                       <p>
+                                                                               
<xsl:value-of select="config/application_terms"/>
+                                                                       </p>
+                                                               </xsl:if>
                                                                <br />
                                                                <div 
id='regulation_documents'>&nbsp;</div>
                                                                <br />

Modified: 
branches/Version-2_0-branch/booking/templates/base/application_edit.xsl
===================================================================
--- branches/Version-2_0-branch/booking/templates/base/application_edit.xsl     
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/templates/base/application_edit.xsl     
2016-06-24 10:51:21 UTC (rev 15336)
@@ -95,8 +95,13 @@
                                                        </div>
                                                        <div 
class="pure-control-group">
                                                                <label 
for="field_equipment">
-                                                                       
<xsl:value-of select="php:function('lang', 'Equipment')" />
+                                                                       
<xsl:value-of select="php:function('lang', 'Extra info')" />
                                                                </label>
+                                                               <xsl:if 
test="config/application_equipment">
+                                                                       <p>
+                                                                               
<xsl:value-of select="config/application_equipment"/>
+                                                                       </p>
+                                                               </xsl:if>
                                                                <textarea 
id="field_equipment" class="full-width pure-u-1 pure-u-sm-1-2 pure-u-lg-1-3" 
name="equipment">
                                                                        
<xsl:value-of select="application/equipment"/>
                                                                </textarea>

Modified: branches/Version-2_0-branch/booking/templates/base/building.xsl
===================================================================
--- branches/Version-2_0-branch/booking/templates/base/building.xsl     
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/templates/base/building.xsl     
2016-06-24 10:51:21 UTC (rev 15336)
@@ -192,8 +192,8 @@
         var permissionsURL   = 
'index.php?menuaction=booking.uipermission_building.index&sort=name&filter_object_id='
 + building_id + '&phpgw_return_as=json&';
         ]]>
                var colDefsResources = [{key: 'sort', label: lang['Sort 
order']},{key: 'name', label: lang['Name'], formatter: genericLink}, {key: 
'type', label: lang['Resource Type']}];
-               var colDefsDocuments = [{key: 'name', label: lang['Name'], 
formatter: genericLink}, {key: 'category', label: lang['Category']}, {key: 
'actions', label: lang['Actions'], formatter: genericLink(lang['Edit'], 
lang['Delete'])}];
-               var colDefsPermissions = [{key: 'subject_name', label: 
lang['Account']}, {key: 'role', label: lang['Role']}, {key: 'actions', label: 
lang['Actions'], formatter: genericLink({name: 'edit', label: 'Edit'}, 
lang['Delete'])}];
+               var colDefsDocuments = [{key: 'name', label: lang['Name'], 
formatter: genericLink}, {key: 'category', label: lang['Category']}, {key: 
'actions', label: lang['Actions'], formatter: genericLink({name: 'edit', 
label:lang['Edit']}, {name: 'delete', label:lang['Delete']})}];
+               var colDefsPermissions = [{key: 'subject_name', label: 
lang['Account']}, {key: 'role', label: lang['Role']}, {key: 'actions', label: 
lang['Actions'], formatter: genericLink({name: 'edit', label: 'Edit'}, {name: 
'delete', label:lang['Delete']})}];
 
                
createTable('resources_container',resourcesURL,colDefsResources);
                
createTable('documents_container',documentsURL,colDefsDocuments);

Modified: branches/Version-2_0-branch/booking/templates/base/resource.xsl
===================================================================
--- branches/Version-2_0-branch/booking/templates/base/resource.xsl     
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/templates/base/resource.xsl     
2016-06-24 10:51:21 UTC (rev 15336)
@@ -123,12 +123,12 @@
                var colDefsDocuments = [
                {key: 'name', label: lang['Name'], formatter: genericLink},
                {key: 'category', label: lang['Category']},
-               {key: 'actions', label: lang['Actions'], formatter: 
genericLink(lang['Edit'], lang['Delete'])}
+               {key: 'actions', label: lang['Actions'], formatter: 
genericLink({name: 'edit', label:lang['Edit']}, {name: 'delete', 
label:lang['Delete']})}
                ];
                var colDefsPermissions = [
                {key: 'subject_name', label: lang['Account']},
                {key: 'role', label: lang['Role']},
-               {key: 'actions', label: lang['Actions'], formatter: 
genericLink(lang['Edit'], lang['Delete'])}
+               {key: 'actions', label: lang['Actions'], formatter: 
genericLink({name: 'edit', label:lang['Edit']}, {name: 'delete', 
label:lang['Delete']})}
                ];
 
                
createTable('documents_container',documentsURL,colDefsDocuments);

Modified: branches/Version-2_0-branch/booking/templates/base/season.xsl
===================================================================
--- branches/Version-2_0-branch/booking/templates/base/season.xsl       
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/booking/templates/base/season.xsl       
2016-06-24 10:51:21 UTC (rev 15336)
@@ -93,7 +93,7 @@
                var colDefsPermissions = [
                {key: 'subject_name', label: lang['Account']},
                {key: 'role', label: lang['Role']},
-               {key: 'actions', label: lang['Actions'], formatter: 
genericLink(lang['Edit'], lang['Delete'])}
+               {key: 'actions', label: lang['Actions'], formatter: 
genericLink({name: 'edit', label:lang['Edit']}, {name: 'delete', 
label:lang['Delete']})}
                ];
                createTable('resources_container', resourcesURL, 
colDefsRespurces);
                createTable('permissions_container', permissionsURL, 
colDefsPermissions);


Property changes on: branches/Version-2_0-branch/bookingfrontend
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894,14906-14909,14917-14919,14924-14978,14980-15258,15297
   + /branches/stavangerkommune/bookingfrontend:9468-12740,12986
/trunk/bookingfrontend:14721-14732,14770-14783,14794-14808,14824-14825,14838,14886-14894,14906-14909,14917-14919,14924-14978,14980-15258,15297,15312-15335

Modified: branches/Version-2_0-branch/bookingfrontend/inc/class.bosearch.inc.php
===================================================================
--- branches/Version-2_0-branch/bookingfrontend/inc/class.bosearch.inc.php      
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/bookingfrontend/inc/class.bosearch.inc.php      
2016-06-24 10:51:21 UTC (rev 15336)
@@ -184,7 +184,7 @@
                                        $res_result['total_records'] ++;
                                        $res_result['results'][] = $res;
                                }
-
+/*
                                if (isset($bui_result['total_records']) && 
$bui_result['total_records'] > 0)
                                {
                                        $_bui_result = array(
@@ -203,7 +203,10 @@
                                        }
                                        $bui_result = $_bui_result;
                                }
+ */
                        }
+
+
                        if (!in_array('building', $types))
                        {
                                $bui_result = array();

Modified: 
branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/application.js
===================================================================
--- 
branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/application.js   
    2016-06-24 10:49:35 UTC (rev 15335)
+++ 
branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/application.js   
    2016-06-24 10:51:21 UTC (rev 15336)
@@ -3,6 +3,11 @@
 
 $(document).ready(function ()
 {
+       $("#start_date").change(function ()
+       {
+               $("#end_date").val($("#start_date").val());
+       });
+
        JqueryPortico.autocompleteHelper(phpGWLink('bookingfrontend/', 
{menuaction: 'bookingfrontend.uibuilding.index'}, true), 'field_building_name', 
'field_building_id', 'building_container');
 
        $("#field_activity").change(function ()

Modified: 
branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/schedule.js
===================================================================
--- branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/schedule.js  
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/schedule.js  
2016-06-24 10:51:21 UTC (rev 15336)
@@ -10,18 +10,38 @@
        var datestr = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + 
date.getDate();
        url += '&date=' + datestr;
 
-       var lang = {
-               WEEKDAYS_FULL: [
-                       'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 
'Friday', 'Saturday'
-               ],
-               MONTHS_LONG: [
-                       'January', 'February', 'March', 'April', 'May', 'June', 
'July', 'August', 'September', 'October', 'November', 'December'
-               ],
-               LBL_TIME: 'Time',
-               LBL_RESOURCE: 'Resource',
-               LBL_WEEK: 'Week'
-       };
+       var detected_lang = navigator.language || navigator.userLanguage;
+       var lang = {};
 
+       if(detected_lang == 'no' || detected_lang == 'nn' || detected_lang == 
'nb')
+       {
+               lang = {
+                       WEEKDAYS_FULL: [
+                               'Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 
'Torsdag', 'Fredag', 'Lørdag'
+                       ],
+                       MONTHS_LONG: [
+                               'Januar', 'Februar', 'Mars', 'April', 'May', 
'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember'
+                       ],
+                       LBL_TIME: 'Tidsrom',
+                       LBL_RESOURCE: 'Ressurs',
+                       LBL_WEEK: 'Uke'
+               };
+       }
+       else
+       {
+               lang = {
+                       WEEKDAYS_FULL: [
+                               'Sunday', 'Monday', 'Tuesday', 'Wednesday', 
'Thursday', 'Friday', 'Saturday'
+                       ],
+                       MONTHS_LONG: [
+                               'January', 'February', 'March', 'April', 'May', 
'June', 'July', 'August', 'September', 'October', 'November', 'December'
+                       ],
+                       LBL_TIME: 'Time',
+                       LBL_RESOURCE: 'Resource',
+                       LBL_WEEK: 'Week'
+               };
+       }
+
        var colDefs = [
                {key: 'time', label: date.getFullYear() + '<br/>' + 
lang['LBL_TIME']}];
        if (includeResource)

Modified: 
branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/search.js
===================================================================
--- branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/search.js    
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/bookingfrontend/js/bookingfrontend/search.js    
2016-06-24 10:51:21 UTC (rev 15336)
@@ -32,6 +32,16 @@
        {
                update_search(selected_criteria, true);
        });
+
+       $('#field_searchterm').keydown(function (event)
+       {
+               var keypressed = event.keyCode || event.which;
+               if (keypressed == 13)
+               {
+                       update_search(selected_criteria, true);
+               }
+       });
+
        $("#search_type :checkbox").on('click', function ()
        {
                update_search(selected_criteria, true);

Modified: branches/Version-2_0-branch/phpgwapi/js/jquery/common.js
===================================================================
--- branches/Version-2_0-branch/phpgwapi/js/jquery/common.js    2016-06-24 
10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/phpgwapi/js/jquery/common.js    2016-06-24 
10:51:21 UTC (rev 15336)
@@ -86,12 +86,12 @@
        }
 
        var data = oData[key];
-       if (key == 'opcion_edit')
+       if (key == 'option_edit')
        {
                var link = data;
                var name = 'Edit';
        }
-       else if (key == 'opcion_delete')
+       else if (key == 'option_delete')
        {
                var link = data;
                var name = 'Delete';
@@ -1124,11 +1124,11 @@
                                                                }
                                                                if (label_name 
== 'Edit' || label_name == 'edit')
                                                                {
-                                                                       vcfLink 
= 'opcion_edit';
+                                                                       vcfLink 
= 'option_edit';
                                                                }
                                                                else if 
(label_name == 'Delete' || label_name == 'delete')
                                                                {
-                                                                       vcfLink 
= 'opcion_delete';
+                                                                       vcfLink 
= 'option_delete';
                                                                }
                                                                else if 
(label_name == 'dellink')
                                                                {
@@ -1611,4 +1611,4 @@
        {
                return "<a onclick='return confirm(\"Er du sikker på at du vil 
slette denne?\")' href='" + link + "'>" + name + "</a>";
        }
-}
\ No newline at end of file
+}

Modified: 
branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl
===================================================================
--- branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl    
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/phpgwapi/templates/base/datatable_jquery.xsl    
2016-06-24 10:51:21 UTC (rev 15336)
@@ -657,7 +657,7 @@
                                                },
                                        </xsl:when>
                                </xsl:choose>
-                               'excelHtml5',
+                               'csvHtml5',
                                <xsl:choose>
                                        <xsl:when test="download">
                                                ,{
@@ -682,8 +682,26 @@
                                                                var iframe = 
document.createElement('iframe');
                                                                
iframe.style.height = "0px";
                                                                
iframe.style.width = "0px";
+                                                               
console.log(oParams);
+
+                                                               
if(typeof(oParams.order[0]) != 'undefined')
+                                                               {
+                                                                       var 
column = oParams.order[0].column;
+                                                                       var dir 
= oParams.order[0].dir;
+                                                                       var 
column_to_keep = oParams.columns[column];
+                                                                       delete 
oParams.columns;
+                                                                       
oParams.columns = {};
+                                                                       
if(JqueryPortico.columns[column]['orderable'] == true)
+                                                                       {
+                                                                               
oParams.columns[column] = column_to_keep;
+                                                                       }
+                                                               }
+                                                               else
+                                                               {
+                                                                               
delete oParams.columns;
+                                                               }
+
                                                                iframe.src = 
sUrl+"&"+$.param(oParams) + "&export=1" + "&query=" + $('div.dataTables_filter 
input').val();
-
                                                                
if(confirm("This will take some time..."))
                                                                {
                                                                        
document.body.appendChild( iframe );

Modified: branches/Version-2_0-branch/property/inc/class.sotts.inc.php
===================================================================
--- branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2016-06-24 10:49:35 UTC (rev 15335)
+++ branches/Version-2_0-branch/property/inc/class.sotts.inc.php        
2016-06-24 10:51:21 UTC (rev 15336)
@@ -141,14 +141,14 @@
 
 
                        $result_order_field = array();
-                       $order_join = "{$this->join} phpgw_accounts ON 
fm_tts_tickets.user_id=phpgw_accounts.account_id";
+                       $order_join = " {$this->join} phpgw_accounts ON 
fm_tts_tickets.user_id=phpgw_accounts.account_id";
 
                        if ($order)
                        {
                                if ($order == 'assignedto')
                                {
                        //              $result_order_field = 
array('account_lastname' => 'account_lastname');
-                       //              $order_join = "LEFT OUTER JOIN 
phpgw_accounts ON fm_tts_tickets.assignedto=phpgw_accounts.account_id";
+                       //              $order_join = " LEFT OUTER JOIN 
phpgw_accounts ON fm_tts_tickets.assignedto=phpgw_accounts.account_id";
                        //              $order = 'account_lastname';
                                }
                                else if ($order == 'user')
@@ -163,7 +163,6 @@
                        {
                                $ordermethod = ' ORDER BY id DESC';
                        }
-                       $order_join .= " {$this->join} phpgw_group_map ON 
(phpgw_accounts.account_id = phpgw_group_map.account_id)";
                        $union_select = false;
                        $filtermethod = '';
 
@@ -171,8 +170,9 @@
 
                        $config = $GLOBALS['phpgw']->config->read();
 
-                       if (!isset($config['bypass_acl_at_tickets']) || 
!$config['bypass_acl_at_tickets'])
+                       if (!$start_date && 
(!isset($config['bypass_acl_at_tickets']) || !$config['bypass_acl_at_tickets']))
                        {
+                               $order_join .= " {$this->join} phpgw_group_map 
ON (phpgw_accounts.account_id = phpgw_group_map.account_id)";
                                
$GLOBALS['phpgw']->acl->set_account_id($this->account);
                                $grants = 
$GLOBALS['phpgw']->acl->get_grants2('property', '.ticket');
 
@@ -421,7 +421,7 @@
                                        $start_period = date('Ym', $start_date);
                                        $end_period = date('Ym', $end_date);
 //                                     $filtermethod .= " OR 
(fm_tts_payments.period >= {$start_period} AND fm_tts_payments.period <= 
{$end_period})";
-                                       $date_cost_join = "LEFT OUTER JOIN 
fm_tts_payments ON ( fm_tts_tickets.id=fm_tts_payments.ticket_id AND 
fm_tts_payments.period >= $start_period AND fm_tts_payments.period <= 
$end_period )";
+                                       $date_cost_join = " LEFT OUTER JOIN 
fm_tts_payments ON ( fm_tts_tickets.id=fm_tts_payments.ticket_id AND 
fm_tts_payments.period >= $start_period AND fm_tts_payments.period <= 
$end_period )";
 //                                     $actual_cost_field = 
'SUM(fm_tts_payments.amount) AS actual_cost';
                                        $actual_cost_field = 
array('SUM(actual_cost) AS actual_cost' => 'fm_tts_payments.amount as 
actual_cost');
 
@@ -430,7 +430,7 @@
                                        $start_budget_period = date('Y', 
$start_date) . '00';
                                        $end_budget_period = date('Y', 
$end_date) . '13';
 //                                     $filtermethod .= " OR 
(fm_tts_budget.period >= {$start_budget_period} AND fm_tts_budget.period <= 
{$end_budget_period}))";
-                                       $date_budget_join = "LEFT OUTER JOIN 
fm_tts_budget ON ( fm_tts_tickets.id=fm_tts_budget.ticket_id AND 
fm_tts_budget.period >= $start_budget_period AND fm_tts_budget.period <= 
$end_budget_period )";
+                                       $date_budget_join = " LEFT OUTER JOIN 
fm_tts_budget ON ( fm_tts_tickets.id=fm_tts_budget.ticket_id AND 
fm_tts_budget.period >= $start_budget_period AND fm_tts_budget.period <= 
$end_budget_period )";
 //                                     $budget_field = 
'SUM(fm_tts_budget.amount) AS budget';
                                        $budget_field = array('SUM(budget) AS 
budget' => 'fm_tts_budget.amount as budget');
                                        $budget_group_field = '';




reply via email to

[Prev in Thread] Current Thread [Next in Thread]