Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 2058

Přidáno uživatelem Ondřej Fibich před více než 11 roky(ů)

Upravy:
- znemozneni manualniho nastaveni typu cena na cekatele

Opravy:
- oprava editace cekatele na clenstvi (php validator data vstupu)

Zobrazit rozdíly:

freenetis/branches/1.1/application/controllers/js.php
$this->address_point_streets();
$this->address_point_gps();
$this->domicile_toogle();
$this->member_type();
}
private function _js_members_approve_applicant($applicant_id)
......
$this->address_point_streets();
$this->address_point_gps();
$this->domicile_toogle();
$this->member_type();
}
private function _js_members_fees_add($member_id = NULL, $fee_type_id = NULL)
......
}
/**
* Adds javascript for handling of member type. (Form is changed according to type)
*
* @author Ondřej Fibich
*/
private function member_type()
{
$this->views['__pieces_member_type'] =
View::factory('js/__pieces/member_type')->render();
}
/**
* Adds javascript for handling of time activity rule attributes.
*
* @author Ondřej Fibich
freenetis/branches/1.1/application/controllers/members.php
$entrace_start_year = date('Y', strtotime($association->entrance_date));
// cannot add former member
unset($types[$enum_types->get_type_id('Former member')]);
unset($types[Member_Model::TYPE_FORMER]);
unset($types[Member_Model::TYPE_APPLICANT]);
// regular member by default
$type_id = $enum_types->get_type_id('Regular member');
......
->value($member->name);
}
if ($this->acl_check_edit(get_class($this),'type',$member->id))
if ($this->acl_check_edit(get_class($this),'type',$member->id) &&
$member->type != Member_Model::TYPE_APPLICANT)
{
$enum_type_model = new Enum_type_Model();
$types = $enum_type_model->get_values(Enum_type_Model::MEMBER_TYPE_ID);
unset($types[$enum_type_model->get_type_id('Former member')]);
unset($types[Member_Model::TYPE_FORMER]);
unset($types[Member_Model::TYPE_APPLICANT]);
$form->dropdown('type')
->options($types)
......
->rules('valid_numeric')
->value($allowed_subnets_count);
if ($this->acl_check_edit(get_class($this), 'entrance_date', $member->id))
if ($this->acl_check_edit(get_class($this), 'entrance_date', $member->id) &&
$member->type != Member_Model::TYPE_APPLICANT)
{
$form->date('entrance_date')
->label('Entrance date')
......
}
}
if ($this->acl_check_edit(get_class($this),'type',$member->id))
if ($this->acl_check_edit(get_class($this),'type',$member->id) &&
$member->type != Member_Model::TYPE_APPLICANT)
{
if ($member->type != $form_data['type'])
{
// change gacl rights for applicant (registration)
// required after self registration
if ($member->type == Member_Model::TYPE_APPLICANT)
{
$group_aro_map = new Groups_aro_map_Model();
// get main user
$main_user_id = NULL;
foreach ($member->users as $user)
{
if ($user->type == User_Model::MAIN_USER)
{
$main_user_id = $user->id;
break;
}
}
if (!$main_user_id)
throw new Exception('Main user of applicant is missing');
// if is not member yet
if (!$group_aro_map->exist_row(
Aro_group_Model::REGULAR_MEMBERS, $main_user_id
))
{
// delete rights of applicant
$group_aro_map->detete_row(
Aro_group_Model::REGISTERED_APPLICANTS,
$main_user_id
);
// insert regular member access rights
$groups_aro_map = new Groups_aro_map_Model();
$groups_aro_map->aro_id = $main_user_id;
$groups_aro_map->group_id = Aro_group_Model::REGULAR_MEMBERS;
$groups_aro_map->save();
}
}
$member->type = $form_data['type'];
}
$member->type = $form_data['type'];
}
if ($this->acl_check_edit(get_class($this), 'organization_id', $member->id))
......
else
{
$headline = __('Edit member');
if ($member->type == Member_Model::TYPE_APPLICANT)
{
$headline = __('Edit applicant for membership');
}
// breadcrumbs navigation
$breadcrumbs = breadcrumbs::add()
......
$view->breadcrumbs = $breadcrumbs->html();
$view->title = $headline;
$view->content = new View('form');
$view->content->headline =
__('Editing of member').' '.$member->name;
$view->content->headline = $headline . ' ' . $member->name;
$view->content->form = $form->html();
$view->content->link_back = '';
$view->render(TRUE);
freenetis/branches/1.1/application/i18n/cs_CZ/texts.php
'edit address point' => 'Upravit adresní bod',
'edit admin of devices' => 'Upravit správce zařízení',
'edit all records' => 'Upravovat všechny záznamy',
'edit applicant for membership' => 'Upravit čekatele na členství',
'edit approval template' => 'Upravit hlasovací šablonu',
'edit approval template item' => 'Upravit položku hlasovací šablony',
'edit approval type' => 'Upravit hlasovací typ',
freenetis/branches/1.1/application/views/js/__pieces/member_type.php
<?php
/**
* Member type javascript view.
* During adding/editing of member, toogle fields according to member type.
*
* @author Michal Kliment, Ondřej Fibich
*/
// IDE complementation
if (FALSE): ?><script type="text/javascript"><?php endif
?>
// on change of type change the form
$('select#type').change(function ()
{
var val = $(this).val();
var $entrance_date_row = $('th.entrance_date').parent();
// applicant - hide registration
if (val == '<?php echo Member_Model::TYPE_APPLICANT ?>')
{
$entrance_date_row.hide();
}
// default - show all
else
{
$entrance_date_row.show();
}
}).trigger('change');

Také k dispozici: Unified diff