[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [9031] registration: approval
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [9031] registration: approval |
Date: |
Sun, 25 Mar 2012 19:28:01 +0000 |
Revision: 9031
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9031
Author: sigurdne
Date: 2012-03-25 19:28:01 +0000 (Sun, 25 Mar 2012)
Log Message:
-----------
registration: approval
Modified Paths:
--------------
trunk/registration/inc/class.menu.inc.php
trunk/registration/setup/setup.inc.php
trunk/registration/setup/tables_current.inc.php
trunk/registration/setup/tables_update.inc.php
Added Paths:
-----------
trunk/registration/inc/class.bopending.inc.php
trunk/registration/inc/class.sopending.inc.php
trunk/registration/inc/class.uicommon.inc.php
trunk/registration/inc/class.uipending.inc.php
trunk/registration/js/
trunk/registration/js/yahoo/
trunk/registration/js/yahoo/pending.index.js
trunk/registration/templates/base/app_data.xsl
trunk/registration/templates/base/common.xsl
trunk/registration/templates/base/css/
trunk/registration/templates/base/css/base.css
trunk/registration/templates/base/pending_users.xsl
trunk/registration/templates/base/yui_booking_i18n.xsl
Added: trunk/registration/inc/class.bopending.inc.php
===================================================================
--- trunk/registration/inc/class.bopending.inc.php
(rev 0)
+++ trunk/registration/inc/class.bopending.inc.php 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -0,0 +1,255 @@
+<?php
+ /**
+ * phpGroupWare - registration
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003,2004,2005,2006,2007 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/bbb_/ekstern/
+ * @package registration
+ * @version $Id: class.bolocation.inc.php 8281 2011-12-13 09:24:03Z
sigurdne $
+ */
+
+ /**
+ * Description
+ * @package registration
+ */
+
+ class registration_bopending
+ {
+ var $start;
+ var $query;
+ var $filter;
+ var $sort;
+ var $order;
+ var $lookup;
+ var $use_session;
+ var $total_records = 0;
+
+ /**
+ * @var object $custom reference to custom fields object
+ */
+
+ var $public_functions = array
+ (
+ 'read' => true,
+ 'read_single' => true,
+ 'save' => true,
+ 'delete' => true,
+ 'check_perms' => true
+ );
+
+ function __construct($session=false)
+ {
+ $this->so =
CreateObject('registration.sopending');
+
+ if ($session )
+ {
+ $this->read_sessiondata();
+ $this->use_session = true;
+ }
+
+ $start =
phpgw::get_var('start', 'int', 'REQUEST', 0);
+ $query =
phpgw::get_var('query');
+ $sort =
phpgw::get_var('sort');
+ $order =
phpgw::get_var('order');
+ $filter =
phpgw::get_var('filter', 'int');
+ $status_id =
phpgw::get_var('status_id', 'int');
+ $allrows =
phpgw::get_var('allrows', 'bool');
+
+ $this->start = $start ? $start : 0;
+ $this->query = isset($query) &&
$query ? $query : '';
+ $this->filter = isset($filter) &&
$filter ? $filter : '';
+ $this->sort = isset($sort)
&& $sort ? $sort : $this->sort;
+ $this->order = isset($order) &&
$order ? $order : $this->order;
+ $this->status_id = isset($status_id) &&
$status_id ? $status_id : '';
+ $this->allrows = isset($allrows) &&
$allrows ? $allrows : '';
+ $this->acl_location = '.pending';
+ $this->location_code = isset($location_code) &&
$location_code ? $location_code : '';
+
+ }
+
+ function read_sessiondata()
+ {
+ $data =
$GLOBALS['phpgw']->session->appsession('session_data','location');
+
+ $this->start =
isset($data['start'])?$data['start']:'';
+ $this->filter =
isset($data['filter'])?$data['filter']:'';
+ $this->sort =
isset($data['sort'])?$data['sort']:'';
+ $this->order =
isset($data['order'])?$data['order']:'';;
+ $this->status_id =
isset($data['status_id'])?$data['status_id']:'';
+ $this->query =
isset($data['query'])?$data['query']:'';
+ $this->status =
isset($data['status'])?$data['status']:'';
+ }
+
+ function save_sessiondata($data)
+ {
+ if ($this->use_session)
+ {
+
$GLOBALS['phpgw']->session->appsession('session_data','location',$data);
+ }
+ }
+
+
+ function read($data = array())
+ {
+ $users = $this->so->read(array('start' =>
$this->start,'query' => $this->query,'sort' => $this->sort,'order' =>
$this->order,
+ 'filter' =>
$this->filter,'allrows'=>$data['allrows'],
+ 'status_id'=>$this->status_id,'results' =>
$data['results']));
+
+ foreach($users as &$user)
+ {
+ $user['reg_dla'] =
$GLOBALS['phpgw']->common->show_date($user['reg_dla']);
+ }
+
+ $this->total_records = $this->so->total_records;
+ $this->uicols = $this->so->uicols;
+
+ return $users;
+ }
+
+
+ function read_single($data='',$extra=array())
+ {
+ if(is_array($data))
+ {
+ $location_code = $data['location_code'];
+ $extra = $data['extra'];
+ }
+ else
+ {
+ $location_code = $data;
+ }
+
+ $location_array = explode('-',$location_code);
+ $type_id= count($location_array);
+
+ if (!$type_id)
+ {
+ return;
+ }
+
+ if(!isset($extra['noattrib']) || !$extra['noattrib'])
+ {
+ $values['attributes'] =
$this->custom->find('property','.location.' . $type_id, 0, '', 'ASC',
'attrib_sort', true, true);
+ $values =
$this->so->read_single($location_code, $values);
+ $values = $this->custom->prepare($values,
'property',".location.{$type_id}", $extra['view']);
+ }
+ else
+ {
+ $values =
$this->so->read_single($location_code);
+ }
+
+
+ if( isset($extra['tenant_id']) &&
$extra['tenant_id']!='lookup')
+ {
+ if($extra['tenant_id']>0)
+ {
+
$tenant_data=$this->bocommon->read_single_tenant($extra['tenant_id']);
+ $values['tenant_id'] =
$extra['tenant_id'];
+ $values['contact_phone'] =
$extra['contact_phone']?$extra['contact_phone']:$tenant_data['contact_phone'];
+ $values['last_name'] =
$tenant_data['last_name'];
+ $values['first_name'] =
$tenant_data['first_name'];
+ }
+ else
+ {
+ unset($values['tenant_id']);
+ unset($values['contact_phone']);
+ unset($values['last_name']);
+ unset($values['first_name']);
+ }
+ }
+
+ if(is_array($extra))
+ {
+ $values = $values + $extra;
+ }
+ return $values;
+ }
+
+
+ /**
+ * Arrange attributes within groups
+ *
+ * @param string $location the name of the location of the
attribute
+ * @param array $attributes the array of the attributes to
be grouped
+ *
+ * @return array the grouped attributes
+ */
+
+
+ function
save($location,$values_attribute,$action='',$type_id='',$location_code_parent='')
+ {
+ if(is_array($values_attribute))
+ {
+ $values_attribute =
$this->custom->convert_attribute_save($values_attribute);
+ }
+
+ if ($action=='edit')
+ {
+ if
($this->so->check_location($location['location_code'],$type_id))
+ {
+ $receipt =
$this->so->edit($location,$values_attribute,$type_id);
+ }
+ else
+ {
+
$receipt['error'][]=array('msg'=>lang('This location ID does not exist!'));
+ }
+ }
+ else
+ {
+ if(!$receipt['error'])
+ {
+ $receipt =
$this->so->add($location,$values_attribute,$type_id);
+ }
+ }
+
+ $criteria = array
+ (
+ 'appname' => 'property',
+ 'location' =>
".location.{$type_id}",
+ 'allrows' => true
+ );
+
+ $custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
+
+ foreach ( $custom_functions as $entry )
+ {
+ // prevent path traversal
+ if ( preg_match('/\.\./', $entry['file_name']) )
+ {
+ continue;
+ }
+
+ $file = PHPGW_SERVER_ROOT .
"/property/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
+ if ( $entry['active'] && is_file($file) )
+ {
+ require_once $file;
+ }
+ }
+
+ return $receipt;
+ }
+
+ function delete()
+ {
+ //$location_code =
phpgw::get_var('location_code','string','GET');
+ //$this->so->delete($location_code);
+ }
+ }
Modified: trunk/registration/inc/class.menu.inc.php
===================================================================
--- trunk/registration/inc/class.menu.inc.php 2012-03-24 20:11:29 UTC (rev
9030)
+++ trunk/registration/inc/class.menu.inc.php 2012-03-25 19:28:01 UTC (rev
9031)
@@ -25,11 +25,27 @@
*/
public function get_menu()
{
+ $menus = array();
+
$incoming_app =
$GLOBALS['phpgw_info']['flags']['currentapp'];
$GLOBALS['phpgw_info']['flags']['currentapp'] =
'registration';
$menus['toolbar'] = array();
+
+ $menus['navbar'] = array
+ (
+ 'registration' => array
+ (
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'registration.uipending.index')),
+ 'text' => lang('registration'),
+ 'image' => array('admin',
'navbar'),
+ 'order' => -6,
+ 'group' => 'systools'
+ ),
+ );
+
+
if ( $GLOBALS['phpgw']->acl->check('run',
phpgwapi_acl::READ, 'admin')
|| $GLOBALS['phpgw']->acl->check('admin',
phpgwapi_acl::ADD, 'registration'))
{
@@ -48,6 +64,15 @@
);
}
+
+// $menus['navigation'] = array();
+ $menus['navigation']['pending'] = array
+ (
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>
'registration.uipending.index')),
+ 'text' => lang('Pending for approval'),
+ 'image' => array('property',
'location'),
+ );
+
$GLOBALS['phpgw_info']['flags']['currentapp'] =
$incoming_app;
return $menus;
}
Added: trunk/registration/inc/class.sopending.inc.php
===================================================================
--- trunk/registration/inc/class.sopending.inc.php
(rev 0)
+++ trunk/registration/inc/class.sopending.inc.php 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -0,0 +1,142 @@
+<?php
+ /**
+ * phpGroupWare - registration
+ *
+ * @author Sigurd Nes <address@hidden>
+ * @copyright Copyright (C) 2003,2004,2005,2006,2007 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/bbb_/ekstern/
+ * @package registration
+ * @version $Id: class.solocation.inc.php 8572 2012-01-15 14:16:40Z
sigurdne $
+ */
+
+ /**
+ * Description
+ * @package registration
+ */
+
+ class registration_sopending
+ {
+
+ var $bocommon;
+ var $total_records;
+ protected $global_lock = false;
+
+ function __construct($bocommon = '')
+ {
+ $this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
+ $this->soadmin_location =
CreateObject('property.soadmin_location');
+ if(!$bocommon || !is_object($bocommon))
+ {
+ $this->bocommon =
CreateObject('property.bocommon');
+ }
+ else
+ {
+ $this->bocommon = $bocommon;
+ }
+ $this->custom =
createObject('property.custom_fields');
+
+ $this->db = & $GLOBALS['phpgw']->db;
+ $this->socommon = & $this->bocommon->socommon;
+
+ $this->join = & $this->db->join;
+ $this->left_join = & $this->db->left_join;
+ $this->like = & $this->db->like;
+ }
+
+ function read($data)
+ {
+ $start =
isset($data['start']) && $data['start'] ? $data['start'] : 0;
+ $filter =
isset($data['filter']) && $data['filter'] ? $data['filter'] : 0;
+ $query =
isset($data['query']) ? $data['query'] : '';
+ $sort =
isset($data['sort']) && $data['sort'] ? $data['sort'] : 'ASC';
+ $order =
isset($data['order']) && $data['order'] ? $data['order'] : 'reg_id';
+ $status_id =
isset($data['status_id']) && $data['status_id'] ? (int)$data['status_id'] : 0;
+ $allrows =
isset($data['allrows']) ? $data['allrows'] : '';
+ $results =
$data['results'] ? (int)$data['results'] : 0;
+
+ $ordermethod = " ORDER BY {$order} {$sort}";
+
+ $where= 'WHERE';
+ $filtermethod = '';
+
+ switch ($status_id)
+ {
+ case '1':
+ $filtermethod .= "$where reg_approved =
1";
+ $where= 'AND';
+ break;
+ case '2':
+ $filtermethod .= "$where reg_approved
IS NULL";
+ $where= 'AND';
+ break;
+ default:
+ // nothing
+ }
+
+ if($query)
+ {
+ $query = $this->db->db_addslashes($query);
+ $querymethod = "{$where} reg_lid {$this->like}
'%$query%'";
+ }
+
+ $sql = "SELECT * FROM phpgw_reg_accounts
{$filtermethod} {$querymethod}";
+
+ $values = array();
+ $this->db->query('SELECT count(*) AS cnt ' .
substr($sql,strripos($sql,' FROM')),__LINE__,__FILE__);
+ $this->db->next_record();
+ $this->total_records = $this->db->f('cnt');
+
+ if(!$allrows)
+ {
+ $this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__,$results);
+ }
+ else
+ {
+ if($this->total_records > 200)
+ {
+ $_fetch_single = true;
+ }
+ else
+ {
+ $_fetch_single = false;
+ }
+ $this->db->query($sql .
$ordermethod,__LINE__,__FILE__, false, $_fetch_single );
+ unset($_fetch_single);
+ }
+
+ $j=0;
+
+ $values = array();
+
+ while ($this->db->next_record())
+ {
+ $values[] = array
+ (
+ 'reg_id' =>
$this->db->f('reg_id'),
+ 'reg_lid' =>
$this->db->f('reg_lid'),
+ 'reg_info' =>
$this->db->f('reg_info'),
+ 'reg_dla' =>
$this->db->f('reg_dla'),
+ 'reg_approved' =>
$this->db->f('reg_approved')
+ );
+
+ }
+ return $values;
+ }
+ }
Added: trunk/registration/inc/class.uicommon.inc.php
===================================================================
--- trunk/registration/inc/class.uicommon.inc.php
(rev 0)
+++ trunk/registration/inc/class.uicommon.inc.php 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -0,0 +1,806 @@
+<?php
+ /**
+ * phpGroupWare - registration
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <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 registration
+ * @version $Id: class.uicommon.inc.php 8830 2012-02-13 06:57:11Z erikhl
$
+ */
+
+ phpgw::import_class('phpgwapi.yui');
+
+ /**
+ * Cherry pick selected values into a new array
+ *
+ * @param array $array input array
+ * @param array $keys array of keys to pick
+ *
+ * @return array containg values from $array for the keys in $keys.
+ */
+ function extract_values($array, $keys, $options = array())
+ {
+ static $default_options = array(
+ 'prefix' => '',
+ 'suffix' => '',
+ 'preserve_prefix' => false,
+ 'preserve_suffix' => false
+ );
+
+ $options = array_merge($default_options, $options);
+
+ $result = array();
+ foreach($keys as $write_key)
+ {
+ $array_key =
$options['prefix'].$write_key.$options['suffix'];
+ if(isset($array[$array_key])) {
+ $result[($options['preserve_prefix'] ?
$options['prefix'] : '').$write_key.($options['preserve_suffix'] ?
$options['suffix'] : '')] = $array[$array_key];
+ }
+ }
+ return $result;
+ }
+
+ function array_set_default(&$array, $key, $value)
+ {
+ if(!isset($array[$key])) $array[$key] = $value;
+ }
+
+ /**
+ * Reformat an ISO timestamp into norwegian format
+ *
+ * @param string $date date
+ *
+ * @return string containg timestamp in norwegian format
+ */
+ function pretty_timestamp($date)
+ {
+ if (empty($date)) return "";
+
+ if(is_array($date) && is_object($date[0]) && $date[0]
instanceof DOMNode)
+ {
+ $date = $date[0]->nodeValue;
+ }
+ preg_match('/([0-9]{4})-([0-9]{2})-([0-9]{2})(
([0-9]{2}):([0-9]{2}))?/', $date, $match);
+
+ $dateformat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+ if($match[4])
+ {
+ $dateformat .= ' H:i';
+ $timestamp = mktime($match[5], $match[6], 0, $match[2],
$match[3], $match[1]);
+ }
+ else
+ {
+ $timestamp = mktime(0, 0, 0, $match[2], $match[3],
$match[1]);
+ }
+ $text = date($dateformat,$timestamp);
+
+ return $text;
+ }
+
+ /**
+ * Generates a javascript translator object/hash for the specified
fields.
+ */
+ function js_lang()
+ {
+ $keys = func_get_args();
+ $strings = array();
+ foreach($keys as $key)
+ {
+ $strings[$key] = is_string($key) ? lang($key) :
call_user_func_array('lang', $key);
+ }
+ return json_encode($strings);
+ }
+
+ /**
+ * Creates an array of translated strings.
+ */
+ function lang_array()
+ {
+ $keys = func_get_args();
+ foreach($keys as &$key)
+ {
+ $key = lang($key);
+ }
+ return $keys;
+ }
+
+ abstract class registration_uicommon
+ {
+ const UI_SESSION_FLASH = 'flash_msgs';
+
+ protected
+ $filesArray;
+
+ protected static
+ $old_exception_handler;
+
+ private
+ $ui_session_key,
+ $flash_msgs;
+
+
+ const LOCATION_ROOT = '.';
+ const LOCATION_SUPERUSER = '.usertype.superuser';
+// const LOCATION_ADMINISTRATOR = '.RESPONSIBILITY.ADMIN';
+ const LOCATION_USER = '.usertype.user';
+
+ public $dateFormat;
+
+ public $type_of_user;
+
+ // public $flash_msgs;
+
+ public function __construct()
+ {
+ self::set_active_menu('registration');
+
self::add_stylesheet('phpgwapi/js/yahoo/calendar/assets/skins/sam/calendar.css');
+
self::add_stylesheet('phpgwapi/js/yahoo/autocomplete/assets/skins/sam/autocomplete.css');
+
self::add_stylesheet('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
+
self::add_stylesheet('phpgwapi/js/yahoo/container/assets/skins/sam/container.css');
+
self::add_stylesheet('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css');
+
self::add_stylesheet('phpgwapi/js/yahoo/treeview/assets/skins/sam/treeview.css');
+
//self::add_stylesheet('registration/templates/base/css/base.css');
+ self::add_javascript('controller', 'yahoo',
'common.js');//Use this one for now
+ $this->tmpl_search_path = array();
+ array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT .
'/phpgwapi/templates/base');
+ array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT .
'/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set']);
+ array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT .
'/' . $GLOBALS['phpgw_info']['flags']['currentapp'] . '/templates/base');
+ phpgwapi_yui::load_widget('datatable');
+ phpgwapi_yui::load_widget('history');
+ phpgwapi_yui::load_widget('paginator');
+ phpgwapi_yui::load_widget('menu');
+ phpgwapi_yui::load_widget('calendar');
+ phpgwapi_yui::load_widget('autocomplete');
+ phpgwapi_yui::load_widget('animation');
+
+ $this->url_prefix = str_replace('_', '.',
get_class($this));
+
+ $this->dateFormat =
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
+
+ $this->acl = & $GLOBALS['phpgw']->acl;
+ $this->locations = & $GLOBALS['phpgw']->locations;
+
+ $this->type_of_user = array(
+ MANAGER => $this->isManager(),
+ EXECUTIVE_OFFICER =>
$this->isExecutiveOfficer(),
+ ADMINISTRATOR => $this->isAdministrator()
+ );
+ //var_dump($this->type_of_user);
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($GLOBALS['phpgw_info']['flags']['currentapp']);
+ }
+
+ private function get_ui_session_key() {
+ return $this->ui_session_key;
+ }
+
+ private function restore_flash_msgs() {
+ if (($flash_msgs =
$this->session_get(self::UI_SESSION_FLASH))) {
+ if (is_array($flash_msgs)) {
+ $this->flash_msgs = $flash_msgs;
+
$this->session_set(self::UI_SESSION_FLASH, array());
+ return true;
+ }
+ }
+
+ $this->flash_msgs = array();
+ return false;
+ }
+
+ private function store_flash_msgs() {
+ return $this->session_set(self::UI_SESSION_FLASH,
$this->flash_msgs);
+ }
+
+ private function reset_flash_msgs() {
+ $this->flash_msgs = array();
+ $this->store_flash_msgs();
+ }
+
+ private function session_set($key, $data) {
+ return
phpgwapi_cache::session_set($this->get_ui_session_key(), $key, $data);
+ }
+
+ private function session_get($key) {
+ return
phpgwapi_cache::session_get($this->get_ui_session_key(), $key);
+ }
+
+ /**
+ * Provides a private session cache setter per ui class.
+ */
+ protected function ui_session_set($key, $data) {
+ return $this->session_set(get_class($this).'_'.$key,
$data);
+ }
+
+ /**
+ * Provides a private session cache getter per ui class .
+ */
+ protected function ui_session_get($key) {
+ return $this->session_get(get_class($this).'_'.$key);
+ }
+
+ protected function generate_secret($length = 10)
+ {
+ return
substr(base64_encode(rand(1000000000,9999999999)),0, $length);
+ }
+
+ public function add_js_event($event, $js) {
+ $GLOBALS['phpgw']->js->add_event($event, $js);
+ }
+
+ public function add_js_load_event($js) {
+ $this->add_js_event('load', $js);
+ }
+
+ /**
+ * Permission check. Proxy method for method check in
phpgwapi->acl
+ *
+ * @param $location
+ * @param $permission
+ * @return true if check is ok, false othewise
+ */
+ protected function hasPermissionOn($location =
registration_uicommon::LOCATION_ROOT, $permission = PHPGW_ACL_PRIVATE){
+ return
$this->acl->check($location,$permission,'registration');
+ }
+
+
+ /**
+ * Check to see if this user is an administrator
+ *
+ * @return true if private permission on root, false otherwise
+ */
+ protected function isAdministrator(){
+ return
$this->acl->check(registration_uicommon::LOCATION_ROOT,PHPGW_ACL_PRIVATE,'registration');
+ }
+
+ /**
+ * Check to see if the user is an executive officer
+ *
+ * @return true if at least add permission on fields of
responsibilities (locations: .RESPONSIBIITY.*)
+ */
+ protected function isExecutiveOfficer(){
+ return (
+
$this->acl->check(registration_uicommon::LOCATION_SUPERUSER,PHPGW_ACL_ADD,'registration')
||
+
$this->acl->check(registration_uicommon::LOCATION_USER,PHPGW_ACL_ADD,'registration')
+ );
+ }
+
+ /**
+ * Check to see if the user is a manager
+ *
+ * @return true if no read,add,delete,edit permission on fields
of responsibilities (locations: .RESPONSIBILITY.*)
+ */
+ protected function isManager(){
+ return !$this->isExecutiveOfficer();
+ }
+
+ public static function
process_registration_unauthorized_exceptions()
+ {
+ self::$old_exception_handler =
set_exception_handler(array(__CLASS__,
'handle_registration_unauthorized_exception'));
+ }
+
+ public static function
handle_registration_unauthorized_exception(Exception $e)
+ {
+ if ($e instanceof registration_unauthorized_exception)
+ {
+ $message = htmlentities('HTTP/1.0 401
Unauthorized - '.$e->getMessage(), null, self::encoding());
+ header($message);
+ echo
"<html><head><title>$message</title></head><body><strong>$message</strong></body></html>";
+ } else {
+ call_user_func(self::$old_exception_handler,
$e);
+ }
+ }
+
+ public function link($data)
+ {
+ return $GLOBALS['phpgw']->link('/index.php', $data);
+ }
+
+ public function redirect($link_data)
+ {
+ $GLOBALS['phpgw']->redirect_link('/index.php',
$link_data);
+ }
+
+ public function flash($msg, $type='success')
+ {
+ $this->flash_msgs[$msg] = $type == 'success';
+ }
+
+ public function flash_form_errors($errors)
+ {
+ foreach($errors as $field => $msg)
+ {
+ $this->flash_msgs[$msg] = false;
+ }
+ }
+
+ public function add_stylesheet($path)
+ {
+ $GLOBALS['phpgw']->css->add_external_file($path);
+ }
+
+ public function add_javascript($app, $pkg, $name)
+ {
+ return $GLOBALS['phpgw']->js->validate_file($pkg,
str_replace('.js', '', $name), $app);
+ }
+
+ public function set_active_menu($item)
+ {
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
$item;
+ }
+
+ /**
+ * A more flexible version of xslttemplate.add_file
+ */
+ public function add_template_file($tmpl)
+ {
+ if(is_array($tmpl))
+ {
+ foreach($tmpl as $t)
+ {
+ $this->add_template_file($t);
+ }
+ return;
+ }
+ foreach(array_reverse($this->tmpl_search_path) as $path)
+ {
+ $filename = $path . '/' . $tmpl . '.xsl';
+ if (file_exists($filename))
+ {
+
$GLOBALS['phpgw']->xslttpl->xslfiles[$tmpl] = $filename;
+ return;
+ }
+ }
+ echo "Template $tmpl not found in search path: ";
+ print_r($this->tmpl_search_path);
+ die;
+ }
+
+ public function render_template($output)
+ {
+ $GLOBALS['phpgw']->common->phpgw_header(true);
+ if($this->flash_msgs)
+ {
+ $msgbox_data =
$GLOBALS['phpgw']->common->msgbox_data($this->flash_msgs);
+ $msgbox_data =
$GLOBALS['phpgw']->common->msgbox($msgbox_data);
+ foreach($msgbox_data as & $message)
+ {
+ echo "<div
class='{$message['msgbox_class']}'>";
+ echo $message['msgbox_text'];
+ echo '</div>';
+ }
+ }
+ echo htmlspecialchars_decode($output);
+ $GLOBALS['phpgw']->common->phpgw_exit();
+ }
+
+ public function add_yui_translation(&$data)
+ {
+ $this->add_template_file('yui_booking_i18n');
+ $previous = lang('prev');
+ $next = lang('next');
+
+ $data['yui_booking_i18n'] = array(
+ 'Calendar' => array(
+ 'WEEKDAYS_SHORT' =>
json_encode(lang_array('Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa')),
+ 'WEEKDAYS_FULL' =>
json_encode(lang_array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
'Friday', 'Saturday')),
+ 'MONTHS_LONG' =>
json_encode(lang_array('January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December')),
+ ),
+ 'DataTable' => array(
+ 'MSG_EMPTY' => json_encode(lang('No
records found.')),
+ 'MSG_LOADING' =>
json_encode(lang("Loading...")),
+ 'MSG_SORTASC' =>
json_encode(lang('Click to sort ascending')),
+ 'MSG_SORTDESC' =>
json_encode(lang('Click to sort descending')),
+ ),
+ 'setupDatePickerHelper' => array(
+ 'LBL_CHOOSE_DATE' =>
json_encode(lang('Choose a date')),
+ ),
+ 'setupPaginator' => array(
+ 'pageReportTemplate' =>
json_encode(lang("Showing items {startRecord} - {endRecord} of
{totalRecords}")),
+ 'previousPageLinkLabel' =>
json_encode("< {$previous}"),
+ 'nextPageLinkLabel' =>
json_encode("{$next} >"),
+ ),
+ 'common' => array(
+ 'LBL_NAME' => json_encode(lang('Name')),
+ 'LBL_TIME' => json_encode(lang('Time')),
+ 'LBL_WEEK' => json_encode(lang('Week')),
+ 'LBL_RESOURCE' =>
json_encode(lang('Resource')),
+ ),
+ );
+ }
+
+
+ public function add_template_helpers() {
+ $this->add_template_file('helpers');
+ }
+
+ public function render_template_xsl($files, $data)
+ {
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+
+ if($this->flash_msgs) {
+ $data['msgbox_data'] =
$GLOBALS['phpgw']->common->msgbox($this->flash_msgs);
+ } else {
+ $this->add_template_file('msgbox');
+ }
+
+ $this->reset_flash_msgs();
+
+ $this->add_yui_translation($data);
+ $data['webserver_url'] =
$GLOBALS['phpgw_info']['server']['webserver_url'];
+
+ $output = phpgw::get_var('output', 'string', 'REQUEST',
'html');
+ $GLOBALS['phpgw']->xslttpl->set_output($output);
+ $this->add_template_file($files);
+
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('data' => $data));
+ }
+
+
+ public function check_active($url)
+ {
+ if($_SERVER['REQUEST_METHOD'] == 'POST')
+ {
+ $activate = extract_values($_POST,
array("status", "activate_id"));
+
$this->bo->set_active(intval($activate['activate_id']),
intval($activate['status']));
+ $this->redirect(array('menuaction' => $url,
'id' => $activate['activate_id']));
+ }
+ }
+
+ // Add link key to a result array
+ public function _add_links(&$value, $key, $menuaction)
+ {
+ $unset = 0;
+ // FIXME: Fugly workaround
+ // I cannot figure out why this variable isn't set, but
it is needed
+ // by the ->link() method, otherwise we wind up in the
phpgroupware
+ // errorhandler which does lot of weird things and
breaks the output
+ if
(!isset($GLOBALS['phpgw_info']['server']['webserver_url'])) {
+
$GLOBALS['phpgw_info']['server']['webserver_url'] = "/";
+ $unset = 1;
+ }
+
+ $value['link'] = self::link(array('menuaction' =>
$menuaction, 'id' => $value['id']));
+
+ // FIXME: Fugly workaround
+ // I kid you not my friend. There is something very
wonky going on
+ // in phpgroupware which I cannot figure out.
+ // If this variable isn't unset() (if it wasn't set
before that is)
+ // then it will contain extra slashes and break URLs
+ if ($unset) {
+
unset($GLOBALS['phpgw_info']['server']['webserver_url']);
+ }
+ }
+
+ // Build a YUI result style array
+ public function yui_results($results)
+ {
+ if (!$results) {
+ $results['total_records'] = 0;
+ $result['results'] = array();
+ }
+
+ return array(
+ 'ResultSet' => array(
+ 'totalRecords' =>
$results['total_records'],
+ 'recordsReturned' =>
count($results['results']),
+ 'startIndex' =>
$results['start'],
+ 'sortKey' =>
$results['sort'],
+ 'sortDir' =>
$results['dir'],
+ 'Result' =>
$results['results']
+ )
+ );
+ }
+
+ public function use_yui_editor($targets)
+ {
+ /*
+
self::add_stylesheet('phpgwapi/js/yahoo/assets/skins/sam/skin.css');
+ self::add_javascript('yahoo', 'yahoo/editor',
'simpleeditor-min.js');
+ */
+ $lang_font_style = lang('Font Style');
+ $lang_lists = lang('Lists');
+ $lang_insert_item = lang('Insert Item');
+ $js = '';
+ foreach ( $targets as $target )
+ {
+ $js .= <<<SCRIPT
+ (function() {
+ var Dom = YAHOO.util.Dom,
+ Event = YAHOO.util.Event;
+
+ var editorConfig = {
+ toolbar:
+ {buttons: [
+ { group: 'textstyle',
label: '{$lang_font_style}',
+ buttons: [
+ { type:
'push', label: 'Fet CTRL + SHIFT + B', value: 'bold' }
+ ]
+ },
+ { type: 'separator' },
+ { group: 'indentlist',
label: '{$lang_lists}',
+ buttons: [
+ { type:
'push', label: 'Opprett punktliste', value: 'insertunorderedlist' },
+ { type:
'push', label: 'Opprett nummerert liste', value: 'insertorderedlist' }
+ ]
+ },
+ { type: 'separator' },
+ { group: 'insertitem',
label: '{$lang_insert_item}',
+ buttons: [
+ { type:
'push', label: 'HTML Lenke CTRL + SHIFT + L', value: 'createlink', disabled:
true },
+ { type:
'push', label: 'Sett inn bilde', value: 'insertimage' }
+ ]
+ },
+ { type: 'separator' },
+ { group: 'undoredo',
label: 'Angre/Gjenopprett',
+ buttons: [
+ { type:
'push', label: 'Angre', value: 'undo' },
+ { type:
'push', label: 'Gjenopprett', value: 'redo' }
+ ]
+ }
+ ]
+ },
+ height: '200px',
+ width: '700px',
+ animate: true,
+ dompath: true,
+ handleSubmit: true
+ };
+
+ var editorWidget = new
YAHOO.widget.Editor('{$target}', editorConfig);
+ editorWidget.render();
+ })();
+
+SCRIPT;
+ }
+
+
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/editor/assets/skins/sam/editor.css');
+ phpgw::import_class('phpgwapi.yui');
+ phpgwapi_yui::load_widget('editor');
+ $GLOBALS['phpgw']->js->add_event('load', $js);
+ }
+
+ /**
+ * Returns formatted version of gab id. The format of the
string returned
+ * is '[Cadastral unit number] / [Property unit number] /
[Leasehold unit number] / [Section unit number]'.
+ *
+ * @param $gab_id string with id to to format.
+ * @return string formatted version of the string passed to the
method,
+ * or the same string if the one passed is of an incorrect
format.
+ */
+ public static function get_nicely_formatted_gab_id(string
$gab_id)
+ {
+ if(strlen($gab_id) == 20)
+ {
+ $gab_id = substr($gab_id,4,5).' /
'.substr($gab_id,9,4).' / '.substr($gab_id,13,4).' / '.substr($gab_id,17,3);
+ }
+ return $gab_id;
+ }
+
+ public function render($template,$local_variables = array())
+ {
+ foreach($local_variables as $name => $value)
+ {
+ $$name = $value;
+
+ }
+
+ ob_start();
+ foreach(array_reverse($this->tmpl_search_path) as $path)
+ {
+ $filename = $path . '/' . $template;
+ if (file_exists($filename))
+ {
+ include($filename);
+ break;
+ }
+ }
+ $output = ob_get_contents();
+ ob_end_clean();
+ self::render_template($output);
+ }
+
+ /**
+ * Method for JSON queries.
+ *
+ * @return YUI result
+ */
+ public abstract function query();
+
+ /**
+ * Generate javascript for the extra column definitions for a
partial list
+ *
+ * @param $array_name the name of the javascript variable that
contains the column definitions
+ * @param $extra_cols the list of extra columns to set
+ * @return string javascript
+ */
+ public static function get_extra_column_defs($array_name,
$extra_cols = array())
+ {
+ $result = "";
+
+ foreach($extra_cols as $col){
+ $literal = '{';
+ $literal .= 'key: "' . $col['key'] . '",';
+ $literal .= 'label: "' . $col['label'] . '"';
+ if (isset($col['formatter'])) {
+ $literal .= ',formatter: ' .
$col['formatter'];
+ }
+ if (isset($col['parser'])) {
+ $literal .= ',parser: ' .
$col['parser'];
+ }
+ $literal .= '}';
+
+ if($col["index"]){
+ $result .=
"{$array_name}.splice(".$col["index"].", 0,".$literal.");";
+ } else {
+ $result .=
"{$array_name}.push($literal);";
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Generate javascript definitions for any editor widgets set
on columns for
+ * a partial list.
+ *
+ * @param $array_name the name of the javascript variable that
contains the column definitions
+ * @param $editors the list of editors, keyed by column key
+ * @return string javascript
+ */
+ public static function get_column_editors($array_name, $editors
= array())
+ {
+ $result = "for (var i in {$array_name}) {\n";
+ $result .= " switch ({$array_name}[i].key) {\n";
+ foreach ($editors as $field => $editor) {
+ $result .= " case '{$field}':\n";
+ $result .= "
{$array_name}[i].editor = {$editor};\n";
+ $result .= " break;\n";
+ }
+ $result .= " }\n";
+ $result .= "}";
+
+ return $result;
+ }
+
+ /**
+ * Returns a html-formatted error message if one is defined in
the
+ * list of validation errors on the object we're given. If no
+ * error is defined, an empty string is returned.
+ *
+ * @param $object the object to display errors for
+ * @param $field the name of the attribute to display errors for
+ * @return string a html formatted error message
+ */
+ public static function get_field_error($object, $field)
+ {
+ if(isset($object))
+ {
+ $errors = $object->get_validation_errors();
+
+ if ($errors[$field]) {
+ return '<label class="error" for="' .
$field . '">' . $errors[$field] . '</label>';
+ }
+ return '';
+ }
+ }
+
+ public static function get_messages($messages, $message_type)
+ {
+ $output = '';
+ if(is_array($messages) && count($messages) > 0) //
Array of messages
+ {
+ $output = "<div class=\"{$message_type}\">";
+ foreach($messages as $message)
+ {
+ $output .= "<p
class=\"message\">{$message}</p>";
+ }
+ $output .= "</div>";
+ }
+ else if($messages) {
+ $output = "<div class=\"{$message_type}\"><p
class=\"message\">{$messages}</p></div>";
+ }
+ return $output;
+ }
+ /**
+ * Returns a html-formatted error message to display on top of
the page. If
+ * no error is defined, an empty string is returned.
+ *
+ * @param $error the error to display
+ * @return string a html formatted error message
+ */
+ public static function get_page_error($errors)
+ {
+ return self::get_messages($errors, 'error');
+ }
+
+ /**
+ * Returns a html-formatted error message to display on top of
the page. If
+ * no error is defined, an empty string is returned.
+ *
+ * @param $error the error to display
+ * @return string a html formatted error message
+ */
+ public static function get_page_warning($warnings)
+ {
+ return self::get_messages($warnings, 'warning');
+ }
+
+ /**
+ * Returns a html-formatted info message to display on top of
the page. If
+ * no message is defined, an empty string is returned.
+ *
+ * @param $message the message to display
+ * @return string a html formatted info message
+ */
+ public static function get_page_message($messages)
+ {
+ return self::get_messages($messages, 'info');
+ }
+
+ /**
+ * Download xls, csv or similar file representation of a data
table
+ */
+ public function download()
+ {
+ $list = $this->query();
+ $list = $list['ResultSet']['Result'];
+
+ $keys = array();
+
+ if(count($list[0]) > 0) {
+ foreach($list[0] as $key => $value) {
+ if(!is_array($value)) {
+ array_push($keys, $key);
+ }
+ }
+ }
+
+ // Remove newlines from output
+ $count = count($list);
+ for($i = 0; $i < $count; $i++)
+ {
+ foreach ($list[$i] as $key => &$data)
+ {
+ $data = str_replace(array("\n","\r\n",
"<br>"),'',$data);
+ }
+ }
+
+ // Use keys as headings
+ $headings = array();
+ $count_keys = count($keys);
+ for($j=0;$j<$count_keys;$j++)
+ {
+ array_push($headings, lang($keys[$j]));
+ }
+
+ $property_common = CreateObject('property.bocommon');
+ $property_common->download($list, $keys, $headings);
+ }
+
+ /**
+ * Added because error reporting facilities in phpgw tries to
serialize the PDO
+ * instance in $this->db which causes an error. This method
removes $this->db from the
+ * serialized values to avoid this problem.
+ */
+ public function __sleep()
+ {
+ return array('table_name', 'fields');
+ }
+ }
Added: trunk/registration/inc/class.uipending.inc.php
===================================================================
--- trunk/registration/inc/class.uipending.inc.php
(rev 0)
+++ trunk/registration/inc/class.uipending.inc.php 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -0,0 +1,342 @@
+<?php
+ /**
+ * phpGroupWare - registration
+ *
+ * @author Erink Holm-Larsen <address@hidden>
+ * @author Torstein Vadla <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 registration
+ * @version $Id: class.uicheck_list.inc.php 8628 2012-01-21 10:42:05Z
vator $
+ */
+
+ phpgw::import_class('phpgwapi.yui');
+ phpgw::import_class('registration.uicommon');
+// phpgw::import_class('registration.socontrol_area');
+
+/*
+ include_class('registration', 'check_list', 'inc/model/');
+ include_class('registration', 'date_generator', 'inc/component/');
+ include_class('registration', 'status_checker', 'inc/helper/');
+ include_class('registration', 'date_helper', 'inc/helper/');
+*/
+ class registration_uipending extends registration_uicommon
+ {
+ var $cat_id;
+ var $start;
+ var $query;
+ var $sort;
+ var $order;
+ var $filter;
+ var $currentapp;
+ var $type_id;
+ var $location_code;
+
+ private $so_control_area;
+ private $so_control;
+ private $so_check_list;
+ private $so_control_item;
+ private $so_check_item;
+ private $so_procedure;
+
+ var $public_functions = array
+ (
+ 'index'
=> true,
+ 'query'
=> true,
+ 'view_locations_for_control' => true,
+ 'register_control_to_location' => true,
+ 'register_control_to_location_2' => true,
+ 'get_locations_for_control' => true,
+ 'get_location_category' => true,
+ 'get_district_part_of_town' => true
+ );
+
+ function __construct()
+ {
+ parent::__construct();
+
+ $this->bo =
CreateObject('registration.bopending',true);
+ $this->bocommon = &
$this->bo->bocommon;
+
+ $this->type_id =
$this->bo->type_id;
+
+ $this->start =
$this->bo->start;
+ $this->query =
$this->bo->query;
+ $this->sort =
$this->bo->sort;
+ $this->order =
$this->bo->order;
+ $this->filter =
$this->bo->filter;
+ $this->cat_id =
$this->bo->cat_id;
+ $this->part_of_town_id =
$this->bo->part_of_town_id;
+ $this->district_id =
$this->bo->district_id;
+ $this->status =
$this->bo->status;
+ $this->allrows =
$this->bo->allrows;
+ $this->lookup =
$this->bo->lookup;
+ $this->location_code =
$this->bo->location_code;
+
+ self::set_active_menu('registration::pending');
+ }
+
+ function index()
+ {
+ if(phpgw::get_var('save_location'))
+ {
+ //add component to control using component item
ID
+ $items_checked = array();
+ $items = phpgw::get_var('values_assign');
+ $item_arr = explode('|',$items);
+ foreach($item_arr as $item)
+ {
+ $items_checked[] = explode(';',$item);
+ }
+ //var_dump($items_checked);
+
+ $control_id = phpgw::get_var('control_id');
+ //$location_code =
phpgw::get_var('location_code');
+
+ $control_location = null;
+ $control_location_id = 0;
+
+ foreach($items_checked as $location_code)
+ {
+ $control_location =
$this->so_control->get_control_location($control_id, $location_code[0]);
+
+ if($control_location == null )
+ {
+ $control_location_id =
$this->so_control->register_control_to_location($control_id, $location_code[0]);
+ }
+ }
+
+/* if($control_location_id > 0)
+ return json_encode( array( "status" =>
"saved" ) );
+ else
+ return json_encode( array( "status" =>
"not_saved" ) );
+*/
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'registration.uipending.index'));
+
+ }
+ else
+ {
+ if(phpgw::get_var('phpgw_return_as') == 'json')
+ {
+ return $this->query();
+ }
+
+ $status_list = array
+ (
+ array
+ (
+ 'id' => 0,
+ 'name' => lang('Select status')
+ ),
+ array
+ (
+ 'id' => 1,
+ 'name' => lang('approved')
+ ),
+ array
+ (
+ 'id' => 2,
+ 'name' => lang('pending')
+ ),
+ );
+
+ $data = array(
+ 'filter_form'
=> array(
+ 'status_list'
=> array('options' => $status_list)
+ ),
+ 'datatable' => array(
+ 'source' =>
self::link(array('menuaction' => 'registration.uipending.query',
'phpgw_return_as' => 'json')),
+ 'field' => array(
+ array(
+ 'key' =>
'reg_id',
+ 'label' =>
lang('id'),
+ 'sortable'
=> true,
+ 'formatter' =>
'formatLinkPending'
+ ),
+ array(
+ 'key' =>
'reg_lid',
+ 'label' =>
lang('user'),
+ 'sortable'
=> true
+ ),
+ array(
+ 'key' =>
'reg_dla',
+ 'label' =>
lang('time'),
+ 'sortable'
=> true
+ ),
+ array(
+ 'key' =>
'reg_approved',
+ 'label' =>
lang('approved'),
+ 'sortable'
=> true
+ ),
+ array(
+ 'key'
=> 'checked',
+ 'label'
=> lang('approve'),
+
'sortable' => false,
+
'formatter' => 'YAHOO.widget.DataTable.formatCheckbox',
+
'className' => 'mychecks'
+ ),
+ array(
+ 'key' =>
'actions',
+ 'hidden' => true
+ ),
+ array(
+ 'key' =>
'labels',
+ 'hidden' => true
+ ),
+ array(
+ 'key' => 'ajax',
+ 'hidden' => true
+ ),array(
+ 'key' =>
'parameters',
+ 'hidden' => true
+ )
+ )
+ )
+ );
+
+ phpgwapi_yui::load_widget('paginator');
+
+ self::add_javascript('registration', 'yahoo',
'pending.index.js');
+// self::add_javascript('registration',
'registration', 'jquery.js');
+// self::add_javascript('registration',
'registration', 'ajax.js');
+
+
self::render_template_xsl(array('pending_users', 'common'), $data);
+ }
+ }
+
+ // Returns locations for a control
+ public function get_locations_for_control()
+ {
+ $control_id = phpgw::get_var('control_id');
+
+ if(is_numeric($control_id) & $control_id > 0)
+ {
+ $locations_for_control_array =
$this->so_control->get_locations_for_control($control_id);
+
+ foreach($locations_for_control_array as
$location)
+ {
+ $results['results'][]= $location;
+ }
+
+ $results['total_records'] = count(
$locations_for_control_array );
+ $results['start'] = 1;
+ $results['sort'] = 'location_code';
+ }
+ else
+ {
+ $results['total_records'] = 0;
+ }
+
+ return $this->yui_results($results);
+ }
+
+ public function query()
+ {
+ $status_id = phpgw::get_var('status_id');
+
+ $this->bo->sort = "ASC";
+ $this->bo->start = phpgw::get_var('startIndex');
+
+ $user_list = $this->bo->read(array('user_id' =>
$user_id, 'role_id' =>$role_id,
'type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,
+
'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run'
=>$dry_run));
+
+ foreach($user_list as $user)
+ {
+ $results['results'][]= $user;
+ }
+
+ $results['total_records'] = $this->bo->total_records;
+ $results['start'] = $this->start;
+ $results['sort'] = 'location_code';
+ $results['dir'] = "ASC";
+
+ array_walk($results['results'], array($this,
'add_links'), array($type));
+
+ return $this->yui_results($results);
+ }
+
+ public function register_control_to_location_2()
+ {
+ $control_id = phpgw::get_var('control_id');
+ $location_code = phpgw::get_var('location_code');
+
+ $control_location = null;
+ $control_location_id = 0;
+
+ $control_location =
$this->so_control->get_control_location($control_id, $location_code);
+
+ if($control_location == null ){
+
+ $control_location_id =
$this->so_control->register_control_to_location($control_id, $location_code);
+ }
+
+ if($control_location_id > 0)
+ return json_encode( array( "status" => "saved"
) );
+ else
+ return json_encode( array( "status" =>
"not_saved" ) );
+ }
+
+ public function add_actions(&$value, $key, $params)
+ {
+ unset($value['query_location']);
+
+ $value['ajax'] = array();
+ $value['actions'] = array();
+ $value['labels'] = array();
+ $value['parameters'] = array();
+/*
+ $value['ajax'][] = true;
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'registration.uipending.register_control_to_location_2','location_code' =>
$value['location_code'], 'phpgw_return_as' => 'json')));
+ $value['labels'][] = lang('add_location');
+ $value['parameters'][] = "control_id";
+ */
+ }
+
+ /*
+ * Return categories based on chosen location
+ */
+ public function get_location_category()
+ {
+ $type_id = phpgw::get_var('type_id');
+ $category_types =
$this->bocommon->select_category_list(array(
+
'format'=>'filter',
+
'selected' => 0,
+
'type'
=>'location',
+
'type_id'
=>$type_id,
+
'order'=>'descr'
+
));
+ $default_value = array ('id'=>'','name'=>lang('no
category selected'));
+ array_unshift($category_types,$default_value);
+ return json_encode( $category_types );
+ }
+
+ /*
+ * Return parts of town based on chosen district
+ */
+ public function get_district_part_of_town()
+ {
+ $district_id = phpgw::get_var('district_id');
+ $part_of_town_list =
$this->bocommon->select_part_of_town('filter',null,$district_id);
+ $default_value = array ('id'=>'','name'=>lang('no part
of town'));
+ array_unshift($part_of_town_list,$default_value);
+
+ return json_encode( $part_of_town_list );
+ }
+ }
Added: trunk/registration/js/yahoo/pending.index.js
===================================================================
--- trunk/registration/js/yahoo/pending.index.js
(rev 0)
+++ trunk/registration/js/yahoo/pending.index.js 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -0,0 +1,98 @@
+ var oArgs_edit = {menuaction:'registration.uipending.edit'};
+ var edit_Url = phpGWLink('index.php', oArgs_edit);
+
+ formatLinkPending = function(elCell, oRecord, oColumn, oData)
+ {
+ var id = oRecord.getData(oColumn.key);
+ elCell.innerHTML = '<a href="' + edit_Url + '&id=' + id +
'">Link</a>';
+ };
+
+ function checkAll(myclass)
+ {
+ controls = YAHOO.util.Dom.getElementsByClassName(myclass);
+ for(i=0;i<controls.length;i++)
+ {
+ //for class=mychecks, they have to be interchanged
+ //checkbox is located within td->div->input. To get the
input-object, use controls[i].children[0].children[0]
+ if(myclass=='mychecks')
+ {
+ if(controls[i].children[0].children[0].checked)
+ {
+
controls[i].children[0].children[0].checked = false;
+ }
+ else
+ {
+
controls[i].children[0].children[0].checked = true;
+ }
+ }
+ //for the rest, always id checked
+ else
+ {
+ controls[i].children[0].children[0].checked =
true;
+ }
+ }
+ }
+
+ function saveLocationToControl()
+ {
+ var control_id_value =
document.getElementById('control_id').value;
+
+ if( !(control_id_value > 0) ){
+ var choose_control_elem =
document.getElementById('choose_control');
+ var error_elem =
YAHOO.util.Dom.getElementsByClassName('error_msg')[0];
+
+ error_elem.style.display = 'block';
+
+ return false;
+ }else{
+ var error_elem =
YAHOO.util.Dom.getElementsByClassName('error_msg')[0];
+ error_elem.style.display = 'none';
+ }
+
+ var divs =
YAHOO.util.Dom.getElementsByClassName('location_submit');
+ var mydiv = divs[divs.length-1];
+
+ // styles for dont show
+
+
+ valuesForPHP =
YAHOO.util.Dom.getElementsByClassName('mychecks');
+ var values_return = ""; //new Array();
+
+ for(i=0;i<valuesForPHP.length;i++)
+ {
+ if(valuesForPHP[i].children[0].children[0].checked)
+ {
+ if(values_return != "")
+ values_return
+="|"+valuesForPHP[i].parentNode.firstChild.firstChild.firstChild.firstChild.nodeValue+';'+valuesForPHP[i].children[0].children[0].value;
+ else
+ values_return +=
valuesForPHP[i].parentNode.firstChild.firstChild.firstChild.firstChild.nodeValue+';'+valuesForPHP[i].children[0].children[0].value;
+ }
+ }
+
+ if( !(values_return.length > 0) ){
+ var datatable_container_elem =
document.getElementById('datatable-container');
+ var error_elem =
YAHOO.util.Dom.getElementsByClassName('error_msg')[1];
+
+ error_elem.style.display = 'block';
+
+ return false;
+ }else{
+ var error_elem =
YAHOO.util.Dom.getElementsByClassName('error_msg')[1];
+ error_elem.style.display = 'none';
+ }
+
+ mydiv.style.display = "none";
+
+ var returnfield = document.createElement('input');
+ returnfield.setAttribute('name', 'values_assign');
+ returnfield.setAttribute('type', 'text');
+ returnfield.setAttribute('value', values_return);
+ mydiv.appendChild(returnfield);
+
+ var control_id_field = document.createElement('input');
+ control_id_field.setAttribute('name', 'control_id');
+ control_id_field.setAttribute('type', 'text');
+ control_id_field.setAttribute('value', control_id_value);
+ mydiv.appendChild(control_id_field);
+ }
+
Modified: trunk/registration/setup/setup.inc.php
===================================================================
--- trunk/registration/setup/setup.inc.php 2012-03-24 20:11:29 UTC (rev
9030)
+++ trunk/registration/setup/setup.inc.php 2012-03-25 19:28:01 UTC (rev
9031)
@@ -16,7 +16,7 @@
/* Basic information about this app */
$setup_info['registration']['name'] =
'registration';
- $setup_info['registration']['version'] = '0.8.2';
+ $setup_info['registration']['version'] = '0.8.3';
$setup_info['registration']['app_order'] = '90';
$setup_info['registration']['enable'] = 2;
$setup_info['registration']['app_group'] = 'other';
Modified: trunk/registration/setup/tables_current.inc.php
===================================================================
--- trunk/registration/setup/tables_current.inc.php 2012-03-24 20:11:29 UTC
(rev 9030)
+++ trunk/registration/setup/tables_current.inc.php 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -23,6 +23,7 @@
'reg_lid' => array('type' => 'varchar',
'precision' => 255,'nullable' => False),
'reg_info' => array('type' => 'text','nullable'
=> False),
'reg_dla' => array('type' => 'int', 'precision'
=> 4,'nullable' => False)
+ 'reg_approved' => array('type' => 'int',
'precision' => 2,'nullable' => true)
),
'pk' => array(),
'fk' => array(),
Modified: trunk/registration/setup/tables_update.inc.php
===================================================================
--- trunk/registration/setup/tables_update.inc.php 2012-03-24 20:11:29 UTC
(rev 9030)
+++ trunk/registration/setup/tables_update.inc.php 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -14,8 +14,6 @@
$test[] = '0.8.1';
function registration_upgrade0_8_1()
{
- global $setup_info, $phpgw_setup;
-
$phpgw_setup->oProc->CreateTable('phpgw_reg_fields', array(
'fd' => array(
'field_name' => array('type' => 'varchar',
'precision' => 255,'nullable' => False),
@@ -31,8 +29,20 @@
'uc' => array()
));
- $setup_info['registration']['currentver'] = '0.8.2';
- return $setup_info['registration']['currentver'];
+ $GLOBALS['setup_info']['registration']['currentver'] = '0.8.2';
+ return $GLOBALS['setup_info']['registration']['currentver'];
}
-?>
\ No newline at end of file
+ $test[] = '0.8.2';
+ function registration_upgrade0_8_2()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_reg_accounts','reg_approved',array('type'
=> 'int','precision' => 2, 'nullable' => True));
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['registration']['currentver'] =
'0.8.3';
+ return
$GLOBALS['setup_info']['registration']['currentver'];
+ }
+ }
Added: trunk/registration/templates/base/app_data.xsl
===================================================================
--- trunk/registration/templates/base/app_data.xsl
(rev 0)
+++ trunk/registration/templates/base/app_data.xsl 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -0,0 +1,4 @@
+<!-- $Id: app_data.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+ <xsl:template name="dummy">
+ </xsl:template>
+
Added: trunk/registration/templates/base/common.xsl
===================================================================
--- trunk/registration/templates/base/common.xsl
(rev 0)
+++ trunk/registration/templates/base/common.xsl 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -0,0 +1,535 @@
+<!-- $Id: common.xsl 8307 2011-12-15 08:59:28Z vator $ -->
+<xsl:template name="common" xmlns:php="http://php.net/xsl">
+
+
+<script type="text/javascript">
+
+<![CDATA[
+
+/**
+ * Javascript for the controller module. Holds datasource init functions and
form helpers.
+ *
+ * Functions and objects within this file are kept in the YAHOO.controller
namespace.
+ */
+
+ YAHOO.namespace('controller');
+
+ // Holds data source setup funtions
+ YAHOO.controller.setupDatasource = new Array();
+
+ //Holds all data sources
+ YAHOO.controller.datatables = new Array();
+
+ counter = 0;
+ // Adds data source setup funtions
+ function setDataSource(source_url, column_defs, form_id, filter_ids,
container_id, paginator_id, datatable_id,rel_id, editor_action,
disable_left_click) {
+ YAHOO.controller.setupDatasource.push(
+ function() {
+ this.url = source_url;
+ this.columns = column_defs;
+ this.form = form_id;
+ this.filters = filter_ids;
+ this.container = container_id;
+ this.paginator = paginator_id;
+ this.tid = datatable_id;
+ this.related_datatable = rel_id;
+ this.editor_action = editor_action;
+ if(disable_left_click) {
+ this.disable_left_click = true;
+ } else {
+ this.disable_left_click = false;
+ }
+ }
+ );
+ }
+
+ // Reloads all data sources that are necessary based on the selected
related datatable
+ function reloadDataSources(selected_datatable){
+
+ //... hooks into the regular callback function
(onDataReturnInitializeTable) call to set empty payload array
+ var loaded = function ( sRequest , oResponse , oPayload ) {
+ var payload = new Array();
+ this.onDataReturnInitializeTable( sRequest , oResponse
, payload );
+ }
+
+ //... refresh the selected data tables
+
selected_datatable.getDataSource().sendRequest('',{success:loaded,
scope:selected_datatable});
+
+ //... traverse all datatables and refresh related (to the
selected) data tables
+ for(var i=0; i<YAHOO.controller.datatables.length; i++){
+ var datatable = YAHOO.controller.datatables[i];
+
+ for(var j=0;j<selected_datatable.related.length;j++){
+ var curr_related =
selected_datatable.related[j];
+
+ if(datatable.tid == curr_related){
+
datatable.getDataSource().sendRequest('',{success:loaded,scope: datatable});
+ }
+ }
+ }
+ }
+
+ var highlightEditableCell = function(oArgs) {
+ var elCell = oArgs.target;
+ if(YAHOO.util.Dom.hasClass(elCell, "yui-dt-editable")) {
+ this.highlightCell(elCell);
+ }
+ };
+
+ // Wraps data sources setup logic
+ function dataSourceWrapper(source_properties,pag) {
+
+ this.properties = source_properties;
+ this.paginator = pag;
+
+ //... prepare base url
+ this.url = this.properties.url;
+ if(this.url[length-1] != '&') {
+ this.url += '&';
+ }
+
+ //... set up a new data source
+ this.source = new YAHOO.util.DataSource(this.url);
+
+ this.source.responseType = YAHOO.util.DataSource.TYPE_JSON;
+ this.source.connXhrMode = "queueRequests";
+
+ this.source.responseSchema = {
+ resultsList: "ResultSet.Result",
+ fields: this.properties.columns,
+ metaFields : {
+ totalRecords: "ResultSet.totalRecords"
+ }
+ };
+
+ //... set up a new data table
+
+ ]]>
+
+ this.table = new YAHOO.widget.DataTable(
+ this.properties.container,
+ this.properties.columns,
+ this.source,
+ {
+ paginator: this.paginator,
+ dynamicData: true,
+ MSG_EMPTY: '<xsl:value-of
select="php:function('lang', 'DATATABLE_MSG_EMPTY')"/>',
+ MSG_ERROR: '<xsl:value-of
select="php:function('lang', 'DATATABLE_MSG_ERROR')"/>',
+ MSG_LOADING: '<xsl:value-of
select="php:function('lang', 'DATATABLE_MSG_LOADING')"/>'
+ }
+ );
+
+ <![CDATA[
+
+ //... set table properties
+ this.table.related = this.properties.related_datatable;
+ this.table.tid = this.properties.tid;
+ this.table.container_id = this.properties.container;
+ this.table.editor_action = this.properties.editor_action;
+
+ //... push the data table on a stack
+ YAHOO.controller.datatables.push(this.table);
+
+ //... ?
+ this.table.handleDataReturnPayload = function(oRequest,
oResponse, oPayload) {
+ if(oPayload){
+ oPayload.totalRecords =
oResponse.meta.totalRecords;
+ return oPayload;
+ }
+ }
+
+ //... create context menu for each record after the table has
loaded the data
+ this.table.doAfterLoadData = function() {
+ onContextMenuBeforeShow = function(p_sType, p_aArgs)
+ {
+ 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);
+ }
+ }
+
+ onContextMenuHide = function(p_sType, p_aArgs)
+ {
+ if (this.getRoot() == this && oSelectedTR)
+ {
+ oSelectedTR.style.backgroundColor = ""
;
+ oSelectedTR.style.color = "";
+ YAHOO.util.Dom.removeClass(oSelectedTR,
prefixSelected);
+ }
+ }
+
+ var records = this.getRecordSet();
+
+ var validRecords = 0;
+ for(var i=0; i<records.getLength(); i++) {
+ var record = records.getRecord(i);
+
+ if(record == null)
+ {
+ continue;
+ }
+ else
+ {
+ validRecords++;
+ }
+
+ // use a global counter to create unique names
(even for the same datatable) for all context menues on the page
+ var menuName = this.container_id + "_cm_" +
counter;
+ counter++;
+
+ //... add menu items with label and handler
function for click events
+ var labels = record.getData().labels;
+
+ //create a context menu that triggers on the
HTML row element
+ record.menu = new
YAHOO.widget.ContextMenu(menuName,{trigger:this.getTrEl(validRecords -1
),itemdata: labels, lazyload: true});
+
+ //... subscribe handler for click events
+
record.menu.clickEvent.subscribe(onContextMenuClick, this);
+ record.menu.subscribe("beforeShow",
onContextMenuBeforeShow);
+ record.menu.subscribe("hide",
onContextMenuHide);
+
+ //... render the menu on the related table row
+
record.menu.render(this.getTrEl(validRecords-1));
+ }
+
+
+ }
+
+ //... calback methods for handling ajax calls
+ var ajaxResponseSuccess = function(o){
+ reloadDataSources(this.args);
+ };
+
+ var ajaxResponseFailure = function(o){
+ reloadDataSources(this.args);
+ };
+
+ //...create a handler for context menu clicks
+ var onContextMenuClick = function(eventString, args, table) {
+ //... the argument holds the selected index number in
the context menu
+ var task = args[1];
+
+ //... only act on a data table
+ if(table instanceof YAHOO.widget.DataTable) {
+ //... retrieve the record based on the selected
table row
+ var row =
table.getTrEl(this.contextEventTarget);
+ var record = table.getRecord(row);
+ var requestUrl = "";
+
+ if(record.getData().parameters[task.index]){
+ var parameter_id =
record.getData().parameters[0];
+
+ var parameter_value =
YAHOO.util.Dom.get(parameter_id).value;
+ requestUrl = record.getData().actions[
task.index ] + "&" + parameter_id + "=" + parameter_value;
+ }
+
+ //... check whether this action should be an
AJAX call
+ if( record.getData().ajax[task.index] ) {
+
+ var alertStatus = false;
+
+ // Check if confirm box should be
displayed before request is executed
+ if( record.getData().alert != null )
+ alertStatus =
record.getData().alert[0];
+
+ if( alertStatus ){
+ // Display confirm box with
message
+ var alertMessage =
record.getData().alert[1];
+ var answer = confirm(
alertMessage );
+
+ // Abort request if user clicks
the abort button
+ if (!answer){
+ return false;
+ }
+ }
+
+ if(requestUrl){
+ var request =
YAHOO.util.Connect.asyncRequest(
+ 'GET',
+ requestUrl,
+ {
+ success:
ajaxResponseSuccess,
+ success:
ajaxResponseFailure,
+ args: table
+ });
+ }
+ } else {
+
+ window.location = requestUrl;
+ }
+ }
+ };
+
+ // Handle mouseover and click events for inline editing
+ this.table.subscribe("cellMouseoverEvent",
highlightEditableCell);
+ this.table.subscribe("cellMouseoutEvent",
this.table.onEventUnhighlightCell);
+ this.table.subscribe("cellClickEvent",
this.table.onEventShowCellEditor);
+
+ this.table.subscribe("editorSaveEvent", function(oArgs) {
+ var field = oArgs.editor.getColumn().field;
+ var value = oArgs.newData;
+ var id = oArgs.editor.getRecord().getData().id;
+ var action = oArgs.editor.getDataTable().editor_action;
+
+ // Translate to unix time if the editor is a calendar.
+ if (oArgs.editor._sType == 'date') {
+ var selectedDate =
oArgs.editor.calendar.getSelectedDates()[0];
+ //alert("selDate1: " + selectedDate);
+ // Make sure we're at midnight GMT
+ selectedDate = selectedDate.toString().split("
");
+ //for(var e=0;e<selectedDate.length;e++){
+ // alert("element " + e + ": " +
selectedDate[e]);
+ //}
+ if(selectedDate[3] == "00:00:00"){
+ // alert("seldate skal byttes!");
+ selectedDate =
selectedDate.slice(0,3).join(" ") + " " + selectedDate[5] + " 00:00:00 GMT";
+ }
+ else{
+ selectedDate =
selectedDate.slice(0,4).join(" ") + " 00:00:00 GMT";
+ }
+ //selectedDate =
selectedDate.toString().split(" ").slice(0, 4).join(" ") + " 00:00:00 GMT";
+ //alert("selDate2: " + selectedDate);
+ var value = Math.round(Date.parse(selectedDate)
/ 1000);
+ //alert("selDate3 value: " + value);
+ }
+
+ var request = YAHOO.util.Connect.asyncRequest(
+ 'GET',
+ 'index.php?menuaction=' + action +
"&field=" + field + "&value=" + value + "&id=" + id,
+ {
+ success: ajaxResponseSuccess,
+ failure: ajaxResponseFailure,
+ args:oArgs.editor.getDataTable()
+ }
+ );
+ });
+
+ // Don't set the row to be left-clickable if the table is
editable by inline editors.
+ // In that case we use cellClickEvents instead
+ var table_should_be_clickable = true;
+ for (i in this.properties.columns) {
+ if (this.properties.columns[i].editor) {
+ table_should_be_clickable = false;
+ }
+ }
+
+ if (table_should_be_clickable &&
!this.properties.disable_left_click) {
+ //... create a handler for regular clicks on a table row
+ this.table.subscribe("rowClickEvent", function(e,obj) {
+ YAHOO.util.Event.stopEvent(e);
+
+ //... trigger first action on row click
+ var row = obj.table.getTrEl(e.target);
+ if(row) {
+ var record = obj.table.getRecord(row);
+
+ //... check whether this action should
be an AJAX call
+ if(record.getData().ajax[0]) {
+ var request =
YAHOO.util.Connect.asyncRequest(
+ 'GET',
+ //... execute first
action
+
record.getData().actions[0],
+ {
+ success:
ajaxResponseSuccess,
+ failure:
ajaxResponseFailure,
+ args:obj.table
+ }
+ );
+ } else {
+ //... execute first action
+ window.location =
record.getData().actions[0];
+ }
+ }
+ },this);
+
+ //... highlight rows on mouseover. This too only
happens if the table is
+ // not editable.
+ this.table.subscribe("rowMouseoverEvent",
this.table.onEventHighlightRow);
+ this.table.subscribe("rowMouseoutEvent",
this.table.onEventUnhighlightRow);
+ }
+
+
+ //... create context menues when the table renders
+ this.table.subscribe("renderEvent",this.table.doAfterLoadData);
+
+ //... listen for form submits and filter changes
+
YAHOO.util.Event.addListener(this.properties.form,'submit',formListener,this,true);
+ YAHOO.util.Event.addListener(this.properties.filters,
'change',formListener,this,true);
+ }
+
+
+ // Set up data sources when the document has loaded
+ YAHOO.util.Event.addListener(window, "load", function() {
+ var i = 0;
+ while(YAHOO.controller.setupDatasource.length > 0){
+ //... create a variable name, assign set up function to
that variable and instantiate properties
+ variableName = "YAHOO.controller.datasource" + i;
+ eval(variableName + " =
YAHOO.controller.setupDatasource.shift()");
+ var source_properties = eval("new " + variableName +
"()");
+
+]]>
+ // ... create a paginator for this datasource
+
+ var pag = new YAHOO.widget.Paginator({
+ rowsPerPage: 10,
+ alwaysVisible: true,
+ rowsPerPageOptions: [5, 10, 25, 50, 100, 200],
+ firstPageLinkLabel: "<< <xsl:value-of
select="php:function('lang', 'first')"/>",
+ previousPageLinkLabel: "< <xsl:value-of
select="php:function('lang', 'previous')"/>",
+ nextPageLinkLabel: "<xsl:value-of
select="php:function('lang', 'next')"/> >",
+ lastPageLinkLabel: "<xsl:value-of
select="php:function('lang', 'last')"/> >>",
+ template :
"{RowsPerPageDropdown}<xsl:value-of select="php:function('lang',
'elements_pr_page')"/>.{CurrentPageReport}<br/> {FirstPageLink}
{PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}",
+ pageReportTemplate : "<xsl:value-of
select="php:function('lang', 'shows_from')"/> {startRecord} <xsl:value-of
select="php:function('lang', 'to')"/> {endRecord} <xsl:value-of
select="php:function('lang', 'of_total')"/> {totalRecords}.",
+ containers: [source_properties.paginator]
+ });
+
+<![CDATA[
+
+ pag.render();
+
+ //... send data source properties and paginator to
wrapper function
+ this.wrapper = new dataSourceWrapper(source_properties,
pag);
+ i+=1;
+/*
+ <?php
+ $populate = phpgw::get_var('populate_form');
+ if(isset($populate)){?>
+ var qs =
YAHOO.controller.serializeForm(source_properties.form);
+ this.wrapper.source.liveData =
this.wrapper.url + qs + '&';
+ this.wrapper.source.sendRequest('',
{success: function(sRequest, oResponse, oPayload) {
+
this.wrapper.table.onDataReturnInitializeTable(sRequest, oResponse,
this.wrapper.paginator);
+ }, scope: this});
+ <?php }
+ ?>
+*/
+ // XXX: Create generic column picker for all datasources
+
+ // Shows dialog, creating one when necessary
+ var newCols = true;
+ var showDlg = function(e) {
+ YAHOO.util.Event.stopEvent(e);
+
+ if(newCols) {
+ // Populate Dialog
+ // Using a template to create elements
for the SimpleDialog
+ var allColumns =
this.wrapper.table.getColumnSet().keys;
+ var elPicker =
YAHOO.util.Dom.get("dt-dlg-picker");
+ var elTemplateCol =
document.createElement("div");
+ YAHOO.util.Dom.addClass(elTemplateCol,
"dt-dlg-pickercol");
+ var elTemplateKey =
elTemplateCol.appendChild(document.createElement("span"));
+ YAHOO.util.Dom.addClass(elTemplateKey,
"dt-dlg-pickerkey");
+ var elTemplateBtns =
elTemplateCol.appendChild(document.createElement("span"));
+ YAHOO.util.Dom.addClass(elTemplateBtns,
"dt-dlg-pickerbtns");
+ var onclickObj = {fn:handleButtonClick,
obj:this, scope:false };
+
+ // Create one section in the
SimpleDialog for each Column
+ var elColumn, elKey, elButton,
oButtonGrp;
+
+ for(var
i=0,l=allColumns.length;i<l;i++) {
+ var oColumn = allColumns[i];
+ if(oColumn.label !=
'unselectable') { // We haven't marked the column as unselectable for the user
+ // Use the template
+ elColumn =
elTemplateCol.cloneNode(true);
+
+ // Write the Column key
+ elKey =
elColumn.firstChild;
+ elKey.innerHTML =
oColumn.label;
+
+ // Create a ButtonGroup
+ oButtonGrp = new
YAHOO.widget.ButtonGroup({
+ id:
"buttongrp"+i,
+ name:
oColumn.getKey(),
+ container:
elKey.nextSibling
+ });
+ oButtonGrp.addButtons([
+ { label: "Vis",
value: "Vis", checked: ((!oColumn.hidden)), onclick: onclickObj},
+ { label:
"Skjul", value: "Skjul", checked: ((oColumn.hidden)), onclick: onclickObj}
+ ]);
+
+
elPicker.appendChild(elColumn);
+ }
+ }
+
+ newCols = false;
+ }
+
+ myDlg.show();
+ };
+
+ var storeColumnsUrl = YAHOO.controller.storeColumnsUrl;
+ var hideDlg = function(e) {
+ this.hide();
+ // After we've hidden the dialog we send a post
call to store the columns the user has selected
+ var postData = 'values[save]=1';
+ var allColumns =
wrapper.table.getColumnSet().keys;
+ for(var i=0; i < allColumns.length; i++) {
+ if(!allColumns[i].hidden){
+ postData +=
'&values[columns][]=' + allColumns[i].getKey();
+ }
+ }
+
+ YAHOO.util.Connect.asyncRequest('POST',
storeColumnsUrl, null, postData);
+ };
+
+ var handleButtonClick = function(e, oSelf) {
+ var sKey = this.get("name");
+ if(this.get("value") === "Skjul") {
+ // Hides a Column
+ wrapper.table.hideColumn(sKey);
+ } else {
+ // Shows a Column
+ wrapper.table.showColumn(sKey);
+ }
+ };
+
+ // Create the SimpleDialog
+ YAHOO.util.Dom.removeClass("dt-dlg", "inprogress");
+ var myDlg = new YAHOO.widget.SimpleDialog("dt-dlg", {
+ width: "30em",
+ visible: false,
+ modal: false, // modal: true doesn't work for
some reason - the dialog becomes unclickable
+ buttons: [
+ {text:"Lukk", handler:hideDlg}
+ ],
+ fixedcenter: true,
+ constrainToViewport: true
+ });
+ myDlg.render();
+
+ // Nulls out myDlg to force a new one to be created
+ wrapper.table.subscribe("columnReorderEvent",
function(){
+ newCols = true;
+ YAHOO.util.Event.purgeElement("dt-dlg-picker",
true);
+ YAHOO.util.Dom.get("dt-dlg-picker").innerHTML =
"";
+ }, this, true);
+
+ // Hook up the SimpleDialog to the link
+ YAHOO.util.Event.addListener("dt-options-link",
"click", showDlg, this, true);
+ }
+ });
+
+ /*
+ * Listen for events in form. Serialize all form elements. Stop
+ * the original request and send new request.
+ */
+ function formListener(event){
+ YAHOO.util.Event.stopEvent(event);
+ var qs = YAHOO.portico.serializeForm(this.properties.form);
+ this.source.liveData = this.url + qs + '&';
+ this.source.sendRequest('', {success: function(sRequest,
oResponse, oPayload) {
+ this.table.onDataReturnInitializeTable(sRequest,
oResponse, this.paginator);
+ }, scope: this});
+ }
+
+]]>
+
+</script>
+</xsl:template>
Added: trunk/registration/templates/base/css/base.css
===================================================================
--- trunk/registration/templates/base/css/base.css
(rev 0)
+++ trunk/registration/templates/base/css/base.css 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -0,0 +1,1398 @@
+#invoice_details { float: left; width: 30%; }
+#list_navigation { float: left; width: 30%; }
+#user_messages { float: right; width: 40%;}
+#contract_lists {width: 100%; float: left; background-color: #EFEFEF; border:
1px solid #ABABAB; padding-left: 1em; margin-top: 1em;}
+form#invoice_run {margin: 2em;}
+form#invoice_run th {
+ background-color: #CDCDCD;
+ padding: 5px;
+ border: 1px solid #ABABAB;
+ font-weight: bolder;
+ }
+
+div#contract_lists td {
+ margin:0;
+ padding:4px 10px;
+}
+form#invoice_run td {
+ border: 1px solid #CDCDCD;
+ }
+
+
+div#invoice_details dt{
+ float:left;
+ font-weight: bolder;
+ margin-right: 1em;
+}
+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 {
+ margin-left: 0.3em;
+ margin-right: 0,3em;
+ font-style: normal;
+ font-size: 13px;
+}
+
+#content {
+ margin: 2em 1em;
+}
+.clr { clear: both;}
+
+#dashboard {padding: 1em;}
+#dashborad_column_1 { float:left; width:50%;}
+#dashboard_column_2 { margin-left:50%; width:50%;}
+
+#inactive {
+ background-color: #ff5555;
+ width: 10em;
+ padding: 1em;
+ border: 0.2em dotted #000000;
+ letter-spacing: 2px;
+}
+#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 dt,
+dl.proplist-col dt {
+ font-style: italic;
+ font-weight: bolder;
+ font-size: 90%;
+ margin: .8em 0 .1em 0;
+}
+
+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: 2em;
+}
+.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;
+}
+#toolbar {
+ width: 100%;
+ background-color: #eee;
+ border: 1px solid #bbb;
+ margin-bottom: 0em;
+ padding: 10px 30px;
+}
+
+#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;
+}
+#week-selector { margin: 1em 0;}
+#week-selector li { display: inline; padding-right: .5em;}
+
+#schedule_container tr td { border-top: 1px solid #ccc; background: white;
white-space: nowrap; }
+#schedule_container tr td:first-child { background: #eee; }
+#schedule_container tr.time td { border-top: 1px solid #444;}
+#schedule_container .color1 { background: #ccf;}
+#schedule_container .color2 { background: #cfc;}
+#schedule_container .color3 { background: #fcc;}
+#schedule_container .color4 { background: #ffb;}
+#schedule_container .color5 { background: #bff;}
+#schedule_container .color6 { background: #fbf;}
+
+#boundary-table td, #boundary-table th {
+ padding: .1em .2em;
+}
+
+.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;
+}
+/*
+fieldset h3 {
+ display:block;
+ float:left;
+ line-height:1.3em;
+ margin:0;
+ width:120px;
+}
+*/
+/* Set up common form styles. TODO: needs refinement. */
+legend, label, input, select {
+ margin: 0 13px 0 0;
+ padding: 2px;
+}
+
+label {
+ line-height:1.5em;
+}
+
+
+
+fieldset {
+ border-bottom:0px solid #ccc;
+ padding:5px 0px 5px 10px;
+}
+
+h1 em {
+ font-style:italic;
+}
+
+div.info, div.error, div.warning {
+ font-weight: normal;
+ margin:20px;
+ padding:5px;
+ font-size:1.1em;
+ text-align: left;
+}
+p.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;
+}
+
+.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;
+}
+
+
+/* ======================================= ITEM LIST
========================================= */
+
+ul.itemlist {
+ position: relative;
+}
+ul.itemlist li {
+ padding: 3px 0;
+}
+
+ul.itemlist li.odd{
+ background: none repeat scroll 0 0 #DBE7F5;
+}
+
+ul.itemlist h3 {
+ font-size: 18px;
+ margin: 0 0 5px;
+}
+
+ul.groups {
+ position: relative;
+}
+ul.groups li {
+ padding: 3px 0;
+}
+
+ul.groups li.odd{
+ background: none repeat scroll 0 0 #DBE7F5;
+}
+
+ul.groups h3 {
+ font-size: 18px;
+ margin: 0 0 5px;
+}
+
+.drag_group {
+ width: 650px;
+}
+
+/* ======================================= EXPAND LIST
========================================= */
+
+ul.expand_list h4 {
+ cursor: pointer;
+ font-size: 17px;
+ margin-bottom: 6px;
+ margin-top: 0;
+}
+
+ul.expand_list li ul {
+ display:none;
+ margin-left:21px;
+}
+
+ul.expand_list li ul li {
+ margin-bottom: 3px;
+ padding: 3px;
+}
+
+ul.expand_list input {
+ margin: 0 8px 0 5px;
+}
+
+ul.expand_list h4 span {
+ padding-left: 5px;
+ vertical-align: middle;
+}
+
+.yui-content input[type="submit"] {
+ margin: 15px 0 0;
+ padding: 1px 15px;
+}
+h1 img{
+ margin-right:5px;
+ }
+
+#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;
+}
+
+.yui-content h2{
+ margin:0 0 10px;
+}
+
+#frm_control_items{
+ clear:left;
+ margin-top:10px;
+}
+
+dl.proplist, dl.proplist-col {
+ margin: 0;
+ padding-left: 0;
+}
+
+.drag_elem{
+ z-index: 100;
+ position:absolute;
+ opacity: .50;
+ filter: alpha(opacity=50);
+}
+
+#list{
+ width: 650px;
+ position:relative;
+}
+
+.list_item{
+ position:relative;
+ z-index: 1;
+ opacity: 1;
+ filter: alpha(opacity=100);
+ top: 0px;
+ left: 0px;
+}
+
+.list_item:hover, .drag_group:hover{
+ cursor: move;
+}
+
+.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;
+}
+
+.yui-skin-sam .yui-button button, .yui-skin-sam .yui-button a, .yui-skin-sam
.yui-button a:visited {
+ height: 24px;
+}
+
+#toolbar {
+ padding: 10px;
+}
+
+#toolbar input[type="text"] {
+ font-size: 100%;
+ padding: 3px;
+}
+
+#toolbar input[type="submit"] {
+ padding:0 8px;
+ margin-top:0;
+}
+
+#innertoolbar-button{
+ /*background: none repeat scroll 0 0 #CCCCCC;*/
+ color: #111111;
+}
+
+.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;
+}
+
+#main_content {
+ padding: 20px;
+ width: 1150px;
+}
+
+#main_content.groups{
+ cursor: default;
+}
+#main_content fieldset{
+ padding:0;
+ margin:0;
+}
+
+#main_content h1{
+ margin-top:0;
+}
+
+.check_list li div {
+ float: left;
+ margin: 5px;
+ padding: 2px;
+ text-align: center;
+ width: 190px;
+}
+#main_content fieldset.check_list_details {
+ background: none repeat scroll 0 0 #EDF5FF;
+ border: 1px solid #A3A3A3;
+ padding: 15px;
+}
+#main_content fieldset.check_item_details{
+ background: none repeat scroll 0 0 #EDF5FF;
+ border: 1px solid #243356;
+ padding: 15px;
+}
+
+.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;
+}
+fieldset.check_list_details{
+ clear: both;
+}
+fieldset.check_list_details label{
+ font-weight:bold;
+ width:150px;
+}
+fieldset.check_list_details div{
+ clear:left;
+ margin:5px 0;
+}
+
+fieldset.tab_check_list_details label {
+ display: inline-block;
+ font-weight: bold;
+ width: 100px;
+}
+fieldset.tab_check_list_details {
+ padding: 0 0 10px 0;
+}
+
+
+fieldset.check_list_details textarea{
+ width:400px;
+ height:100px;
+}
+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;
+}
+fieldset.check_list_details label{
+ display: inline-block;
+ font-weight: bold;
+ width: 150px;
+}
+.check_item{
+ margin: 25px 0;
+}
+.check_item div{
+ margin: 5px 0;
+ clear:left;
+}
+h3.check_item_details{
+ margin-bottom:0;
+}
+.check_item textarea{
+ width:400px;
+ height:100px;
+}
+.check_item label{
+ width:150px;
+}
+.new_item a#innertoolbar-button{
+ background: grey;
+ font-weight: bold;
+}
+#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 .col_1 {
+ float: left;
+ height: 240px;
+ width: 600px;
+}
+
+#control_plan .col_2 {
+ float: right;
+ margin-top: 40px;
+ width: 330px;
+}
+
+ul.calendar li{
+ clear:left;
+}
+ul.calendar li.heading div {
+ font-weight: bold;
+ font-size:16px;
+}
+ul.calendar {
+ clear: both;
+ float: left;
+ margin-top: 30px;
+ width: 100%;
+}
+ul.calendar.month {
+ margin-top: 0;
+ width: 60%;
+}
+ul.calendar li div {
+ float: left;
+ width: 30px;
+ padding: 3px;
+ text-align: center;
+}
+#cal_wrp {
+ clear: both;
+ float: left;
+ margin-top: 30px;
+ width: 100%;
+}
+#cal_wrp .nav{
+ padding: 1% 0;
+}
+a.move_left{
+ float: right;
+}
+a.move_right {
+ float: right;
+ margin-right: 34%;
+}
+#days_wrp {
+ float: right;
+ height: 800px;
+ overflow-x: hidden;
+ position: relative;
+ width: 37%;
+}
+ul.calendar.days li div.cell {
+ height: 17px;
+ width: 24px;
+}
+ul.calendar.days {
+ position: absolute;
+ width: 1120px;
+ margin-top:0;
+}
+ul.calendar li div.date, ul.calendar.info div.date {
+ width: 80px;
+}
+ul.calendar div.title, ul.calendar.info div.title {
+ width: 200px;
+}
+ul.calendar div.title {
+ width: 150px;
+}
+ul.calendar div.location {
+ width: 150px;
+ text-align: left;
+}
+ul.calendar div.assigned {
+ width: 80px;
+ text-align: left;
+}
+ul.calendar div.id, ul.calendar.info div.id {
+ width: 50px;
+}
+ul.calendar div.title{
+ text-align: left;
+}
+ul.calendar .heading div.title{
+ text-align: center;
+}
+ul.calendar div.frequency, ul.calendar.info div.frequency {
+ width: 100px;
+}
+.months a.view_check_list {
+ width: 30px;
+}
+.cal_info_msg{
+ font-size: 16px;
+ padding: 40px 20px;
+}
+
+#info_box {
+ background: none repeat scroll 0 0 #EDF5FF;
+ border: 1px solid #243356;
+ left: 40px;
+ padding: 10px;
+ position: absolute;
+ text-align: left;
+ top: 3px;
+ width: 350px;
+ z-index: 1;
+ font-size:12px;
+ position:absolute;
+ display:none;
+}
+
+#info_box label{
+ font-weight:bold;
+ margin-right:2px;
+ font-size:12px;
+ display: inline-block;
+ width: 70px;
+}
+
+#info_box ul li ul label{
+ display: inline;
+}
+
+#info_box ul li ul {
+ margin: 5px 0;
+ padding-left: 5px;
+}
+#info_box h5 {
+ font-size: 15px;
+ font-weight: bold;
+ padding: 0 0 8px;
+ text-align: center;
+}
+.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{
+ padding:3px;
+}
+ul#search_list input[type="submit"] {
+ margin: 0;
+ padding: 0 10px;
+}
+ul#search_list input[type="text"] {
+ margin: 0 5px 0 0;
+ padding: 3px;
+}
+#queryForm{
+ overflow:hidden;
+ margin: 20px;
+}
+fieldset.add_check_list div{
+ padding:2px;
+}
+fieldset.add_check_list label{
+ display:inline-table;
+ width:120px;
+}
+#calendar_dates{
+ margin:25px 0;
+}
+#calendar_dates p{
+ font-weight: bold;
+ margin: 5px 0;
+}
+#calendar_dates span {
+ border: 2px solid black;
+ margin-right: 10px;
+ padding: 1px 4px;
+ cursor: pointer;
+}
+textarea{
+ padding: 4px;
+}
+
+/*================================== 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 {
+ display: none;
+}
+.check_item label{
+ width: 150px;
+ display: inline-block;
+}
+
+.check_items h4 img{
+ padding-bottom:2px;
+}
+.check_items.expand_list h4{
+ font-size: 15px;
+}
+#days_view div{
+ font-weight:bold;
+}
+.calendar .months {
+ margin-left: 20px;
+ width: 440px;
+ padding:0;
+}
+.calendar .heading a{
+ text-decoration: none;
+ color:#000;
+}
+.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 {
+ overflow: hidden;
+}
+.tab_menu a, .hor_menu a {
+ background: none repeat scroll 0 0 #FAFAFA;
+ border-left: 1px solid #A3A3A3;
+ border-right: 1px solid #A3A3A3;
+ border-top: 1px solid #A3A3A3;
+ color: #000000;
+ cursor: pointer;
+ display: block;
+ float: left;
+ font-size: 12px;
+ font-weight: normal;
+ margin-right: 3px;
+ padding: 7px 0;
+ text-align: center;
+ text-decoration: none;
+ width: 150px;
+}
+.hor_menu a {
+ border:1px solid #d0d9f1;
+ background: #ecf1ff;
+}
+.tab_menu a.active, .hor_menu a.active {
+ background: #2647A0;
+ border-left: 1px solid #173073;
+ border-right: 1px solid #173073;
+ border-top: 1px solid #173073;
+ color: #FFF;
+}
+.hor_menu a.active {
+ border-bottom: 1px solid #173073;
+}
+.tab_item {
+ background: none repeat scroll 0 0 #EDF5FF;
+ border: 1px solid #A3A3A3;
+ margin: 0 318px 0 0;
+ padding: 15px;
+ width: 800px;
+}
+.tab_item h2{
+ margin:0 0 10px;
+ font-size: 17px;
+}
+.tab_item h2.last{
+ margin:20px 0 10px;
+}
+.tab_item.active {
+ display:block;
+}
+fieldset.check_list_details{
+ width: 800px;
+}
+#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;
+}
+ul#icon_color_map {
+ border: 1px solid #DDDDDD;
+ padding: 5px;
+ margin-top: 40px;
+}
+ul#icon_color_map li {
+ font-size: 12px;
+ padding: 3px 10px;
+}
+ul#icon_color_map span{
+ margin-left: 10px;
+}
+#create_message_dialog{
+ display:none;
+ position:absolute;
+ width: 600px;
+ z-index: 2;
+ background:#aaa;
+}
+#curtain{
+ display:none;
+ position:absolute;
+ z-index: 1;
+}
+#main_content #case_details {
+ background: none repeat scroll 0 0 #EDF5FF;
+ border: 1px solid #DDDDDD;
+ margin-bottom: 20px;
+ padding: 15px;
+ width: 800px;
+}
+#case_details label{
+ display: inline-block;
+ width: 130px;
+ font-weight: normal;
+ font-size: 15px;
+}
+#case_details h3 {
+ font-size: 15px;
+ font-weight: normal;
+ margin: 10px 0;
+}
+#case_details h3.first {
+ margin-top:0;
+}
+#case_details h3.last {
+ margin-bottom:0;
+}
+.btn{
+ background: none repeat scroll 0 0 #2647A0;
+ color: #FFFFFF;
+ display: inline-block;
+ margin-right: 5px;
+ padding: 5px 10px;
+ text-decoration: none;
+ border: 1px solid #173073;
+ cursor: pointer;
+}
+
+.btn.focus{
+ background: none repeat scroll 0 0 #DD624B;
+ border-bottom: 1px solid #CB563F;
+ border-top: 1px solid #EE836F;
+ border-left:0;
+ border-right:0;
+ box-shadow: 0 1px 0 #A9422E, 0 -1px 0 #A9422E;
+ color: #FFFFFF;
+ margin-top: 1px;
+}
+
+#edit_check_list_menu div{
+ float:left;
+ margin-left: 75px;
+}
+
+#edit_check_list_menu a.focus {
+ float: none;
+ font-size: 11px;
+ margin-top: 3px;
+ padding: 3px 0;
+}
+
+#edit_check_list_menu a.focus.first{
+ margin-top: 0;
+}
+
+#frm_update_check_list input[type="submit"]{
+ width: 140px;
+}
+#error_message_menu {
+ float: left;
+ margin-top: 50px;
+}
+#error_message_menu a {
+ text-align: center;
+ width: 140px;
+ margin: 2px 0;
+ display:block;
+}
+
+#view_cases {
+ float: left;
+ margin: 20px 0 0 0;
+}
+#register_errors_content {
+ float: right;
+ margin-top: 20px;
+}
+#edit_check_list_menu a {
+ float: left;
+ padding: 14px 0;
+ text-align: center;
+ width: 185px;
+}
+#edit_check_list_menu {
+ margin: 0 0 20px;
+ overflow: hidden;
+}
+.content_wrp {
+ background: none repeat scroll 0 0 #EDF5FF;
+ border: 1px solid #DDDDDD;
+ margin-bottom: 20px;
+ padding: 15px;
+ width: 800px;
+}
+.box_header {
+ background: none repeat scroll 0 0 #2647A0;
+ border-left: 1px solid #173073;
+ border-right: 1px solid #173073;
+ border-top: 1px solid #173073;
+ color: #FFFFFF;
+ font-size: 13px;
+ font-weight: normal;
+ margin: 0;
+ padding: 3px 0 3px 15px;
+ text-align: left;
+ width: 815px;
+}
+
+/* ======================== VIEW CASES ============================= */
+
+li.check_item_case h4 {
+ margin: 5px 0;
+}
+li.check_item_case ul{
+ margin-bottom: 20px;
+}
+li.check_item_case ul li {
+ border: 1px solid #DDDDDD;
+ margin: 5px 0 0;
+ padding: 5px;
+}
+
+#main_content .quick_edit fieldset {
+ padding: 10px;
+ border: 1px solid #DDDDDD;
+}
+.frm_update_case label {
+ display: block;
+}
+.frm_update_case textarea {
+ width: 500px;
+ display: block;
+}
+.quick_edit hr {
+ color:#fafafa;
+}
+.frm_update_case input[type=submit]{
+ float:right;
+}
+a.view_check_list{
+ color: #FFFFFF;
+ display: block;
+ font-size: 10px;
+ font-weight: bold;
+ height: 13px;
+ text-decoration: none;
+ width: 24px;
+}
+.quick_edit label{
+ font-weight:bold;
+ vertical-align:top;
+}
+.quick_edit h3{
+ margin:0;
+}
+.quick_edit select{
+ display: inline-block;
+ vertical-align:top;
+}
+.quick_menu {
+ font-size: 12px;
+ margin-left: 10px;
+ padding: 2px;
+ text-decoration: underline;
+}
+.quick_menu a{
+ margin: 0 5px;
+}
+ul#groups {
+ margin-left: 10px;
+ margin-top: 5px;
+}
+ul#groups h4{
+ margin: 4px 0;
+}
+.input_error_msg{
+ background:#FBE3E4;
+ border-bottom-right-radius: 4px;
+ color: #D12F19;
+ display: block;
+ padding: 4px 5px;
+ width: 150px;
+}
+
+input.focus, select.focus{
+ border: 2px solid #dae6f4;
+}
+
+div.controller_checklist {
+ padding: 20px;
+ border: 1px solid #ABABAB;
+}
+
+/* ======================== REGISTER CONTROL FOR LOCATION
============================== */
+#choose_control{
+ margin: 10px;
+ padding: 10px;
+ width: 25%;
+}
+.error_msg {
+ color: red;
+ display: none;
+ font-size: 14px;
+ padding: 7px 0;
+}
+
+#control_details #select_all{
+ margin-left: 660px;
+}
+#control_details #location_form{
+ margin-left: 20px;
+ margin-bottom: 20px;
+}
+
+.help_text {
+ background: none repeat scroll 0 0 #DDDDDD;
+ padding: 3px 6px;
+ display: none;
+}
\ No newline at end of file
Added: trunk/registration/templates/base/pending_users.xsl
===================================================================
--- trunk/registration/templates/base/pending_users.xsl
(rev 0)
+++ trunk/registration/templates/base/pending_users.xsl 2012-03-25 19:28:01 UTC
(rev 9031)
@@ -0,0 +1,150 @@
+<!-- $Id: pending_users.xsl 8854 2012-02-14 07:54:40Z vator $ -->
+
+<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>
+
+<!-- separate tabs and inline tables-->
+
+<xsl:template match="data" xmlns:php="http://php.net/xsl">
+<div class="yui-navset yui-navset-top" id="pending_for_approval_tabview">
+ <div class="identifier-header">
+ <h1><xsl:value-of select="php:function('lang', 'Pending for
approval')"/></h1>
+ </div>
+ <xsl:call-template name="pending_users" />
+</div>
+
+</xsl:template>
+
+<xsl:template name="pending_users" xmlns:php="http://php.net/xsl">
+ <!-- IMPORTANT!!! Loads YUI javascript -->
+ <xsl:call-template name="common"/>
+
+ <div class="yui-content">
+ <div id="control_details">
+ <xsl:call-template name="yui_booking_i18n"/>
+ <xsl:apply-templates select="filter_form" />
+ <xsl:apply-templates select="paging"/>
+ <xsl:apply-templates select="datatable"/>
+ <xsl:apply-templates select="form/list_actions"/>
+ </div>
+ </div>
+</xsl:template>
+
+
+<xsl:template match="filter_form" xmlns:php="http://php.net/xsl">
+
+ <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:call-template name="filter_list"/>
+ </form>
+
+ <form id="update_table_dummy" method='POST' action='' ></form>
+
+</xsl:template>
+
+<xsl:template name="filter_list" xmlns:php="http://php.net/xsl">
+ <ul id="filters">
+ <li>
+ <select id="status_id" name="status_id">
+ <xsl:apply-templates select="status_list/options"/>
+ </select>
+ </li>
+ </ul>
+ <ul id="search_list">
+ <li>
+ <input type="text" name="query" />
+ </li>
+ <li>
+ <xsl:variable name="lang_search"><xsl:value-of
select="php:function('lang', 'Search')" /></xsl:variable>
+ <input type="submit" name="search"
value="{$lang_search}" title = "{$lang_search}" />
+ </li>
+ </ul>
+</xsl:template>
+
+<xsl:template match="datatable" xmlns:php="http://php.net/xsl">
+ <script type="text/javascript">
+ <![CDATA[
+ ]]>
+ </script>
+ <div id="data_paginator"/>
+ <div class="error_msg" style="margin-left:20px;">Du må velge bygg før
du kan legge til en kontroll</div>
+ <div id="datatable-container"/>
+
+ <xsl:call-template name="datasource-definition" />
+ <xsl:variable name="label_submit"><xsl:value-of
select="php:function('lang', 'save')" /></xsl:variable>
+ <xsl:variable name="label_checkAll"><xsl:value-of
select="php:function('lang', 'invert_checkboxes')" /></xsl:variable>
+ <div><input type="button" id="select_all" value="{$label_checkAll}"
onclick="checkAll('mychecks')"/></div>
+ <form action="#" name="location_form" id="location_form" method="post">
+ <div class="location_submit"><input type="submit"
name="save_location" id="save_location" value="{$label_submit}" onclick="return
saveLocationToControl()"/></div>
+ </form>
+</xsl:template>
+
+
+<xsl:template name="datasource-definition" xmlns:php="http://php.net/xsl">
+ <script>
+ YAHOO.namespace('controller');
+
+ YAHOO.controller.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>
+ ];
+
+ var main_source = '<xsl:value-of select="source"/>';
+ var main_columnDefs = YAHOO.controller.columnDefs;
+ var main_form = 'queryForm';
+ var main_filters = ['status_id', 'responsibility_roles_list'];
+ var main_container = 'datatable-container';
+ var main_table_id = 'datatable';
+ var main_pag = 'data_paginator';
+ var related_table = new Array('locations_table');
+
+ setDataSource(main_source, main_columnDefs, main_form,
main_filters, main_container, main_pag, main_table_id, related_table );
+
+ </script>
+
+</xsl:template>
+
+<!-- options for use with select-->
+<xsl:template match="options">
+ <option value="{id}">
+ <xsl:if test="selected != 0">
+ <xsl:attribute name="selected" value="selected"/>
+ </xsl:if>
+ <xsl:value-of disable-output-escaping="yes" select="name"/>
+ </option>
+</xsl:template>
+
Added: trunk/registration/templates/base/yui_booking_i18n.xsl
===================================================================
--- trunk/registration/templates/base/yui_booking_i18n.xsl
(rev 0)
+++ trunk/registration/templates/base/yui_booking_i18n.xsl 2012-03-25
19:28:01 UTC (rev 9031)
@@ -0,0 +1,17 @@
+<!-- $Id: yui_booking_i18n.xsl 8267 2011-12-11 12:27:18Z sigurdne $ -->
+ <xsl:template name="yui_booking_i18n" xmlns:php="http://php.net/xsl">
+ <xsl:if test="yui_booking_i18n">
+ <script type="text/javascript">
+ YAHOO.portico.i18n = {};
+ <xsl:for-each select="yui_booking_i18n/*">
+ YAHOO.portico.i18n.<xsl:value-of
select="local-name()"/> = function(cfg)
+ {
+ cfg = cfg || {};
+ <xsl:for-each select="./*">
+ cfg["<xsl:value-of
select="local-name()"/>"] = <xsl:value-of disable-output-escaping="yes"
select="."/>;
+ </xsl:for-each>
+ };
+ </xsl:for-each>
+ </script>
+ </xsl:if>
+ </xsl:template>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [9031] registration: approval,
Sigurd Nes <=