Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 765

Přidáno uživatelem Michal Kliment před téměř 14 roky(ů)

Snad posledni opravy - u instalace bylo potreba jeste pridat defaultni poplatky pro clena s ID 1 (zpetny SQL dotazy funguji pouze pro existuji instalace, u novych se diky neexistenci clena ID 1 nevykonaji). Stejne tak pridanty systemove (pouze pro cteni) poplatky - preruseni clenstvi. neplatici radny clen, neclen a cestny clen.

Zobrazit rozdíly:

freenetis/branches/tariffs/application/controllers/installation.php
// interval of fee availability
$from = date("Y-m-d", $form_data["foundation"]);
$to = "9999-12-31 23:59:59";
// entrance fee
$entrance_fee = new Fee_Model();
$entrance_fee->fee = $form_data['entrance_fee'];
......
$entrance_fee->to = $to;
$entrance_fee->type_id = $enum_type->get_type_id('entrance fee');
$entrance_fee->save();
// default entrance fee
$default_entrance_fee = new Members_fee_Model();
$default_entrance_fee->fee_id = $entrance_fee->id;
$default_entrance_fee->member_id = $member->id;
$default_entrance_fee->activation_date = $from;
$default_entrance_fee->deactivation_date = $to;
$default_entrance_fee->priority = 1;
$default_entrance_fee->save();
// regular member fee
$regular_member_fee = new Fee_Model();
$regular_member_fee->fee = $form_data['regular_member_fee'];
......
$regular_member_fee->to = $to;
$regular_member_fee->type_id = $enum_type->get_type_id('regular member fee');
$regular_member_fee->save();
// default regular member fee
$default_regular_member_fee = new Members_fee_Model();
$default_regular_member_fee->fee_id = $regular_member_fee->id;
$default_regular_member_fee->member_id = $member->id;
$default_regular_member_fee->activation_date = $from;
$default_regular_member_fee->deactivation_date = $to;
$default_regular_member_fee->priority = 1;
$default_regular_member_fee->save();
// transfer fee
$transfer_fee = new Fee_Model();
$transfer_fee->fee = $form_data['transfer_fee'];
......
$transfer_fee->to = $to;
$transfer_fee->type_id = $enum_type->get_type_id('transfer fee');
$transfer_fee->save();
// default transfer fee
$default_transfer_fee = new Members_fee_Model();
$default_transfer_fee->fee_id = $transfer_fee->id;
$default_transfer_fee->member_id = $member->id;
$default_transfer_fee->activation_date = $from;
$default_transfer_fee->deactivation_date = $to;
$default_transfer_fee->priority = 1;
$default_transfer_fee->save();
// penalty
$penalty = new Fee_Model();
$penalty->fee = $form_data['penalty'];
......
$penalty->to = $to;
$penalty->type_id = $enum_type->get_type_id('penalty');
$penalty->save();
// default transfer fee
$default_penalty = new Members_fee_Model();
$default_penalty->fee_id = $penalty->id;
$default_penalty->member_id = $member->id;
$default_penalty->activation_date = $from;
$default_penalty->deactivation_date = $to;
$default_penalty->priority = 1;
$default_penalty->save();
// system settings
$this->settings->set('title', $form_data['title']);
$this->settings->set('currency', $form_data['currency']);
$this->settings->set('default_country', $form_data['default_country']);
// saves special (read-only) types of fee
$fee_model = new Fee_Model();
$special_types = array(1 => "Membership interrupt", 2 => "Fee-free regular member", 3 => "Non-member", 4 => "Honorary member");
foreach ($special_types as $id => $name)
{
$fee_model->clear();
$fee_model->readonly = 1;
$fee_model->fee = 0;
$fee_model->from = $from;
$fee_model->to = $to;
$fee_model->type_id = $enum_type->get_type_id('regular member fee');
$fee_model->name = $name;
$fee_model->special_type_id = $id;
$fee_model->save();
}
$clean_urls = ($form_data['clean_urls'] && server::is_mod_rewrite_enabled());
// want clean urls - remove index.php from urls

Také k dispozici: Unified diff