Revize 1234
Přidáno uživatelem Ondřej Fibich před asi 13 roky(ů)
freenetis/branches/testing/media/css/style.css | ||
---|---|---|
.help_16 {
|
||
cursor: help;
|
||
}
|
||
.menu_item_counter {
|
||
margin-right: 5px;
|
||
padding: 0px 6px;
|
||
font-size: 10px;
|
||
font-family: arial;
|
||
font-weight: bold;
|
||
background-color: #CCC;
|
||
-moz-border-radius: 5px;
|
||
-webkit-border-radius: 5px;
|
||
border-radius: 5px;
|
||
}
|
||
|
||
/* -------#end MENU-------- */
|
||
/* ------------------------ */
|
||
... | ... | |
}
|
||
|
||
.help {
|
||
cursor: help;
|
||
cursor: help;
|
||
}
|
||
|
||
.red {
|
||
color: red;
|
||
color: red;
|
||
}
|
||
|
||
.rbg {
|
||
background-color: red;
|
||
color: white;
|
||
}
|
||
|
||
.search_result {
|
||
margin: 15px;
|
||
margin: 15px;
|
||
}
|
||
|
||
.search_result_title {
|
freenetis/branches/testing/application/i18n/cs_CZ/help.php | ||
---|---|---|
'allowed_subnets_enabled' => 'Zelené tlačítko nalevo znamená to, že podsíť, ze které se přihlašujete, patří mezi vaše povolené podsítě. POZOR! Kliknutím na tlačítko ji zakážete. Tímto úkonem povolíte některou z aktuálně zakázaných podsítí.',
|
||
'allowed_subnets_update_interval' => 'Interval aktualizace povolených podsítí v sekundách. Po uplynutí této doby se IP adresám z nepovolených podsítí nastaví přesměrování typu Přerušené členství. Výchozí hodnota je 60 sekund (1 minuta).',
|
||
'application_password' => 'Aplikační heslo slouží uživateli pro přihlášení ke službám, které jsou závislé na Radius serveru, jako například VPN, aktivní prvky sítě atd. Toto heslo je v databázi uloženo v otevřené podobě.',
|
||
'approval_priority' => 'Priorita umožňuje vícekolové hlasování o práci/pracovním výkazu. Pokud nechcete šablonu s vícekolovým hlasováním, nastavte u všech položek šablony prioritu na hodnotu \'0\'. Vícekolové hlasování začíná u prvku s nejvyšší prioritou a sestupuje k dalším kolům hlasováním, dokud není buďto schváleno ve všech kolech, nebo v jednom z kol zamítnuto. Pokud v některém z kol hlasování chcete schvalovat více prvků zadejte jim stejnou prioritu.',
|
||
'approval_state' => 'Stav je ve formátu Pro / Proti / Zdrželi se.',
|
||
'bank_accounts' => 'Bankovní účty jsou primárně vytvářeny automaticky během importu bankovního výpisu. V případě úspěšného rozpoznání platby je rovnou tento bankovní účet svázán s rozpoznaným členem. V případě, že člen v budoucnu splete variabilní symbol, pak toto ukládání bankovních účtů usnadňuje identifikaci platby v případě, že opět platil ze stejného účtu. Ruční přidávání bankovních účtů je vyhrazeno pro nestandardní případy.',
|
||
'bank_accounts_of_association' => 'Sdružení může mít více bankovních účtů, jeden je vždy založen po instalaci, nicméně je časem možné přidávat další. Na příslušném bankovním účtu pak lze provádět import výpisů.',
|
freenetis/branches/testing/application/i18n/en_US/help.php | ||
---|---|---|
'allowed_subnets_enabled' => 'Green button on the left means that the subnet from which you access the board, is allowed between your subnet. ATTENTION! Click the button to disable it. This act enabled some of the currently banned subnets.',
|
||
'allowed_subnets_update_interval' => 'Update interval of allowed subnets in seconds. After this time, the IP addresses from unauthorized subnets set up redirects Broken type of membership. The default is 60 seconds (1 minute).',
|
||
'application_password' => 'Application user password used to login to services that are dependent on the Radius server, such as VPN, active network elements, etc. This password is stored in the database in an open form.',
|
||
'approval_priority' => 'Priority allows multi-round voting for works / work reports. If you do not vote multi-round template, set the template for all items priority to \'0 \'. Multi-round voting begins at the element with the highest priority and descends to the next rounds of voting until it is either approved in all rounds, or in one of the rounds rejected. If any of the rounds of votes to approve more elements enter them the same priority.',
|
||
'approval_state' => 'State with the format in Agree / Disagree / Abstain.',
|
||
'bank_accounts' => 'Bank accounts are primarily created automatically during import bank statement. In case of successful recognition of payment is equal to the bank account linked with recognized member. In the event that a member makes a mistake in the future variable symbol, then the saving bank accounts, facilitating identification of the payment in case the back pay from the same account. Manually adding a bank account is reserved for unusual cases.',
|
||
'bank_accounts_of_association' => 'The Association may have multiple bank accounts, one is always based upon the installation, however, it is possible to add more time. The relevant bank account can then perform the import statements.',
|
freenetis/branches/testing/application/vendors/unit_tester/unit_testing_config.xml | ||
---|---|---|
<input></input>
|
||
</values>
|
||
</method>
|
||
<method name="get_gps_by_address_from_google" autogenerate="on">
|
||
<attributes></attributes>
|
||
<values>
|
||
<input></input>
|
||
</values>
|
||
</method>
|
||
<method name="autocomplete_gps" autogenerate="on">
|
||
<attributes></attributes>
|
||
<values>
|
||
<input></input>
|
||
</values>
|
||
</method>
|
||
</controller>
|
||
<controller name="allowed_subnets">
|
||
<method name="show_by_member" autogenerate="on">
|
||
... | ... | |
<values>
|
||
</values>
|
||
</method>
|
||
<method name="valid_priority" autogenerate="off">
|
||
<attributes>
|
||
<attribute name="input" default_value=""/>
|
||
</attributes>
|
||
<values>
|
||
</values>
|
||
</method>
|
||
</controller>
|
||
<controller name="approval_templates">
|
||
<method name="index" autogenerate="on">
|
||
... | ... | |
<input></input>
|
||
</values>
|
||
</method>
|
||
<method name="get_devices_by_user" autogenerate="on">
|
||
<attributes></attributes>
|
||
<values>
|
||
<input></input>
|
||
</values>
|
||
</method>
|
||
</controller>
|
||
<controller name="languages">
|
||
<method name="index" autogenerate="on">
|
||
... | ... | |
</input>
|
||
</values>
|
||
</method>
|
||
<method name="delete" autogenerate="on">
|
||
<attributes>
|
||
<attribute name="vlan_id" default_value="" />
|
||
</attributes>
|
||
<values>
|
||
<input></input>
|
||
<input>
|
||
<param value="" />
|
||
</input>
|
||
</values>
|
||
</method>
|
||
</controller>
|
||
<controller name="voip">
|
||
<method name="index" autogenerate="on">
|
||
... | ... | |
</input>
|
||
</values>
|
||
</method>
|
||
<method name="get_all_address_points_with_empty_gps" autogenerate="on">
|
||
<attributes></attributes>
|
||
<values>
|
||
<input></input>
|
||
</values>
|
||
</method>
|
||
</model>
|
||
<model name="allowed_subnet">
|
||
<method name="get_all_allowed_subnets_by_member" autogenerate="on">
|
||
... | ... | |
</input>
|
||
</values>
|
||
</method>
|
||
<method name="get_count_of_unvoted_works_of_voter" autogenerate="on">
|
||
<attributes>
|
||
<attribute name="user_id" default_value="" />
|
||
</attributes>
|
||
<values>
|
||
<input>
|
||
<param value="" />
|
||
</input>
|
||
</values>
|
||
</method>
|
||
<method name="get_state" autogenerate="off">
|
||
<attributes>
|
||
<attribute name="type" default_value=""/>
|
||
</attributes>
|
||
<values>
|
||
</values>
|
||
</method></model>
|
||
</method>
|
||
</model>
|
||
<model name="job_report">
|
||
<method name="get_state" autogenerate="on">
|
||
<attributes></attributes>
|
||
... | ... | |
<input></input>
|
||
</values>
|
||
</method>
|
||
<method name="get_suggest_amount" autogenerate="on">
|
||
<attributes></attributes>
|
||
<values>
|
||
<input></input>
|
||
</values>
|
||
</method>
|
||
<method name="get_count_of_unvoted_work_reports_of_voter" autogenerate="on">
|
||
<attributes>
|
||
<attribute name="user_id" default_value="" />
|
||
</attributes>
|
||
<values>
|
||
<input>
|
||
<param value="" />
|
||
</input>
|
||
</values>
|
||
</method>
|
||
<method name="get_works_of_monthly_workreport" autogenerate="on">
|
||
<attributes></attributes>
|
||
<values>
|
||
... | ... | |
</values>
|
||
</method>
|
||
<method name="get_members_joined" autogenerate="on">
|
||
<attributes></attributes>
|
||
<attributes>
|
||
<attribute name="member_id" default_value="" />
|
||
</attributes>
|
||
<values>
|
||
<input></input>
|
||
<input>
|
||
<param value="" />
|
||
</input>
|
||
</values>
|
||
</method>
|
||
<method name="get_first_member_account_id" autogenerate="on">
|
||
<attributes>
|
||
<attribute name="member_id" default_value="" />
|
||
</attributes>
|
||
<values>
|
||
<input></input>
|
||
<input>
|
||
<param value="" />
|
||
</input>
|
||
</values>
|
||
</method>
|
||
<method name="get_registered_members" autogenerate="on">
|
||
<attributes></attributes>
|
||
<values>
|
||
... | ... | |
</input>
|
||
</values>
|
||
</method>
|
||
<method name="count_unfilled_phone_invoices" autogenerate="on">
|
||
<attributes>
|
||
<attribute name="user_id" default_value="" />
|
||
</attributes>
|
||
<values>
|
||
<input>
|
||
<param value="" />
|
||
</input>
|
||
</values>
|
||
</method>
|
||
<method name="get_total_prices" autogenerate="off">
|
||
<attributes>
|
||
<attribute name="user_id" default_value=""/>
|
||
... | ... | |
</input>
|
||
</values>
|
||
</method>
|
||
<method name="get_devices_of_vlan" autogenerate="on">
|
||
<attributes>
|
||
<attribute name="vlan_id" default_value="" />
|
||
</attributes>
|
||
<values>
|
||
<input></input>
|
||
<input>
|
||
<param value="" />
|
||
</input>
|
||
</values>
|
||
</method>
|
||
</model>
|
||
<model name="vlan_iface">
|
||
<method name="count_all_vlan_ifaces" autogenerate="on">
|
||
... | ... | |
<param value="1'+1"/>
|
||
</input>
|
||
</values>
|
||
</method></model>
|
||
</method>
|
||
<method name="has_user_voted_about" autogenerate="on">
|
||
<attributes>
|
||
<attribute name="user_id" default_value="" />
|
||
<attribute name="fk_id" default_value="" />
|
||
</attributes>
|
||
<values>
|
||
<input>
|
||
<param value="" />
|
||
<param value="" />
|
||
</input>
|
||
</values>
|
||
</method>
|
||
</model>
|
||
<model name="wireless_iface">
|
||
<method name="get_mode" autogenerate="on">
|
||
<attributes>
|
||
... | ... | |
</method>
|
||
</helper>
|
||
<helper name="callback">
|
||
<method name="date" autogenerate="off">
|
||
<attributes>
|
||
<attribute name="item" default_value=""/>
|
||
<attribute name="name" default_value=""/>
|
||
</attributes>
|
||
<values>
|
||
</values>
|
||
</method>
|
||
<method name="work_approved" autogenerate="off">
|
||
<attributes>
|
||
<attribute name="item" default_value=""/>
|
||
... | ... | |
</attributes>
|
||
<values>
|
||
</values>
|
||
</method>
|
||
<method name="ports_field" autogenerate="off">
|
||
<attributes>
|
||
<attribute name="item" default_value=""/>
|
||
<attribute name="name" default_value=""/>
|
||
</attributes>
|
||
<values>
|
||
</values>
|
||
</method>
|
||
<method name="devices_field" autogenerate="off">
|
||
<attributes>
|
||
<attribute name="item" default_value=""/>
|
||
<attribute name="name" default_value=""/>
|
||
</attributes>
|
||
<values>
|
||
</values>
|
||
</method></helper>
|
||
<helper name="cookie">
|
||
<method name="set" autogenerate="on">
|
||
... | ... | |
</input>
|
||
</values>
|
||
</method>
|
||
<method name="menu_item_counter" autogenerate="on">
|
||
<attributes>
|
||
<attribute name="count" default_value="" />
|
||
</attributes>
|
||
<values>
|
||
<input>
|
||
<param value="" />
|
||
</input>
|
||
</values>
|
||
</method>
|
||
</helper>
|
||
<helper name="inflector">
|
||
<method name="uncountable" autogenerate="on">
|
freenetis/branches/testing/application/helpers/html.php | ||
---|---|---|
}
|
||
elseif (strpos($uri, '://') === FALSE)
|
||
{
|
||
$site_url = url::site($uri, $protocol);
|
||
$site_url = url_lang::site($uri, FALSE, $protocol);
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
|
||
return $compiled;
|
||
}
|
||
|
||
/**
|
||
* Menu item counter for view menu
|
||
*
|
||
* @author Ondřej Fibich
|
||
* @param integer $count
|
||
*/
|
||
public static function menu_item_counter($count)
|
||
{
|
||
echo '<span class="menu_item_counter ' . ($count ? 'rbg' : '') . '">' . $count . '</span>';
|
||
}
|
||
|
||
} // End html
|
freenetis/branches/testing/application/helpers/callback.php | ||
---|---|---|
class callback
|
||
{
|
||
/**
|
||
* Callback for date
|
||
*
|
||
* @author Ondrej Fibich
|
||
* @param object $item
|
||
* @param string $name
|
||
*/
|
||
public static function date($item, $name)
|
||
{
|
||
echo date('j.n. Y', strtotime($item->$name));
|
||
}
|
||
|
||
/**
|
||
* Callback for true false values.
|
||
*
|
||
* @author Ondrej Fibich
|
||
... | ... | |
$color = 'red';
|
||
|
||
echo "<span". ((isset($color)) ? " style='color:$color'" : "") . ">$balance</span>";
|
||
|
||
if (isset($item->a_comment) && $item->a_comment != '')
|
||
echo "<span class='help' title='".$item->a_comment."'><img src='".url::base()."media/images/icons/comment.png'></span>";
|
||
{
|
||
echo "<span class='help' title='".$item->a_comment."'><img src='".url::base()."media/images/icons/comment.png'></span>";
|
||
}
|
||
|
||
if (isset($item->member_id) && $item->member_id != 1)
|
||
echo ' '.html::anchor (url_lang::base() . (($item->a_comments_thread_id) ? 'comments/add/'.$item->a_comments_thread_id : 'comments_threads/add/account/'.$item->aid), html::image(array('src' => url::base().'media/images/ico_add.gif')), array('title' => url_lang::lang('texts.Add comment to financial state of member')));
|
||
{
|
||
echo ' '.html::anchor((($item->a_comments_thread_id) ? 'comments/add/'.$item->a_comments_thread_id : 'comments_threads/add/account/'.$item->aid), html::image(array('src' => url::base().'media/images/ico_add.gif')), array('title' => __('Add comment to financial state of member')));
|
||
}
|
||
}
|
||
|
||
/**
|
||
... | ... | |
*/
|
||
public static function origin_account_field($item, $name)
|
||
{
|
||
echo html::anchor(url_lang::base().'transfers/show_by_account/'.$item->oa_id, $item->oa_name);
|
||
echo html::anchor('transfers/show_by_account/'.$item->oa_id, $item->oa_name);
|
||
}
|
||
|
||
/**
|
||
... | ... | |
*/
|
||
public static function destination_account_field($item, $name)
|
||
{
|
||
echo html::anchor(url_lang::base().'transfers/show_by_account/'.$item->da_id, $item->da_name);
|
||
echo html::anchor('transfers/show_by_account/'.$item->da_id, $item->da_name);
|
||
}
|
||
|
||
/**
|
||
... | ... | |
public static function member_field($item, $name, $args = array())
|
||
{
|
||
if ($item->member_id)
|
||
echo html::anchor(url_lang::base()."members/show/$item->member_id", $item->member_name);
|
||
echo html::anchor("members/show/$item->member_id", $item->member_name);
|
||
elseif (isset($args[0]))
|
||
echo $args[0];
|
||
else
|
||
... | ... | |
public static function subnet_field($item, $name)
|
||
{
|
||
if (isset($item->subnet_id) && $item->subnet_id)
|
||
echo html::anchor(url_lang::base()."subnets/show/$item->subnet_id", $item->subnet_name);
|
||
echo html::anchor("subnets/show/$item->subnet_id", $item->subnet_name);
|
||
else
|
||
echo $item->subnet_name;
|
||
}
|
||
... | ... | |
if (url_lang::current(1) == 'devices')
|
||
{
|
||
echo html::anchor(
|
||
url_lang::base()."devices/show_ip_address/$item->ip_address_id",
|
||
"devices/show_ip_address/$item->ip_address_id",
|
||
$ip_address, array('class' => $class, 'title' => $title)
|
||
);
|
||
}
|
||
else
|
||
{
|
||
echo html::anchor(
|
||
url_lang::base()."ip_addresses/show/$item->ip_address_id",
|
||
"ip_addresses/show/$item->ip_address_id",
|
||
$ip_address,
|
||
array('class' => $class, 'title' => $title)
|
||
);
|
||
... | ... | |
public static function segment_field($item, $name)
|
||
{
|
||
if ($item->segment_id)
|
||
echo html::anchor(url_lang::base()."segments/show/$item->segment_id", $item->segment_name);
|
||
echo html::anchor("segments/show/$item->segment_id", $item->segment_name);
|
||
else
|
||
echo ' ';
|
||
}
|
||
... | ... | |
public static function device_field($item, $name)
|
||
{
|
||
if ($item->device_id)
|
||
echo html::anchor(url_lang::base()."devices/show/$item->device_id", $item->device_name);
|
||
echo html::anchor("devices/show/$item->device_id", $item->device_name);
|
||
else if ($item->device_name != '')
|
||
echo $item->device_name;
|
||
else if (!$item->ip_address_id)
|
||
echo '<span style="color: green">'.url_lang::lang('texts.Free').'</span>';
|
||
echo '<span style="color: green">'.__('Free').'</span>';
|
||
}
|
||
|
||
/**
|
||
... | ... | |
*/
|
||
public static function device_type_field($item, $name)
|
||
{
|
||
echo html::anchor(url_lang::base()."devices/show/$item->device_id", $item->type);
|
||
echo html::anchor("devices/show/$item->device_id", $item->type);
|
||
}
|
||
|
||
/**
|
||
... | ... | |
public static function iface_field($item, $name)
|
||
{
|
||
if ($item->iface_id)
|
||
echo html::anchor(url_lang::base()."ifaces/show/$item->iface_id", $item->mac);
|
||
echo html::anchor("ifaces/show/$item->iface_id", $item->mac);
|
||
else
|
||
echo ' ';
|
||
}
|
||
... | ... | |
*/
|
||
public static function user_field($item, $name)
|
||
{
|
||
echo html::anchor(url_lang::base()."users/show/$item->user_id", $item->user_name);
|
||
echo html::anchor("users/show/$item->user_id", $item->user_name);
|
||
}
|
||
|
||
/**
|
||
... | ... | |
*/
|
||
public static function user_login_field($item, $name)
|
||
{
|
||
echo html::anchor(url_lang::base()."users/show/$item->user_id", $item->user_login);
|
||
echo html::anchor("users/show/$item->user_id", $item->user_login);
|
||
}
|
||
|
||
public static function redirection_preview_field($item, $name)
|
||
{
|
||
echo html::anchor(url::base().'redirection/?ip_address='.$item->ip_address, url_lang::lang('texts.Show'));
|
||
echo html::anchor(url::base().'redirection/?ip_address='.$item->ip_address, __('Show'));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
}
|
||
else
|
||
{
|
||
echo url_lang::lang('texts.Cancel').' ';
|
||
echo html::anchor(url_lang::base()."redirect/delete/$item->ip_address_id/$item->message_id/member", url_lang::lang('texts.one IP address'));
|
||
echo __('Cancel').' ';
|
||
echo html::anchor("redirect/delete/$item->ip_address_id/$item->message_id/member", __('one IP address'));
|
||
echo ' | ';
|
||
echo html::anchor(url_lang::base()."redirect/delete_from_member/$item->member_id/$item->message_id", url_lang::lang('texts.all ip addresses of member'));
|
||
echo html::anchor("redirect/delete_from_member/$item->member_id/$item->message_id", __('all ip addresses of member'));
|
||
}
|
||
}
|
||
|
||
... | ... | |
switch ($item->whitelisted)
|
||
{
|
||
case Ip_address_Model::$permanent_whitelist:
|
||
echo url_lang::lang('texts.Permanent whitelist');
|
||
echo __('Permanent whitelist');
|
||
break;
|
||
case Ip_address_Model::$temporary_whitelist:
|
||
echo url_lang::lang('texts.Temporary whitelist');
|
||
echo __('Temporary whitelist');
|
||
break;
|
||
default:
|
||
echo url_lang::lang('texts.No whitelist');
|
||
echo __('No whitelist');
|
||
}
|
||
}
|
||
|
||
... | ... | |
else
|
||
{
|
||
// null value means no message
|
||
echo url_lang::lang('texts.No redirection');
|
||
echo __('No redirection');
|
||
}
|
||
}
|
||
|
||
... | ... | |
public static function message_type_field($item, $name)
|
||
{
|
||
if ($item->type == 0)
|
||
echo url_lang::lang('texts.User message');
|
||
echo __('User message');
|
||
else
|
||
echo url_lang::lang('texts.System message');
|
||
echo __('System message');
|
||
}
|
||
|
||
/**
|
||
... | ... | |
}
|
||
else
|
||
{
|
||
echo html::anchor(url_lang::base().'messages/activate/'.$message->id, url_lang::lang('texts.Activate'));
|
||
echo html::anchor('messages/activate/'.$message->id, __('Activate'));
|
||
}
|
||
}
|
||
|
||
... | ... | |
}
|
||
else
|
||
{
|
||
echo html::anchor(url_lang::base().'messages/deactivate/'.$message->id, __('Deactivate'));
|
||
echo html::anchor('messages/deactivate/'.$message->id, __('Deactivate'));
|
||
}
|
||
}
|
||
|
||
... | ... | |
$message = new Message_Model($item->id);
|
||
if ($message->type == Message_Model::USER_MESSAGE)
|
||
{
|
||
echo html::anchor(url_lang::base().'messages/delete/'.$message->id, url_lang::lang('texts.Delete'));
|
||
echo html::anchor('messages/delete/'.$message->id, __('Delete'));
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
static function message_preview_field($item, $name)
|
||
{
|
||
$message = new Message_Model($item->id);
|
||
echo html::anchor(url::base().'redirection/?id='.$message->id, url_lang::lang('texts.Preview'), array('target' => '_blank'));
|
||
echo html::anchor(url::base().'redirection/?id='.$message->id, __('Preview'), array('target' => '_blank'));
|
||
}
|
||
|
||
|
||
... | ... | |
{
|
||
if ($item->private == 1)
|
||
{
|
||
echo '<span style="color: green">' . url_lang::lang('texts.yes') . '</span>';
|
||
echo '<span style="color: green">' . __('yes') . '</span>';
|
||
}
|
||
else
|
||
{
|
||
echo '<span style="color: red">' . url_lang::lang('texts.no') . '</span>';
|
||
echo '<span style="color: red">' . __('no') . '</span>';
|
||
}
|
||
}
|
||
|
||
... | ... | |
{
|
||
if ($item->locked == 1)
|
||
{
|
||
$title = url_lang::lang('texts.Locked by admin');
|
||
$title = __('Locked by admin');
|
||
echo Html::image(array('src' => 'media/images/states/readonly_16x16.png', 'title' => $title));
|
||
}
|
||
else if ($item->filled == 1)
|
||
{
|
||
$title = url_lang::lang('texts.Already filled in');
|
||
$title = __('Already filled in');
|
||
echo Html::image(array('src' => 'media/images/states/good_16x16.png', 'title' => $title));
|
||
}
|
||
else
|
||
{
|
||
$title = url_lang::lang('texts.Not filled in');
|
||
$title = __('Not filled in');
|
||
echo Html::image(array('src' => 'media/images/icons/publish_x.png', 'title' => $title));
|
||
}
|
||
}
|
||
... | ... | |
{
|
||
if ($item->filled == 1)
|
||
{
|
||
$title = url_lang::lang('texts.Already filled in');
|
||
$title = __('Already filled in');
|
||
echo Html::image(array('src' => 'media/images/states/good_16x16.png', 'title' => $title));
|
||
}
|
||
else
|
||
{
|
||
$title = url_lang::lang('texts.Not filled in');
|
||
$title = __('Not filled in');
|
||
echo Html::image(array('src' => 'media/images/icons/publish_x.png', 'title' => $title));
|
||
}
|
||
}
|
||
... | ... | |
url_lang::base() . 'private_phone_contacts/edit/' . $pucontact_id,
|
||
html::image(array('src' => 'media/images/icons/gtk_edit.png')),
|
||
array('rel' => 'dialog', 'class' => 'link_private_contact_edit',
|
||
'title' => url_lang::lang('texts.Edit'))
|
||
'title' => __('Edit'))
|
||
);
|
||
|
||
echo ' ' . html::anchor(
|
||
url_lang::base() . 'private_phone_contacts/delete/' . $pucontact_id,
|
||
html::image(array('src' => 'media/images/icons/delete.png')),
|
||
array('rel' => 'dialog', 'class' => 'link_private_contact_delete',
|
||
'title' => url_lang::lang('texts.Delete'))
|
||
'title' => __('Delete'))
|
||
);
|
||
}
|
||
else
|
||
... | ... | |
$pucontact->user_id . '/' . $item->number . '/' . $item->phone_invoice_user_id,
|
||
html::image(array('src' => 'media/images/icons/history.png')),
|
||
array('rel' => 'dialog', 'class' => 'link_private_contact_delete',
|
||
'title' => url_lang::lang('texts.History'))
|
||
'title' => __('History'))
|
||
);
|
||
}
|
||
}
|
||
... | ... | |
url_lang::base() . 'private_phone_contacts/add/' . $item->user_id . '/' . $item->number,
|
||
html::image(array('src' => 'media/images/ico_add.gif')),
|
||
array('rel' => 'dialog', 'class' => 'link_private_contact_add',
|
||
'title' => url_lang::lang('texts.Add'))
|
||
'title' => __('Add'))
|
||
);
|
||
}
|
||
|
||
... | ... | |
$item->user_id . '/' . $item->number . '/' . $item->phone_invoice_user_id,
|
||
html::image(array('src' => 'media/images/icons/history.png')),
|
||
array('rel' => 'dialog', 'class' => 'link_private_contact_delete',
|
||
'title' => url_lang::lang('texts.History'))
|
||
'title' => __('History'))
|
||
);
|
||
}
|
||
}
|
||
... | ... | |
if ($contact_id > 0)
|
||
{
|
||
echo ' <span style="color: green">' .
|
||
url_lang::lang('texts.private contact') . '</span>';
|
||
__('private contact') . '</span>';
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
{
|
||
echo html::anchor(
|
||
url_lang::base() . 'phone_invoices/delete/' .
|
||
$item->id, url_lang::lang('texts.Delete'),
|
||
$item->id, __('Delete'),
|
||
array('class' => 'delete_link')
|
||
);
|
||
}
|
||
else
|
||
{
|
||
echo '<span style="color: red;">' . url_lang::lang('texts.Locked') . '</span>';
|
||
echo '<span style="color: red;">' . __('Locked') . '</span>';
|
||
}
|
||
}
|
||
|
||
... | ... | |
{
|
||
echo html::anchor(
|
||
url_lang::base() . 'phone_invoices/show/' .
|
||
$item->id, url_lang::lang('texts.' . (($item->locked == 1) ? 'Show' : 'Edit')),
|
||
$item->id, __('' . (($item->locked == 1) ? 'Show' : 'Edit')),
|
||
array('class' => 'a_edit')
|
||
);
|
||
}
|
||
... | ... | |
{
|
||
echo html::anchor(
|
||
url_lang::base() . 'phone_invoices/show_details/' .
|
||
$item->id, url_lang::lang('texts.Edit'),
|
||
$item->id, __('Edit'),
|
||
array('class' => 'a_show_details')
|
||
);
|
||
}
|
||
else
|
||
{
|
||
echo '<span style="color: red;">' . url_lang::lang('texts.Locked') . '</span>';
|
||
echo '<span style="color: red;">' . __('Locked') . '</span>';
|
||
}
|
||
}
|
||
|
||
... | ... | |
if ($user->id)
|
||
{
|
||
echo html::anchor(
|
||
url_lang::base().'users/show/'.$user->id,
|
||
'users/show/'.$user->id,
|
||
$user->name . ' ' . $user->surname
|
||
);
|
||
echo ' ' . html::anchor(
|
||
url_lang::base().'logs/show_by_user/'.$user->id,
|
||
'logs/show_by_user/'.$user->id,
|
||
html::image(array('src' => 'media/images/icons/history.png',
|
||
'title' => url_lang::lang('texts.Show user actions')))
|
||
'title' => __('Show user actions')))
|
||
);
|
||
}
|
||
else
|
||
... | ... | |
switch ($item->action)
|
||
{
|
||
case Log_Model::ACTION_ADD:
|
||
echo url_lang::lang('texts.Added');
|
||
echo __('Added');
|
||
break;
|
||
case Log_Model::ACTION_DELETE:
|
||
echo url_lang::lang('texts.Deleted');
|
||
echo __('Deleted');
|
||
break;
|
||
case Log_Model::ACTION_UPDATE:
|
||
echo url_lang::lang('texts.Updated');
|
||
echo __('Updated');
|
||
break;
|
||
}
|
||
}
|
||
... | ... | |
public static function object_log_field($item, $name)
|
||
{
|
||
echo html::anchor(
|
||
url_lang::base().'logs/show_object/'.$item->table_name.'/'.$item->object_id,
|
||
'logs/show_object/'.$item->table_name.'/'.$item->object_id,
|
||
$item->object_id
|
||
);
|
||
}
|
||
... | ... | |
break;
|
||
}
|
||
|
||
echo html::image(array('src' => url::base().'media/images/'.$state.'.png', 'title' => url_lang::lang('texts.'.$state)));
|
||
echo html::image(array('src' => url::base().'media/images/'.$state.'.png', 'title' => __(''.$state)));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
public static function iface_vlan_iface_field ($item, $name)
|
||
{
|
||
if ($item->iface_id)
|
||
echo html::anchor (url_lang::base().'ifaces/show/'.$item->iface_id, $item->iface_name, array('title' => url_lang::lang('texts.Show interface')));
|
||
echo html::anchor ('ifaces/show/'.$item->iface_id, $item->iface_name, array('title' => __('Show interface')));
|
||
else
|
||
echo html::anchor (url_lang::base().'vlan_ifaces/show/'.$item->vlan_iface_id, $item->vlan_iface_name, array('title' => url_lang::lang('texts.Show VLAN interface')));
|
||
echo html::anchor ('vlan_ifaces/show/'.$item->vlan_iface_id, $item->vlan_iface_name, array('title' => __('Show VLAN interface')));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
*/
|
||
public static function vlan_field ($item, $name)
|
||
{
|
||
echo html::anchor (url_lang::base().'vlans/show/'.$item->vlan_id, $item->vlan_name, array('title' => url_lang::lang('texts.Show VLAN')));
|
||
echo html::anchor ('vlans/show/'.$item->vlan_id, $item->vlan_name, array('title' => __('Show VLAN')));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
public static function vlan_iface_field ($item, $name)
|
||
{
|
||
if (url_lang::current(TRUE) == 'devices')
|
||
echo html::anchor (url_lang::base().'devices/show_vlan_iface/'.$item->vlan_iface_id, $item->vlan_iface_name, array('title' => url_lang::lang('texts.Show VLAN interface')));
|
||
echo html::anchor ('devices/show_vlan_iface/'.$item->vlan_iface_id, $item->vlan_iface_name, array('title' => __('Show VLAN interface')));
|
||
else
|
||
echo html::anchor (url_lang::base().'vlan_ifaces/show/'.$item->vlan_iface_id, $item->vlan_iface_name, array('title' => url_lang::lang('texts.Show VLAN interface')));
|
||
echo html::anchor ('vlan_ifaces/show/'.$item->vlan_iface_id, $item->vlan_iface_name, array('title' => __('Show VLAN interface')));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
*/
|
||
public static function port_field ($item, $name)
|
||
{
|
||
echo html::anchor (url_lang::base().'ports/show/'.$item->port_id, $item->port_name, array('title' => url_lang::lang('texts.Show port')));
|
||
echo html::anchor ('ports/show/'.$item->port_id, $item->port_name, array('title' => __('Show port')));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
*/
|
||
public static function iface_id_field ($item, $name)
|
||
{
|
||
echo html::anchor (url_lang::base().'devices/show_iface/'.$item->iface_id, $item->iface_id, array('title' => url_lang::lang('texts.Show interface')));
|
||
echo html::anchor ('devices/show_iface/'.$item->iface_id, $item->iface_id, array('title' => __('Show interface')));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
public static function edit_field ($item, $name, $args = array())
|
||
{
|
||
if (Session::instance()->get('user_id') == $item->user_id)
|
||
echo html::anchor (url_lang::base().$args[0].'/edit/'.$item->id, url_lang::lang('texts.Edit'));
|
||
echo html::anchor ($args[0].'/edit/'.$item->id, __('Edit'));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
public static function delete_field ($item, $name, $args = array())
|
||
{
|
||
if (Session::instance()->get('user_id') == $item->user_id)
|
||
echo html::anchor (url_lang::base().$args[0].'/delete/'.$item->id, url_lang::lang('texts.Delete'), array('class' => 'delete_link'));
|
||
echo html::anchor ($args[0].'/delete/'.$item->id, __('Delete'), array('class' => 'delete_link'));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
|
||
if (isset($args[0]) && $args[0] != '')
|
||
echo html::anchor (
|
||
url_lang::base().$args[0].$item->id, html::image(
|
||
$args[0].$item->id, html::image(
|
||
array(
|
||
'src' => url::base().'media/images/'.$state.'.png', 'title' => url_lang::lang('texts.'.$state))
|
||
'src' => url::base().'media/images/'.$state.'.png', 'title' => __(''.$state))
|
||
)
|
||
);
|
||
else
|
||
echo html::image(
|
||
array(
|
||
'src' => url::base().'media/images/'.$state.'.png', 'title' => url_lang::lang('texts.'.$state))
|
||
'src' => url::base().'media/images/'.$state.'.png', 'title' => __(''.$state))
|
||
);
|
||
}
|
||
|
||
... | ... | |
{
|
||
// it's domicile of member
|
||
case 1:
|
||
echo url_lang::lang('texts.Domicile'). ' '.help::hint('address_point_member_domicile');
|
||
echo __('Domicile'). ' '.help::hint('address_point_member_domicile');
|
||
break;
|
||
// it's only connecting place of member, he has domicile on another address point
|
||
case 2:
|
||
echo url_lang::lang('texts.Connecting place'). ' '.help::hint('address_point_member_connecting_place');
|
||
echo __('Connecting place'). ' '.help::hint('address_point_member_connecting_place');
|
||
break;
|
||
}
|
||
}
|
||
... | ... | |
switch ($item->type)
|
||
{
|
||
case 'account':
|
||
echo url_lang::lang('texts.Financial state of member').' '.html::anchor(url_lang::base().'members/show/'.$item->member_id, $item->member_name, array('title' => url_lang::lang('texts.Show member')));
|
||
echo __('Financial state of member').' '.html::anchor('members/show/'.$item->member_id, $item->member_name, array('title' => __('Show member')));
|
||
break;
|
||
|
||
case 'job':
|
||
echo html::anchor(url_lang::base().'works/show/'.$item->work_id, url_lang::lang('texts.Work'), array('title' => url_lang::lang('texts.Show work'))).' '.url_lang::lang('texts.of user').' '.html::anchor(url_lang::base().'users/show/'.$item->work_user_id, $item->work_user_name, array('title' => url_lang::lang('texts.Show user')));
|
||
echo html::anchor('works/show/'.$item->work_id, __('Work'), array('title' => __('Show work'))).' '.__('of user').' '.html::anchor('users/show/'.$item->work_user_id, $item->work_user_name, array('title' => __('Show user')));
|
||
break;
|
||
}
|
||
}
|
||
... | ... | |
public static function mac_address_field ($item, $name)
|
||
{
|
||
if (url_lang::current(1) == 'devices')
|
||
echo html::anchor(url_lang::base().'devices/show_iface/'.$item->iface_id, $item->mac, array('title' => $item->iface_name));
|
||
echo html::anchor('devices/show_iface/'.$item->iface_id, $item->mac, array('title' => $item->iface_name));
|
||
else
|
||
echo html::anchor(url_lang::base().'ifaces/show/'.$item->iface_id, $item->mac, array('title' => $item->iface_name));
|
||
echo html::anchor('ifaces/show/'.$item->iface_id, $item->mac, array('title' => $item->iface_name));
|
||
}
|
||
|
||
/**
|
||
... | ... | |
public static function email_from_field ($item, $name)
|
||
{
|
||
if ($item->from_user_id)
|
||
echo html::anchor(url_lang::base().'users/show/'.$item->from_user_id, $item->from_user_name, array('title' => $item->from));
|
||
echo html::anchor('users/show/'.$item->from_user_id, $item->from_user_name, array('title' => $item->from));
|
||
else
|
||
echo $item->from;
|
||
}
|
||
... | ... | |
public static function email_to_field ($item, $name)
|
||
{
|
||
if ($item->to_user_id)
|
||
echo html::anchor(url_lang::base().'users/show/'.$item->to_user_id, $item->to_user_name, array('title' => $item->to));
|
||
echo html::anchor('users/show/'.$item->to_user_id, $item->to_user_name, array('title' => $item->to));
|
||
else
|
||
echo $item->to;
|
||
}
|
||
... | ... | |
// interface
|
||
case Segment_Model::IFACE:
|
||
echo html::anchor(
|
||
url_lang::base().'ifaces/show/'.$item->id, $item->name
|
||
'ifaces/show/'.$item->id, $item->name
|
||
);
|
||
break;
|
||
|
||
// port
|
||
case Segment_Model::PORT:
|
||
echo html::anchor(
|
||
url_lang::base().'ports/show/'.$item->id, $item->name
|
||
'ports/show/'.$item->id, $item->name
|
||
);
|
||
break;
|
||
|
freenetis/branches/testing/application/helpers/url_lang.php | ||
---|---|---|
{
|
||
if ($lang === FALSE)
|
||
{
|
||
$lang = Config::get('locale.lang');
|
||
$lang = Config::get('lang');
|
||
}
|
||
|
||
return url::site($lang . '/' . trim($uri, '/'), $protocol);
|
freenetis/branches/testing/application/models/phone_invoice_user.php | ||
---|---|---|
*
|
||
* @author Ondřej Fibich
|
||
* @package Model
|
||
*
|
||
* @property integer $user_id
|
||
* @property User_Model $user
|
||
* @property integer $phone_invoice_id
|
||
* @property Phone_invoice_Model $phone_invoice
|
||
* @property string $phone_number
|
||
* @property boolean $locked
|
||
* @property ORM $phone_connections
|
||
* @property ORM $phone_calls
|
||
* @property ORM $phone_fixed_calls
|
||
* @property ORM $phone_pays
|
||
* @property ORM $phone_roaming_sms_messages
|
||
* @property ORM $phone_sms_messages
|
||
* @property ORM $phone_vpn_calls
|
||
*/
|
||
class Phone_invoice_user_Model extends ORM
|
||
{
|
||
protected $belongs_to = array('user', 'phone_invoice');
|
||
protected $has_many = array(
|
||
|
||
protected $has_many = array
|
||
(
|
||
'phone_connections', 'phone_calls', 'phone_fixed_calls', 'phone_pays',
|
||
'phone_roaming_sms_messages', 'phone_sms_messages', 'phone_vpn_calls'
|
||
);
|
||
... | ... | |
WHERE user_id = ?
|
||
", $user_id)->current()->count > 0;
|
||
}
|
||
|
||
/**
|
||
* Gets count of unfilled users phone invoices
|
||
*
|
||
* @param integer $user_id User
|
||
* @return integer
|
||
*/
|
||
public function count_unfilled_phone_invoices($user_id)
|
||
{
|
||
return $this->db->query("
|
||
SELECT COUNT(pi.id) AS count
|
||
FROM phone_invoice_users pi
|
||
LEFT JOIN phone_invoices p ON pi.phone_invoice_id = p.id
|
||
WHERE pi.user_id = ? AND pi.locked = 0 AND p.locked = 0
|
||
", $user_id)->current()->count;
|
||
}
|
||
|
||
/**
|
||
* Get sum of all users phone invoices separated to cells price_company and price_private
|
freenetis/branches/testing/application/models/approval_template_item.php | ||
---|---|---|
LEFT JOIN approval_types t ON t.id = i.approval_type_id
|
||
LEFT JOIN aro_groups ag ON t.aro_group_id = ag.id
|
||
WHERE i.approval_template_id = ?
|
||
ORDER BY i.priority
|
||
ORDER BY i.priority DESC
|
||
", array($template_id));
|
||
}
|
||
|
||
... | ... | |
|
||
return $result->current()->max;
|
||
}
|
||
|
||
|
||
/**
|
||
* Function to check if user have rights to vote
|
||
*
|
||
* @author Michal Kliment
|
||
* @param number $template_id
|
||
* @param number $user_id
|
||
* @return bool
|
||
*
|
||
* @author Ondřej Fibich
|
||
* @param integer $work_id
|
||
* @param integer $user_id
|
||
* @param double $suggest_amount
|
||
* @return boolean
|
||
*/
|
||
public function check_user_vote_rights(
|
||
$template_id, $user_id, $suggest_amount = 0)
|
||
$work_id, $user_id, $suggest_amount = NULL)
|
||
{
|
||
return (bool) $this->get_aro_group_by_approval_template_id_and_user_id(
|
||
$template_id, $user_id, $suggest_amount
|
||
);
|
||
$work = new Job_Model($work_id);
|
||
|
||
if (!$work || !$work->id || $work->state > 1)
|
||
{
|
||
return FALSE;
|
||
}
|
||
|
||
// get approval types
|
||
|
||
$cond = '';
|
||
|
||
// if suggested amount is empty get it from work/report
|
||
if (empty($suggest_amount))
|
||
{
|
||
$suggest_amount = $work->suggest_amount;
|
||
|
||
// gets suggested amount of whole report
|
||
if ($work->job_report_id)
|
||
{
|
||
$suggest_amount = $work->job_report->get_suggest_amount();
|
||
}
|
||
}
|
||
|
||
$groups = $this->db->query("
|
||
SELECT a.id, a.name, i.priority, i.approval_type_id
|
||
FROM approval_template_items i
|
||
LEFT JOIN approval_types t ON i.approval_type_id = t.id
|
||
LEFT JOIN aro_groups a ON t.aro_group_id = a.id
|
||
WHERE i.approval_template_id = ? AND t.min_suggest_amount <= ?
|
||
ORDER BY i.priority DESC
|
||
", $work->approval_template_id, $suggest_amount);
|
||
|
||
// group by priority
|
||
|
||
$group_by_priority = array();
|
||
|
||
foreach ($groups as $group)
|
||
{
|
||
$group_by_priority[$group->priority][] = $group;
|
||
}
|
||
|
||
unset($groups);
|
||
|
||
// check each group from most priority
|
||
|
||
$job = new Job_Model();
|
||
$vote = new Vote_Model();
|
||
$counter = 0;
|
||
|
||
foreach ($group_by_priority as $group)
|
||
{
|
||
$state = 0;
|
||
$ids = array();
|
||
$counter++;
|
||
|
||
foreach ($group as $item)
|
||
{
|
||
$ids[] = $item->id;
|
||
|
||
$item_state = $work->get_state(
|
||
Vote_Model::$work,
|
||
$item->approval_type_id
|
||
);
|
||
|
||
if ($item_state == 2)
|
||
{
|
||
$state = 2;
|
||
}
|
||
else if ($item_state == 3 && $state == 0)
|
||
{
|
||
$state = 3;
|
||
}
|
||
}
|
||
|
||
// is user in vote group?
|
||
|
||
$in_group = FALSE;
|
||
|
||
if (count($ids))
|
||
{
|
||
$in_group = $this->db->query("
|
||
SELECT COUNT(*) AS count
|
||
FROM groups_aro_map
|
||
WHERE group_id IN (" . implode(', ', $ids) . ") AND
|
||
aro_id = ?
|
||
", $user_id)->current()->count > 0;
|
||
}
|
||
|
||
// vote not finished yet, can vote or edit vote?
|
||
if ($state <= 2)
|
||
{
|
||
return $in_group;
|
||
}
|
||
// approved, but some user should not vote yet or
|
||
// if this is last group of voters, enable edit vote
|
||
else if ($in_group && (
|
||
(count($group_by_priority) == $counter) ||
|
||
!$vote->has_user_voted_about($user_id, $work->id)
|
||
))
|
||
|
||
{
|
||
return TRUE;
|
||
}
|
||
}
|
||
|
||
return FALSE;
|
||
}
|
||
|
||
|
||
/**
|
||
* Returns all group assigned to approval
|
||
... | ... | |
LEFT JOIN approval_types t ON i.approval_type_id = t.id
|
||
LEFT JOIN aro_groups a ON t.aro_group_id = a.id
|
||
WHERE i.approval_template_id = ? $cond
|
||
ORDER BY i.priority
|
||
ORDER BY i.priority DESC
|
||
", array($template_id));
|
||
}
|
||
|
||
... | ... | |
LEFT JOIN aro_groups a ON t.aro_group_id = a.id
|
||
LEFT JOIN groups_aro_map m ON a.id = m.group_id
|
||
WHERE i.approval_template_id = ? AND m.aro_id = ? $cond
|
||
ORDER BY i.priority
|
||
ORDER BY i.priority DESC
|
||
", array($template_id, $user_id));
|
||
|
||
// no record, returns null
|
||
if (!$result || $result->count() != 1)
|
||
if (!$result || !$result->count())
|
||
{
|
||
return NULL;
|
||
}
|
freenetis/branches/testing/application/models/member.php | ||
---|---|---|
/**
|
||
* Gets joined values of members for members fees
|
||
*
|
||
* @param integer $member_id
|
||
* @return unknown_type
|
||
*/
|
||
public function get_members_joined()
|
||
public function get_members_joined($member_id = NULL)
|
||
{
|
||
if (empty($member_id))
|
||
{
|
||
... | ... | |
))->orderby('surname')
|
||
->find_all();
|
||
}
|
||
|
||
/**
|
||
* Gets ID of member account if there is any
|
||
*
|
||
* @param integer $member_id
|
||
* @return integer
|
||
*/
|
||
public function get_first_member_account_id($member_id = NULL)
|
||
{
|
||
if (empty($member_id))
|
||
{
|
||
$member_id = $this->id;
|
||
}
|
||
|
||
$result = $this->db->query("
|
||
SELECT a.id
|
||
FROM accounts a
|
||
WHERE a.member_id = ?
|
||
", $member_id);
|
||
|
||
if ($result && $result->count())
|
||
{
|
||
return $result->current()->id;
|
||
}
|
||
|
||
return NULL;
|
||
}
|
||
|
||
/**
|
||
* Function gets list of all members from database.
|
||
... | ... | |
public function count_of_registered_members()
|
||
{
|
||
return $this->db->query("
|
||
SELECT COUNT(*) AS count
|
||
SELECT IFNULL(COUNT(*), 0) AS count
|
||
FROM members m
|
||
WHERE m.type = ?
|
||
", Member_Model::TYPE_APPLICANT)->current()->count;
|
freenetis/branches/testing/application/models/job.php | ||
---|---|---|
));
|
||
}
|
||
|
||
|
||
/**
|
||
* Gets count of unvoted works of voter
|
||
*
|
||
* @param integer $user_id ID of voter
|
||
* @return integer
|
||
*/
|
||
public function get_count_of_unvoted_works_of_voter($user_id)
|
||
{
|
||
return $this->db->query("
|
||
SELECT IFNULL(COUNT(j.id), 0) AS count
|
||
FROM groups_aro_map g
|
||
LEFT JOIN approval_types at ON at.aro_group_id = g.group_id
|
||
LEFT JOIN approval_template_items ati ON at.id = ati.approval_type_id
|
||
LEFT JOIN jobs j ON j.approval_template_id = ati.approval_template_id AND
|
||
j.suggest_amount >= at.min_suggest_amount
|
||
LEFT JOIN votes v ON v.fk_id = j.id AND v.user_id = ?
|
||
WHERE g.aro_id = ? AND
|
||
j.job_report_id IS NULL AND
|
||
j.state <= 1 AND
|
||
v.id IS NULL
|
||
", $user_id, $user_id)->current()->count;
|
||
}
|
||
|
||
/**
|
||
* Function to get state of work approval from all votes
|
||
* by approval template and type.
|
||
*
|
||
* @author Michal Kliment
|
||
* @author Michal Kliment, Ondřej Fibich
|
||
* @param integer $type
|
||
* @return integer
|
||
*/
|
||
public function get_state($type)
|
||
public function get_state($type, $approval_type_id = NULL)
|
||
{
|
||
if (!$this->id)
|
||
{
|
||
... | ... | |
return $state;
|
||
}
|
||
|
||
$approval_template_items = $approval_template_item_model
|
||
->where('approval_template_id', $this->approval_template_id)
|
||
->orderby('priority')
|
||
->find_all();
|
||
if (!empty($approval_type_id))
|
||
{
|
||
$approval_template_items = $approval_template_item_model
|
||
->where('approval_template_id', $this->approval_template_id)
|
||
->where('approval_type_id', $approval_type_id)
|
||
->orderby('priority', 'desc')
|
||
->find_all();
|
||
}
|
||
else
|
||
{
|
||
$approval_template_items = $approval_template_item_model
|
||
->where('approval_template_id', $this->approval_template_id)
|
||
->orderby('priority', 'desc')
|
||
->find_all();
|
||
}
|
||
|
||
$arr_users = array();
|
||
$state = 3;
|
||
|
||
$suggest_amount = $this->suggest_amount;
|
||
|
||
if ($this->job_report_id)
|
||
{
|
||
$suggest_amount = $this->job_report->get_suggest_amount();
|
||
}
|
||
|
||
foreach ($approval_template_items as $approval_template_item)
|
||
{
|
||
if (!$this->suggest_amount ||
|
||
$approval_template_item->approval_type->min_suggest_amount <= $this->suggest_amount)
|
||
$at = $approval_template_item->approval_type;
|
||
|
||
if (!$suggest_amount || $at->min_suggest_amount <= $suggest_amount)
|
||
{
|
||
$count = 0;
|
||
$total_votes = 0;
|
||
$agree = 0;
|
||
$abstain = 0;
|
||
|
||
$users = $groups_aro_map_model->get_all_users_by_group_id(
|
||
$approval_template_item->approval_type->aro_group_id
|
||
$at->aro_group_id
|
||
);
|
||
|
||
foreach ($users as $user)
|
||
... | ... | |
|
||
if ((!$vote || !$vote->id))
|
||
{
|
||
$interval = date::hour_diff(
|
||
$approval_template_item->approval_type->interval
|
||
);
|
||
$interval = date::hour_diff($at->interval);
|
||
|
||
if (!$interval)
|
||
$state = 1;
|
||
... | ... | |
{
|
||
$total_votes++;
|
||
|
||
if ($approval_template_item->approval_type->type == Approval_type_Model::$simple &&
|
||
if ($at->type == Approval_type_Model::$simple &&
|
||
$vote->vote == 0)
|
||
{
|
||
$abstain++;
|
||
... | ... | |
|
||
$percent = ($total_votes) ? round($agree/$total_votes*100, 2) : 0;
|
||
|
||
if ($percent < $approval_template_item->approval_type->majority_percent)
|
||
if ($percent < $at->majority_percent)
|
||
{
|
||
$state = 2;
|
||
return $state;
|
||
... | ... | |
}
|
||
else
|
||
{
|
||
$interval = date::hour_diff($approval_template_item->approval_type->interval);
|
||
$interval = date::hour_diff($at->interval);
|
||
if ($interval)
|
||
{
|
||
$count -= $abstain;
|
||
|
||
$percent = ($count) ? round($agree/$count*100, 2) : 0;
|
||
|
||
if ($percent < $approval_template_item->approval_type->majority_percent)
|
||
if ($percent < $at->majority_percent)
|
||
{
|
||
$agree += ($count - $total_votes + $abstain);
|
||
|
||
$percent = ($count) ? round($agree/$count*100, 2) : 0;
|
||
|
||
if ($percent < $approval_template_item->approval_type->majority_percent)
|
||
if ($percent < $at->majority_percent)
|
||
{
|
||
$state = 2;
|
||
return $state;
|
freenetis/branches/testing/application/models/job_report.php | ||
---|---|---|
*
|
||
* @property integer $user_id
|
||
* @property User_Model $user
|
||
* @property integer $added_by_id
|
||
* @property User_Model $added_by
|
||
* @property integer $approval_template_id
|
||
* @property Approval_template_Model $approval_template
|
||
* @property string $description
|
||
... | ... | |
class Job_report_Model extends ORM
|
||
{
|
||
|
||
protected $belongs_to = array('user', 'approval_template', 'transfer');
|
||
protected $belongs_to = array
|
||
(
|
||
'user', 'approval_template', 'transfer',
|
||
'added_by' => 'user'
|
||
);
|
||
|
||
protected $has_many = array('jobs');
|
||
|
||
... | ... | |
* Gets state of work reports from it's works
|
||
*
|
||
* @author Ondřej Fibich
|
||
* @staticvar array $cache Cache fo states
|
||
* @staticvar array $cache Cache for states
|
||
* @return integer
|
||
*/
|
||
public function get_state()
|
||
... | ... | |
if (!isset($cache[$this->id]))
|
||
{
|
||
$cache[$this->id] = $this->db->query("
|
||
SELECT IFNULL(MAX(j.state), 0) AS state
|
||
FROM job_reports r
|
||
LEFT JOIN jobs j ON r.id = j.job_report_id
|
||
WHERE r.id = ?
|
||
SELECT IF(MIN(state) <= 1, MIN(state), MAX(state)) AS state
|
||
FROM jobs
|
||
WHERE job_report_id = ?
|
||
", $this->id)->current()->state;
|
||
}
|
||
|
||
return $cache[$this->id];
|
||
}
|
||
|
||
/**
|
||
* Gets suggest amount of work reports from it's works
|
||
*
|
||
* @author Ondřej Fibich
|
||
* @staticvar array $cache Cache for amounts
|
||
* @return double
|
||
*/
|
||
public function get_suggest_amount()
|
||
{
|
||
static $cache = array();
|
||
|
||
if (!$this->id)
|
Také k dispozici: Unified diff
Novinky:
- vicekolove hlasovani u praci a vykazu
- upozorneni na nevykonane akce pocitadly v hlavnim menu
Upravy:
- poradek v kodu hlavniho menu, presun kodu pracujiciho s modely do preprocesoru MY_Controlleru
Opravy:
- oprava labelu u Form_Checkboxu