forked from extern/egroupware
Fix accidentally crossed directory
This commit is contained in:
parent
ab54bf675f
commit
b7f7cae531
@ -1,42 +1,43 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Registration - Sitemgr registration form
|
* Addressbook - Sitemgr contact form
|
||||||
*
|
*
|
||||||
* @link http://www.egroupware.org
|
* @link http://www.egroupware.org
|
||||||
* @author Nathan Gray
|
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||||
* @package registration
|
* @package addressbook
|
||||||
* @copyright (c) 2010 Nathan Gray
|
* @copyright (c) 2007 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SiteMgr registration form
|
* SiteMgr contact form for the addressbook
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
class module_registration_form extends sitemgr_module
|
class module_addressbook_contactform extends sitemgr_module
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
|
* @return module_addressbook_contactform
|
||||||
*/
|
*/
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
$this->i18n = true;
|
|
||||||
$this->arguments = array(); // get's set in get_user_interface
|
$this->arguments = array(); // get's set in get_user_interface
|
||||||
$this->title = lang('Registration');
|
$this->title = lang('Contactform');
|
||||||
$this->description = lang('This module displays a registration form, and sends a confirmation email.');
|
$this->description = lang('This module displays a contactform, that stores direct into the addressbook.');
|
||||||
|
|
||||||
$this->etemplate_method = 'registration.registration_sitemgr.display';
|
$this->etemplate_method = 'addressbook.addressbook_contactform.display';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reimplemented to add the registration translations
|
* Reimplemented to add the addressbook translations and fetch the addressbooks only if needed for the user-interface
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function get_user_interface()
|
function get_user_interface()
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->translation->add_app('registration');
|
$GLOBALS['egw']->translation->add_app('addressbook');
|
||||||
|
|
||||||
$uicontacts = new addressbook_ui();
|
$uicontacts = new addressbook_ui();
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ class module_registration_form extends sitemgr_module
|
|||||||
'org_unit' => lang('Department'),
|
'org_unit' => lang('Department'),
|
||||||
'n_fn' => lang('Prefix').', '.lang('Firstname').' + '.lang('Lastname'),
|
'n_fn' => lang('Prefix').', '.lang('Firstname').' + '.lang('Lastname'),
|
||||||
'sep1' => '----------------------------',
|
'sep1' => '----------------------------',
|
||||||
// 'email' => lang('email'), // Required, so don't even make it optional
|
'email' => lang('email'),
|
||||||
'tel_work' => lang('work phone'),
|
'tel_work' => lang('work phone'),
|
||||||
'tel_cell' => lang('mobile phone'),
|
'tel_cell' => lang('mobile phone'),
|
||||||
'tel_fax' => lang('fax'),
|
'tel_fax' => lang('fax'),
|
||||||
@ -67,40 +68,26 @@ class module_registration_form extends sitemgr_module
|
|||||||
'sep5' => '----------------------------',
|
'sep5' => '----------------------------',
|
||||||
'captcha' => lang('Verification'),
|
'captcha' => lang('Verification'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$register_for = registration_bo::register_apps_list();
|
|
||||||
// Only real (not sitemgr) admins can select account
|
|
||||||
if(!$GLOBALS['egw_info']['user']['apps']['admin'])
|
|
||||||
{
|
|
||||||
unset($register_for['admin']);
|
|
||||||
}
|
|
||||||
$this->arguments = array(
|
$this->arguments = array(
|
||||||
'register_for' => array(
|
'arg1' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => 'What are they registering for',
|
'label' => lang('Addressbook the contact should be saved to').' ('.lang('The anonymous user needs add rights for it!').')',
|
||||||
'options'=> $register_for
|
|
||||||
),
|
|
||||||
'pending_addressbook' => array(
|
|
||||||
'type' => 'select',
|
|
||||||
'label' => lang('Addressbook the contacts should be saved to before they are confirmed.').' ('.lang('The anonymous user needs add rights for it!').')',
|
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'' => lang('None'),
|
'' => lang('None'),
|
||||||
)+registration_bo::get_allowed_addressbooks(registration_bo::PENDING)
|
)+$uicontacts->get_addressbooks(EGW_ACL_ADD) // add to not show the accounts!
|
||||||
),
|
),
|
||||||
'confirmed_addressbook' => array(
|
'arg4' => array(
|
||||||
'type' => 'select',
|
|
||||||
'label' => lang('Confirmed addressbook.').' ('.lang('The anonymous user needs add rights for it!').')',
|
|
||||||
'options' => array(
|
|
||||||
'' => lang('None'),
|
|
||||||
)+registration_bo::get_allowed_addressbooks(registration_bo::CONFIRMED)
|
|
||||||
),
|
|
||||||
'expiry' => array(
|
|
||||||
'type' => 'textfield',
|
'type' => 'textfield',
|
||||||
'label' => lang('How long to confirm before registration expires? (hours)'),
|
'label' => lang('Email addresses (comma separated) to send the contact data'),
|
||||||
'params' => array('size' => 5),
|
'params' => array('size' => 80),
|
||||||
'default' => 2,
|
|
||||||
),
|
),
|
||||||
'fields' => array(
|
'arg6' => array(
|
||||||
|
'type' => 'textfield',
|
||||||
|
'label' => lang('Subject for email'),
|
||||||
|
'params' => array('size' => 80),
|
||||||
|
'default' => lang('Contactform'),
|
||||||
|
),
|
||||||
|
'arg2' => array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => lang('Contact fields to show'),
|
'label' => lang('Contact fields to show'),
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
@ -108,19 +95,24 @@ class module_registration_form extends sitemgr_module
|
|||||||
'default' => $default,
|
'default' => $default,
|
||||||
'params' => array('size' => 9),
|
'params' => array('size' => 9),
|
||||||
),
|
),
|
||||||
'etemplate' => array(
|
'arg3' => array(
|
||||||
|
'type' => 'textfield',
|
||||||
|
'label' => lang('Message after submitting the form'),
|
||||||
|
'params' => array('size' => 80),
|
||||||
|
'default' => lang('Thank you for contacting us.'),
|
||||||
|
),
|
||||||
|
'arg5' => array(
|
||||||
'type' => 'textfield',
|
'type' => 'textfield',
|
||||||
'label' => lang('Custom eTemplate for the contactform'),
|
'label' => lang('Custom eTemplate for the contactform'),
|
||||||
'params' => array('size' => 40),
|
'params' => array('size' => 40),
|
||||||
'default' => 'registration.registration_form',
|
'default' => 'addressbook.contactform',
|
||||||
|
),
|
||||||
|
'arg7' => array(
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'label' => lang('Send emailcopy to receiver'),
|
||||||
|
'params' => array('size' => 1),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
return parent::get_user_interface();
|
return parent::get_user_interface();
|
||||||
}
|
}
|
||||||
function get_content(&$arguments, $properties) {
|
|
||||||
$arguments['link'] = $this->link();
|
|
||||||
$args['arg1'] = $this->block;
|
|
||||||
$args['arg2'] = $properties;
|
|
||||||
return parent::get_content($args, $properties);
|
|
||||||
}
|
|
||||||
}
|
}
|
90
addressbook/sitemgr/class.module_addressbook_display.inc.php
Executable file
90
addressbook/sitemgr/class.module_addressbook_display.inc.php
Executable file
@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Addressbook - Sitemgr contact form
|
||||||
|
*
|
||||||
|
* @link http://www.egroupware.org
|
||||||
|
* @author stefan Becker <StefanBecker-AT-outdoor-training.de>
|
||||||
|
* @package addressbook
|
||||||
|
* @copyright (c) 2008 by stefan Becker <StefanBecker-AT-outdoor-training.de>
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
|
* @version $Id: class.module_addressbook_display.inc.php 24028 2008-02-18 09:04:36Z stefanbecker $
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SiteMgr contact form for the addressbook
|
||||||
|
*/
|
||||||
|
class module_addressbook_display extends sitemgr_module
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @return module_addressbook_showcontactblock
|
||||||
|
*/
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
$this->arguments = array(); // get's set in get_user_interface
|
||||||
|
$this->title = lang('Display Contact');
|
||||||
|
$this->description = lang('This module displays Block from a Adddressbook Group.');
|
||||||
|
|
||||||
|
$this->etemplate_method = 'addressbook.addressbook_display.display';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented to add the addressbook translations and fetch the addressbooks only if needed for the user-interface
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function get_user_interface()
|
||||||
|
{
|
||||||
|
$GLOBALS['egw']->translation->add_app('addressbook');
|
||||||
|
|
||||||
|
$uicontacts = new addressbook_ui();
|
||||||
|
|
||||||
|
$default = $fields = array(
|
||||||
|
'org_name' => lang('Company'),
|
||||||
|
'org_unit' => lang('Department'),
|
||||||
|
'n_fn' => lang('Prefix').', '.lang('Firstname').' + '.lang('Lastname'),
|
||||||
|
'sep1' => '----------------------------',
|
||||||
|
'email' => lang('email'),
|
||||||
|
'tel_work' => lang('work phone'),
|
||||||
|
'tel_cell' => lang('mobile phone'),
|
||||||
|
'tel_fax' => lang('fax'),
|
||||||
|
'tel_home' => lang('home phone'),
|
||||||
|
'url' => lang('url'),
|
||||||
|
'sep2' => '----------------------------',
|
||||||
|
'adr_one_street' => lang('street'),
|
||||||
|
'adr_one_street2' => lang('address line 2'),
|
||||||
|
'adr_one_locality' => lang('city').' + '.lang('zip code'),
|
||||||
|
'country' => lang('country'),
|
||||||
|
);
|
||||||
|
foreach($uicontacts->customfields as $name => $data)
|
||||||
|
{
|
||||||
|
$fields['#'.$name] = $data['label'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->arguments = array(
|
||||||
|
'arg1' => array(
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => lang('Addressbook the contact should be shown').' ('.lang('The anonymous user needs read it!').')',
|
||||||
|
'options' => array(
|
||||||
|
'' => lang('All'),
|
||||||
|
)+$uicontacts->get_addressbooks(EGW_ACL_ADD) // add to not show the accounts!
|
||||||
|
),
|
||||||
|
'arg2' => array(
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => lang('Contact fields to show'),
|
||||||
|
'multiple' => true,
|
||||||
|
'options' => $fields,
|
||||||
|
'default' => $default,
|
||||||
|
'params' => array('size' => 9),
|
||||||
|
),
|
||||||
|
'arg5' => array(
|
||||||
|
'type' => 'textfield',
|
||||||
|
'label' => lang('Custom eTemplate for the contactform'),
|
||||||
|
'params' => array('size' => 40),
|
||||||
|
'default' => 'addressbook.display',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return parent::get_user_interface();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user