fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10033] added functions for create and update project


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [10033] added functions for create and update project and project types
Date: Tue, 25 Sep 2012 12:48:22 +0000

Revision: 10033
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10033
Author:   erikhl
Date:     2012-09-25 12:48:20 +0000 (Tue, 25 Sep 2012)
Log Message:
-----------
added functions for create and update project and project types

Modified Paths:
--------------
    trunk/logistic/inc/class.menu.inc.php
    trunk/logistic/inc/model/class.model.inc.php
    trunk/logistic/inc/model/class.project.inc.php
    trunk/logistic/setup/phpgw_no.lang

Added Paths:
-----------
    trunk/logistic/inc/class.socommon.inc.php
    trunk/logistic/inc/class.soproject.inc.php
    trunk/logistic/inc/class.uiproject.inc.php
    trunk/logistic/inc/model/class.activity.inc.php
    trunk/logistic/js/yahoo/
    trunk/logistic/js/yahoo/datatable.js
    trunk/logistic/templates/base/app_data.xsl
    trunk/logistic/templates/base/config.tpl
    trunk/logistic/templates/base/css/
    trunk/logistic/templates/base/css/base.css
    trunk/logistic/templates/base/datatable.xsl
    trunk/logistic/templates/base/project_datatable.xsl
    trunk/logistic/templates/base/project_item.xsl
    trunk/logistic/templates/base/project_type_item.xsl
    trunk/logistic/templates/base/project_types_datatable.xsl

Modified: trunk/logistic/inc/class.menu.inc.php
===================================================================
--- trunk/logistic/inc/class.menu.inc.php       2012-09-25 09:13:55 UTC (rev 
10032)
+++ trunk/logistic/inc/class.menu.inc.php       2012-09-25 12:48:20 UTC (rev 
10033)
@@ -77,6 +77,45 @@
                                )     
                        );
                        
+                       if ( $GLOBALS['phpgw']->acl->check('run', 
phpgwapi_acl::READ, 'admin')
+                               || $GLOBALS['phpgw']->acl->check('admin', 
phpgwapi_acl::ADD, 'controller'))
+                       {
+                               $menus['admin'] = array
+                               (
+                                       'index' => array
+                                       (
+                                               'text'  => 
lang('Configuration'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uiconfig.index', 'appname' => 'logistic') )
+                                       ),
+                                       'acl'   => array
+                                       (
+                                               'text'  => lang('Configure 
Access Permissions'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'preferences.uiadmin_acl.list_acl', 'acl_app' => 'logistic') )
+                                       ),
+                                       'project_types' => array
+                                       (
+                                               'text'  => lang('Project 
types'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'logistic.uiproject.project_types') )
+                                       ),
+/*                                     'control_cats'  => array
+                                       (
+                                               'text'  => lang('Control area'),
+                                               'url'   => 
$GLOBALS['phpgw']->link('/index.php', array('menuaction' => 
'admin.uicategories.index', 'appname' => 'controller', 'location' => 
'.control', 'global_cats' => 'true', 'menu_selection' => 
'admin::controller::control_cats') )
+                                       ),
+                                       'role_at_location'      => array
+                                       (
+                                               'url'   =>      
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uilocation.responsiblility_role', 'menu_selection' => 
'admin::controller::role_at_location') ),
+                                               'text'  =>      lang('role at 
location'),
+                                               'image' => array('property', 
'responsibility_role')
+                                       ),
+                                       'controller_document_types'     => array
+                                       (
+                                               'url'   =>      
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'controller.uidocument.document_types', 'menu_selection' => 
'admin::controller::controller_document_types') ),
+                                               'text'  =>      lang('Document 
types')
+                                       )*/
+                               );
+                       }
+                       
                        $menus['folders'] = 
phpgwapi_menu::get_categories('bergen');
 
                        $GLOBALS['phpgw_info']['flags']['currentapp'] = 
$incoming_app;

Added: trunk/logistic/inc/class.socommon.inc.php
===================================================================
--- trunk/logistic/inc/class.socommon.inc.php                           (rev 0)
+++ trunk/logistic/inc/class.socommon.inc.php   2012-09-25 12:48:20 UTC (rev 
10033)
@@ -0,0 +1,367 @@
+<?php
+       /**
+       * phpGroupWare - logistic: a part of a Facilities Management System.
+       *
+       * @author Erik Holm-Larsen <address@hidden>
+       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+       * @package property
+       * @subpackage logistic
+       * @version $Id: $
+       */
+
+       abstract class logistic_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;
+               }
+
+               /**
+                * 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);
+                       }
+                       else if($type == 'string' & $value == '')
+                       {
+                               return 'NULL';
+                       }
+
+                       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 (boolean)$value;
+                       }
+                       else if($type == 'boolean')
+                       {
+                               return (boolean) $value;
+                       }
+                       else if($type == 'int')
+                       {
+                               return (int) $value;
+                       }
+                       else if($type == 'float')
+                       {
+                               return (float) $value;
+                       }
+                       else if($type == 'string')
+                       {
+                               return (string) $value;
+                       }
+                       else if($value === null || $value == 'NULL')
+                       {
+                               return null;
+                       }
+                       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(null, null, null, null, null, 
null, 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 boolean 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, boolean $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(null, 
null, $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 boolean 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 boolean 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, 
boolean $ascending, string $search_for, string $search_type, array $filters, 
boolean $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;
+               }
+       }

Added: trunk/logistic/inc/class.soproject.inc.php
===================================================================
--- trunk/logistic/inc/class.soproject.inc.php                          (rev 0)
+++ trunk/logistic/inc/class.soproject.inc.php  2012-09-25 12:48:20 UTC (rev 
10033)
@@ -0,0 +1,257 @@
+<?php
+
+       /**
+       * phpGroupWare - logistic: a part of a Facilities Management System.
+       *
+       * @author Erik Holm-Larsen <address@hidden>
+       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+       * @package property
+       * @subpackage logistic
+       * @version $Id:$
+       */      
+
+       phpgw::import_class('logistic.socommon');
+
+       include_class('logistic', 'project', 'inc/model/');
+
+       class logistic_soproject extends logistic_socommon
+       {
+               protected static $so;
+
+               /**
+                * Get a static reference to the storage object associated with 
this model object
+                *
+                * @return controller_soparty the storage object
+                */
+               public static function get_instance()
+               {
+                       if (self::$so == null)
+                       {
+                               self::$so = CreateObject('logistic.soproject');
+                       }
+                       return self::$so;
+               }
+
+               protected function add(&$project)
+               {
+                       $name = $project->get_name();
+                       $description = $project->get_description();
+                       $type_id = $project->geT_project_type_id();
+
+                       $sql = "INSERT INTO lg_project (name, description, 
project_type_id) VALUES ('$name','$description',$type_id)";
+                       $result = $this->db->query($sql, __LINE__,__FILE__);
+
+                       if($result)
+                       {
+                               // Set the new project ID
+                               return 
$this->db->get_last_insert_id('lg_project', 'id');
+                       }
+                       else
+                       {
+                               return 0;
+                       }
+               }
+               
+               
+               protected function update($project)
+               {
+                       $id = intval($project->get_id());
+
+                       $values = array(
+                               'name = ' . 
$this->marshal($project->get_name(), 'string'),
+                               'description = ' . 
$this->marshal($project->get_description(), 'string'),
+                               'project_type_id = ' . 
$this->marshal($project->get_project_type_id(), 'int')
+                       );
+
+                       $result = $this->db->query('UPDATE lg_project SET ' . 
join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
+
+                       if( $result )
+                       {
+                               return $id;
+                       }
+                       else
+                       {
+                               return 0;
+                       }
+               }
+
+               protected function get_id_field_name()
+               {
+                       if(!$extended_info)
+                       {
+                               $ret = 'id';
+                       }
+                       else
+                       {
+                               $ret = array
+                               (
+                                       'table'                 => 'project', 
// alias
+                                       'field'                 => 'id',
+                                       'translated'    => 'id'
+                               );
+                       }
+
+                       return $ret;
+               }
+
+               protected function get_query(string $sort_field, boolean 
$ascending, string $search_for, string $search_type, array $filters, boolean 
$return_count)
+               {
+                       $clauses = array('1=1');
+                       $project_type = false;
+                       $table_alias = 'project';
+                       if($search_type && $search_type == 'project_type')
+                       {
+                               $project_type = true;
+                               $table_alias = 'project_type';
+                       }
+
+                       if($search_for)
+                       {
+                               $like_pattern = "'%" . 
$this->db->db_addslashes($search_for) . "%'";
+                               $like_clauses = array();
+                               switch($search_type)
+                               {
+                                       default:
+                                               $like_clauses[] = 
"{$table_alias}.name $this->like $like_pattern";
+                                               break;
+                               }
+                               if(count($like_clauses))
+                               {
+                                       $clauses[] = '(' . join(' OR ', 
$like_clauses) . ')';
+                               }
+                       }
+
+                       $filter_clauses = array();
+                       if(isset($filters[$this->get_id_field_name()]))
+                       {
+                               $filter_clauses[] = "{$table_alias}.id = 
{$this->marshal($filters[$this->get_id_field_name()],'int')}";
+                       }
+
+                       if(count($filter_clauses))
+                       {
+                               $clauses[] = join(' AND ', $filter_clauses);
+                       }
+
+                       $condition =  join(' AND ', $clauses);
+
+                       //$joins = " {$this->left_join} controller_control_area 
ON (controller_procedure.control_area_id = controller_control_area.id)";
+
+                       if($project_type)
+                       {
+                               $tables = "lg_project_type project_type";
+                       }
+                       else
+                       {
+                               $tables = "lg_project project";
+                       }
+
+                       if($return_count) // We should only return a count
+                       {
+                               $cols = 'COUNT(DISTINCT('.$table_alias.'.id)) 
AS count';
+                       }
+                       else
+                       {
+                               $cols .= "* ";
+                       }
+                       //var_dump($sort_field);
+                       $dir = $ascending ? 'ASC' : 'DESC';
+                       $order = $sort_field ? "ORDER BY 
{$this->marshal($sort_field, 'field')} $dir ": '';
+
+                       //var_dump("SELECT {$cols} FROM {$tables} {$joins} 
WHERE {$condition} {$order}");
+
+                       return "SELECT {$cols} FROM {$tables} {$joins} WHERE 
{$condition} {$order}";
+               }
+
+               protected function populate(int $project_id, &$project)
+               {
+                       if($project == null)
+                       {
+                               $project = new logistic_project((int) 
$project_id);
+
+                               
$project->set_name($this->unmarshal($this->db->f('name'), 'string'));
+                               
$project->set_description($this->unmarshal($this->db->f('description'), 
'string'));
+                               
$project->set_project_type_id($this->unmarshal($this->db->f('project_type_id'), 
'int'));
+                               if($project->get_project_type_id() && 
$project->get_project_type_id() > 0)
+                               {
+                                       
$project->set_project_type_label($this->get_project_type_label($this->unmarshal($this->db->f('project_type_id'),
 'int')));
+                               }
+                       }
+
+                       return $project;
+               }
+               
+               private function get_project_type_label($id)
+               {
+                       $sql = "SELECT name FROM lg_project_type where id=$id";
+                       $this->db->query($sql, __LINE__, __FILE__);
+                       
+                       while ($this->db->next_record())
+                       {
+                               return $this->db->f('name');
+                       }
+               }
+               
+               public function get_project_types()
+               {
+                       $project_type_array = array();
+                       $sql = "SELECT * FROM lg_project_type";
+                       $this->db->query($sql, __LINE__, __FILE__);
+
+                       while ($this->db->next_record())
+                       {
+                               $project_type_array[] = array(
+                                               'id' => $this->db->f('id'),
+                                               'name' => 
$this->unmarshal($this->db->f('name'), 'string')
+                                               );
+                       }
+                       return $project_type_array;
+               }
+               
+               public function update_project_type($id, $name)
+               {
+                       $sql = "UPDATE lg_project_type set name='{$name}' where 
id={$id}";
+                       $result = $this->db->query($sql, __LINE__,__FILE__);
+
+                       if( $result )
+                       {
+                               return $id;
+                       }
+                       else
+                       {
+                               return 0;
+                       }
+               }
+               
+               public function add_project_type($name)
+               {
+                       $sql = "INSERT INTO lg_project_type (name) VALUES 
('{$name}')";
+                       $result = $this->db->query($sql, __LINE__,__FILE__);
+
+                       if($result)
+                       {
+                               return 
$this->db->get_last_insert_id('lg_project_type', 'id');
+                       }
+                       else
+                       {
+                               return 0;
+                       }
+               }
+       }
\ No newline at end of file

Added: trunk/logistic/inc/class.uiproject.inc.php
===================================================================
--- trunk/logistic/inc/class.uiproject.inc.php                          (rev 0)
+++ trunk/logistic/inc/class.uiproject.inc.php  2012-09-25 12:48:20 UTC (rev 
10033)
@@ -0,0 +1,477 @@
+<?php
+
+       /**
+       * phpGroupWare - logistic: a part of a Facilities Management System.
+       *
+       * @author Erik Holm-Larsen <address@hidden>
+       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+       * @package property
+       * @subpackage logistic
+       * @version $Id:$
+       */      
+
+       phpgw::import_class('phpgwapi.uicommon');
+       phpgw::import_class('logistic.soproject');
+       
+       include_class('logistic', 'project');
+       
+       class logistic_uiproject extends phpgwapi_uicommon
+       {
+               private $so;
+               
+               public $public_functions = array(
+                               'query' => true,
+                               'index' => true,
+                               'project_types' => true,
+                               'view' => true,
+                               'view_project_type' => true,
+                               'edit_project_type' => true,
+                               'add' => true,
+                               'edit' => true
+               );
+               
+               public function __construct() {
+                       parent::__construct();
+                       
+                       $this->so = CreateObject('logistic.soproject');         
        
+
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"logistic::project";
+               }
+               
+               public function query()
+               {
+                       $params = array(
+                               'start' => phpgw::get_var('startIndex', 'int', 
'REQUEST', 0),
+                               'results' => phpgw::get_var('results', 'int', 
'REQUEST', null),
+                               'query' => phpgw::get_var('query'),
+                               'sort'  => phpgw::get_var('sort'),
+                               'dir'   => phpgw::get_var('dir'),
+                               'filters' => $filters
+                       );
+
+                       
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+                       {
+                               $user_rows_per_page = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+                       }
+                       else {
+                               $user_rows_per_page = 10;
+                       }
+                       // YUI variables for paging and sorting
+                       $start_index    = phpgw::get_var('startIndex', 'int');
+                       $num_of_objects = phpgw::get_var('results', 'int', 
'GET', $user_rows_per_page);
+                       $sort_field             = phpgw::get_var('sort');
+                       $sort_ascending = phpgw::get_var('dir') == 'desc' ? 
false : true;
+                       // Form variables
+                       $search_for     = phpgw::get_var('query');
+                       $search_type    = phpgw::get_var('search_option');
+                       // Create an empty result set
+                       $result_objects = array();
+                       $result_count = 0;
+
+                       //Retrieve a contract identifier and load corresponding 
contract
+                       $project_id = phpgw::get_var('project_id');
+
+                       $exp_param      = phpgw::get_var('export');
+                       $export = false;
+                       if(isset($exp_param)){
+                               $export=true;
+                               $num_of_objects = null;
+                       }
+
+                       //Retrieve the type of query and perform type specific 
logic
+                       $query_type = phpgw::get_var('type');
+                       //var_dump($query_type);
+                       switch($query_type)
+                       {
+                               case 'project_type': 
+                                       phpgwapi_cache::session_set('logistic', 
'project_type_query', $search_for);
+                                       $search_type =  'project_type';
+                                       $result_objects = 
$this->so->get($start_index, $num_of_objects, $sort_field, $sort_ascending, 
$search_for, $search_type, $filters);
+                                       $object_count = 
$this->so->get_count($search_for, $search_type, $filters);
+                                       break;
+                               default: // ... all composites, filters (active 
and vacant)
+                                       phpgwapi_cache::session_set('logistic', 
'project_query', $search_for);
+                                       //$filters = array();
+                                       $result_objects = 
$this->so->get($start_index, $num_of_objects, $sort_field, $sort_ascending, 
$search_for, $search_type, $filters);
+                                       $object_count = 
$this->so->get_count($search_for, $search_type, $filters);
+                                       break;
+                       }
+
+                       //Create an empty row set
+                       $rows = array();
+                       foreach($result_objects as $result) {
+                               if(isset($result))
+                               {
+                                       $rows[] = $result->serialize();
+                               }
+                       }
+
+                       // ... add result data
+                       $result_data = array('results' => $rows);
+
+                       $result_data['total_records'] = $object_count;
+                       $result_data['start'] = $params['start'];
+                       $result_data['sort'] = $params['sort'];
+                       $result_data['dir'] = $params['dir'];
+
+                       $editable = phpgw::get_var('editable') == 'true' ? true 
: false;
+
+                       if(!$export){
+                               //Add action column to each row in result table
+                               if($search_type && $search_type == 
'project_type')
+                               {
+                                       array_walk(
+                                               $result_data['results'],
+                                               array($this, '_add_links'),
+                                               
"logistic.uiproject.view_project_type");
+                               }
+                               else
+                               {
+                                       array_walk(
+                                               $result_data['results'],
+                                               array($this, '_add_links'),
+                                               "logistic.uiproject.view");
+                               }
+                               
+                       }
+                       return $this->yui_results($result_data);
+               }
+               
+               public function index()
+               {
+                       if(phpgw::get_var('phpgw_return_as') == 'json') {
+                               return $this->query();
+                       }
+                       self::add_javascript('logistic', 'yahoo', 
'datatable.js');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('paginator');
+                       
+                       $project_type_array = $this->so->get_project_types();
+                       
+                       $data = array(
+                               'form' => array(
+                                       'toolbar' => array(
+                                               'item' => array(
+                                                       array('type' => 
'filter',
+                                                               'name' => 
'project_types',
+                                                               'text' => 
lang('Project_type').':',
+                                                               'list' => 
$project_type_array,
+                                                       ),
+                                                       array('type' => 'text', 
+                                                               'text' => 
lang('search'),
+                                                               'name' => 
'query'
+                                                       ),
+                                                       array(
+                                                               'type' => 
'submit',
+                                                               'name' => 
'search',
+                                                               'value' => 
lang('Search')
+                                                       ),
+                                                       array(
+                                                               'type' => 
'link',
+                                                               'value' => 
lang('t_new_project'),
+                                                               'href' => 
self::link(array('menuaction' => 'logistic.uiproject.add')),
+                                                               'class' => 
'new_item'
+                                                       ),
+                                               ),
+                                       ),
+                               ),
+                               'datatable' => array(
+                                       'source' => 
self::link(array('menuaction' => 'logistic.uiproject.index', 'phpgw_return_as' 
=> 'json')),
+                                       'field' => array(
+                                               array(
+                                                       'key' => 'name',
+                                                       'label' => 
lang('Project name'),
+                                                       'sortable'      => true
+                                               ),
+                                               array(
+                                                       'key' => 'id',
+                                                       'label' => lang('ID'),
+                                                       'sortable'      => true,
+                                                       'formatter' => 
'YAHOO.portico.formatLink'
+                                               ),
+                                               array(
+                                                       'key' => 'description',
+                                                       'label' => 
lang('Project description'),
+                                                       'sortable'      => false
+                                               ),
+                                               array(
+                                                       'key' => 
'project_type_label',
+                                                       'label' => 
lang('Project type'),
+                                                       'sortable'      => false
+                                               ),
+                                               array(
+                                                       'key' => 'link',
+                                                       'hidden' => true
+                                               )
+                                       )
+                               ),
+                       );
+
+                       self::render_template_xsl(array( 'project_datatable', 
'datatable' ), $data);
+               }
+               
+               public function project_types()
+               {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"admin::logistic::project_types";
+                       if(phpgw::get_var('phpgw_return_as') == 'json') {
+                               return $this->query();
+                       }
+                       self::add_javascript('logistic', 'yahoo', 
'datatable.js');
+                       phpgwapi_yui::load_widget('datatable');
+                       phpgwapi_yui::load_widget('paginator');
+                       
+                       $project_type_id = phpgw::get_var('id');
+                       $new_type = phpgw::get_var('new_type');
+                       $edit_type = phpgw::get_var('edit_type');
+                       
+                       if($new_type || $edit_type)
+                       {
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.edit_project_type'));
+                       }
+                       else
+                       {
+                               //list project types
+                               $data = array(
+                                       'form' => array(
+                                               'toolbar' => array(
+                                                       'item' => array(
+                                                               array('type' => 
'text', 
+                                                                       'text' 
=> lang('search'),
+                                                                       'name' 
=> 'query'
+                                                               ),
+                                                               array(
+                                                                       'type' 
=> 'submit',
+                                                                       'name' 
=> 'search',
+                                                                       'value' 
=> lang('Search')
+                                                               ),
+                                                               array(
+                                                                       'type' 
=> 'link',
+                                                                       'value' 
=> lang('t_new_project_type'),
+                                                                       'href' 
=> self::link(array('menuaction' => 'logistic.uiproject.project_types', 
'new_type' => 'yes')),
+                                                                       'class' 
=> 'new_item'
+                                                               ),
+                                                       ),
+                                               ),
+                                       ),
+                                       'datatable' => array(
+                                               'source' => 
self::link(array('menuaction' => 'logistic.uiproject.project_types', 
'phpgw_return_as' => 'json', 'type' => 'project_type')),
+                                               'field' => array(
+                                                       array(
+                                                               'key' => 'id',
+                                                               'label' => 
lang('ID'),
+                                                               'sortable'      
=> true,
+                                                               'formatter' => 
'YAHOO.portico.formatLink'
+                                                       ),
+                                                       array(
+                                                               'key' => 'name',
+                                                               'label' => 
lang('Project type name'),
+                                                               'sortable'      
=> false
+                                                       ),
+                                                       array(
+                                                               'key' => 'link',
+                                                               'hidden' => true
+                                                       )
+                                               )
+                                       ),
+                               );
+
+                               self::render_template_xsl(array( 
'project_types_datatable', 'datatable' ), $data);
+                       }
+               }
+               
+               public function view()
+               {
+                       $project_id = phpgw::get_var('id');
+                       if(isset($_POST['edit_project']))
+                       {
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.edit', 'id' => $project_id));
+                       }
+                       else
+                       {
+                               if($project_id && is_numeric($project_id))
+                               {
+                                       $project = 
$this->so->get_single($project_id);
+                               }
+                               
+                               $project_array = $project->toArray();
+                               
+                               if($this->flash_msgs)
+                               {
+                                       $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox_data($this->flash_msgs);
+                                       $msgbox_data = 
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
+                               }
+                               
+                               $data = array
+                               (
+                                       'value_id'                              
=> !empty($project) ? $project->get_id() : 0,
+                                       'img_go_home'                   => 
'rental/templates/base/images/32x32/actions/go-home.png',
+                                       'project'                               
=> $project_array,
+                                       'view'                                  
        => 'view_project'
+                               );
+
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('logistic') . '::' . lang('Project');
+                               
self::render_template_xsl(array('project_item'), $data);
+                       }
+               }
+               
+               public function view_project_type()
+               {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"admin::logistic::project_types";
+                       $project_type_id = phpgw::get_var('id');
+                       if(isset($_POST['edit_project_type']))
+                       {
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.edit_project_type', 'id' => 
$project_type_id));
+                       }
+                       else
+                       {
+                               if($project_type_id && 
is_numeric($project_type_id))
+                               {
+                                       $objects = $this->so->get(null, null, 
null, null, null,'project_type', array('id' => $project_type_id));
+                                       if(count($objects) > 0)
+                                       {
+                                               $keys = array_keys($objects);
+                                               $project = $objects[$keys[0]];
+                                       }
+                               }
+
+                               $project_array = $project->toArray();
+                               
+                               $data = array
+                               (
+                                       'value_id'                              
=> !empty($project) ? $project->get_id() : 0,
+                                       'img_go_home'                   => 
'rental/templates/base/images/32x32/actions/go-home.png',
+                                       'project'                               
        => $project_array
+                               );
+
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('logistic') . '::' . lang('Project type');
+                               
self::render_template_xsl(array('project_type_item'), $data);
+                       }
+               }
+               
+               public function edit_project_type()
+               {
+                       $GLOBALS['phpgw_info']['flags']['menu_selection'] = 
"admin::logistic::project_types";
+                       $project_type_id = phpgw::get_var('id');
+                       if($project_type_id && is_numeric($project_type_id))
+                       {
+                               $objects = $this->so->get(null, null, null, 
null, null,'project_type', array('id' => $project_type_id));
+                               if(count($objects) > 0)
+                               {
+                                       $keys = array_keys($objects);
+                                       $project = $objects[$keys[0]];
+                               }
+                       }
+                       else
+                       {
+                               $project = new logistic_project();
+                       }
+                       if(isset($_POST['save_project_type']))
+                       {
+                               $project_type_name = phpgw::get_var('title');
+                               if(!$project_type_id || 
is_null($project_type_id))
+                               {
+                                       $project_type_id = 
$this->so->add_project_type($project_type_name);
+                               }
+                               else
+                               {
+                                       
$this->so->update_project_type($project_type_id, $project_type_name);
+                               }
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.view_project_type', 'id' => 
$project_type_id));
+                       }
+                       else if(isset($_POST['cancel_project_type']))
+                       {
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.view_project_type', 'id' => 
$project_type_id));
+                       }
+                       else
+                       {
+                               $project_array = $project->toArray();
+
+                               $data = array
+                               (
+                                       'value_id'                              
=> !empty($project) ? $project->get_id() : 0,
+                                       'img_go_home'                   => 
'rental/templates/base/images/32x32/actions/go-home.png',
+                                       'project'                               
        => $project_array,
+                                       'editable'                              
=> true
+                               );
+
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('logistic') . '::' . lang('Project type');
+                               
self::render_template_xsl(array('project_type_item'), $data);
+                       }
+               }
+               
+               public function add()
+               {
+                       $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.edit'));
+               }
+               
+               public function edit()
+               {
+                       $project_id = phpgw::get_var('id');
+                       if($project_id && is_numeric($project_id))
+                       {
+                               $project = $this->so->get_single($project_id);
+                       }
+                       else
+                       {
+                               $project = new logistic_project();
+                       }
+                       
+                       if(isset($_POST['save_project']))
+                       {
+                               $project->set_name(phpgw::get_var('name'));
+                               
$project->set_project_type_id(phpgw::get_var('project_type_id'));
+                               
$project->set_description(phpgw::get_var('description'));
+                               
+                               $project_id = $this->so->store($project);
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.view', 'id' => $project_id));
+                       }
+                       else if(isset ($_POST['cancel_project']))
+                       {
+                               $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'logistic.uiproject.view', 'id' => $project_id));
+                       }
+                       else
+                       {
+                               $project_types = $this->so->get_project_types();
+                               foreach ($project_types as &$p_type)
+                               {
+                                       if($project->get_project_type_id() == 
$p_type['id'])
+                                       {
+                                               $p_type['selected'] = 1;
+                                       }
+                               }
+                               $project_array = $project->toArray();
+
+                               $data = array
+                               (
+                                       'value_id'                              
=> !empty($project) ? $project->get_id() : 0,
+                                       'img_go_home'                   => 
'rental/templates/base/images/32x32/actions/go-home.png',
+                                       'project'                               
        => $project_array,
+                                       'options'                               
        => $project_types,
+                                       'editable'                              
=> true
+                               );
+
+                               $this->use_yui_editor('description');
+                               $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('logistic') . '::' . lang('Project type');
+                               
self::render_template_xsl(array('project_item'), $data);
+                       }
+               }
+       }
+?>

Added: trunk/logistic/inc/model/class.activity.inc.php
===================================================================
--- trunk/logistic/inc/model/class.activity.inc.php                             
(rev 0)
+++ trunk/logistic/inc/model/class.activity.inc.php     2012-09-25 12:48:20 UTC 
(rev 10033)
@@ -0,0 +1,152 @@
+<?php
+       /**
+       * phpGroupWare - logistic: a part of a Facilities Management System.
+       *
+       * @author Erik Holm-Larsen <address@hidden>
+       * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * This file is part of phpGroupWare.
+       *
+       * phpGroupWare is free software; you can redistribute it and/or modify
+       * it under the terms of the GNU General Public License as published by
+       * the Free Software Foundation; either version 2 of the License, or
+       * (at your option) any later version.
+       *
+       * phpGroupWare is distributed in the hope that it will be useful,
+       * but WITHOUT ANY WARRANTY; without even the implied warranty of
+       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+       * GNU General Public License for more details.
+       *
+       * You should have received a copy of the GNU General Public License
+       * along with phpGroupWare; if not, write to the Free Software
+       * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 
 USA
+       *
+       * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+       * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+       * @package property
+       * @subpackage logistic
+       * @version $Id $
+       */
+
+               include_class('logistic', 'model' , 'inc/model');
+               
+               class logistic_activity extends logistic_model
+               {
+                               public static $so;
+
+                               protected static $id;
+                               protected static $name;
+                               protected static $parent_id;
+                               protected static $project_id;
+                               protected static $start_date;
+                               protected static $end_date;
+                               protected static $responsible_user_id;
+
+                               /**
+                               * Constructor.  Takes an optional ID.  If a 
contract is created from outside
+                               * the database the ID should be empty so the 
database can add one according to its logic.
+                               * 
+                               * @param int $id the id of this project
+                               */
+                               public function __construct(int $id = null)
+                               {
+                                       $this->id = (int)$id;
+                               }
+
+                               public function set_id($id)
+                               {
+                                       $this->id = $id;
+                               }
+
+                               public function get_id()
+                               {
+                                       return $this->id;
+                               }
+
+                               public function set_name($name)
+                               {
+                                       $this->name = $name;
+                               }
+
+                               public function get_name()
+                               {
+                                       return $this->title; 
+                               }
+                               
+                               public function set_parent_id($parent_id)
+                               {
+                                       $this->parent_id = $parent_id;
+                               }
+                               
+                               public function get_parent_id()
+                               {
+                                       return $this->parent_id;
+                               }
+                               
+                               public function set_project_id($project_id)
+                               {
+                                       $this->project_id = $project_id;
+                               }
+                               
+                               public function get_project_id()
+                               {
+                                       return $this->project_id;
+                               }
+                               
+                               public function set_start_date($start_date)
+                               {
+                                       $this->start_date = $start_date;
+                               }
+                               
+                               public function get_start_date()
+                               {
+                                       return $this->start_date;
+                               }
+                               
+                               public function set_end_date($end_date)
+                               {
+                                       $this->end_date = $end_date;
+                               }
+                               
+                               public function get_end_date()
+                               {
+                                       return $this->end_date;
+                               }
+                               
+                               public function 
set_responsible_user_id($responsible_user_id)
+                               {
+                                       $this->responsible_user_id = 
$responsible_user_id;
+                               }
+                               
+                               public function get_responsible_user_id()
+                               {
+                                       return $this->responsible_user_id;
+                               }
+
+                               /**
+                               * Get a static reference to the storage object 
associated with this model object
+                               * 
+                               * @return the storage object
+                               */
+                               public static function get_so()
+                               {
+                                       if (self::$so == null) {
+                                               self::$so = 
CreateObject('logistic.soproject');
+                                       }
+
+                                       return self::$so;
+                               }
+
+                               public function serialize()
+                               {
+                                       return array(
+                                               'id' => $this->get_id(),
+                                               'name' => $this->get_name(),
+                                               'parent_id' => 
$this->get_parent_id(),
+                                               'project_id' => 
$this->get_project_id(),
+                                               'start_date' => 
$this->get_start_date(),
+                                               'end_date' => 
$this->get_end_date(),
+                                               'responsible_user_id' => 
$this->get_responsible_user_id()
+                                       );
+                               }
+               }
+?>

Modified: trunk/logistic/inc/model/class.model.inc.php
===================================================================
--- trunk/logistic/inc/model/class.model.inc.php        2012-09-25 09:13:55 UTC 
(rev 10032)
+++ trunk/logistic/inc/model/class.model.inc.php        2012-09-25 12:48:20 UTC 
(rev 10033)
@@ -113,8 +113,7 @@
                                                
$control_item_arr[$_class_method_part[1]] = $this->$class_method();
                                        }
                                }
-
-       //                      _debug_array($control_item_arr);
+                               
                                return $control_item_arr;
                        }
 

Modified: trunk/logistic/inc/model/class.project.inc.php
===================================================================
--- trunk/logistic/inc/model/class.project.inc.php      2012-09-25 09:13:55 UTC 
(rev 10032)
+++ trunk/logistic/inc/model/class.project.inc.php      2012-09-25 12:48:20 UTC 
(rev 10033)
@@ -24,9 +24,105 @@
        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
        * @package property
        * @subpackage logistic
-       * @version $Id$
+       * @version $Id $
        */
 
- include_class('logistic', 'model' , 'inc/model')
+               include_class('logistic', 'model', '/inc/model/');
+               
+               class logistic_project extends logistic_model
+               {
+                               public static $so;
 
+                               protected static $id;
+                               protected static $name;
+                               protected static $project_type_id;
+                               protected static $project_type_label;
+                               protected static $description;
+
+                               /**
+                               * Constructor.  Takes an optional ID.  If a 
contract is created from outside
+                               * the database the ID should be empty so the 
database can add one according to its logic.
+                               * 
+                               * @param int $id the id of this project
+                               */
+                               public function __construct(int $id = null)
+                               {
+                                       $this->id = (int)$id;
+                               }
+
+                               public function set_id($id)
+                               {
+                                       $this->id = $id;
+                               }
+
+                               public function get_id()
+                               {
+                                       return $this->id;
+                               }
+
+                               public function set_name($name)
+                               {
+                                       $this->name = $name;
+                               }
+
+                               public function get_name()
+                               {
+                                       return $this->name; 
+                               }
+                               
+                               public function 
set_project_type_id($project_type_id)
+                               {
+                                       $this->project_type_id = 
$project_type_id;
+                               }
+                               
+                               public function get_project_type_id()
+                               {
+                                       return $this->project_type_id;
+                               }
+                               
+                               public function 
set_project_type_label($project_type_label)
+                               {
+                                       $this->project_type_label = 
$project_type_label;
+                               }
+                               
+                               public function get_project_type_label()
+                               {
+                                       return $this->project_type_label;
+                               }
+                               
+                               public function set_description($description)
+                               {
+                                       $this->description = $description;
+                               }
+                               
+                               public function get_description()
+                               {
+                                       return $this->description;
+                               }
+                               
+                               /**
+                               * Get a static reference to the storage object 
associated with this model object
+                               * 
+                               * @return the storage object
+                               */
+                               public static function get_so()
+                               {
+                                       if (self::$so == null) {
+                                               self::$so = 
CreateObject('logistic.soproject');
+                                       }
+
+                                       return self::$so;
+                               }
+
+                               public function serialize()
+                               {
+                                       return array(
+                                               'id' => $this->get_id(),
+                                               'name' => $this->get_name(),
+                                               'project_type_id' => 
$this->get_project_type_id(),
+                                               'project_type_label' => 
$this->get_project_type_label(),
+                                               'description' => 
$this->get_description()
+                                       );
+                               }
+               }
 ?>

Added: trunk/logistic/js/yahoo/datatable.js
===================================================================
--- trunk/logistic/js/yahoo/datatable.js                                (rev 0)
+++ trunk/logistic/js/yahoo/datatable.js        2012-09-25 12:48:20 UTC (rev 
10033)
@@ -0,0 +1,489 @@
+YAHOO.portico.setupToolbar = function() {
+       YAHOO.portico.renderUiFormItems('toolbar');
+};
+
+YAHOO.portico.setupListActions = function() {
+       YAHOO.portico.renderUiFormItems('list_actions');
+};
+
+YAHOO.portico.renderUiFormItems = function(container) {
+       var items = YAHOO.util.Dom.getElementsBy(function(){return true;}, 
'input', container);
+   for(var i=0; i < items.length; i++) {
+          var type = items[i].getAttribute('type');
+          if(type == 'link') {
+                  new YAHOO.widget.Button(items[i], 
+                                                                  {type: 
'link', 
+                                                                       href: 
items[i].getAttribute('href')}).addClass(items[i].getAttribute('class'));
+          }
+          else if(type == 'submit') {
+                  new YAHOO.widget.Button(items[i], {type: 'submit'});
+          }
+   }
+};
+
+YAHOO.portico.setupPaginator = function() {
+       var paginatorConfig = {
+               rowsPerPage: 10,
+               alwaysVisible: false,
+               template: "{PreviousPageLink} 
<strong>{CurrentPageReport}</strong> {NextPageLink}",
+               pageReportTemplate: "Showing items {startRecord} - {endRecord} 
of {totalRecords}",
+               containers: ['paginator']
+       };
+       
+       YAHOO.portico.lang('setupPaginator', paginatorConfig);
+       var pag = new YAHOO.widget.Paginator(paginatorConfig);
+       pag.render();
+       return pag;
+};
+
+YAHOO.portico.preSerializeQueryFormListeners = new Array();
+
+       YAHOO.portico.addPreSerializeQueryFormListener = function(func) {
+       YAHOO.portico.preSerializeQueryFormListeners.push(func);
+}
+
+YAHOO.portico.preSerializeQueryForm = function(form) {
+       for (var key in YAHOO.portico.preSerializeQueryFormListeners) {
+               YAHOO.portico.preSerializeQueryFormListeners[key](form);
+       }
+}
+
+YAHOO.portico.initializeDataTable = function()
+{
+       YAHOO.portico.setupToolbar();
+       YAHOO.portico.setupListActions();
+       YAHOO.portico.setupDatasource();
+       var pag = YAHOO.portico.setupPaginator();
+
+       var fields = [];
+       for(var i=0; i < YAHOO.portico.columnDefs.length; i++) {
+               fields.push(YAHOO.portico.columnDefs[i].key);
+       }
+       var baseUrl = YAHOO.portico.dataSourceUrl;
+       if(baseUrl[baseUrl.length - 1] != '&') {
+               baseUrl += '&';
+       }
+       
+       if (YAHOO.portico.initialSortedBy) {
+         baseUrl += 'sort=' + YAHOO.portico.initialSortedBy.key + '&dir=' + 
YAHOO.portico.initialSortedBy.dir;
+       } else {
+         baseUrl += 'sort=' + fields[0];
+       }
+       
+         baseUrl += '&results=' + pag.getRowsPerPage() + '&';
+       var myDataSource = new YAHOO.util.DataSource(baseUrl);
+
+       myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
+       myDataSource.connXhrMode = "queueRequests";
+       myDataSource.responseSchema = {
+               resultsList: "ResultSet.Result",
+               fields: fields,
+               metaFields : {
+                       totalResultsAvailable: "ResultSet.totalRecords",
+                       recordsReturned: "ResultSet.recordsReturned",
+                       startIndex: 'ResultSet.startIndex',
+                       sortKey: 'ResultSet.sortKey',
+                       sortDir: 'ResultSet.sortDir'
+               }
+       };
+       var myDataTable = new YAHOO.widget.DataTable("datatable-container", 
+               YAHOO.portico.columnDefs, myDataSource, {
+                       paginator: pag,
+                       dynamicData: true,
+                       sortedBy: YAHOO.portico.initialSortedBy || {key: 
fields[0], dir: YAHOO.widget.DataTable.CLASS_ASC}
+       });
+
+//------------
+               myContextMenu = new YAHOO.widget.ContextMenu("mycontextmenu", 
{trigger:myDataTable.getTbodyEl()});
+               myContextMenu.addItems(YAHOO.portico.GetMenuContext());
+                               
+               myDataTable.subscribe("rowMouseoverEvent", 
myDataTable.onEventHighlightRow);
+               myDataTable.subscribe("rowMouseoutEvent", 
myDataTable.onEventUnhighlightRow);
+
+               myContextMenu.subscribe("beforeShow", 
YAHOO.portico.onContextMenuBeforeShow);
+               myContextMenu.subscribe("hide", 
YAHOO.portico.onContextMenuHide);
+               //Render the ContextMenu instance to the parent container of 
the DataTable
+               myContextMenu.subscribe("click", 
YAHOO.portico.onContextMenuClick, myDataTable);
+               myContextMenu.render(myDataTable);
+//--------------
+
+       var handleSorting = function (oColumn) {
+               var sDir = this.getColumnSortDir(oColumn);
+               var newState = getState(oColumn.key, sDir);
+               History.navigate("state", newState);
+       };
+       myDataTable.sortColumn = handleSorting;
+
+       var handlePagination = function(state) {
+               var sortedBy  = this.get("sortedBy");
+               var newState = getState(sortedBy.key, sortedBy.dir, 
state.recordOffset);
+               History.navigate("state", newState);
+        };
+       pag.unsubscribe("changeRequest", myDataTable.onPaginatorChangeRequest);
+       pag.subscribe("changeRequest", handlePagination, myDataTable, true);
+       myDataTable.doBeforeLoadData = function(oRequest, oResponse, oPayload) {
+               oPayload.totalRecords = oResponse.meta.totalResultsAvailable;
+               oPayload.pagination = { 
+                       rowsPerPage: oResponse.meta.paginationRowsPerPage || 
10, 
+               //      rowsPerPage: oResponse.meta.recordsReturned || 10, 
+                       recordOffset: oResponse.meta.startIndex || 0 
+               }
+               oPayload.sortedBy = { 
+                       key: oResponse.meta.sortKey || "id", 
+                       dir: (oResponse.meta.sortDir) ? "yui-dt-" + 
oResponse.meta.sortDir : "yui-dt-asc" 
+               };
+               return true;
+       }
+        
+       YAHOO.util.Event.on(
+               YAHOO.util.Selector.query('select'), 'change', function (e) {
+                       //var val = this.value;
+                       var state = getState();
+                       YAHOO.util.Dom.setStyle('list_flash', 'display', 
'none');
+                       History.navigate('state', state);
+       });
+
+       YAHOO.util.Event.addListener('queryForm', "submit", function(e){
+               YAHOO.util.Event.stopEvent(e);
+               var state = getState();
+               YAHOO.util.Dom.setStyle('list_flash', 'display', 'none');
+               History.navigate('state', state);
+       });
+
+       YAHOO.util.Event.addListener('list_actions_form', "submit", function(e){
+               YAHOO.util.Event.stopEvent(e);
+               window.setTimeout(function() {
+                       var state = getState();
+                       var action = myDataSource.liveData + '&' + state;
+                       action = action.replace('&phpgw_return_as=json', '');
+                       
YAHOO.util.Dom.setAttribute(document.getElementById('list_actions_form'), 
'action', action);
+                  document.getElementById('list_actions_form').submit();
+               }, 0);
+       });
+
+       var History = YAHOO.util.History; 
+       var getState = function(skey, sdir, start) {
+               var state = YAHOO.portico.serializeForm('queryForm');
+               var sortedBy  = myDataTable.get("sortedBy");
+               skey = skey ? skey : sortedBy.key;
+               sdir = sdir ? sdir : sortedBy.dir; 
+               sdir = sdir == 'yui-dt-asc' ? 'asc' : 'desc';
+               start = start ? start : 0;
+               state += '&sort=' + skey;
+               state += '&dir=' + sdir;
+               state += '&startIndex=' + start;
+               return state;
+       }
+
+       var handleHistoryNavigation = function (state) {
+               var params = YAHOO.portico.parseQS(state);
+               YAHOO.portico.fillForm('queryForm', params);
+               myDataSource.sendRequest(state, {success: function(sRequest, 
oResponse, oPayload) {
+                       myDataTable.onDataReturnInitializeTable(sRequest, 
oResponse, pag);
+               }});
+       };
+       
+       var initialRequest = History.getBookmarkedState("state") || getState();
+       History.register("state", initialRequest, handleHistoryNavigation);
+       History.onReady(function() {
+               var state = YAHOO.util.History.getCurrentState('state');
+               handleHistoryNavigation(state);
+       });
+       History.initialize("yui-history-field", "yui-history-iframe");
+
+};
+
+       YAHOO.portico.GetMenuContext = function()
+       {
+               var opts = new Array();
+               var p=0;
+               for(var k =0; k < actions.length; k ++)
+               {
+                       opts[p]=[{text: actions[k].text}];
+                       p++;
+               }
+               return opts;
+   }
+
+       YAHOO.portico.onContextMenuBeforeShow = function(p_sType, p_aArgs)
+       {
+               var prefixSelected = '';
+               var oTarget = this.contextEventTarget;
+               if (this.getRoot() == this)
+               {
+                       if(oTarget.tagName != "TD")
+                       {
+                               oTarget = 
YAHOO.util.Dom.getAncestorByTagName(oTarget, "td");
+                       }
+                       oSelectedTR = 
YAHOO.util.Dom.getAncestorByTagName(oTarget, "tr");
+                       oSelectedTR.style.backgroundColor  = '#AAC1D8' ;
+                       oSelectedTR.style.color = "black";
+                       YAHOO.util.Dom.addClass(oSelectedTR, prefixSelected);
+               }
+       }
+ 
/********************************************************************************
+ *
+ */
+       YAHOO.portico.onContextMenuHide = function(p_sType, p_aArgs)
+       {
+               var prefixSelected = '';
+               if (this.getRoot() == this && oSelectedTR)
+               {
+                       oSelectedTR.style.backgroundColor  = "" ;
+                       oSelectedTR.style.color = "";
+                       YAHOO.util.Dom.removeClass(oSelectedTR, prefixSelected);
+               }
+       }
+ 
+       YAHOO.portico.onContextMenuClick = function(p_sType, p_aArgs, 
p_myDataTable)
+       {       
+               var task = p_aArgs[1];
+                       if(task)
+                       {
+                               if(actions[task.groupIndex].confirm_msg)
+                               {
+                                       confirm_msg = 
actions[task.groupIndex].confirm_msg;
+                                       if(!confirm(confirm_msg))
+                                       {
+                                               return false;
+                                       }                               
+                               }
+
+                               // Extract which TR element triggered the 
context menu
+                               var elRow = 
p_myDataTable.getTrEl(this.contextEventTarget);
+                               if(elRow)
+                               {
+                                       var oRecord = 
p_myDataTable.getRecord(elRow);
+                                       var url = 
actions[task.groupIndex].action;
+                                       var sUrl = "";
+                                       var vars2 = "";
+
+                                       
if(actions[task.groupIndex].parameters!=null)
+                                       {
+                                               for(f=0; 
f<actions[task.groupIndex].parameters.parameter.length; f++)
+                                               {
+                                                       param_name = 
actions[task.groupIndex].parameters.parameter[f].name;
+                                                       param_source = 
actions[task.groupIndex].parameters.parameter[f].source;
+                                                       vars2 = vars2 + 
"&"+param_name+"=" + oRecord.getData(param_source);
+                                               }
+                                               sUrl = url + vars2;
+                                       }
+                                       
if(actions[task.groupIndex].parameters.parameter.length > 0)
+                                       {
+                                               //nothing
+                                       }
+                                       else //for New
+                                       {
+                                               sUrl = url;
+                                       }
+                                       //Convert all HTML entities to their 
applicable characters
+                                       
sUrl=YAHOO.portico.html_entity_decode(sUrl);
+
+                                       // look for the word "DELETE" in URL
+                                       
if(YAHOO.portico.substr_count(sUrl,'delete')>0)
+                                       {
+                                               sUrl = sUrl + 
"&confirm=yes&phpgw_return_as=json";
+                                               
YAHOO.portico.delete_record(sUrl);
+                                       }
+                                       else
+                                       {
+                                               
if(YAHOO.portico.substr_count(sUrl,'target=_blank')>0)
+                                               {
+                                                       
window.open(sUrl,'_blank');
+                                               }
+                                               else 
if(YAHOO.portico.substr_count(sUrl,'target=_lightbox')>0)
+                                               {
+                                                       //have to be defined as 
a local function. Example in invoice.list_sub.js
+                                                       //console.log(sUrl); // 
firebug
+                                                       showlightbox(sUrl);
+                                               }
+                                               else
+                                               {
+
+                                                       
window.open(sUrl,'_self');
+                                               }
+                                       }
+                               }
+                       }
+       };
+
+       YAHOO.portico.html_entity_decode = function(string)
+       {
+               var histogram = {}, histogram_r = {}, code = 0;
+               var entity = chr = '';
+
+               histogram['34'] = 'quot';
+               histogram['38'] = 'amp';
+               histogram['60'] = 'lt';
+               histogram['62'] = 'gt';
+               histogram['160'] = 'nbsp';
+               histogram['161'] = 'iexcl';
+               histogram['162'] = 'cent';
+               histogram['163'] = 'pound';
+               histogram['164'] = 'curren';
+               histogram['165'] = 'yen';
+               histogram['166'] = 'brvbar';
+               histogram['167'] = 'sect';
+               histogram['168'] = 'uml';
+               histogram['169'] = 'copy';
+               histogram['170'] = 'ordf';
+               histogram['171'] = 'laquo';
+               histogram['172'] = 'not';
+               histogram['173'] = 'shy';
+               histogram['174'] = 'reg';
+               histogram['175'] = 'macr';
+               histogram['176'] = 'deg';
+               histogram['177'] = 'plusmn';
+               histogram['178'] = 'sup2';
+               histogram['179'] = 'sup3';
+               histogram['180'] = 'acute';
+               histogram['181'] = 'micro';
+               histogram['182'] = 'para';
+               histogram['183'] = 'middot';
+               histogram['184'] = 'cedil';
+               histogram['185'] = 'sup1';
+               histogram['186'] = 'ordm';
+               histogram['187'] = 'raquo';
+               histogram['188'] = 'frac14';
+               histogram['189'] = 'frac12';
+               histogram['190'] = 'frac34';
+               histogram['191'] = 'iquest';
+               histogram['192'] = 'Agrave';
+               histogram['193'] = 'Aacute';
+               histogram['194'] = 'Acirc';
+               histogram['195'] = 'Atilde';
+               histogram['196'] = 'Auml';
+               histogram['197'] = 'Aring';
+               histogram['198'] = 'AElig';
+               histogram['199'] = 'Ccedil';
+               histogram['200'] = 'Egrave';
+               histogram['201'] = 'Eacute';
+               histogram['202'] = 'Ecirc';
+               histogram['203'] = 'Euml';
+               histogram['204'] = 'Igrave';
+               histogram['205'] = 'Iacute';
+               histogram['206'] = 'Icirc';
+               histogram['207'] = 'Iuml';
+               histogram['208'] = 'ETH';
+               histogram['209'] = 'Ntilde';
+               histogram['210'] = 'Ograve';
+               histogram['211'] = 'Oacute';
+               histogram['212'] = 'Ocirc';
+               histogram['213'] = 'Otilde';
+               histogram['214'] = 'Ouml';
+               histogram['215'] = 'times';
+               histogram['216'] = 'Oslash';
+               histogram['217'] = 'Ugrave';
+               histogram['218'] = 'Uacute';
+               histogram['219'] = 'Ucirc';
+               histogram['220'] = 'Uuml';
+               histogram['221'] = 'Yacute';
+               histogram['222'] = 'THORN';
+               histogram['223'] = 'szlig';
+               histogram['224'] = 'agrave';
+               histogram['225'] = 'aacute';
+               histogram['226'] = 'acirc';
+               histogram['227'] = 'atilde';
+               histogram['228'] = 'auml';
+               histogram['229'] = 'aring';
+               histogram['230'] = 'aelig';
+               histogram['231'] = 'ccedil';
+               histogram['232'] = 'egrave';
+               histogram['233'] = 'eacute';
+               histogram['234'] = 'ecirc';
+               histogram['235'] = 'euml';
+               histogram['236'] = 'igrave';
+               histogram['237'] = 'iacute';
+               histogram['238'] = 'icirc';
+               histogram['239'] = 'iuml';
+               histogram['240'] = 'eth';
+               histogram['241'] = 'ntilde';
+               histogram['242'] = 'ograve';
+               histogram['243'] = 'oacute';
+               histogram['244'] = 'ocirc';
+               histogram['245'] = 'otilde';
+               histogram['246'] = 'ouml';
+               histogram['247'] = 'divide';
+               histogram['248'] = 'oslash';
+               histogram['249'] = 'ugrave';
+               histogram['250'] = 'uacute';
+               histogram['251'] = 'ucirc';
+               histogram['252'] = 'uuml';
+               histogram['253'] = 'yacute';
+               histogram['254'] = 'thorn';
+               histogram['255'] = 'yuml';
+
+               // Reverse table. Cause for maintainability purposes, the 
histogram is
+               // identical to the one in htmlentities.
+               for (code in histogram) {
+                       entity = histogram[code];
+                       histogram_r[entity] = code;
+               }
+
+               return (string+'').replace(/(\&([a-zA-Z]+)\;)/g, function(full, 
m1, m2){
+                       if (m2 in histogram_r) {
+                               return String.fromCharCode(histogram_r[m2]);
+                       } else {
+                               return m2;
+                       }
+               });
+       }
+
+       YAHOO.portico.substr_count = function( haystack, needle, offset, length 
)
+       {
+               var pos = 0, cnt = 0;
+
+               haystack += '';
+               needle += '';
+               if(isNaN(offset)) offset = 0;
+               if(isNaN(length)) length = 0;
+               offset--;
+
+               while( (offset = haystack.indexOf(needle, offset+1)) != -1 )
+               {
+                       if(length > 0 && (offset+needle.length) > length)
+                       {
+                               return false;
+                       } else
+                       {
+                               cnt++;
+                       }
+               }
+               return cnt;
+       }
+ 
/********************************************************************************
+ *
+ */
+       YAHOO.portico.delete_record = function(sUrl)
+       {
+               var callback =  {success: function(o){
+                                                       message_delete = 
o.responseText.toString().replace("\"","").replace("\"","");
+                                                       alert(message_delete);
+                                                       
document.getElementById('update_table_dummy').submit();//update table
+                                                       },
+                                                       failure: 
function(o){window.alert('Server or your connection is dead.')},
+                                                       timeout: 10000
+                                               };
+               var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, 
callback);
+
+       }
+
+/****************************************************************************************
+*
+*/
+
+       this.onChangeSelect = function(type)
+       {
+               var myselect=document.getElementById("sel_"+ type);
+               for (var i=0; i<myselect.options.length; i++)
+               {
+                       if (myselect.options[i].selected==true)
+                       {
+                               break;
+                       }
+               }
+               eval("path_values." +type +"='"+myselect.options[i].value+"'");
+               execute_ds();
+       }
+
+YAHOO.util.Event.addListener(window, "load", 
YAHOO.portico.initializeDataTable);

Modified: trunk/logistic/setup/phpgw_no.lang
===================================================================
--- trunk/logistic/setup/phpgw_no.lang  2012-09-25 09:13:55 UTC (rev 10032)
+++ trunk/logistic/setup/phpgw_no.lang  2012-09-25 12:48:20 UTC (rev 10033)
@@ -3,4 +3,16 @@
 project        logistic        no      Prosjekt
 activity       logistic        no      Aktivitet
 booking        logistic        no      Booking
-requirement    logistic        no      Behov
\ No newline at end of file
+requirement    logistic        no      Behov
+Project name   logistic        no      Navn
+Project type   logistic        no      Type
+Project description    logistic        no      Beskrivelse
+ID     logistic        no      ID
+t_new_project  logistic        no      Nytt prosjekt
+t_new_project_type     logistic        no      Ny prosjekttype
+Project_type   logistic        no      Prosjekttype
+settings       logistic        no      innstillinger
+Project types  logistic        no      Prosjekttyper
+Project type name      logistic        no      Navn
+Project title  logistic        no      Prosjektnavn
+Description    logistic        no      Beskrivelse
\ No newline at end of file

Added: trunk/logistic/templates/base/app_data.xsl
===================================================================
--- trunk/logistic/templates/base/app_data.xsl                          (rev 0)
+++ trunk/logistic/templates/base/app_data.xsl  2012-09-25 12:48:20 UTC (rev 
10033)
@@ -0,0 +1,3 @@
+<!-- $Id:$ -->
+       <xsl:template name="dummy">
+       </xsl:template>
\ No newline at end of file

Added: trunk/logistic/templates/base/config.tpl
===================================================================
--- trunk/logistic/templates/base/config.tpl                            (rev 0)
+++ trunk/logistic/templates/base/config.tpl    2012-09-25 12:48:20 UTC (rev 
10033)
@@ -0,0 +1,52 @@
+<!-- $Id:$ -->
+<!-- BEGIN header -->
+<form method="POST" action="{action_url}">
+       <table border="0" align="center" width="85%">
+               <tr class="th">
+                       <td colspan="2"><font 
color="{th_text}">&nbsp;<b>{title}</b></font></td>
+               </tr>
+               <!-- END header -->
+               <!-- BEGIN body -->
+               <tr class="row_on">
+                       <td colspan="2">&nbsp;</td>
+               </tr>
+               <tr class="row_off">
+                       <td colspan="2">&nbsp;<b>{lang_logistic} 
{lang_settings}</b></td>
+               </tr>
+               <tr class="row_off">
+                       <td>{lang_Use_ACL_for_control_areas}.</td>
+                       <td>
+                               <select name="newsettings[acl_at_control_area]">
+                                       <option value="2" 
{selected_acl_at_control_area_2}>NO</option>
+                                       <option value="1" 
{selected_acl_at_control_area_1}>YES</option>
+                               </select>
+                       </td>
+               </tr>
+               <tr class="row_on">
+                       <td>Antall planlagte kontroller som skal vises.</td>
+                       <td>
+                               <input type="text" 
name="newsettings[no_of_planned_controls]" 
value="{value_no_of_planned_controls}"/>
+                       </td>
+               </tr>
+               <tr class="row_off">
+                       <td>Antall tildelte kontroller som skal vises</td>
+                       <td>
+                               <input type="text" 
name="newsettings[no_of_assigned_controls]" 
value="{value_no_of_assigned_controls}"/>
+                       </td>
+               </tr>
+               <!-- END body -->
+               <!-- BEGIN footer -->
+               <tr class="th">
+                       <td colspan="2">
+                               &nbsp;
+                       </td>
+               </tr>
+               <tr>
+                       <td colspan="2" align="center">
+                               <input type="submit" name="submit" 
value="{lang_submit}">
+                               <input type="submit" name="cancel" 
value="{lang_cancel}">
+                       </td>
+               </tr>
+       </table>
+</form>
+<!-- END footer -->

Added: trunk/logistic/templates/base/css/base.css
===================================================================
--- trunk/logistic/templates/base/css/base.css                          (rev 0)
+++ trunk/logistic/templates/base/css/base.css  2012-09-25 12:48:20 UTC (rev 
10033)
@@ -0,0 +1,2237 @@
+#list_navigation { float: left; width: 30%; }
+#user_messages { float: right; width: 40%;}
+
+div.content {
+  margin: 2em; 
+}
+.hd {
+  margin-bottom: 0;
+  text-align: center;
+}
+.hd img {
+  vertical-align: middle;
+}
+fieldset {
+  margin-top: 0.5em;   
+}
+
+legend {
+  font-weight: bolder;
+  margin-bottom: 0.2em;        
+}
+
+label {
+  font-size: 13px;
+  font-weight: bold;
+  margin-right: 5px;
+  display: inline-block;
+}
+
+a{
+  cursor: pointer;     
+}
+
+.row{
+  padding: 0.3em 0;
+}
+h3 {
+  font-size: 1.2em;
+  font-weight: bold;
+  margin: 1em 0;
+}
+#content {
+  margin: 2em 1em;
+}
+.clr { clear: both;}
+
+#active {
+  background-color: #ffffff;
+  width: 10em;
+  padding: 1em;
+  border: 0em dotted #000000;
+  letter-spacing: 2px;
+}
+
+#inactivate-button {
+  border: 1px solid #000000;
+  margin-top: 1em;
+  padding: 0.1em;
+  background-color: #ffffff;
+}
+
+#activate-button {
+  border: 1px solid #000000;
+  margin-top: 1em;
+  padding: 0.1em;
+  background-color: #ffffff;
+}
+
+.breadcrumbs{
+  margin-left: 20px;   
+}
+
+ul.pathway {
+  font-weight: bolder;
+  margin: 1em 0;
+  font-size: 110%;
+}
+ul.pathway li a { color: #000; text-decoration: none;}
+ul.pathway li a:hover { color: #008; }
+ul.pathway li { 
+  display: inline;
+  background: url(../images/pathwaysep.png) no-repeat 0% 50%;
+  padding-left: 16px;
+}
+ul.pathway li:first-child { background: none; padding-left: 0;}
+
+dl.form, dl.form-col {
+  margin: 1em 1em 1em 0;
+}
+
+dl.form dt, dl.form-col dt {
+  font-style: italic;
+  font-weight: bolder;
+  margin: .5em 0 .1em 0;
+  color: #002;
+}
+dl.form dd textarea,
+dl.form-col dd textarea {
+  width: 15em;
+  height: 6em;
+}
+dl.form dd textarea.full-width,
+dl.form-col dd textarea.full-width {
+  width: 33em;
+  height: 10em;
+}
+dl.form dd input[type="text"],  dl.form dd .autocomplete,
+dl.form-col dd input[type="text"],  dl.form-col dd .autocomplete {
+  width: 15em;
+}
+dl.form dd .autocomplete,
+dl.form-col dd .autocomplete {
+  padding-bottom: 2em;
+}
+
+dl.form dt.heading, dl.form-col dt.heading {
+  color: #448;
+  font-weight: normal;
+  font-size: 110%;
+  margin-top: 1.4em;
+  margin-bottom: .6em;
+  border-bottom: 1px solid #aaa;
+}
+
+dl.proplist,
+dl.proplist-col {
+  margin: 1em 0;
+  padding-left: 2em;
+}
+
+dl.proplist-col,
+dl.form-col {
+  /*    width: 18em; */
+  float: left;
+}
+
+div.identifier-header {
+  padding-left: 2em;
+  margin-bottom: 1em;  
+}
+
+div.identifier-header label {
+  font-weight: bold;
+}
+
+.form-buttons {
+  clear: both;
+  padding-top: 1em;
+}
+
+.form-buttons input[type=submit]{
+  margin-right: 5px;
+}
+
+.form-buttons button {
+  margin-right: .5em;
+}
+
+.form-buttons .cancel {
+  margin-left: .6em;
+}
+
+.date-picker .container,
+.datetime-picker .container { 
+  display:none; 
+  position:absolute; z-index:1;
+}
+
+#datatableToolbar {
+  background-color: white;
+  margin-bottom: 0em;
+  padding: .3em;
+}
+
+table.datatableToolbar {
+  padding: .3em;
+}
+
+#controller_user_error {
+  width: 100%;
+  background-color: #eee;
+  border: 0px none #bbb;
+  margin-bottom: 0em;
+  padding-left: .3em;
+  color: red;
+  font-size: larger;
+}
+
+#controller_user_message {
+  width: 100%;
+  background-color: #eee;
+  border: 0px none #bbb;
+  margin-bottom: 0em;
+  padding-left: .3em;
+  color: green;
+  font-size: larger;
+}
+
+.toolbarelement {
+  vertical-align:middle;
+}
+td.toolbarlabel {
+  width: 10em;
+  font-weight: bold;   
+}
+td.toolbarcol {
+  padding-left: 1em;
+}
+
+div.calendarButtons {
+  vertical-align:middle;
+  background-color: grey;
+}
+
+label.toolbar_element_label {
+  padding-left: .25em;
+  padding-right: .50em;
+  vertical-align: middle;
+}
+#toolbar input[type="text"] {
+  font-size: 120%;
+  margin: auto .25em;
+}
+
+dl.proplist dd.address,
+dl.proplist-col dd.address {
+  white-space: pre;
+}
+
+.date-container {
+  margin-bottom: .8em;
+  white-space: nowrap;
+}
+
+.date-container .close-btn {
+  display: block;
+  float: right;
+  border: none;
+  text-decoration: none;
+  background:transparent 
url(../../../../phpgwapi/js/yahoo/assets/skins/sam/sprite.png) no-repeat scroll 
0 -300px;
+  width: 25px;
+  height: 15px;
+  cursor: pointer;
+  color: white;
+}
+
+div.allocation-list
+{
+  width: 30em;
+  height: 10em;
+  border: 1px solid #555;
+  padding: .4em;
+  overflow: auto;
+}
+
+.showit {
+  visibility: visible;
+}
+.hideit {
+  visibility: hidden;
+}
+.datatable{
+  margin-left: 20px;
+  margin-top: 10px;
+}
+
+/* Styles for this the column selector */
+#dt-columnselector {width:45em;margin:0 auto;}
+#dt-options {margin-left:5px;}
+#dt-dlg {visibility:hidden;border:1px solid #808080;background-color:#E3E3E3;}
+#dt-dlg .hd 
{font-weight:bold;padding:1em;background:none;background-color:#E3E3E3;border-bottom:0;}
+#dt-dlg .ft {text-align:right;padding:.5em;background-color:#E3E3E3;}
+#dt-dlg .bd {height:15em;margin:0 1em;overflow:auto;border:1px solid 
black;background-color:white;}
+#dt-dlg .dt-dlg-pickercol {clear:both;padding:.5em 1em 3em;border-bottom:1px 
solid gray;}
+#dt-dlg .dt-dlg-pickerkey {float:left;}
+#dt-dlg .dt-dlg-pickerbtns {float:right;}
+/* Container workarounds for Mac Gecko scrollbar issues */
+.yui-panel-container.hide-scrollbars #dt-dlg .bd {
+  /* Hide scrollbars by default for Gecko on OS X */
+  overflow: hidden;
+}
+.yui-panel-container.show-scrollbars #dt-dlg .bd {
+  /* Show scrollbars for Gecko on OS X when the Panel is visible  */
+  overflow: auto;
+}
+#dt-dlg_c .underlay {overflow:hidden;}
+.inprogress {position:absolute;} /* transitional progressive enhancement state 
*/
+}
+
+dl.controller-description {
+  width: 70%;
+}
+
+dl.controller-description dt, dl.controller-description-edit {
+  width: 100%;
+  float:left;
+  font-weight:bold;
+}
+
+dl.controller-description dd {
+  width: 100%;
+  border: 1px solid #ccc;
+  float: left;
+  background-color: white;
+  height: 100px;
+  overflow-y: scroll;
+}
+
+dl.controller-description-edit textarea {
+  width: 100%;
+  height: 100px;
+  border: 1px solid #ccc;
+  float: left;
+}
+
+input#place {
+  width:60%;
+}
+
+input#address_1 {
+  width: 60%;
+  float:left;
+}
+
+input#house_number {
+  width: 20%;
+  float: left;
+}
+
+input.postcode {
+  width: 50px;
+  float: left;
+}
+
+.yui-navset {
+  clear: both;
+  margin-left: 2em;
+  margin-right: 2em;
+}
+
+h1 img, li img { 
+  vertical-align: middle;
+}
+/* Set up common form styles.  TODO: needs refinement. */
+
+/* 
======================================================================================================================
+                                                        CONTROLLER MODULE CSS
+ 
========================================================================================================================
 */
+
+/* ==========================================   SELECTORS, IDS AND CLASSES    
=========================================== */
+
+input[type="radio"] {
+  margin: 0 5px 0 2px;
+  padding: 3px 6px;
+}
+
+input[type="checkbox"] {
+  margin: 5px;
+}
+
+input[type="text"] {
+  padding: 5px 5px 2px;
+}
+
+select {
+  padding: 4px;
+}
+
+fieldset {
+  border-bottom:0px solid #ccc;
+}
+
+textarea{
+  padding: 4px;        
+}
+
+h1 em {
+  font-style:italic;
+}
+
+a {
+  color: #0066CC;
+  text-decoration: none;
+}
+
+#innertoolbar-button, input[type="submit"] {
+  background: none repeat scroll 0 0 #4F9AEA;
+  border: 1px solid #4685C8;
+  border-radius: 4px;
+  color: #FFFFFF;
+  cursor: pointer;
+       filter:chroma(color=#000000);
+  padding: 5px 20px;
+}
+
+#innertoolbar-button {
+  font-size: 1em;
+  line-height: 1.2em;
+  min-height: 1.2em;
+  padding: 2px 15px;
+}
+
+a#innertoolbar-button {
+  padding: 3px 15px;
+}
+
+.row input[type="submit"] {
+  padding: 2px 10px;
+}
+
+
+.info, .error, .warning {
+  font-weight: normal;
+  margin:20px;
+  padding:5px;
+  font-size:1.1em;
+  text-align: left;
+}
+
+.message {
+  margin: 5px;
+}
+
+.info {
+  background-color:#CCFFCC;
+  border:1px solid #00FF00;
+  color:black;
+}
+
+.warning {
+  background-color: #FEEFB3;
+  border:1px solid #9F6000;
+  color:#9F6000;
+}
+.yui-calendar td.calcell {
+  border:0px !important;
+}
+
+.yui-skin-sam .yui-dt TABLE TH{
+  border: none !important;
+}
+
+.yui-skin-sam .yui-dt TABLE TD{ 
+  border: none !important;
+}
+
+.yui-skin-sam .yui-button .first-child {
+  border: 0 none;
+  margin: 0 10px 0 0;
+}
+
+.yui-skin-sam .yui-button {
+  background: none;
+  border:0;
+  margin: 0;
+}
+
+.datatable_container {
+  margin-left: 1em;
+  margin-top: 1em;
+}
+
+.paginator {
+  margin-left: 1em !important;
+}
+
+th.yui-dt-sortable div{
+  background: url(../../../../phpgwapi/js/yahoo/assets/skins/sam/sprite.png) 
repeat-x scroll 0pt -100px rgb(216, 216, 218);
+}
+
+dd ol li {
+  list-style: decimal;
+  list-style-position: inside;
+}
+
+dd ul li {
+  list-style: disc;
+  list-style-position: inside;
+}
+
+h1 img{
+       margin-right:5px;
+}
+
+.yui-content h2{
+  margin:0 0 10px;
+}
+
+/* =======================================  CONTROL ITEM  
========================================= */
+
+#control_item_details {
+  background: none repeat scroll 0 0 #EDF5FF;
+  border-color: #DBE5EF;
+  border-style: solid;
+  border-width: 1px;
+  clear: both;
+  margin-top: 1em;
+  overflow: hidden;
+  padding: 1em;
+  width: 100%;
+}
+
+#control_item_details label {
+  display: block;
+  margin-bottom: 2px;
+  margin-right: 10px;
+}
+
+#control_item_details label.line{
+  display: inline-block;
+}
+
+#control_item_details label.top {
+  display: block;
+  margin-bottom: 7px;
+}
+
+#control_item_details .styleWrp {
+  background: none repeat scroll 0 0 #F2F8FF;
+  border: 1px solid #DBE5EF;
+  border-radius: 4px;
+  padding: 10px;
+}
+
+#control_item_details dl.proplist dt{
+  font-size: 1em;
+  font-weight: normal;
+  margin-bottom: 2em;
+}
+
+#control_item_details .control_item_type {
+  margin-top: 0.5em;
+}
+
+.control_item_type .btn {
+  margin-right: 5px;   
+}
+
+#control_item_details .control_item_type .active {
+  background: none repeat scroll 0 0 #F57056;
+  border: 1px solid #CB563F;
+}
+
+#control_item_details input[type=radio] {
+  display:none;
+}
+
+#control-items .print{
+  margin-top: 20px;    
+}
+
+/* =======================================  ADD CONTROL ITEM LIST VALUES  
========================================= */
+
+#add_control_item_option_panel {
+  margin-top: 2em;
+  display: none;
+}
+
+#add_control_item_option_panel label{
+  display: inline-block;
+  width: 85px; 
+}
+
+#add_control_item_option_panel input[type=text]{
+  display: inline-block;
+  width: 150px; 
+}
+
+#add_control_item_option_panel hr{
+  border: 1px solid #CCD2D9;
+}
+
+#add_control_item_list_value .btn{
+  margin-left: 5px;
+  vertical-align: middle;
+  padding: 2px 10px;
+}
+
+#add_control_item_list_value input{
+  vertical-align: middle;
+}
+
+ul#control_item_options{
+  margin-bottom: 1em;
+}
+
+ul#control_item_options li {
+  margin-bottom: 5px;
+  margin-right: 5px;
+}
+
+ul#control_item_options li .order_nr{
+  margin-left: 5px;
+}
+
+ul#control_item_options input[type="text"] {
+  background: none repeat scroll 0 0 transparent;
+  border: medium none;
+}
+
+ul#control_item_options label {
+  margin-right: 10px;
+}
+
+ul#control_item_options .btn.delete {
+  background: none repeat scroll 0 0 #EEEEEE;
+  border: 1px solid #CCCCCC;
+  color: #333333;
+  font-weight: normal;
+  margin: 0 0 0 4px;
+  padding: 2px 10px;
+  text-align: center;
+  width: 49px;
+}
+
+#frm_control_items{
+  clear:left;
+  margin-top:10px;     
+}
+
+/* =======================================  CONTROL TAB VIEW  
========================================= */
+#control_tabview .yui-navset, #control_location_tabview .yui-navset{
+  margin:0;
+}
+
+#control_tabview .identifier-header, #control_location_tabview 
.identifier-header {
+  padding-left:0;
+}
+
+#control_tabview .yui-content{
+  padding:20px;
+}
+
+
+/* =======================================  ITEM LIST  
========================================= */
+ul.groups {
+  padding: 0;
+  margin:0;
+  position: relative;
+}
+ul.groups li.odd{
+  background: none repeat scroll 0 0 #DBE7F5;
+}
+ul.groups h3 {
+  font-size: 18px;
+  margin: 0;
+}
+ul.groups a {
+  color: #000000;
+  display: block;
+  padding: 3px 0;
+  text-decoration: none;
+}
+ul.groups a:visited{
+  color:#000;
+}
+
+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;
+}
+
+.control_items li{
+  padding: 5px;
+}
+
+#control_items form{
+  margin-bottom: 20px;
+}
+
+/* =======================================  DRAG LIST  
========================================= */
+
+.drag_group{
+  margin-bottom: 10px;
+}
+.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;
+}
+
+/* =======================================  EXPAND LIST  
========================================= */
+
+ul.expand_list h4 {
+  cursor: pointer;
+  font-size: 1.1em;
+  margin-bottom: 6px;
+  margin-top: 0;
+}
+ul.expand_list h4 img {
+  height: 12px;
+}
+
+ul.expand_list li ul {
+  display:none;
+  margin-left:21px;
+}
+
+ul.expand_list li ul li {
+  margin-bottom: 3px;
+  padding: 3px;
+}
+
+ul.expand_list h4 span {
+  padding-left: 5px;
+  vertical-align: middle;
+}
+ul.expand_list .expand_item {
+  display: none;
+}
+
+dl.proplist, dl.proplist-col {
+  margin: 0;
+  padding-left: 0;
+}
+
+#details .proplist dd, #details .proplist-col dd{
+  margin-bottom: 0.5em;
+}
+
+.frm_save_order input[type='submit']{
+  margin: 10px 0 15px 0;
+  width: 120px;
+}
+.delete {
+  cursor: pointer;
+  margin-left: 5px;
+}
+.yui-navset .yui-content.tab_content {
+  padding: 20px;
+}
+
+#datatable-container {
+  margin: 20px;
+}
+
+#paginator {
+  margin: 20px;
+}
+
+#paginator.top {
+  margin: 20px 0 0 20px;
+}
+
+#toolbar {
+  display: inline-block;
+  padding: 10px;
+  background-color: #DEEAF8;
+  border: 1px solid #CEE3F9;
+}
+
+#toolbar input[type="text"] {
+  font-size: 100%;
+  padding: 3px;
+}
+
+#toolbar input[type="submit"] {
+  padding:0 8px;
+  margin-top:0;
+}
+
+.yui-button.yui-link-button.new_button{
+  margin-left:30px;    
+}
+
+#view_check_lists {
+  padding: 30px;
+  width: 600px;
+}
+
+ul.th {
+  font-weight: bold;
+  overflow:hidden;     
+}
+
+ul.th li {
+  float: left;
+  margin-right: 20px;
+  padding: 3px 6px;
+  width: 100px;
+}
+
+ul.row{
+  overflow: hidden;    
+}
+
+ul.row li{
+  float:left;  
+  margin-right: 20px;
+  padding: 3px 6px;
+  width: 100px;
+}
+
+/* =======================================  GENERAL CLASSES  
========================================= */
+
+.box {
+  background: none repeat scroll 0 0 #EDF5FF;
+  border: 1px solid #eee;
+  margin-bottom: 20px;
+  padding: 15px;
+}
+.box.ext {
+  background: none repeat scroll 0 0 #FEFBF7;
+  border: 1px solid #FEEDEA;
+}
+
+.box_header {
+  background: none repeat scroll 0 0 #CFE6FF;
+  border-color: #C7DCF2;
+  border-style: solid;
+  border-width: 1px 1px 0;
+  color: #444444;
+  font-size: 13px;
+  font-weight: bold;
+  margin: 0;
+  padding: 6px 0 6px 15px;
+  text-align: left;
+}
+
+.box_header.ext {
+  background: none repeat scroll 0 0 #F57056;
+  border-color: #EB9685;
+  color: #FFFFFF;
+}
+
+.btn, .btn_m, .btn-sm {
+  background: none repeat scroll 0 0 #4F9AEA;
+  border: 1px solid #428AD7;
+  border-radius: 4px;
+  color: #FFFFFF;
+  cursor: pointer;
+  display: inline-block;
+  padding: 5px 10px;
+  text-decoration: none;
+}
+
+.btn_m{
+  padding: 2px 6px;
+  font-size: 12px;
+}
+
+.btn-sm {
+  font-size: 12px;
+  padding: 1px 4px;
+}
+
+.btn.cancel, .btn_m.cancel {
+  background: none repeat scroll 0 0 #EEEEEE;
+  border: 1px solid #CCCCCC;
+  color: #333333;
+}
+
+.btn.focus, .btn_m.focus {
+  background: none repeat scroll 0 0 #F57056;
+  border-color: #EE836F -moz-use-text-color #CB563F;
+  border-style: solid none;
+  border-width: 1px 0;
+  color: #FFFFFF;
+  margin-top: 1px;
+}
+
+/* =======================================  MAIN CONTENT  
========================================= */
+
+#main_content {
+  padding: 20px;
+  width: 1150px;
+}
+
+#main_content.groups{
+  cursor: default;     
+}
+
+#main_content h1{
+  margin-top:0;
+}
+
+.content-wrp {
+  background: none repeat scroll 0 0 #EDF5FF;
+  border: 1px solid #DEE1E4;
+  margin-top: 1em;
+  padding: 0;
+}
+
+.content-wrp .yui-skin-sam .yui-dt table {
+  border: 1px solid #CCCCCC;
+}
+
+/* =======================================  CHECK LIST DETAILS 
========================================= */
+
+input.id {
+  background: none repeat scroll 0 0 #FFFFFF;
+  border: 1px solid #DDDDDD;
+  text-align: right;
+  width: 50px;
+}
+
+input.date {
+  text-align: right;
+  width: 65px;
+}
+
+/* =======================================  CHECK LIST  
========================================= */
+#check-list-heading .box-1 {
+  float:left; 
+  width:71%;
+}
+
+#check-list-heading .box-2 {
+  float:right; 
+  width:25%;
+}
+
+#check-list-heading .box-2 a{
+  font-weight: normal;
+  padding: 0 0 5px;
+  text-align: center;
+}
+
+.check_list li div {
+  float: left;
+  margin: 5px;
+  padding: 2px;
+  text-align: center;
+  width: 190px;
+}
+
+.check_list li.heading {
+  background: url("../../../../phpgwapi/js/yahoo/assets/skins/sam/sprite.png") 
repeat-x scroll 0 0 #D8D8D8;
+  height: 20px;
+  padding-left: 25px;
+}
+
+.check_list li.heading div {
+  margin: 0 5px;
+  padding: 2px;
+}
+
+.check_list li div.order_nr{
+  width:15px;
+}
+
+.check_list li div.status {
+  padding-left: 10px;
+  width: 50px;
+}
+
+.check_list li div.title{
+  width: 600px;
+  text-align:left;
+}
+
+.check_list li.heading div.title{
+  text-align:center;
+}
+
+.check_list li{
+  overflow:hidden;
+}
+
+/* =======================================  CHECK LIST DETAILS 
========================================= */
+
+#check_list_details form{
+  background: none repeat scroll 0 0 #EDF5FF;
+  border: 1px solid #DBE5EF;
+  padding: 15px;
+  clear: both;
+  margin:0;
+}
+
+#check_list_details form .row {
+  padding: 0.1em 0;
+}
+
+#check_list_details label{
+  font-weight:bold;
+  width:150px;
+  display: inline-block;
+}
+
+#check_list_details .comment {
+  clear: both;
+  float: left;
+  margin-top: 20px;
+}
+
+#check_list_details .comment label {
+  vertical-align: top;
+}
+
+#check_list_details textarea{
+  width:400px;
+  height:100px;
+}
+
+#check_list_details .col_1, #check_list_details .col_2 {
+  float: left;
+  vertical-align: top;
+}
+
+#check_list_details .col_1 {
+  width: 50%;
+}
+
+/* =======================================  TAB CHECK LIST DETAILS 
========================================= */
+.tab_check_list_details label {
+  display: inline-block;
+  font-weight: bold;
+  width: 100px;
+}
+
+fieldset.tab_check_list_details {
+  padding: 0 0 10px 0;
+}
+
+/* =======================================  CHECK ITEM DETAILS 
========================================= */
+
+fieldset.check_item_details label{
+  font-weight:normal;
+  vertical-align:top;
+  float:left;
+}
+
+fieldset.check_item_details h3 {
+  font-size: 15px;
+  font-weight: bold;
+  margin: 10px 0;
+}
+
+h3.check_item_details{
+  margin-bottom:0;     
+}
+
+/* =======================================  CHECK ITEM  
========================================= */
+
+.check_item div{
+  margin: 5px 0;
+  clear:left;
+}
+
+.check_item textarea {
+  display: block;
+  height: 100px;
+  margin-top: 6px;
+  width: 63%;
+}
+
+.check_item label{
+  width:150px; 
+}
+
+.new_item a#innertoolbar-button {
+  background: none repeat scroll 0 0 #FCF0DD;
+  border: 1px solid #CDBFAC;
+  color: #333333;
+}
+
+#frm_save_check_items input[type="submit"]{
+  padding: 3px 30px;   
+}
+
+.form-buttons-top{
+  float: right;
+  margin-bottom:5px;
+}
+
+.form-buttons-top input[type="submit"]{
+  margin:0;
+}
+
+#frm_save_check_items h1 {
+  float: left;
+  margin: 5px;
+}
+
+ul.check_list {
+  width: 925px;        
+}
+
+/* ====================================  CALENDAR  
========================================= */
+#control_plan .top h3 {
+  clear: left;
+  float: left;
+  font-size: 19px;
+  margin-bottom: 1em;
+  margin-top: 0;
+  padding: 0;
+}
+
+#control_plan .top h3 .month {
+  margin-right: 5px;
+}
+
+#control_plan .middle {
+  background: none repeat scroll 0 0 #EDF5FF;
+  border-color: #DBE5EF;
+  border-radius: 4px 4px 0 0;
+  border-style: solid solid none;
+  border-width: 1px 1px 0;
+  clear: both;
+  margin-top: 1em;
+  overflow: hidden;
+  padding: 1em 1em 0;
+}
+
+#control_plan h2 {
+  background: none repeat scroll 0 0 #FFFFFF;
+  color: #000000;
+  float: left;
+  font-size: 23px;
+  padding: 0.2em 0.5em;
+}
+
+#control_plan h2.components {
+  margin-top: 40px;
+}
+
+#control_plan h3 {
+  padding-left: 1em;
+}
+
+#cal-filters {
+  clear: left;
+  float: left;
+  margin-top: 1em;
+}
+
+#cal_wrp h3 {
+  clear: both;
+  font-size: 1.4em;
+  margin-bottom: 5px;
+}
+
+/* =============================  SEARCH LOCATION BOX  ======================= 
*/
+#search-location {
+  float: right;
+  margin-bottom: 10px;
+}
+
+#search-location-name {
+  margin: 2px 0 0;
+  width: 16em;
+}
+
+#choose-my-location {
+  float: right;
+  margin-right: 10px;
+}
+
+#choose-building {
+  float: left;
+}
+
+#filters {
+  clear: left;
+  float: left;
+}
+
+#cal-filters.select-box {
+  background: none repeat scroll 0 0 #DEEAF8;
+  border: 1px solid #BDD3ED;
+}
+
+#cal-filters .filter {
+  float: left;
+}
+
+#cal-filters .filter.first {
+  margin-right: 1em;
+}
+
+.month_view #choose-building {
+  clear:left;
+  margin-top: 1em;
+}
+
+.select-box { 
+  background: none repeat scroll 0 0 #FEFBF4;
+  border: 1px solid #DDDDDD;
+  border-radius: 4px;
+  padding: 1em;        
+}
+
+.select-box label{
+  margin-bottom:5px;
+  display: block;      
+}
+
+.select-box a{
+  display: block;
+  font-weight: bold;
+  padding: 0 0 10px;
+  text-align: justify; 
+}
+
+.select-box a.last{
+  padding: 0;
+}
+
+#choose-loc .btn {
+  display: inline-block;
+  font-size: 0.9em;
+  padding: 2px 8px;
+}
+
+#choose-loc .btn.first {
+  margin-right: 0.3em;
+}
+
+#choose-loc .btn.active{
+  background: #3F7EC1; 
+}
+#choose-loc label {
+  display: inline-block;
+}
+
+/* ==================  COLOR MAP ============================= */
+
+ul#icon_color_map {
+  background: none repeat scroll 0 0 #FFFFFF;
+  border: 1px solid #DDDDDD;
+  border-radius: 4px 4px 4px 4px;
+  float: right;
+  padding: 1em;
+}
+
+ul#icon_color_map li {
+  font-size: 12px;
+  padding: 3px 0;
+}
+
+ul#icon_color_map span{
+  margin-left: 10px;
+}
+
+#calendar {
+  clear: both;
+  table-layout: fixed;
+  width: 100%;
+}
+
+#calendar th {
+  font-weight: bold;
+  font-size:15px;
+  background:none;
+}
+
+#calendar th, #calendar td {
+  padding: 10px;
+  text-align: center;
+}
+
+#calendar.month th, #calendar.month td {
+  line-height: 1.5em;
+  padding: 5px;
+}
+
+#calendar .even {
+  background: none repeat scroll 0 0 #DEEAF8;
+}
+
+#calendar h3 {
+  padding-left: 1em;
+  text-align: left;
+}
+
+#cal_wrp {
+  background: none repeat scroll 0 0 #EDF5FF;
+  border-color: #DBE5EF;
+  border-radius: 0 0 4px 4px;
+  border-style: solid;
+  border-width: 0 1px 1px;
+  clear: both;
+  padding: 0 1em 1em;
+}
+
+.control_details_wrp div {
+  float: left;
+  height: 30px;
+  padding: 0 10px;
+  width: 100px;
+}
+
+#calendar .title, #calendar .assigned {
+  width: 150px;
+}
+
+#calendar .location-name, #calendar .component-type {
+  width: 150px;
+  text-align: left;
+}
+
+#calendar .frequency {
+  margin-right: 10px;
+  width: 100px;
+}
+
+#calendar .frequency, #calendar .title, #calendar .assigned, #calendar 
.location-name {
+  text-align: left;
+}
+
+#calendar .frequency .pre {
+  margin-right: 3px;
+}
+
+#calendar .frequency .val {
+  text-transform: lowercase;
+}
+
+.cal_info_msg {
+  font-size: 16px;
+  padding: 40px 20px;  
+}
+
+#calendar .cal_info_msg td{
+  text-align: left;
+
+}
+
+#showYear{
+  display:block;
+  font-weight: bold;
+  font-size: 14px;
+  float:left;
+}
+
+#showYear img {
+  margin-right: 5px;
+  vertical-align: bottom;
+}
+
+#calNav {
+  clear: both;
+  font-size: 14px;
+  font-weight: bold;
+  padding-top: 1em;
+}
+
+#calNav img{
+  vertical-align:bottom;
+}
+
+#calNav a.showNext{
+  display: block;
+  float: right;
+  padding-top: 5px;
+}
+
+#calNav a.showNext img{
+  margin-left:5px;
+}
+
+#calNav a.showPrev {
+  display: block;
+  float: left;
+  padding-left: 3px;
+  padding-top: 5px;
+  vertical-align: sub;
+}
+
+#calNav a.showPrev img{
+  margin-right:5px;
+}
+
+#calNav .current {
+  display: block;
+  float: left;
+  font-size: 21px;
+  padding-left: 500px;
+}
+/* ===============================  CALENDAR INFO BOX 
========================== */
+
+a.view_info_box {
+  color: #FFFFFF;
+  display: block;
+  font-size: 10px;
+  font-weight: bold;
+  height: 15px;
+  padding-top: 1px;
+  text-align: center;
+  text-decoration: none;
+}
+
+.ext_info{
+  display:none;
+}
+
+.info_box_wrp {
+  background: url("../../../images/status_icon_red_empty.png") no-repeat 
scroll 50% 50% transparent;
+  height: 15px;
+  position: relative;
+  text-align: center;
+  width: 15px;
+}
+
+.year .info_box_wrp {
+  width: 100%;
+}
+
+.days_wrp a.view_info_box {
+  left: 8px;
+}
+
+#info_box {
+  background: none repeat scroll 0 0 #EDF5FF;
+  border: 1px solid #98B4D6;
+  display: none;
+  float: none;
+  font-size: 12px;
+  left: 40px;
+  overflow: hidden;
+  padding: 10px;
+  position: absolute;
+  text-align: left;
+  top: 3px;
+  width: 400px;
+  z-index: 1;
+}
+
+#info_box h3 {
+       background: none repeat scroll 0 0 #D1E3F8;
+  margin: 0 0 10px;
+  padding: 5px 0;
+  text-align: center;
+}
+
+#info_box h5 {
+  font-size: 13px;
+  font-weight: bold;
+  margin: 0 0 4px;
+  text-align: left;
+}
+
+#info_box .check_item {
+       width: 100%     
+}
+
+#info_box .check_item label{
+       display:inline;
+       margin-left:20px;       
+}
+
+#info_box .case {
+       text-align:left;        
+}
+
+.empty_list{
+  font-size: 16px;
+  font-weight: bold;
+  padding: 0 0 5px;
+}
+
+.yui-pg-first{
+  margin-left: 14px;
+  margin-top: 5px;     
+}
+
+#data_paginator, #loc_paginator{
+  margin:8px;  
+  clear:left;
+}
+
+ul#filters li, ul#search_list li{
+  float:left;  
+}
+
+ul#filters input[type="text"], ul#filters select {
+  margin-right: 5px;
+  padding: 3px;
+}
+
+#choose_control select {
+  float: left;
+  margin-right: 5px;
+}
+
+#choose_control form {
+  float: left;
+}
+
+ul#search_list input[type="submit"] {
+  margin: 0;
+  padding: 2px 15px;
+}
+
+ul#search_list input[type="text"] {
+  margin: 0 5px 0 0;
+  padding: 3px;
+}
+
+#queryForm {
+  clear: both;
+  margin: 20px;
+  overflow: hidden;
+}
+
+fieldset.add_check_list div{
+  padding:2px; 
+}
+fieldset.add_check_list label{
+  display:inline-table;
+  width:120px;
+}
+
+/* ==================================  EXPAND MENU  
======================================== */
+
+.expand_menu div.focus{
+  background: url('../../../images/bg_expand_active.png') no-repeat;
+  color: #FFF;
+}
+.expand_menu {
+  margin: 15px 0 20px;
+  overflow: hidden;
+}
+.expand_menu div {
+  background: url("../../../images/bg_expand_not_active.png") no-repeat scroll 
0 0 transparent;
+  color: #000000;
+  cursor: pointer;
+  float: left;
+  font-size: 12px;
+  font-weight: normal;
+  height: 22px;
+  margin-right: 10px;
+  padding-top: 4px;
+  text-align: center;
+  width: 66px;
+}
+
+label.comment{
+  vertical-align:top;  
+}
+.check_item label{
+  width: 150px;
+  display: inline-block;       
+}
+
+.check_items h4 img{
+  padding-bottom:2px;  
+}
+.check_items.expand_list h4{
+  font-size: 15px;     
+}
+
+.not_active{
+  opacity:0.5;
+}
+ul.check_items li.hidden{
+  display: none;       
+}
+
+.frm_save_check_item input[type='submit']{
+  width: 165px;
+}
+ul.check_items h5{
+  margin:10px;
+  font-size: 13px;
+}
+
+/* ======================== TAB MENU ========================== */
+
+.tab_menu a {
+  background: none repeat scroll 0 0 #F9F5F0;
+  border: 1px solid #F0F0F0;
+  color: #444444;
+  display: inline-block;
+  font-weight: bold;
+  margin-right: 3px;
+  padding: 6px 0;
+  text-align: center;
+  text-decoration: none;
+  width: 150px;
+}
+.tab_menu a.active {
+  background: none repeat scroll 0 0 #CAE3FB;
+  border: 1px solid #CAE3FB;
+  font-weight: bold;
+}
+.tab_menu a, .tab_menu a.active{
+  border-bottom: 0;    
+}
+
+#tab_content {
+  background: none repeat scroll 0 0 #EDF5FF;
+  border: 1px solid #DBE5EF;
+  padding: 0 20px 20px;
+}
+
+/* ======================== CHECK LIST MENU ========================== */
+#check_list_menu {
+  clear: both;
+  margin: 0 0 20px;
+  overflow: hidden;
+}
+
+#check_list_menu a {
+  background: none repeat scroll 0 0 #F4EDE3;
+  border: 1px solid #EDE4D8;
+  color: #444444;
+  cursor: pointer;
+  display: inline-block;
+  font-weight: bold;
+  margin-right: 3px;
+  padding: 18px 0;
+  text-align: center;
+  text-decoration: none;
+  width: 185px;
+}
+
+#check_list_menu a.active {
+       background: none repeat scroll 0 0 #CAE3FB;
+  border: 1px solid #CAE3FB;
+}
+
+#check_list_menu .left_btns {
+  float: left;
+}
+
+#check_list_menu .right_btns {
+  float: right;
+}
+
+#check_list_menu .right_btns a {
+  background: none repeat scroll 0 0 #F57056;
+  border-color: #EE836F -moz-use-text-color #CB563F;
+  border-radius: 4px;
+  border-style: solid none;
+  border-width: 1px 0;
+  color: #FFFFFF;
+  display: block;
+  padding: 4px 0;
+}
+
+/* ===================================  TAB ITEM  
================================= */
+
+.tab_item {
+  background: none repeat scroll 0 0 #F7FAFF;
+  border: 1px solid #DAE2EE;
+  padding: 15px;
+}
+.tab_item.ext {
+  background: none repeat scroll 0 0 #FEFBF7;
+  border: 1px solid #FEEDEA;
+}
+.tab_item h2 {
+  background: none repeat scroll 0 0 #DAE3EB;
+  font-size: 14px;
+  margin: 0 0 10px;
+  padding: 3px 6px;
+}
+.tab_item h2.last{
+  margin:20px 0 10px;  
+}
+
+#main_content fieldset.location_details{
+  background: none repeat scroll 0 0 #EDF5FF;
+  border: 1px solid #CCCCCC;
+  padding: 15px;
+  float:left;  
+  border: 1px solid #ddd;
+}
+fieldset.location_details div{
+  margin:10px 0;
+}
+
+#curtain {
+  background: none repeat scroll 0 0 #000000;
+  display: none;
+  height: 100%;
+  left: 0;
+  opacity: 0.6;
+  position: fixed;
+  top: 0;
+  width: 100%;
+  z-index: 1;
+}
+
+#popupBox {
+  background: none repeat scroll 0 0 #FFFFFF;
+  display: none;
+  left: 50%;
+  position: absolute;
+  top: 30%;
+  width: 500px;
+  margin-left: -250px;
+  z-index: 2;
+}
+
+/* ==================================  CHECK LIST  
================================== */
+
+#main_content.medium {
+  overflow: hidden;
+  width: 900px;
+}
+
+/* ====================================  CASE DETAILS  
============================== */
+#error_message_menu {
+  float: left;
+  margin-top: 50px;
+}
+#error_message_menu a {
+  text-align: center;
+  width: 140px;
+  margin: 2px 0;  
+  display:block;
+}
+#register_errors_content {
+  float: right;
+  margin-top: 20px;   
+}
+
+/* ===================================== VIEW CASES 
================================ */
+
+li.check_item_case h4 {
+  margin: 5px 0;
+}
+li.check_item_case ul{
+  margin-bottom: 20px;
+}
+li.check_item_case ul li {
+  background: none repeat scroll 0 0 #E7EFF8;
+  border: 1px solid #DDDDDD;
+  clear: both;
+  margin: 10px 0 0 20px;
+  overflow: hidden;
+}
+li.check_item_case ul li .col_1 {
+  float: left;
+  padding: 2em 2%;
+  vertical-align: top;
+}
+li.check_item_case ul li .col_2 {
+  border-left: 1px solid #DDDDDD;
+  border-right: 1px solid #DDDDDD;
+  float: left;
+  padding: 1em 2%;
+  width: 73%;
+}
+li.check_item_case ul li .col_3 {
+  float: left;
+  padding: 3%;
+  vertical-align: top;
+}
+
+li.check_item_case ul li.quick_edit_case {
+  padding: 0;
+}
+li.check_item_case .quick_edit_case h4 {
+  color: #000000;
+  margin: 0;
+  padding: 2px 10px;
+}
+
+li.check_item_case .col_1 {
+  display: inline-block;
+  padding: 2em 2%;
+  vertical-align: top;
+}
+li.check_item_case .col_2 {
+  border-left: 1px solid #DDDDDD;
+  border-right: 1px solid #DDDDDD;
+  display: inline-block;
+  padding: 1em 2%;
+  width: 73%;
+}
+li.check_item_case .col_3 {
+  display: inline-block;
+  padding: 3%;
+  vertical-align: top;
+}
+#main_content .quick_edit_case fieldset {
+  padding: 5px;
+}
+
+/* ================================  FORM UPDATE CASE  
============================= */
+.frm_update_case{
+  display: none;
+}
+.frm_update_case label {
+  display: block;      
+}
+.frm_update_case textarea {
+  display: block;
+  width: 98%;
+}
+.frm_update_case input[type="submit"], .frm_update_case input[type="button"] {
+  float: left;
+  margin-top: 10px;
+  padding: 3px 6px;
+}
+.frm_update_case input[type="text"]{
+       width: 170px;  
+}
+.frm_update_case select {
+  width: 184px;
+}
+.frm_update_case label {
+       width: 70px;
+       display:inline-block;
+       font-weight:bold;
+       margin-right: 5px;   
+}
+
+/* ===============================  FORM REGISTER CASE  
============================= */
+
+.frm_register_case {
+  margin-bottom: 1em;
+}
+.frm_register_case input[type="text"]{
+       width: 170px;  
+}
+.frm_register_case select {
+  width: 184px;
+}
+.frm_register_case textarea {
+  display: block;
+  height: 100px;
+  margin-top: 6px;
+  margin-bottom: 1em;
+  width: 63%;
+}
+.frm_register_case label {
+  display: inline-block;
+  width: 18%;
+}
+
+
+/* ================================ CASE MESSAGE ============================= 
*/
+
+#caseMessage a#showMessage {
+  float: right;
+  font-size: 17px;
+  font-weight: bold;
+  text-decoration: none;
+}
+#caseMessage label {
+  width: 13%;
+}
+#caseMessage h3 {
+  font-size: 1.2em;
+  margin: 1.5em 0 0.5em;
+}
+#caseMessage ul.cases {
+  background: none repeat scroll 0 0 #FEFCF9;
+  border: 1px solid #EBE5DD;
+  padding: 0.5em 1%;
+}
+#caseMessage ul.cases h4{
+  margin-top:0
+}
+#caseMessage ul li ul li{
+  padding: 0 0 1em 1em;
+}
+#caseMessage a.btn{
+  margin-top:20px;
+}
+
+/* ==============================  CASE QUICK MENU  
============================= */
+
+.quick_menu {
+  font-size: 12px;
+  padding: 10px 0 0;
+}
+.quick_menu a {
+  margin-right: 5px;
+  text-decoration: underline;
+}
+ul#groups {
+  margin-left: 10px;
+  margin-top: 5px;
+}
+ul#groups h4{
+  margin: 4px 0;
+}
+
+input.focus, select.focus{
+  border: 2px solid #dae6f4;
+}
+
+div.controller_checklist {
+  padding: 20px;
+  border: 1px solid #ABABAB;
+}
+
+/* =====================  CONTROL LOCATION  ===================== */
+
+#choose_control {
+  float: left;
+  margin: 20px;
+  width: 500px;
+}      
+#choose_control h4 {
+  display: block;
+  font-size: 17px;
+  margin: 5px 0;
+}
+
+#choose_control select {
+  width: 245px;
+}
+
+#choose-location {
+  clear: both;
+  margin: 20px;
+}
+
+#queryForm #choose-location {
+  margin: 0;
+}
+
+#choose-location h4{
+  display: block;
+  font-size: 17px;
+  margin: 5px 0;
+}
+
+#comp-filters label {
+  font-size: 1em;
+  font-weight: bold;
+}
+
+#comp-filters .select-box {
+  background: none repeat scroll 0 0 #DEEAF8;
+  border: 1px solid #BDD3ED;
+  float: left;
+  height: 40px;
+  margin-right: 5px;
+}
+
+#comp-filters .filter {
+  float: left;
+}
+
+#choose-location #datatable-container{
+  margin: 20px 0;
+}
+
+#control_area_list {
+  float:left;  
+}
+
+#data_paginator .error_msg{
+  margin-left:20px;
+}
+
+#locations-container{
+  margin:20px;
+}
+
+#select_all {
+  float: right;
+  margin-right: 805px; 
+}
+
+#save_location {
+  margin-left:20px;
+  margin-bottom:20px;
+}
+
+/* ==========================  CONTROL DETAILS   ============================ 
*/
+
+#control_details label {
+  display: inline-block;
+  font-weight: bold;
+  width: 100px;
+}
+
+#control_details input, #control_details select {
+  display: inline-block;
+}
+
+#control_details .input_error_msg {
+  display: block;
+  text-align: center;
+  width: 692px;
+}
+
+#control_details .date {
+  margin-right:0;
+}
+
+#control_details #select_all{
+  margin-left: 660px;  
+}
+
+#control_details #location_form{
+  margin-left: 20px;
+  margin-bottom: 20px; 
+}
+
+#control_details .proplist-col dd{
+  margin-bottom: 1em;  
+}
+
+#repeat_interval {
+  width: 28px;
+}
+
+/* =============================  CONTROL GROUP AND ITEMS  
======================= */
+#control_group_tabview .yui-content{
+  padding: 10px;       
+}
+
+#frm_save_control_groups .itemlist {
+  margin-bottom: 1em;
+}
+
+#frm_save_control_groups .itemlist li{
+  margin-bottom: 0.5em;
+}
+
+ul.control_groups li ul {
+  margin-left: 1em;
+}
+
+ul.control_groups h3 {
+  margin-bottom: 0.5em;
+}
+
+/* =============================   PROCEDURES   ======================= */
+
+#view-procedures .btn-sm {
+  height: auto;
+  margin-left: 11px;
+  vertical-align: middle;
+}
+#view-procedures .box {
+  background: none repeat scroll 0 0 #E7EFF8;
+  border: 1px solid #DDDDDD;
+  margin-bottom: 20px;
+  padding: 0 20px;
+}
+
+/* =============================  IMAGE LOADER  ======================= */
+
+img#loading {
+  margin-left: 5px;
+  vertical-align: middle;
+}
+
+#exec-print {
+  margin:20px 0 0 40px;
+}
+
+#yui-history-iframe { 
+  position:absolute;
+  top:0; 
+  left:0;
+  width:1px; 
+  height:1px;
+  visibility:hidden;
+}
+
+#control_group_id {
+  width: 250px;
+}
+
+#select-wrp {
+  margin: 10px;
+  padding: 10px;
+  width: 25%;
+}
+
+#control_location #queryForm{
+  margin: 20px; 
+  width: 65%;
+}
+
+table.yui-skin-sam {
+  border: 0;
+  padding: 0;
+  margin: 0;
+}
+
+#details table{
+  padding: 10px;
+  margin: 10px;
+  text-align: left;
+  margin-left: 1em;    
+}
+
+#details table td{
+  text-align: left;
+  padding-right: 10px; 
+}
+
+#procedures h2, #procedures h4{
+  margin:5px 0;
+}
+
+#procedures .desc {
+  margin-left:10px;
+}
+
+#procedures h3 {
+  margin:15px 0 3px 0;
+}
+
+#procedures h4 .doc{
+  margin-left:10px;
+}
+
+#procedures #groups .group{
+  margin-left:10px;
+}
+
+#procedures #groups .group{
+  margin-left:10px;
+}
+
+#procedures #groups .group{
+  margin-bottom:10px;
+}
+
+#procedures .btn_sm {
+  margin-left:5px;
+}
+
+.yui-skin-sam td.auto{
+  width: 160px;        
+}
+
+.yui-skin-sam div.auto{
+  width: 140px;        
+}
+
+.yui-skin-sam thead{
+  background: none;    
+}
+
+p.no_items_msg {
+  padding: 5px;        
+}
+
+.no-comp-msg {
+  font-size: 16px;
+  padding-left: 12px;
+}
+
+.option-list-heading {
+  margin: 0 0 10px;
+}
+
+.option-list{
+  margin-top: 5px;     
+}
+
+.option-list{
+  padding-left:10px;   
+}
+
+.option-list li{
+  margin-bottom: 5px;  
+}
+
+.input_error_msg {
+  background: none repeat scroll 0 0 #FBE3E4;
+  border-bottom-right-radius: 4px;
+  color: #D12F19;
+  display: inline-block;
+  margin-bottom: 5px;
+  margin-top: 5px;
+  padding: 5px;
+  text-align: center;
+  width: 90%;
+}
+
+.error_msg {
+  color: red;
+  display: none;
+  font-size: 14px;
+  padding: 7px 0;
+}
+
+.help_text {
+  background: none repeat scroll 0 0 #CCDBED;
+  color: #414851;
+  display: none;
+  padding: 6px 10px 5px;
+  text-align: center;
+  vertical-align: baseline;
+}
+
+.help_text.line {
+  margin-left: 5px;
+}
+
+.help_text.below {
+  margin-left: 0;
+  width: 505px;
+}
+
+#show-control-details-box {
+  border-color: #DBE5EF;
+  overflow: hidden;
+  text-align: left;
+  border: 1px solid #DBE5EF;
+}
+
+#show-control-details-box h3 {
+  background: none repeat scroll 0 0 #EDF5FF;
+  margin: 0;
+  padding: 5px 10px;
+  text-align: center;
+}
+
+#show-control-details-box .elem-wrp {
+  padding: 10px;
+}
+
+#show-control-details-box .elem-wrp li{
+  padding: 3px 0;
+}
+
+#show-control-details-box .label {
+  font-weight: bold;
+  margin-right: 5px;
+}
+
+#show-control-details-box .pre {
+  margin-right: 3px;
+}
\ No newline at end of file

Added: trunk/logistic/templates/base/datatable.xsl
===================================================================
--- trunk/logistic/templates/base/datatable.xsl                         (rev 0)
+++ trunk/logistic/templates/base/datatable.xsl 2012-09-25 12:48:20 UTC (rev 
10033)
@@ -0,0 +1,260 @@
+<!-- $Id: $ -->
+<func:function name="phpgw:conditional">
+       <xsl:param name="test"/>
+       <xsl:param name="true"/>
+       <xsl:param name="false"/>
+
+       <func:result>
+               <xsl:choose>
+                       <xsl:when test="$test">
+                               <xsl:value-of select="$true"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                               <xsl:value-of select="$false"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </func:result>
+</func:function>
+
+<xsl:template name="datatable">
+       <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html"></iframe>
+       <input id="yui-history-field" type="hidden"/>
+       <xsl:call-template name="yui_phpgw_i18n"/>
+       <xsl:apply-templates select="form" />
+       <xsl:apply-templates select="paging"/>
+       <div id="list_flash">
+               <xsl:call-template name="msgbox"/>
+       </div>
+       <xsl:apply-templates select="datatable"/> 
+       <xsl:apply-templates select="form/list_actions"/>
+</xsl:template>
+
+<xsl:template match="toolbar">
+       <div id="toolbar">
+                 <table class='yui-skin-sam'>
+                       <tr>
+               <xsl:for-each select="item">
+                       <xsl:variable name="filter_key" 
select="concat('filter_', name)"/>
+                       <xsl:variable name="filter_key_name" 
select="concat(concat('filter_', name), '_name')"/>
+                       <xsl:variable name="filter_key_id" 
select="concat(concat('filter_', name), '_id')"/>
+               
+                       <xsl:choose>
+                               <xsl:when test="type = 'date-picker'">
+                                       <td valign="top">
+                                       <div class="date-picker">
+                                       <input id="filter_{name}" 
name="filter_{name}" type="text">
+                                                       <xsl:attribute 
name="value"><xsl:value-of select="../../../filters/*[local-name() = 
$filter_key]"/></xsl:attribute>
+                                               </input>
+                               </div>
+                                       </td>
+                               </xsl:when>
+                               <xsl:when test="type = 'autocomplete'">
+                                       <td class="auto">
+                                               <div class="auto">
+                                                       <input 
id="filter_{name}_name" name="filter_{name}_name" type="text">
+                                                               <xsl:attribute 
name="value"><xsl:value-of select="../../../filters/*[local-name() = 
$filter_key_name]"/></xsl:attribute>
+                                                       </input>
+                                                       <input 
id="filter_{name}_id" name="filter_{name}_id" type="hidden">
+                                                               <xsl:attribute 
name="value"><xsl:value-of select="../../../filters/*[local-name() = 
$filter_key_id]"/></xsl:attribute>
+                                                       </input>
+                                                       <div 
id="filter_{name}_container"/>
+                                               </div>
+                                               <script type="text/javascript"> 
+                                               
YAHOO.util.Event.onDOMReady(function() {
+                                                  var name = "<xsl:value-of 
select="name"/>";
+                                                       var ui = "<xsl:value-of 
select="ui"/>";
+
+                                                       var itemSelectCallback 
= false;
+                                                       <xsl:if 
test="onItemSelect">
+                                                               
itemSelectCallback = <xsl:value-of select="onItemSelect"/>;
+                                                       </xsl:if>
+
+                                                       var 
onClearSelectionCallback = false;
+                                                       <xsl:if 
test="onClearSelection">
+                                                               
onClearSelectionCallback = <xsl:value-of select="onClearSelection"/>;
+                                                       </xsl:if>
+
+                                                       var requestGenerator = 
false;
+                                                       <xsl:if 
test="requestGenerator">
+                                                               
requestGenerator = <xsl:value-of select="requestGenerator"/>;
+                                                       </xsl:if>
+
+                                                       <![CDATA[
+                                                       var oAC = 
YAHOO.portico.autocompleteHelper('index.php?menuaction=booking.ui'+ui+'.index&phpgw_return_as=json&',
 
+                                                                               
                                         'filter_'+name+'_name', 
'filter_'+name+'_id', 'filter_'+name+'_container');
+
+                                                       if (requestGenerator) {
+                                                               
oAC.generateRequest = requestGenerator;
+                                                       }
+
+                                                       if (itemSelectCallback) 
{
+                                                               
oAC.itemSelectEvent.subscribe(itemSelectCallback);
+                                                       }
+
+                                                       
YAHOO.util.Event.addBlurListener('filter_'+name+'_name', function()
+                                                       {
+                                                               if 
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "")
+                                                               {
+                                                                       
YAHOO.util.Dom.get('filter_'+name+'_id').value = "";
+                                                                       if 
(onClearSelectionCallback) {
+                                                                               
onClearSelectionCallback();
+                                                                       }
+                                                               }
+                                                       });
+
+                                                       
YAHOO.portico.addPreSerializeQueryFormListener(function(form)
+                                                       {
+                                                               if 
(YAHOO.util.Dom.get('filter_'+name+'_name').value == "")
+                                                               {
+                                                                       
YAHOO.util.Dom.get('filter_'+name+'_id').value = "";
+                                                               } 
+                                                       });
+                                                       ]]>
+                                               });
+                                               </script>
+                                       </td>
+                               </xsl:when>
+                               <xsl:when test="type = 'filter'">
+                                       <td valign="top">
+                                       <xsl:variable name="name"><xsl:value-of 
select="name"/></xsl:variable>
+                                       
+                                       <select id="{$name}" name="{$name}" 
onMouseout="window.status='';return true;">
+                                               <xsl:for-each select="list">
+                                                       <xsl:variable 
name="id"><xsl:value-of select="id"/></xsl:variable>
+                                                       <xsl:if test="id = 
'NEW'">
+                                                               <option 
value="{$id}" selected="selected">
+                                                                       
<xsl:value-of select="name"/>
+                                                               </option>
+                                                       </xsl:if>
+                                                       <xsl:if test="id != 
'NEW'">
+                                                               <option 
value="{$id}">
+                                                                       
<xsl:value-of select="name"/>
+                                                               </option>
+                                                       </xsl:if>
+                                               </xsl:for-each>
+                                       </select>
+                                       </td>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <td valign="top">
+                                       <input id="innertoolbar">
+                                               <xsl:attribute 
name="type"><xsl:value-of select="phpgw:conditional(not(type), '', 
type)"/></xsl:attribute>
+                                               <xsl:attribute 
name="name"><xsl:value-of select="phpgw:conditional(not(name), '', 
name)"/></xsl:attribute>
+                                               <xsl:attribute 
name="onclick"><xsl:value-of select="phpgw:conditional(not(onClick), '', 
onClick)"/></xsl:attribute>
+                                               <xsl:attribute 
name="value"><xsl:value-of select="phpgw:conditional(not(value), '', 
value)"/></xsl:attribute>
+                                               <xsl:attribute 
name="href"><xsl:value-of select="phpgw:conditional(not(href), '', 
href)"/></xsl:attribute>
+                                               <xsl:attribute 
name="class"><xsl:value-of select="phpgw:conditional(not(class), '', 
class)"/></xsl:attribute>
+                                       </input>
+                                       </td>
+                               </xsl:otherwise>
+                       </xsl:choose>
+               </xsl:for-each>
+                 </tr>
+                       <xsl:if test="item/text and normalize-space(item/text)">
+                               <thead>
+                                       <tr>
+                                               <xsl:for-each select="item">
+                                                       <td>
+                                                               <xsl:if 
test="name">
+                                                                       <label>
+                                                                               
<xsl:attribute name="for"><xsl:value-of select="phpgw:conditional(not(name), 
'', name)"/></xsl:attribute>
+                                                                               
<xsl:value-of select="phpgw:conditional(not(text), '', text)"/>
+                                                                       </label>
+                                                               </xsl:if>
+                                                       </td>
+                                               </xsl:for-each>
+                                       </tr>
+                               </thead>
+                       </xsl:if>
+               </table>
+       </div>
+</xsl:template>
+
+<xsl:template match="form/list_actions">
+       <form id="list_actions_form" method="POST">
+               <!-- Form action is set by javascript listener -->
+               <div id="list_actions" class='yui-skin-sam'>
+                       <table cellpadding="0" cellspacing="0">
+                               <tr>
+                                       <xsl:for-each select="item">
+                                               <td valign="top">
+                                                       <input 
id="innertoolbar">
+                                                               <xsl:attribute 
name="type"><xsl:value-of select="phpgw:conditional(not(type), '', 
type)"/></xsl:attribute>
+                                                               <xsl:attribute 
name="name"><xsl:value-of select="phpgw:conditional(not(name), '', 
name)"/></xsl:attribute>
+                                                               <xsl:attribute 
name="onclick"><xsl:value-of select="phpgw:conditional(not(onClick), '', 
onClick)"/></xsl:attribute>
+                                                               <xsl:attribute 
name="value"><xsl:value-of select="phpgw:conditional(not(value), '', 
value)"/></xsl:attribute>
+                                                               <xsl:attribute 
name="href"><xsl:value-of select="phpgw:conditional(not(href), '', 
href)"/></xsl:attribute>
+                                                       </input>
+                                               </td>
+                                       </xsl:for-each>
+                               </tr>
+                       </table>
+               </div>
+       </form>
+</xsl:template>
+<xsl:template match="form">
+       <form id="queryForm">
+               <xsl:attribute name="method">
+                       <xsl:value-of select="phpgw:conditional(not(method), 
'GET', method)"/>
+               </xsl:attribute>
+
+               <xsl:attribute name="action">
+                       <xsl:value-of select="phpgw:conditional(not(action), 
'', action)"/>
+               </xsl:attribute>
+               <xsl:apply-templates select="toolbar"/>
+       </form>
+
+       <form id="update_table_dummy" method='POST' action='' >
+       </form>
+
+</xsl:template>
+
+<xsl:template match="datatable">
+       <div id="paginator"/>
+       <div id="datatable-container"/>
+       <xsl:call-template name="datasource-definition" />
+</xsl:template>
+
+<xsl:template name="datasource-definition">
+       <script>
+               YAHOO.portico.setupDatasource = function() {
+                       <xsl:if test="source">
+                               YAHOO.portico.dataSourceUrl = '<xsl:value-of 
select="source"/>';
+                                       YAHOO.portico.initialSortedBy = false;
+                                       YAHOO.portico.initialFilters = false;
+                                       <xsl:if test="sorted_by">
+                                               YAHOO.portico.initialSortedBy = 
{key: '<xsl:value-of select="sorted_by/key"/>', dir: '<xsl:value-of 
select="sorted_by/dir"/>'};
+                                       </xsl:if>
+                       </xsl:if>
+
+                       YAHOO.portico.columnDefs = [
+                               <xsl:for-each select="//datatable/field">
+                                       {
+                                               key: "<xsl:value-of 
select="key"/>",
+                                               <xsl:if test="label">
+                                               label: "<xsl:value-of 
select="label"/>",
+                                               </xsl:if>
+                                               sortable: <xsl:value-of 
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
+                                               <xsl:if test="hidden">
+                                               hidden: true,
+                                               </xsl:if>
+                                               <xsl:if test="formatter">
+                                               formatter: <xsl:value-of 
select="formatter"/>,
+                                               </xsl:if>
+                                               className: "<xsl:value-of 
select="className"/>"
+                                       }<xsl:value-of 
select="phpgw:conditional(not(position() = last()), ',', '')"/>
+                               </xsl:for-each>
+                       ];
+               }
+               
+               <xsl:choose>
+                       <xsl:when test="//actions != ''">
+                               var actions = <xsl:value-of select="//actions" 
disable-output-escaping="yes" />;
+                       </xsl:when>
+                       <xsl:otherwise>
+                               var actions = new Array();
+                       </xsl:otherwise>        
+               </xsl:choose>
+
+       </script>
+</xsl:template>

Added: trunk/logistic/templates/base/project_datatable.xsl
===================================================================
--- trunk/logistic/templates/base/project_datatable.xsl                         
(rev 0)
+++ trunk/logistic/templates/base/project_datatable.xsl 2012-09-25 12:48:20 UTC 
(rev 10033)
@@ -0,0 +1,13 @@
+<!-- $Id: $ -->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+
+<div id="main_content">
+
+       <h1><xsl:value-of select="php:function('lang','Project')" /></h1>
+
+  <div id="project" class="content-wrp">
+         <xsl:call-template name="datatable" />
+  </div>
+</div>
+</xsl:template>

Added: trunk/logistic/templates/base/project_item.xsl
===================================================================
--- trunk/logistic/templates/base/project_item.xsl                              
(rev 0)
+++ trunk/logistic/templates/base/project_item.xsl      2012-09-25 12:48:20 UTC 
(rev 10033)
@@ -0,0 +1,89 @@
+<!-- $Id:$ -->
+<!-- item  -->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+
+<xsl:call-template name="yui_phpgw_i18n"/>
+<div class="yui-navset yui-navset-top">
+       <div class="identifier-header">
+               <h1><img src="{img_go_home}" /> 
+                               <xsl:value-of select="php:function('lang', 
'Project')" />
+               </h1>
+       </div>
+       <div class="yui-content">
+               <div id="details">
+                       <form action="#" method="post">
+                               <input type="hidden" name="id" value = 
"{value_id}">
+                               </input>
+                               <dl class="proplist-col">
+                                       <dt>
+                                               <label for="name"><xsl:value-of 
select="php:function('lang','Project title')" /></label>
+                                       </dt>
+                                       <dd>
+                                       <xsl:choose>
+                                               <xsl:when test="editable">
+                                                       <input type="text" 
name="name" id="name" value="{project/name}" size="100"/>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:value-of 
select="project/name" />
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                                       </dd>
+                                       <dt>
+                                               <label 
for="project_type"><xsl:value-of select="php:function('lang','Project_type')" 
/></label>
+                                       </dt>
+                                       <dd>
+                                       <xsl:choose>
+                                               <xsl:when test="editable">
+                                                       <select 
id="project_type_id" name="project_type_id">
+                                                               
<xsl:apply-templates select="options"/>
+                                                       </select>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:value-of 
select="project/project_type_label" />
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                                       </dd>   
+                                       <dt>
+                                               <label 
for="description"><xsl:value-of select="php:function('lang', 'Description')" 
/></label>
+                                       </dt>
+                                       <dd>
+                                       <xsl:choose>
+                                               <xsl:when test="editable">
+                                                       <textarea 
id="description" name="description" rows="5" cols="60"><xsl:value-of 
select="project/description" disable-output-escaping="yes"/></textarea>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:value-of 
select="project/description" disable-output-escaping="yes"/>
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                                       </dd>
+                               </dl>
+                               
+                               <div class="form-buttons">
+                                       <xsl:choose>
+                                               <xsl:when test="editable">
+                                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
+                                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
+                                                       <input type="submit" 
name="save_project" value="{$lang_save}" title = "{$lang_save}" />
+                                                       <input type="submit" 
name="cancel_project" value="{$lang_cancel}" title = "{$lang_cancel}" />
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
+                                                       <input type="submit" 
name="edit_project" value="{$lang_edit}" title = "{$lang_edit}" />
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </div>
+                       </form>
+               </div>
+       </div>
+</div>
+</xsl:template>
+
+<xsl:template match="options">
+       <option value="{id}">
+               <xsl:if test="selected">
+                       <xsl:attribute name="selected" value="selected" />
+               </xsl:if>
+               <xsl:value-of disable-output-escaping="yes" select="name"/>
+       </option>
+</xsl:template>

Added: trunk/logistic/templates/base/project_type_item.xsl
===================================================================
--- trunk/logistic/templates/base/project_type_item.xsl                         
(rev 0)
+++ trunk/logistic/templates/base/project_type_item.xsl 2012-09-25 12:48:20 UTC 
(rev 10033)
@@ -0,0 +1,54 @@
+<!-- $Id:$ -->
+<!-- item  -->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+
+<div class="yui-content">
+<h2>Prosjekttype</h2>
+               <div id="details">
+                       <form action="#" method="post">
+                               <input type="hidden" name="id" value = 
"{value_id}">
+                               </input>
+                               <dl class="proplist-col">
+                                       <dt>
+                                               <label for="name"><xsl:value-of 
select="php:function('lang','Project type name')" /></label>
+                                       </dt>
+                                       <dd>
+                                       <xsl:choose>
+                                               <xsl:when test="editable">
+                                                       <input type="text" 
name="title" id="title" value="{project/name}" size="100"/>
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:value-of 
select="project/name" />
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                                       </dd>           
+                               </dl>
+                               
+                               <div class="form-buttons">
+                                       <xsl:choose>
+                                               <xsl:when test="editable">
+                                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save')" 
/></xsl:variable>
+                                                       <xsl:variable 
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')" 
/></xsl:variable>
+                                                       <input type="submit" 
name="save_project_type" value="{$lang_save}" title = "{$lang_save}" />
+                                                       <input type="submit" 
name="cancel_project_type" value="{$lang_cancel}" title = "{$lang_cancel}" />
+                                               </xsl:when>
+                                               <xsl:otherwise>
+                                                       <xsl:variable 
name="lang_edit"><xsl:value-of select="php:function('lang', 'edit')" 
/></xsl:variable>
+                                                       <input type="submit" 
name="edit_project_type" value="{$lang_edit}" title = "{$lang_edit}" />
+                                               </xsl:otherwise>
+                                       </xsl:choose>
+                               </div>
+                       </form>
+               </div>
+       </div>
+</xsl:template>
+
+<xsl:template match="options">
+       <option value="{id}">
+               <xsl:if test="selected">
+                       <xsl:attribute name="selected" value="selected" />
+               </xsl:if>
+               <xsl:value-of disable-output-escaping="yes" select="name"/>
+       </option>
+</xsl:template>

Added: trunk/logistic/templates/base/project_types_datatable.xsl
===================================================================
--- trunk/logistic/templates/base/project_types_datatable.xsl                   
        (rev 0)
+++ trunk/logistic/templates/base/project_types_datatable.xsl   2012-09-25 
12:48:20 UTC (rev 10033)
@@ -0,0 +1,13 @@
+<!-- $Id: $ -->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl";>
+
+<div id="main_content">
+
+       <h1><xsl:value-of select="php:function('lang','Project types')" /></h1>
+
+  <div id="project" class="content-wrp">
+         <xsl:call-template name="datatable" />
+  </div>
+</div>
+</xsl:template>




reply via email to

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