[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [8271] controller: propset svn:keywords "Revision Aut
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [8271] controller: propset svn:keywords "Revision Author Id" on missing files |
Date: |
Sun, 11 Dec 2011 20:31:47 +0000 |
Revision: 8271
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8271
Author: sigurdne
Date: 2011-12-11 20:31:47 +0000 (Sun, 11 Dec 2011)
Log Message:
-----------
controller: propset svn:keywords "Revision Author Id" on missing files
Modified Paths:
--------------
trunk/controller/inc/class.menu.inc.php
trunk/controller/inc/class.uicontrol.inc.php
trunk/controller/setup/default_records.inc.php
trunk/controller/setup/phpgw_no.lang
trunk/controller/setup/setup.inc.php
trunk/controller/setup/tables_update.inc.php
trunk/controller/templates/base/control.xsl
Added Paths:
-----------
trunk/controller/inc/class.cat_hooks.inc.php
trunk/controller/templates/base/config.tpl
Added: trunk/controller/inc/class.cat_hooks.inc.php
===================================================================
--- trunk/controller/inc/class.cat_hooks.inc.php
(rev 0)
+++ trunk/controller/inc/class.cat_hooks.inc.php 2011-12-11 20:31:47 UTC
(rev 8271)
@@ -0,0 +1,91 @@
+<?php
+ /**
+ * phpGroupWare - controller: a part of a Facilities Management System.
+ *
+ * @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 controller
+ * @subpackage entity
+ * @version $Id$
+ */
+
+ /**
+ * hook management for categories
+ * @package controller
+ */
+ class controller_cat_hooks
+ {
+
+ /**
+ * Handle a new category being added, create location to hold
ACL-data
+ */
+ function cat_add($data)
+ {
+ if ( isset($data['cat_owner']) && $data['cat_owner'] !=
-1 )
+ {
+ return false; //nothing needed to be done, we
only care about global cats
+ }
+
+ $location = '';
+ if($data['location_id'])
+ {
+ $location_info =
$GLOBALS['phpgw']->locations->get_name($data['location_id']);
+ $location = $location_info['location'];
+ }
+
$GLOBALS['phpgw']->locations->add("{$location}.category.{$data['cat_id']}",
$data['cat_name'], 'controller');
+
+ }
+
+ /**
+ * Handle a category being deleted, remove the location
+ */
+ function cat_delete($data)
+ {
+ if ( isset($data['cat_owner']) && $data['cat_owner'] !=
-1 )
+ {
+ return false; //nothing needed to be done, we
only care about global cats
+ }
+ if($data['location_id'])
+ {
+ $location_info =
$GLOBALS['phpgw']->locations->get_name($data['location_id']);
+ $location =
"{$location_info['location']}.category.{$data['cat_id']}";
+
$GLOBALS['phpgw']->locations->delete('controller', $location, false);
+ }
+ }
+
+ /**
+ * Handle a category being edited, update the location info
+ */
+ function cat_edit($data)
+ {
+ if ( isset($data['cat_owner']) && $data['cat_owner'] !=
-1 )
+ {
+ return false; //nothing needed to be done, we
only care about global cats
+ }
+
+ if($data['location_id'])
+ {
+ $location_info =
$GLOBALS['phpgw']->locations->get_name($data['location_id']);
+ $location =
"{$location_info['location']}.category.{$data['cat_id']}";
+
$GLOBALS['phpgw']->locations->update_description($location, $data['cat_name'],
'controller');
+ }
+ }
+ }
Property changes on: trunk/controller/inc/class.cat_hooks.inc.php
___________________________________________________________________
Added: svn:keywords
+ Revision Author Id
Modified: trunk/controller/inc/class.menu.inc.php
===================================================================
--- trunk/controller/inc/class.menu.inc.php 2011-12-11 12:49:15 UTC (rev
8270)
+++ trunk/controller/inc/class.menu.inc.php 2011-12-11 20:31:47 UTC (rev
8271)
@@ -134,10 +134,20 @@
{
$menus['admin'] = array
(
+ 'index' => array
+ (
+ 'text' =>
lang('Configuration'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig.index', 'appname' => 'controller') )
+ ),
'acl' => array
(
'text' => lang('Configure
Access Permissions'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'preferences.uiadmin_acl.list_acl', 'acl_app' => 'controller') )
+ ),
+ 'control_cats' => array
+ (
+ 'text' => lang('Control area'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uicategories.index', 'appname' => 'controller', 'location' =>
'.control', 'global_cats' => 'true', 'menu_selection' =>
'admin::controller::control_cats') )
)
);
}
Modified: trunk/controller/inc/class.uicontrol.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol.inc.php 2011-12-11 12:49:15 UTC
(rev 8270)
+++ trunk/controller/inc/class.uicontrol.inc.php 2011-12-11 20:31:47 UTC
(rev 8271)
@@ -55,6 +55,7 @@
private $so_control_group_list;
private $so_check_list_list;
private $so_check_item;
+ private $_category_acl;
public $public_functions = array
(
@@ -90,6 +91,10 @@
$this->so_check_list =
CreateObject('controller.socheck_list');
$this->so_check_item =
CreateObject('controller.socheck_item');
+ $config = CreateObject('phpgwapi.config','controller');
+ $config->read();
+ $this->_category_acl =
isset($config->config_data['acl_at_control_area']) &&
$config->config_data['acl_at_control_area'] == 1 ? true : false;
+
self::set_active_menu('controller::control');
}
@@ -102,6 +107,25 @@
phpgwapi_yui::load_widget('datatable');
phpgwapi_yui::load_widget('paginator');
+
+ // Sigurd: START as categories
+ $cats = CreateObject('phpgwapi.categories', -1,
'controller', '.control');
+ $cats->supress_info = true;
+
+ $control_areas =
$cats->formatted_xslt_list(array('format'=>'filter','selected' =>
$control_area_id,'globals' => true,'use_acl' => $this->_category_acl));
+ array_unshift($control_areas['cat_list'],array
('cat_id'=>'','name'=> lang('select value')));
+ $control_areas_array2 = array();
+ foreach($control_areas['cat_list'] as $cat_list)
+ {
+ $control_areas_array2[] = array
+ (
+ 'id' => $cat_list['cat_id'],
+ 'name' => $cat_list['name'],
+ );
+ }
+
+
+
$data = array(
'form' => array(
'toolbar' => array(
@@ -137,7 +161,14 @@
'text' =>
lang('Control_area'),
'list' =>
$this->so_control_area->get_control_area_select_array(),
),
+
+ //as categories
array('type' =>
'filter',
+ 'name' =>
'control_areas',
+ 'text' =>
lang('Control_area') . 2,
+ 'list' =>
$control_areas_array2,
+ ),
+ array('type' =>
'filter',
'name' =>
'responsibilities',
'text' =>
lang('Responsibility'),
'list' =>
$this->so->get_roles(),
@@ -216,7 +247,25 @@
}
$control_areas_array =
$this->so_control_area->get_control_areas_as_array();
+
+ // Sigurd: START as categories
+ $cats = CreateObject('phpgwapi.categories', -1,
'controller', '.control');
+ $cats->supress_info = true;
+ $control_areas =
$cats->formatted_xslt_list(array('format'=>'filter','selected' =>
$control_area_id,'globals' => true,'use_acl' => $this->_category_acl));
+ array_unshift($control_areas['cat_list'],array
('cat_id'=>'','name'=> lang('select value')));
+ $control_areas_array2 = array();
+ foreach($control_areas['cat_list'] as $cat_list)
+ {
+ $control_areas_array2[] = array
+ (
+ 'id' => $cat_list['cat_id'],
+ 'name' => $cat_list['name'],
+ );
+ }
+ // END as categories
+
+
// Fetches prosedures that are related to first control
area in list
$control_area_id = $control_areas_array[0]['id'];
$procedures_array =
$this->so_procedure->get_procedures_by_control_area_id($control_area_id);
@@ -239,6 +288,7 @@
'editable'
=> true,
'control'
=> (isset($control)) ? $control->toArray(): null,
'control_areas_array' =>
$control_areas_array,
+ 'control_areas_array2' =>
array('options' => $control_areas_array2),
'procedures_array' =>
$procedures_array,
'role_array' =>
$role_array,
'start_date' =>
$GLOBALS['phpgw']->yuical->add_listener('start_date',date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],
time())),
Modified: trunk/controller/setup/default_records.inc.php
===================================================================
--- trunk/controller/setup/default_records.inc.php 2011-12-11 12:49:15 UTC
(rev 8270)
+++ trunk/controller/setup/default_records.inc.php 2011-12-11 20:31:47 UTC
(rev 8271)
@@ -33,12 +33,16 @@
*/
//Create groups, users, add users to groups and set preferences
-$GLOBALS['phpgw']->locations->add('.', 'Root',
'controller',false);
-$GLOBALS['phpgw']->locations->add('admin', 'Admin',
'controller',false);
-$GLOBALS['phpgw']->locations->add('.usertype',
'Usertypes', 'controller',false);
-$GLOBALS['phpgw']->locations->add('.usertype.superuser', 'Usertype:
Superuser', 'controller',false);
-$GLOBALS['phpgw']->locations->add('.usertype.user',
'Usertype: User', 'controller',false);
+$GLOBALS['phpgw']->locations->add('.', 'Root', 'controller',false);
+$GLOBALS['phpgw']->locations->add('admin', 'Admin', 'controller',false);
+$GLOBALS['phpgw']->locations->add('.usertype', 'Usertypes',
'controller',false);
+$GLOBALS['phpgw']->locations->add('.usertype.superuser','Usertype: Superuser',
'controller',false);
+$GLOBALS['phpgw']->locations->add('.usertype.user', 'Usertype: User',
'controller',false);
+$GLOBALS['phpgw']->locations->add('.control', 'Control', 'controller');
+$GLOBALS['phpgw']->locations->add('.checklist', 'Checklist', 'controller');
+$GLOBALS['phpgw']->locations->add('.procedure', 'Procedure', 'controller');
+
/*
// Default groups and users
$GLOBALS['phpgw']->accounts = createObject('phpgwapi.accounts');
Modified: trunk/controller/setup/phpgw_no.lang
===================================================================
--- trunk/controller/setup/phpgw_no.lang 2011-12-11 12:49:15 UTC (rev
8270)
+++ trunk/controller/setup/phpgw_no.lang 2011-12-11 20:31:47 UTC (rev
8271)
@@ -259,6 +259,7 @@
Control_area controller no Kontrollområde
Control area controller no Kontrollområde
Control_areas controller no Kontrollområder
+Use ACL for control areas common no Bruk rettighetsstyring på
kontrollområder
Control item what to do controller no Hva skal gjøres
Not selected controller no Ingen valgt
searchfield controller no Søkefelt
Modified: trunk/controller/setup/setup.inc.php
===================================================================
--- trunk/controller/setup/setup.inc.php 2011-12-11 12:49:15 UTC (rev
8270)
+++ trunk/controller/setup/setup.inc.php 2011-12-11 20:31:47 UTC (rev
8271)
@@ -1,6 +1,6 @@
<?php
$setup_info['controller']['name'] = 'controller';
- $setup_info['controller']['version'] = '0.1.11';
+ $setup_info['controller']['version'] = '0.1.12';
$setup_info['controller']['app_order'] = 100;
$setup_info['controller']['enable'] = 1;
$setup_info['controller']['app_group'] = 'office';
@@ -27,9 +27,12 @@
/* The hooks this app includes, needed for hooks registration */
$setup_info['controller']['hooks'] = array
(
- 'menu' => 'controller.menu.get_menu',
+ 'menu' => 'controller.menu.get_menu',
'config',
'home',
+ 'cat_add' => 'controller.cat_hooks.cat_add',
+ 'cat_delete' => 'controller.cat_hooks.cat_delete',
+ 'cat_edit' => 'controller.cat_hooks.cat_edit'
);
$setup_info['controller']['tables'] = array
Modified: trunk/controller/setup/tables_update.inc.php
===================================================================
--- trunk/controller/setup/tables_update.inc.php 2011-12-11 12:49:15 UTC
(rev 8270)
+++ trunk/controller/setup/tables_update.inc.php 2011-12-11 20:31:47 UTC
(rev 8271)
@@ -224,3 +224,21 @@
$GLOBALS['setup_info']['controller']['currentver'] = '0.1.11';
return $GLOBALS['setup_info']['controller']['currentver'];
}
+
+ /* Update Controller from v 0.1.11 to 0.1.12
+ * Add locations for control and checklist
+ */
+
+ $test[] = '0.1.11';
+ function controller_upgrade0_1_11()
+ {
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('controller_control','equipment_type_id','component_type_id');
+
$GLOBALS['phpgw_setup']->oProc->RenameColumn('controller_control','equipment_id','component_id');
+
+ $GLOBALS['phpgw']->locations->add('.control', 'Control',
'controller');
+ $GLOBALS['phpgw']->locations->add('.checklist', 'Checklist',
'controller');
+ $GLOBALS['phpgw']->locations->add('.procedure', 'Procedure',
'controller');
+
+ $GLOBALS['setup_info']['controller']['currentver'] = '0.1.12';
+ return $GLOBALS['setup_info']['controller']['currentver'];
+ }
Added: trunk/controller/templates/base/config.tpl
===================================================================
--- trunk/controller/templates/base/config.tpl (rev 0)
+++ trunk/controller/templates/base/config.tpl 2011-12-11 20:31:47 UTC (rev
8271)
@@ -0,0 +1,39 @@
+<!-- BEGIN header -->
+<form method="POST" action="{action_url}">
+ <table border="0" align="center" width="85%">
+ <tr class="th">
+ <td colspan="2"><font
color="{th_text}"> <b>{title}</b></font></td>
+ </tr>
+ <!-- END header -->
+ <!-- BEGIN body -->
+ <tr class="row_on">
+ <td colspan="2"> </td>
+ </tr>
+ <tr class="row_off">
+ <td colspan="2"> <b>{lang_controller}
{lang_settings}</b></td>
+ </tr>
+ <tr class="row_off">
+ <td>{lang_Use_ACL_for_control_areas}.</td>
+ <td>
+ <select name="newsettings[acl_at_control_area]">
+ <option value="2"
{selected_acl_at_control_area_2}>NO</option>
+ <option value="1"
{selected_acl_at_control_area_1}>YES</option>
+ </select>
+ </td>
+ </tr>
+ <!-- END body -->
+ <!-- BEGIN footer -->
+ <tr class="th">
+ <td colspan="2">
+
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" align="center">
+ <input type="submit" name="submit"
value="{lang_submit}">
+ <input type="submit" name="cancel"
value="{lang_cancel}">
+ </td>
+ </tr>
+ </table>
+</form>
+<!-- END footer -->
Modified: trunk/controller/templates/base/control.xsl
===================================================================
--- trunk/controller/templates/base/control.xsl 2011-12-11 12:49:15 UTC (rev
8270)
+++ trunk/controller/templates/base/control.xsl 2011-12-11 20:31:47 UTC (rev
8271)
@@ -33,6 +33,9 @@
</xsl:choose>
</xsl:for-each>
</select>
+ <select id="control_area_id"
name="control_area_id">
+ <xsl:apply-templates
select="control_areas_array2/options"/>
+ </select>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="control/control_area_name" />
@@ -167,3 +170,13 @@
</div>
</div>
</xsl:template>
+
+<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>
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [8271] controller: propset svn:keywords "Revision Author Id" on missing files,
Sigurd Nes <=