Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1537

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

Opravy:
- opravy chyb nalezenych unit testerem

Zobrazit rozdíly:

freenetis/branches/testing/application/vendors/unit_tester/unit_testing_config.xml
<input>
<param value=""/>
</input>
<input>
<param value="1"/>
<param type="post" name="subnet_id" value="2"/>
<param type="post" name="submit" value=""/>
</input>
<input>
<param value="1'''"/>
<param type="post" name="subnet_id" value="2'"/>
<param type="post" name="submit" value=""/>
</input>
</values>
</method>
<method name="delete" autogenerate="off">
......
<param value=""/>
</input>
<input>
<param value="1"/>
</input>
<input>
<param value="-'1"/>
</input>
</values>
......
</input>
</values>
</method>
<method name="fio_settings" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
</controller>
<controller name="bank_statements">
<method name="edit" autogenerate="off">
......
<input>
<param value=""/>
</input>
<input>
<param type="post" name="user_id" value="1"/>
<param type="post" name="name" value="Unit tester test"/>
<param type="post" name="trade_name" value=""/>
<param type="post" name="type" value="1"/>
<param type="post" name="PPPoE_logging_in" value="1"/>
<param type="post" name="login" value="Unit tester test"/>
<param type="post" name="login_password" value="Unit tester test"/>
<param type="post" name="comment" value="Unit tester test"/>
<param type="post" name="first_engineer_id" value="1"/>
<param type="post" name="price" value="12"/>
<param type="post" name="payment_rate" value="2"/>
<param type="post" name="buy_date" value="2"/>
<param type="post" name="street_id" value="1"/>
<param type="post" name="street_number" value="1"/>
<param type="post" name="town_id" value="1"/>
<param type="post" name="country_id" value="1"/>
<param type="post" name="gpsx" value="12.45"/>
<param type="post" name="gpsy" value="14.45"/>
<param type="post" name="submit" value=""/>
</input>
<input>
<param value="1"/>
<param type="post" name="user_id" value="1"/>
<param type="post" name="name" value="Unit tester test"/>
<param type="post" name="trade_name" value=""/>
<param type="post" name="type" value="1"/>
<param type="post" name="PPPoE_logging_in" value="1"/>
<param type="post" name="login" value="Unit tester test"/>
<param type="post" name="login_password" value="Unit tester test"/>
<param type="post" name="comment" value="Unit tester test"/>
<param type="post" name="first_engineer_id" value="1"/>
<param type="post" name="price" value="12"/>
<param type="post" name="payment_rate" value="2"/>
<param type="post" name="buy_date" value="2"/>
<param type="post" name="street_id" value="1"/>
<param type="post" name="street_number" value="1"/>
<param type="post" name="town_id" value="1"/>
<param type="post" name="country_id" value="1"/>
<param type="post" name="gpsx" value="12.45"/>
<param type="post" name="gpsy" value="14.45"/>
<param type="post" name="submit" value=""/>
</input>
</values>
</method>
<method name="edit" autogenerate="off">
......
<input>
<param value="1"/>
</input>
<input>
<param value="1"/>
<param type="post" name="user_id" value="1"/>
<param type="post" name="name" value="Unit tester test"/>
<param type="post" name="trade_name" value=""/>
<param type="post" name="type" value="1"/>
<param type="post" name="PPPoE_logging_in" value="1"/>
<param type="post" name="login" value="Unit tester test"/>
<param type="post" name="login_password" value="Unit tester test"/>
<param type="post" name="comment" value="Unit tester test"/>
<param type="post" name="price" value="12"/>
<param type="post" name="payment_rate" value="2"/>
<param type="post" name="buy_date" value="2"/>
<param type="post" name="street_id" value="1"/>
<param type="post" name="street_number" value="1"/>
<param type="post" name="town_id" value="1"/>
<param type="post" name="country_id" value="1"/>
<param type="post" name="gpsx" value="12.45"/>
<param type="post" name="gpsy" value="14.45"/>
<param type="post" name="submit" value=""/>
</input>
</values>
</method>
<method name="delete" autogenerate="on">
......
</input>
</values>
</method>
<method name="push" autogenerate="on">
<attributes>
<attribute name="from" default_value="" />
<attribute name="to" default_value="" />
<attribute name="subject" default_value="" />
<attribute name="body" default_value="" />
</attributes>
<values>
<input>
<param value="" />
<param value="" />
<param value="" />
<param value="" />
</input>
</values>
</method>
</controller>
<controller name="email_queues">
<method name="index" autogenerate="on">
......
<param value="2001-02-05"/>
<param value="1"/>
</input>
<input>
<param value="sef'##$ě"/>
<param value="sef'##$ě"/>
</input>
</values>
</method>
<method name="get_all_fees_by_fee_type_id" autogenerate="off">
......
<param value="array()"/>
</input>
<input>
<param value="0"/>
<param value="1"/>
<param value="array('id'=&gt;'1')"/>
</input>
<input>
<param value="sef'sef"/>
<param value="sef'sef'"/>
<param value="sef'sef''"/>
<param value=""/>
</input>
</values>
</method>
......
<input></input>
</values>
</method>
<method name="activate_interrupted_membership_message" autogenerate="on">
<method name="activate_interrupted_membership_message" autogenerate="off">
<attributes>
<attribute name="message_id" default_value="" />
<attribute name="user_id" default_value="" />
<attribute name="message_id" default_value=""/>
<attribute name="user_id" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
<param value="1"/>
<param value=""/>
</input>
</values>
</method>
......
</input>
</values>
</method>
<method name="max_key" autogenerate="on">
<method name="max_key" autogenerate="off">
<attributes>
<attribute name="array" default_value="" />
<attribute name="array" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="array(1)"/>
</input>
<input>
<param value="array(1,2,3)"/>
</input>
</values>
</method>
<method name="bool" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
<method name="rbool" autogenerate="on">
<attributes></attributes>
<values>
<input></input>
</values>
</method>
</helper>
<helper name="breadcrumbs">
<method name="add" autogenerate="on">
......
<values>
</values>
</method>
<method name="datetime_diff" autogenerate="on">
<method name="datetime_diff" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="name" default_value="" />
<attribute name="args" default_value="array()" />
<attribute name="item" default_value=""/>
<attribute name="name" default_value=""/>
<attribute name="args" default_value="array()"/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
<input>
<param value="" />
<param value="" />
<param value="array()" />
</input>
</values>
</method>
<method name="gps_field" autogenerate="off">
......
<values>
</values>
</method>
<method name="round" autogenerate="on">
<method name="round" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="name" default_value="" />
<attribute name="args" default_value="array()" />
<attribute name="item" default_value=""/>
<attribute name="name" default_value=""/>
<attribute name="args" default_value="array()"/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
<input>
<param value="" />
<param value="" />
<param value="array()" />
</input>
</values>
</method>
<method name="aco_count_field" autogenerate="off">
......
<values>
</values>
</method>
<method name="connected_to_device" autogenerate="on">
<method name="connected_to_device" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="name" default_value="" />
<attribute name="item" default_value=""/>
<attribute name="name" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="email_from_field" autogenerate="off">
......
<values>
</values>
</method>
<method name="latency_field" autogenerate="on">
<method name="latency_field" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="name" default_value="" />
<attribute name="item" default_value=""/>
<attribute name="name" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="log_action_field" autogenerate="off">
......
<values>
</values>
</method>
<method name="monitor_state_field" autogenerate="on">
<method name="monitor_state_field" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="name" default_value="" />
<attribute name="item" default_value=""/>
<attribute name="name" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="month_field" autogenerate="off">
......
<values>
</values>
</method>
<method name="link_item_field" autogenerate="on">
<method name="link_item_field" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="name" default_value="" />
<attribute name="item" default_value=""/>
<attribute name="name" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="link_medium_field" autogenerate="on">
<method name="link_medium_field" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="name" default_value="" />
<attribute name="item" default_value=""/>
<attribute name="name" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="sms_receiver_field" autogenerate="off">
......
<values>
</values>
</method>
<method name="wireless_mode" autogenerate="on">
<method name="wireless_mode" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="name" default_value="" />
<attribute name="item" default_value=""/>
<attribute name="name" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="wireless_segment_frequence" autogenerate="off">
......
<values>
</values>
</method>
<method name="wireless_link_norm" autogenerate="on">
<method name="wireless_link_norm" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="name" default_value="" />
<attribute name="item" default_value=""/>
<attribute name="name" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="work_approved" autogenerate="off">
......
<values>
</values>
</method>
<method name="is_not_default_vlan" autogenerate="on">
<method name="is_not_default_vlan" autogenerate="off">
<attributes>
<attribute name="item" default_value="" />
<attribute name="item" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
</input>
</values>
</method>
</helper>
</method></helper>
<helper name="cookie">
<method name="set" autogenerate="on">
<attributes>
......
</input>
</values>
</method>
<method name="arithmetic_arr" autogenerate="on">
<method name="arithmetic_arr" autogenerate="off">
<attributes>
<attribute name="unit" default_value="" />
<attribute name="number" default_value="" />
<attribute name="unit" default_value=""/>
<attribute name="number" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
<input>
<param value="" />
<param value="" />
</input>
<input>
<param value="" />
<param value="" />
</input>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
<method name="arithmetic" autogenerate="on">
......
</input>
</values>
</method>
<method name="create_hiddens" autogenerate="on">
<method name="create_hiddens" autogenerate="off">
<attributes>
<attribute name="input" default_value="" />
<attribute name="prefix" default_value="" />
<attribute name="input" default_value=""/>
<attribute name="prefix" default_value=""/>
</attributes>
<values>
<input>
<param value="" />
<param value="" />
</input>
<input>
<param value="" />
<param value="" />
</input>
</values>
</method>
</helper>
freenetis/branches/testing/application/models/message.php
LIMIT " . intval($limit_from) . ", " . intval($limit_results) . "
");
}
/**
* Activates interrupted membership message to ip addresses of users with
* interrupted membership.
*
* @author Jiri Svitak
* @param integer $message_id ID of message
* @param integer $user_id Who redirects
* @return integer Number of ip addresses activated
*/
public function activate_interrupted_membership_message($message_id, $user_id)
{
// preparation
$message = new Message_Model($message_id);
// message do not exists
if (!$message || !$message->id)
{
throw new Exception('Debtor message not founded');
}
// IP adreesses
$ip_model = new Ip_address_Model();
$ips = $ip_model->get_ip_addresses_with_interrupted_membership();
// activate
return self::activate_redirection($message, $ips, $user_id);
}
/**
* Activates notifications for ip addresses with unallowed connecting place
......
// activate
return self::activate_redirection($message, $ips, $user_id);
}
/**
* Activates debtor message to ip addresses of members with
* negative credit.
*
* @author Ondřej Fibich
* @param integer $message_id ID of message
* @param integer $user_id Who redirects
* @param double $debtor_boundary Border of debtor
* @param integer $redirection Redirection state
* @param integer $email E-mail state
* @param integer $sms SMS state
* @return array Stats array
*/
public function activate_debtor_message(
$message_id, $user_id, $debtor_boundary,
$redirection, $email, $sms)
{
// stats
$s = array
(
'ip_count' => 0,
'email_count' => 0,
'sms_count' => 0
);
// helper models
$ip_model = new Ip_address_Model();
$uc_model = new Users_contacts_Model();
$message = new Message_Model($message_id);
// message do not exists
if (!$message || !$message->id)
{
throw new Exception('Debtor message not founded');
}
// redirection
if ($redirection == Notifications_Controller::ACTIVATE)
{
// find IP addresses of debtors
$ips = $ip_model->get_ip_addresses_of_debtors($debtor_boundary);
// activate redirection for finded IP addresses
$s['ip_count'] = self::activate_redirection($message, $ips, $user_id);
}
// send emails
if ($email == Notifications_Controller::ACTIVATE)
{
// find email addresses of debtors
$emails = $uc_model->get_contacts_of_debtors_by_type(
$debtor_boundary, Contact_Model::TYPE_EMAIL
);
// send emails for finded emails
$s['email_count'] = self::send_emails($message, $emails);
}
// send SMS messages
if ($sms == Notifications_Controller::ACTIVATE)
{
// find phone numbers of debtors
$smss = $uc_model->get_contacts_of_debtors_by_type(
$debtor_boundary, Contact_Model::TYPE_PHONE
);
// send SMS messages for finded phone numbers
$s['sms_count'] = self::send_sms_messages($message, $smss, $user_id);
}
// return stats array
return $s;
}
/**
* Activates payment notice message to ip addresses of members who have
* low credit.
*
* @author Ondřej Fibich
* @param integer $message_id ID of message
* @param integer $user_id Who redirects
* @param double $payment_notice_boundary
* @param double $debtor_boundary Border of debtor
* @param integer $redirection Redirection state
* @param integer $email E-mail state
* @param integer $sms SMS state
* @return array Stats array
*/
public function activate_payment_notice_message(
$message_id, $user_id, $payment_notice_boundary,
$debtor_boundary, $redirection, $email, $sms)
{
// stats
$s = array
(
'ip_count' => 0,
'email_count' => 0,
'sms_count' => 0
);
// helper models
$ip_model = new Ip_address_Model();
$uc_model = new Users_contacts_Model();
$message = new Message_Model($message_id);
// message do not exists
if (!$message || !$message->id)
{
throw new Exception('Payment notice message not founded');
}
// redirection
if ($redirection == Notifications_Controller::ACTIVATE)
{
// find IP addresses of debtors
$ips = $ip_model->get_ip_addresses_of_almostdebtors(
$payment_notice_boundary, $debtor_boundary
);
// activate redirection for finded IP addresses
$s['ip_count'] = self::activate_redirection($message, $ips, $user_id);
}
// send emails
if ($email == Notifications_Controller::ACTIVATE)
{
// find email addresses of debtors
$emails = $uc_model->get_contacts_of_almostdebtors_by_type(
$payment_notice_boundary, $debtor_boundary,
Contact_Model::TYPE_EMAIL
);
// send emails for finded emails
$s['email_count'] = self::send_emails($message, $emails);
}
// send SMS messages
if ($sms == Notifications_Controller::ACTIVATE)
{
// find phone numbers of debtors
$smss = $uc_model->get_contacts_of_almostdebtors_by_type(
$payment_notice_boundary, $debtor_boundary,
Contact_Model::TYPE_PHONE
);
// send SMS messages for finded phone numbers
$s['sms_count'] = self::send_sms_messages($message, $smss, $user_id);
}
// return stats array
return $s;
}
/**
* Activates user message by given id
......
* @param integer $type
* @return integer
*/
public function get_message_id_by_type ($type)
public function get_message_id_by_type($type)
{
if (!$type)
{
freenetis/branches/testing/application/controllers/transfers.php
$form->group('Basic information');
$form->input('text')
->label(__('Text') . ':')
->rules('required|length[3,50]')
->value($transfer->text);
$form->input('amount')
->label(__('Amount') . ':')
->rules('required')
->value($transfer->amount)
->callback(array($this, 'valid_amount'));
......
try
{
$db = new Transfer_Model();
$db->transaction_start();
$transfer->transaction_start();
Transfer_Model::edit_transfer($form_data['text'], $form_data['amount']);
Transfer_Model::edit_transfer(
$transfer->id, $form_data['text'], $form_data['amount']
);
$db->transaction_commit();
$transfer->transaction_commit();
status::success('Transfer has been successfully updated.');
url::redirect('transfers/show/' . $transfer_id);
}
catch (Exception $e)
{
$db->transaction_rollback();
$transfer->transaction_rollback();
status::error('Error - cant update transfer.');
url::redirect('transfers/show/' . $transfer_id);
}
freenetis/branches/testing/application/controllers/bank_accounts.php
* Settings for daily Fio imports.
* @author Jiri Svitak
*/
/*public function fio_settings()
/*public fun ction fio_settings()
{
// access control
if (!$this->acl_check_new('Accounts_Controller', 'bank_transfers'))
freenetis/branches/testing/application/views/subnets/address_map.php
endfor;
$i = 0;
$height = 0;
while ($i < 256)
{
?>

Také k dispozici: Unified diff