mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:49:10 +01:00
- primary link / contact con now be set direct in the contact line
- checkbox to set a custom contact (additional to the linked contact) - new select/link entry custom fields (eg. to store a contact) - uses the stock customfield widget now - email is now a stock infolog type
This commit is contained in:
parent
532264b3fa
commit
4259d8d622
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,345 +1,376 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - InfoLog: Administration of custom fields, type and status *
|
||||
* http://www.egroupware.org *
|
||||
* Written and (c) by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* -------------------------------------------- *
|
||||
* This program 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. *
|
||||
\**************************************************************************/
|
||||
/**
|
||||
* InfoLog - Custome fields
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @package infolog
|
||||
* @copyright (c) 2003-6 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
/**
|
||||
* Administration of custom fields, type and status
|
||||
*/
|
||||
class uicustomfields
|
||||
{
|
||||
var $public_functions = array(
|
||||
'edit' => True
|
||||
);
|
||||
/**
|
||||
* Customfield types, without the link app-names
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $cf_types = array(
|
||||
'text' => 'Text',
|
||||
'label' => 'Label',
|
||||
'select' => 'Selectbox',
|
||||
'radio' => 'Radiobutton',
|
||||
'checkbox' => 'Checkbox',
|
||||
'link-entry' => 'Select an entry',
|
||||
);
|
||||
/**
|
||||
* Instance of the infolog BO class
|
||||
*
|
||||
* @var boinfolog
|
||||
*/
|
||||
var $bo;
|
||||
/**
|
||||
* Instance of the etemplate class
|
||||
*
|
||||
* @var etemplate
|
||||
*/
|
||||
var $tmpl;
|
||||
/**
|
||||
* instance of the config class for infolog
|
||||
*
|
||||
* @var config
|
||||
*/
|
||||
var $config;
|
||||
|
||||
function uicustomfields( )
|
||||
{
|
||||
$this->bo =& CreateObject('infolog.boinfolog');
|
||||
$this->tmpl =& CreateObject('etemplate.etemplate');
|
||||
$this->types = &$this->bo->enums['type'];
|
||||
$this->status = &$this->bo->status;
|
||||
$this->config = &$this->bo->config;
|
||||
$this->fields = &$this->bo->customfields;
|
||||
|
||||
$GLOBALS['egw']->translation->add_app('etemplate');
|
||||
foreach($this->cf_types as $name => $label) $this->cf_types[$name] = lang($label);
|
||||
$link_types = $this->bo->link->app_list();
|
||||
ksort($link_types);
|
||||
foreach($link_types as $name => $label) $this->cf_types[$name] = '- '.$label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Administration of custom fields, type and status
|
||||
* Edit/Create an InfoLog Custom fields, typ and status
|
||||
*
|
||||
* @package infolog
|
||||
* @author Ralf Becker <RalfBecker@outdoor-training.de>
|
||||
* @copyright (c) by Ralf Becker <RalfBecker@outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @param array $content Content from the eTemplate Exec
|
||||
*/
|
||||
class uicustomfields
|
||||
function edit($content=null)
|
||||
{
|
||||
var $public_functions = array
|
||||
(
|
||||
'edit' => True
|
||||
);
|
||||
|
||||
function uicustomfields( )
|
||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog').' - '.lang('Custom fields, typ and status');
|
||||
if (is_array($content))
|
||||
{
|
||||
$this->bo =& CreateObject('infolog.boinfolog');
|
||||
$this->tmpl =& CreateObject('etemplate.etemplate');
|
||||
$this->types = &$this->bo->enums['type'];
|
||||
$this->status = &$this->bo->status;
|
||||
$this->config = &$this->bo->config;
|
||||
$this->fields = &$this->bo->customfields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit/Create an InfoLog Custom fields, typ and status
|
||||
*
|
||||
* @param array $content Content from the eTemplate Exec
|
||||
*/
|
||||
function edit($content=null)
|
||||
{
|
||||
$GLOBALS['egw_info']['flags']['app_header'] = lang('InfoLog').' - '.lang('Custom fields, typ and status');
|
||||
if (is_array($content))
|
||||
//echo '<pre style="text-align: left;">'; print_r($content); echo "</pre>\n";
|
||||
list($action) = @each($content['button']);
|
||||
switch($action)
|
||||
{
|
||||
//echo '<pre style="text-align: left;">'; print_r($content); echo "</pre>\n";
|
||||
list($action) = @each($content['button']);
|
||||
switch($action)
|
||||
{
|
||||
case 'create':
|
||||
$this->create($content);
|
||||
break;
|
||||
case 'delete':
|
||||
$this->delete($content);
|
||||
break;
|
||||
default:
|
||||
if (!$content['status']['create'] && !$content['status']['delete'] &&
|
||||
!$content['fields']['create'] && !$content['fields']['delete'])
|
||||
{
|
||||
break; // typ change
|
||||
}
|
||||
case 'save':
|
||||
case 'apply':
|
||||
$this->update($content);
|
||||
if ($action != 'save')
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 'cancel':
|
||||
$GLOBALS['egw']->redirect_link('/admin/');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list($typ) = each($this->types);
|
||||
$content = array(
|
||||
'typ' => $typ,
|
||||
);
|
||||
}
|
||||
$readonlys = array();
|
||||
$readonlys['button[delete]'] = isset($this->bo->stock_enums['type'][$content['typ']]);
|
||||
|
||||
$content['status'] = array(
|
||||
'default' => $this->status['defaults'][$content['typ']]
|
||||
);
|
||||
$n = 0;
|
||||
foreach($this->status[$content['typ']] as $name => $label)
|
||||
{
|
||||
$content['status'][++$n] = array(
|
||||
'name' => $name,
|
||||
'label' => $label,
|
||||
'disabled' => False
|
||||
);
|
||||
$preserv_status[$n]['old_name'] = $name;
|
||||
if (isset($this->bo->stock_status[$content['typ']][$name]))
|
||||
{
|
||||
$readonlys['status']["delete[$name]"] =
|
||||
$readonlys['status'][$n.'[name]'] = True;
|
||||
}
|
||||
$readonlys['status']["create$name"] = True;
|
||||
}
|
||||
$content['status'][++$n] = array('name'=>''); // new line for create
|
||||
$readonlys['status']["delete[]"] = True;
|
||||
|
||||
//echo 'customfields=<pre style="text-align: left;">'; print_r($this->fields); echo "</pre>\n";
|
||||
$content['fields'] = array();
|
||||
$n = 0;
|
||||
foreach($this->fields as $name => $data)
|
||||
{
|
||||
if (is_array($data['values']))
|
||||
{
|
||||
$values = '';
|
||||
foreach($data['values'] as $var => $value)
|
||||
case 'create':
|
||||
$this->create($content);
|
||||
break;
|
||||
case 'delete':
|
||||
$this->delete($content);
|
||||
break;
|
||||
default:
|
||||
if (!$content['status']['create'] && !$content['status']['delete'] &&
|
||||
!$content['fields']['create'] && !$content['fields']['delete'])
|
||||
{
|
||||
$values .= (!empty($values) ? "\n" : '').$var.'='.$value;
|
||||
break; // typ change
|
||||
}
|
||||
$data['values'] = $values;
|
||||
}
|
||||
$content['fields'][++$n] = $data + array(
|
||||
'name' => $name
|
||||
);
|
||||
$preserv_fields[$n]['old_name'] = $name;
|
||||
$readonlys['fields']["create$name"] = True;
|
||||
case 'save':
|
||||
case 'apply':
|
||||
$this->update($content);
|
||||
if ($action != 'save')
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 'cancel':
|
||||
$GLOBALS['egw']->redirect_link('/admin/');
|
||||
exit;
|
||||
}
|
||||
$content['fields'][++$n] = array('typ'=>'','order' => 10 * $n); // new line for create
|
||||
$readonlys['fields']["delete[]"] = True;
|
||||
}
|
||||
else
|
||||
{
|
||||
list($typ) = each($this->types);
|
||||
$content = array(
|
||||
'type2' => $typ,
|
||||
);
|
||||
}
|
||||
$readonlys = array();
|
||||
$readonlys['button[delete]'] = isset($this->bo->stock_enums['type'][$content['type2']]);
|
||||
|
||||
//echo '<p>uicustomfields.edit(content = <pre style="text-align: left;">'; print_r($content); echo "</pre>\n";
|
||||
//echo 'readonlys = <pre style="text-align: left;">'; print_r($readonlys); echo "</pre>\n";
|
||||
$this->tmpl->read('infolog.customfields');
|
||||
$this->tmpl->exec('infolog.uicustomfields.edit',$content,array(
|
||||
'typ' => $this->types,
|
||||
),$readonlys,array(
|
||||
'status' => $preserv_status,
|
||||
'fields' => $preserv_fields
|
||||
));
|
||||
$content['status'] = array(
|
||||
'default' => $this->status['defaults'][$content['type2']]
|
||||
);
|
||||
$n = 0;
|
||||
foreach($this->status[$content['type2']] as $name => $label)
|
||||
{
|
||||
$content['status'][++$n] = array(
|
||||
'name' => $name,
|
||||
'label' => $label,
|
||||
'disabled' => False
|
||||
);
|
||||
$preserv_status[$n]['old_name'] = $name;
|
||||
if (isset($this->bo->stock_status[$content['type2']][$name]))
|
||||
{
|
||||
$readonlys['status']["delete[$name]"] =
|
||||
$readonlys['status'][$n.'[name]'] = True;
|
||||
}
|
||||
$readonlys['status']["create$name"] = True;
|
||||
}
|
||||
$content['status'][++$n] = array('name'=>''); // new line for create
|
||||
$readonlys['status']["delete[]"] = True;
|
||||
|
||||
//echo 'customfields=<pre style="text-align: left;">'; print_r($this->fields); echo "</pre>\n";
|
||||
$content['fields'] = array();
|
||||
$n = 0;
|
||||
foreach($this->fields as $name => $field)
|
||||
{
|
||||
if (is_array($field['values']))
|
||||
{
|
||||
$values = '';
|
||||
foreach($field['values'] as $var => $value)
|
||||
{
|
||||
$values .= (!empty($values) ? "\n" : '').$var.'='.$value;
|
||||
}
|
||||
$field['values'] = $values;
|
||||
}
|
||||
$content['fields'][++$n] = $field + array(
|
||||
'name' => $name
|
||||
);
|
||||
$preserv_fields[$n]['old_name'] = $name;
|
||||
$readonlys['fields']["create$name"] = True;
|
||||
}
|
||||
$content['fields'][++$n] = array('type2'=>'','order' => 10 * $n); // new line for create
|
||||
$readonlys['fields']["delete[]"] = True;
|
||||
|
||||
//echo '<p>uicustomfields.edit(content = <pre style="text-align: left;">'; print_r($content); echo "</pre>\n";
|
||||
//echo 'readonlys = <pre style="text-align: left;">'; print_r($readonlys); echo "</pre>\n";
|
||||
$this->tmpl->read('infolog.customfields');
|
||||
$this->tmpl->exec('infolog.uicustomfields.edit',$content,array(
|
||||
'type2' => $this->types,
|
||||
'type' => $this->cf_types,
|
||||
),$readonlys,array(
|
||||
'status' => $preserv_status,
|
||||
'fields' => $preserv_fields,
|
||||
));
|
||||
}
|
||||
|
||||
function update_fields(&$content)
|
||||
{
|
||||
$typ = $content['type2'];
|
||||
$fields = &$content['fields'];
|
||||
|
||||
$create = $fields['create'];
|
||||
unset($fields['create']);
|
||||
|
||||
if ($fields['delete'])
|
||||
{
|
||||
list($delete) = each($fields['delete']);
|
||||
unset($fields['delete']);
|
||||
}
|
||||
|
||||
function update_fields(&$content)
|
||||
foreach($fields as $field)
|
||||
{
|
||||
$typ = $content['typ'];
|
||||
$fields = &$content['fields'];
|
||||
$name = trim($field['name']);
|
||||
$old_name = $field['old_name'];
|
||||
|
||||
$create = $fields['create'];
|
||||
unset($fields['create']);
|
||||
|
||||
if ($fields['delete'])
|
||||
if (!empty($delete) && $delete == $old_name)
|
||||
{
|
||||
list($delete) = each($fields['delete']);
|
||||
unset($fields['delete']);
|
||||
unset($this->fields[$old_name]);
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach($fields as $field)
|
||||
if (isset($field['name']) && empty($name) && ($create || !empty($old_name))) // empty name not allowed
|
||||
{
|
||||
$name = trim($field['name']);
|
||||
$old_name = $field['old_name'];
|
||||
|
||||
if (!empty($delete) && $delete == $old_name)
|
||||
$content['error_msg'] = lang('Name must not be empty !!!');
|
||||
}
|
||||
if (isset($field['old_name']))
|
||||
{
|
||||
if (!empty($name) && $old_name != $name) // renamed
|
||||
{
|
||||
unset($this->fields[$old_name]);
|
||||
continue;
|
||||
}
|
||||
if (isset($field['name']) && empty($name) && ($create || !empty($old_name))) // empty name not allowed
|
||||
elseif (empty($name))
|
||||
{
|
||||
$content['error_msg'] = lang('Name must not be empty !!!');
|
||||
}
|
||||
if (isset($field['old_name']))
|
||||
{
|
||||
if (!empty($name) && $old_name != $name) // renamed
|
||||
{
|
||||
unset($this->fields[$old_name]);
|
||||
}
|
||||
elseif (empty($name))
|
||||
{
|
||||
$name = $old_name;
|
||||
}
|
||||
}
|
||||
elseif (empty($name)) // new item and empty ==> ignore it
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$values = array();
|
||||
if (!empty($field['values']))
|
||||
{
|
||||
foreach(explode("\n",$field['values']) as $line)
|
||||
{
|
||||
list($var,$value) = split('=',trim($line),2);
|
||||
$var = trim($var);
|
||||
$values[$var] = empty($value) ? $var : $value;
|
||||
}
|
||||
}
|
||||
$this->fields[$name] = array(
|
||||
'typ' => $field['typ'],
|
||||
'label' => empty($field['label']) ? $name : $field['label'],
|
||||
'help' => $field['help'],
|
||||
'values'=> $values,
|
||||
'len' => $field['len'],
|
||||
'rows' => intval($field['rows']),
|
||||
'order' => intval($field['order'])
|
||||
);
|
||||
}
|
||||
if (!function_exists('sort_by_order'))
|
||||
{
|
||||
function sort_by_order($arr1,$arr2)
|
||||
{
|
||||
return $arr1['order'] - $arr2['order'];
|
||||
$name = $old_name;
|
||||
}
|
||||
}
|
||||
uasort($this->fields,sort_by_order);
|
||||
|
||||
$n = 0;
|
||||
foreach($this->fields as $name => $data)
|
||||
elseif (empty($name)) // new item and empty ==> ignore it
|
||||
{
|
||||
$this->fields[$name]['order'] = ($n += 10);
|
||||
continue;
|
||||
}
|
||||
$values = array();
|
||||
if (!empty($field['values']))
|
||||
{
|
||||
foreach(explode("\n",$field['values']) as $line)
|
||||
{
|
||||
list($var,$value) = split('=',trim($line),2);
|
||||
$var = trim($var);
|
||||
$values[$var] = empty($value) ? $var : $value;
|
||||
}
|
||||
}
|
||||
$this->fields[$name] = array(
|
||||
'type2' => $field['type2'],
|
||||
'type' => $field['type'],
|
||||
'label' => empty($field['label']) ? $name : $field['label'],
|
||||
'help' => $field['help'],
|
||||
'values'=> $values,
|
||||
'len' => $field['len'],
|
||||
'rows' => (int)$field['rows'],
|
||||
'order' => (int)$field['order'],
|
||||
);
|
||||
}
|
||||
if (!function_exists('sort_by_order'))
|
||||
{
|
||||
function sort_by_order($arr1,$arr2)
|
||||
{
|
||||
return $arr1['order'] - $arr2['order'];
|
||||
}
|
||||
}
|
||||
uasort($this->fields,sort_by_order);
|
||||
|
||||
function update_status(&$content)
|
||||
$n = 0;
|
||||
foreach($this->fields as $name => $data)
|
||||
{
|
||||
$typ = $content['typ'];
|
||||
$status = &$content['status'];
|
||||
|
||||
$default = $status['default'];
|
||||
unset($status['default']);
|
||||
|
||||
$create = $status['create'];
|
||||
unset($status['create']);
|
||||
|
||||
if ($status['delete'])
|
||||
{
|
||||
list($delete) = each($status['delete']);
|
||||
unset($status['delete']);
|
||||
}
|
||||
|
||||
foreach($status as $stat)
|
||||
{
|
||||
$name = trim($stat['name']);
|
||||
$old_name = $stat['old_name'];
|
||||
|
||||
if (!empty($delete) && $delete == $old_name)
|
||||
{
|
||||
unset($this->status[$typ][$old_name]);
|
||||
continue;
|
||||
}
|
||||
if (isset($stat['name']) && empty($name) && ($create || !empty($old_name))) // empty name not allowed
|
||||
{
|
||||
$content['error_msg'] = lang('Name must not be empty !!!');
|
||||
}
|
||||
if (isset($stat['old_name']))
|
||||
{
|
||||
if (!empty($name) && $old_name != $name) // renamed
|
||||
{
|
||||
unset($this->status[$typ][$old_name]);
|
||||
|
||||
if ($default == $old_name)
|
||||
{
|
||||
$default = $name;
|
||||
}
|
||||
}
|
||||
elseif (empty($name))
|
||||
{
|
||||
$name = $old_name;
|
||||
}
|
||||
}
|
||||
elseif (empty($name)) // new item and empty ==> ignore it
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$this->status[$typ][$name] = empty($stat['label']) ? $name : $stat['label'];
|
||||
}
|
||||
$this->status['defaults'][$typ] = empty($default) ? $name : $default;
|
||||
if (!isset($this->status[$typ][$this->status['defaults'][$typ]]))
|
||||
{
|
||||
list($this->status['defaults'][$typ]) = @each($this->status[$typ]);
|
||||
}
|
||||
}
|
||||
|
||||
function update(&$content)
|
||||
{
|
||||
$this->update_status($content);
|
||||
$this->update_fields($content);
|
||||
|
||||
// save changes to repository
|
||||
$this->save_repository();
|
||||
}
|
||||
|
||||
function delete(&$content)
|
||||
{
|
||||
if (isset($this->bo->stock_enums['type'][$content['typ']]))
|
||||
{
|
||||
$content['error_msg'] .= lang("You can't delete one of the stock types !!!");
|
||||
return;
|
||||
}
|
||||
unset($this->types[$content['typ']]);
|
||||
unset($this->status[$content['typ']]);
|
||||
unset($this->status['defaults'][$content['typ']]);
|
||||
$content['typ'] = '';
|
||||
|
||||
// save changes to repository
|
||||
$this->save_repository();
|
||||
}
|
||||
|
||||
function create(&$content)
|
||||
{
|
||||
$new_name = trim($content['new_name']);
|
||||
unset($content['new_name']);
|
||||
if (empty($new_name) || isset($this->types[$new_name]))
|
||||
{
|
||||
$content['error_msg'] .= empty($new_name) ?
|
||||
lang('You have to enter a name, to create a new typ!!!') :
|
||||
lang("Typ '%1' already exists !!!",$new_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->types[$new_name] = $new_name;
|
||||
$this->status[$new_name] = array(
|
||||
'ongoing' => 'ongoing',
|
||||
'done' => 'done'
|
||||
);
|
||||
$this->status['defaults'][$new_name] = 'ongoing';
|
||||
|
||||
// save changes to repository
|
||||
$this->save_repository();
|
||||
|
||||
$content['typ'] = $new_name; // show the new entry
|
||||
}
|
||||
}
|
||||
|
||||
function save_repository()
|
||||
{
|
||||
// save changes to repository
|
||||
$this->config->value('types',$this->types);
|
||||
//echo '<p>uicustomfields::save_repository() \$this->status=<pre style="text-aling: left;">'; print_r($this->status); echo "</pre>\n";
|
||||
$this->config->value('status',$this->status);
|
||||
//echo '<p>uicustomfields::save_repository() \$this->fields=<pre style="text-aling: left;">'; print_r($this->fields); echo "</pre>\n";
|
||||
$this->config->value('customfields',$this->fields);
|
||||
|
||||
$this->config->save_repository();
|
||||
$this->fields[$name]['order'] = ($n += 10);
|
||||
}
|
||||
}
|
||||
|
||||
function update_status(&$content)
|
||||
{
|
||||
$typ = $content['type2'];
|
||||
$status = &$content['status'];
|
||||
|
||||
$default = $status['default'];
|
||||
unset($status['default']);
|
||||
|
||||
$create = $status['create'];
|
||||
unset($status['create']);
|
||||
|
||||
if ($status['delete'])
|
||||
{
|
||||
list($delete) = each($status['delete']);
|
||||
unset($status['delete']);
|
||||
}
|
||||
|
||||
foreach($status as $stat)
|
||||
{
|
||||
$name = trim($stat['name']);
|
||||
$old_name = $stat['old_name'];
|
||||
|
||||
if (!empty($delete) && $delete == $old_name)
|
||||
{
|
||||
unset($this->status[$typ][$old_name]);
|
||||
continue;
|
||||
}
|
||||
if (isset($stat['name']) && empty($name) && ($create || !empty($old_name))) // empty name not allowed
|
||||
{
|
||||
$content['error_msg'] = lang('Name must not be empty !!!');
|
||||
}
|
||||
if (isset($stat['old_name']))
|
||||
{
|
||||
if (!empty($name) && $old_name != $name) // renamed
|
||||
{
|
||||
unset($this->status[$typ][$old_name]);
|
||||
|
||||
if ($default == $old_name)
|
||||
{
|
||||
$default = $name;
|
||||
}
|
||||
}
|
||||
elseif (empty($name))
|
||||
{
|
||||
$name = $old_name;
|
||||
}
|
||||
}
|
||||
elseif (empty($name)) // new item and empty ==> ignore it
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$this->status[$typ][$name] = empty($stat['label']) ? $name : $stat['label'];
|
||||
}
|
||||
$this->status['defaults'][$typ] = empty($default) ? $name : $default;
|
||||
if (!isset($this->status[$typ][$this->status['defaults'][$typ]]))
|
||||
{
|
||||
list($this->status['defaults'][$typ]) = @each($this->status[$typ]);
|
||||
}
|
||||
}
|
||||
|
||||
function update(&$content)
|
||||
{
|
||||
$this->update_status($content);
|
||||
$this->update_fields($content);
|
||||
|
||||
// save changes to repository
|
||||
$this->save_repository();
|
||||
}
|
||||
|
||||
function delete(&$content)
|
||||
{
|
||||
if (isset($this->bo->stock_enums['type'][$content['type2']]))
|
||||
{
|
||||
$content['error_msg'] .= lang("You can't delete one of the stock types !!!");
|
||||
return;
|
||||
}
|
||||
unset($this->types[$content['type2']]);
|
||||
unset($this->status[$content['type2']]);
|
||||
unset($this->status['defaults'][$content['type2']]);
|
||||
list($content['type2']) = each($this->types);
|
||||
|
||||
// save changes to repository
|
||||
$this->save_repository();
|
||||
}
|
||||
|
||||
function create(&$content)
|
||||
{
|
||||
$new_name = trim($content['new_name']);
|
||||
unset($content['new_name']);
|
||||
if (empty($new_name) || isset($this->types[$new_name]))
|
||||
{
|
||||
$content['error_msg'] .= empty($new_name) ?
|
||||
lang('You have to enter a name, to create a new typ!!!') :
|
||||
lang("Typ '%1' already exists !!!",$new_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->types[$new_name] = $new_name;
|
||||
$this->status[$new_name] = array(
|
||||
'ongoing' => 'ongoing',
|
||||
'done' => 'done'
|
||||
);
|
||||
$this->status['defaults'][$new_name] = 'ongoing';
|
||||
|
||||
// save changes to repository
|
||||
$this->save_repository();
|
||||
|
||||
$content['type2'] = $new_name; // show the new entry
|
||||
}
|
||||
}
|
||||
|
||||
function save_repository()
|
||||
{
|
||||
// save changes to repository
|
||||
$this->config->value('types',$this->types);
|
||||
//echo '<p>uicustomfields::save_repository() \$this->status=<pre style="text-aling: left;">'; print_r($this->status); echo "</pre>\n";
|
||||
$this->config->value('status',$this->status);
|
||||
//echo '<p>uicustomfields::save_repository() \$this->fields=<pre style="text-aling: left;">'; print_r($this->fields); echo "</pre>\n";
|
||||
$this->config->value('customfields',$this->fields);
|
||||
|
||||
$this->config->save_repository();
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,22 +1,21 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Info Log *
|
||||
* http://www.egroupware.org *
|
||||
* Written by Ralf Becker <RalfBecker@outdoor-training.de> *
|
||||
* originaly based on todo written by Joseph Engo <jengo@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* This program 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. *
|
||||
\**************************************************************************/
|
||||
/**
|
||||
* InfoLog
|
||||
*
|
||||
* @link http://www.egroupware.org
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @package infolog
|
||||
* @copyright (c) 2003-6 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$GLOBALS['egw_info']['flags'] = array(
|
||||
'currentapp' => 'infolog',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True
|
||||
$GLOBALS['egw_info'] = array(
|
||||
'flags' => array(
|
||||
'currentapp' => 'infolog',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
)
|
||||
);
|
||||
include('../header.inc.php');
|
||||
|
||||
@ -35,4 +34,3 @@ unset($setup_info);
|
||||
ExecMethod('infolog.uiinfolog.index','reset_action_view');
|
||||
|
||||
$GLOBALS['egw']->common->egw_exit();
|
||||
?>
|
||||
|
File diff suppressed because one or more lines are too long
@ -48,6 +48,7 @@ category infolog de Kategorie
|
||||
change the status of an entry, eg. close it infolog de Status eines Eintrags ändern, zB. ihn als erledigt markieren
|
||||
charset of file infolog de Zeichensatz der Datei
|
||||
check to set startday infolog de ankreutzen um Startdatum zu setzen
|
||||
check to specify custom contact infolog de Ankreutzen um einen eigenen Kontakt anzugeben
|
||||
click here to create the link infolog de hier klicken um die Verknüpfung zu erzeugen
|
||||
click here to start the search infolog de hier klicken um die Suche zu starten
|
||||
close infolog de Schließen
|
||||
@ -280,6 +281,7 @@ typ infolog de Typ
|
||||
typ '%1' already exists !!! infolog de Typ '%1' existiert bereits !!!
|
||||
type infolog de Typ
|
||||
type ... infolog de Typ ...
|
||||
type of customfield infolog de Typ des benutzerdefinierten Feldes
|
||||
type of the log-entry: note, phonecall or todo infolog de Typ des Eintrags: Notiz, Anruf oder Auftrag
|
||||
unlink infolog de Verküpfung lösen
|
||||
upcoming infolog de zukünftig
|
||||
|
@ -48,6 +48,7 @@ category infolog en Category
|
||||
change the status of an entry, eg. close it infolog en Change the status of an entry, eg. close it
|
||||
charset of file infolog en Charset of file
|
||||
check to set startday infolog en check to set startday
|
||||
check to specify custom contact infolog en Check to specify custom contact
|
||||
click here to create the link infolog en click here to create the Link
|
||||
click here to start the search infolog en click here to start the search
|
||||
close infolog en Close
|
||||
@ -279,6 +280,7 @@ typ infolog en Type
|
||||
typ '%1' already exists !!! infolog en Type '%1' already exists !!!
|
||||
type infolog en Type
|
||||
type ... infolog en Type ...
|
||||
type of customfield infolog en Type of customfield
|
||||
type of the log-entry: note, phonecall or todo infolog en Type of the log-entry: Note, Phone call or ToDo
|
||||
unlink infolog en Unlink
|
||||
upcoming infolog en upcoming
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
$setup_info['infolog']['name'] = 'infolog';
|
||||
$setup_info['infolog']['version'] = '1.2.004';
|
||||
$setup_info['infolog']['version'] = '1.3.001';
|
||||
$setup_info['infolog']['app_order'] = 5;
|
||||
$setup_info['infolog']['tables'] = array('egw_infolog','egw_infolog_extra');
|
||||
$setup_info['infolog']['enable'] = 1;
|
||||
@ -75,3 +75,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -39,7 +39,8 @@
|
||||
'info_price' => array('type' => 'float','precision' => '8'),
|
||||
'info_percent' => array('type' => 'int','precision' => '2','default' => '0'),
|
||||
'info_datecompleted' => array('type' => 'int','precision' => '8'),
|
||||
'info_location' => array('type' => 'varchar','precision' => '255')
|
||||
'info_location' => array('type' => 'varchar','precision' => '255'),
|
||||
'info_custom_from' => array('type' => 'int','precision' => '1')
|
||||
),
|
||||
'pk' => array('info_id'),
|
||||
'fk' => array(),
|
||||
|
@ -556,3 +556,15 @@
|
||||
|
||||
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.2.004';
|
||||
}
|
||||
|
||||
$test[] = '1.2.004';
|
||||
function infolog_upgrade1_2_004()
|
||||
{
|
||||
// column to save if from contains a custom text
|
||||
$GLOBALS['egw_setup']->oProc->AddColumn('egw_infolog','info_custom_from',array(
|
||||
'type' => 'int',
|
||||
'precision' => '1',
|
||||
));
|
||||
|
||||
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.3.001';
|
||||
}
|
||||
|
@ -14,4 +14,5 @@
|
||||
.planned { font-style:italic; }
|
||||
.fullWidth table { width: 100%; }
|
||||
.infoId:before { content:"#" }
|
||||
.fixedHeight { line-height: 12px; }
|
||||
.fixedHeight { line-height: 12px; }
|
||||
.noWrap { white-space: nowrap; }
|
@ -34,7 +34,7 @@
|
||||
</rows>
|
||||
</grid>
|
||||
</template>
|
||||
<template id="infolog.customfields.fields" template="" lang="" group="0" version="1.2.001">
|
||||
<template id="infolog.customfields.fields" template="" lang="" group="0" version="1.3.001">
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
@ -44,12 +44,14 @@
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row class="th">
|
||||
<description value="Typ"/>
|
||||
<description value="Name"/>
|
||||
<description value="Label"/>
|
||||
<description value="Type"/>
|
||||
<description value="Values for selectbox"/>
|
||||
<description value="Length<br>Rows"/>
|
||||
<description value="Order"/>
|
||||
@ -57,15 +59,18 @@
|
||||
</row>
|
||||
<row class="row" valign="top">
|
||||
<menulist>
|
||||
<menupopup options="All" id="${row}[typ]" statustext="for which types should this field be used"/>
|
||||
<menupopup options="All" id="${row}[type2]" statustext="for which types should this field be used"/>
|
||||
</menulist>
|
||||
<textbox size="20" maxlength="32" id="${row}[name]" statustext="the name used internaly (<= 20 chars), changeing it makes existing data unavailible"/>
|
||||
<vbox>
|
||||
<vbox options="0,0">
|
||||
<textbox maxlength="255" id="${row}[label]" statustext="the text displayed to the user"/>
|
||||
<description id="${row}[label]"/>
|
||||
</vbox>
|
||||
<menulist>
|
||||
<menupopup id="${row}[type]" statustext="Type of customfield" no_lang="1"/>
|
||||
</menulist>
|
||||
<textbox multiline="true" rows="2" cols="30" id="${row}[values]" statustext="each value is a line like <id>[=<label>]"/>
|
||||
<vbox>
|
||||
<vbox options="0,0">
|
||||
<textbox size="5" id="${row}[len]" statustext="max length of the input [, length of the inputfield (optional)]"/>
|
||||
<int options="0,10,2" id="${row}[rows]" statustext="number of row for a multiline inputfield or line of a multi-select-box" blur="1"/>
|
||||
</vbox>
|
||||
@ -78,7 +83,7 @@
|
||||
</rows>
|
||||
</grid>
|
||||
</template>
|
||||
<template id="infolog.customfields" template="" lang="" group="0" version="1.2.001">
|
||||
<template id="infolog.customfields" template="" lang="" group="0" version="1.3.001">
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
@ -92,7 +97,7 @@
|
||||
<row>
|
||||
<description value="Typ"/>
|
||||
<menulist>
|
||||
<menupopup id="typ" onchange="1" statustext="select a typ to edit it's status-values or delete it"/>
|
||||
<menupopup id="type2" onchange="1" statustext="select a typ to edit it's status-values or delete it"/>
|
||||
</menulist>
|
||||
<button label="Delete" id="button[delete]" statustext="deletes the selected typ"/>
|
||||
<textbox size="10" maxlength="40" id="new_name" statustext="name of new type to create" blur="new name"/>
|
||||
|
@ -123,7 +123,7 @@
|
||||
</rows>
|
||||
</grid>
|
||||
</template>
|
||||
<template id="infolog.edit" template="" lang="" group="0" version="1.2.002">
|
||||
<template id="infolog.edit" template="" lang="" group="0" version="1.3.001">
|
||||
<grid width="100%">
|
||||
<columns>
|
||||
<column width="103"/>
|
||||
@ -152,13 +152,19 @@
|
||||
</row>
|
||||
<row class="row">
|
||||
<description value="Contact" options=",,,info_from"/>
|
||||
<textbox size="36" maxlength="255" id="info_from" statustext="Custom contact-information, leave emtpy to use information from most recent link" blur="@blur_title"/>
|
||||
<vbox options="0,0">
|
||||
<hbox options="0,0">
|
||||
<link-entry id="info_contact" class="noWrap"/>
|
||||
<checkbox id="info_custom_from" onchange="document.getElementById(form::name('info_from')).style.display=this.checked?'block':'none';" statustext="Check to specify custom contact"/>
|
||||
</hbox>
|
||||
<textbox size="36" maxlength="255" id="info_from" statustext="Custom contact-information, leave emtpy to use information from most recent link" blur="@blur_title" class="$cont[hide_from_css]"/>
|
||||
</vbox>
|
||||
<description value="Phone/Email" options=",,,_info_addr"/>
|
||||
<textbox size="30" maxlength="255" id="info_addr" statustext="Custom contact-address, leave empty to use information from most recent link"/>
|
||||
</row>
|
||||
<row class="row">
|
||||
<description value="Subject" options=",,,info_subject"/>
|
||||
<textbox size="80" maxlength="255" span="all" id="info_subject" needed="1" statustext="a short subject for the entry"/>
|
||||
<textbox size="80" maxlength="255" span="all" id="info_subject" statustext="a short subject for the entry"/>
|
||||
</row>
|
||||
<row valign="top" height="250">
|
||||
<tabbox span="all">
|
||||
@ -209,7 +215,7 @@
|
||||
<menupopup type="select-account" id="info_owner" readonly="true"/>
|
||||
</menulist>
|
||||
<description value="Last modified"/>
|
||||
<hbox orient="0,0">
|
||||
<hbox options="0" orient="0">
|
||||
<menulist>
|
||||
<menupopup type="select-account" id="info_modifier" readonly="true"/>
|
||||
</menulist>
|
||||
@ -228,5 +234,8 @@
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<styles>
|
||||
.hideFrom input { display: none; }
|
||||
</styles>
|
||||
</template>
|
||||
</overlay>
|
Loading…
Reference in New Issue
Block a user