Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1367

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

Implementace #57 (Pracovni vykazy - v gridu neni videt stav vykazu (schvalen/neschvalen))

Zobrazit rozdíly:

freenetis/branches/testing/application/i18n/cs_CZ/texts.php
'o' => 'V',
'object' => 'Objekt',
'october' => 'Říjen',
'of' => 'ze',
'of all approved work reports' => 'všech schválených pracovních výkazů',
'of all approved works' => 'všech schválených prací',
'of all pending work reports' => 'všech nerozhodnutých pracovních výkazů',
......
'vote has been successfully updated' => 'Hlas byl úspěšně aktualizován.',
'vote to work has been added' => 'Byl přidán hlas k práci',
'vote to your work has been added' => 'K vaší práci byl přidán hlas',
'votes' => 'Hlasy',
'votes has been successfully updated' => 'Hlasy byly úspěšně aktualizovány.',
'welcome to freenetis' => 'Vítejte ve FreeNetISu','voicemail password for voip account' => 'Heslo hlasové schránky pro VoIP účet',
'welcome to freenetis installation' => 'Vítejte ve FreeNetIS instalaci.',
......
'you have no permission to delete redirection' => 'Nemáte práva ke smazání přesměrování',
'you have no permission to edit redirection' => 'Nemáte práva k úpravám přesměrování',
'you have to set up it by yourself:' => 'Budete jej muset nastavit ručně:',
'you have voted in' => 'Hlasoval jste v',
'you must create it manually and paste the following text into it' => 'Musíte jej vytvořit ručně a zkopírovat do něj následující text',
'you will need to know the following items before proceeding' => 'Budete potřebovat znát následující položky před pokračováním:',
'your votes' => 'Vaše hlasy',
'your ip address has not been found in database' => 'Vaše IP adresa nebyla nalezena v databázi.',
'your accout has been locked' => 'Váš účet byl uzamčen.',
'your concepts of work reports' => 'Vaše koncepty pracovních výkazů',
freenetis/branches/testing/application/helpers/callback.php
echo date('j.n.Y', strtotime($item->date_to));
}
}
/**
* Callback for work reports. Displayes votes of a voter on a report.
*
* @author Ondrej Fibich
* @param object $item
* @param string $name
*/
public static function votes_of_voter($item, $name)
{
static $job_report_model = NULL;
if (isset($item->user_id, $item->id))
{
if ($job_report_model == NULL)
{
$job_report_model = new Job_report_Model();
}
$votes = $job_report_model->get_votes_of_voter_on_work_report(
$item->id, Session::instance()->get('user_id')
);
if ($votes->count())
{
$count_votes = 0;
$tvotes = array(-1 => 0, 0 => 0, 1 => 0);
$icon = 'abstain';
foreach ($votes as $vote)
{
if ($vote->id)
{
$count_votes++;
$tvotes[$vote->vote]++;
}
}
if ($count_votes > 0)
{
$icon = ($tvotes[1] == $votes->count()) ? 'agree' : 'disagree';
}
echo '<img alt="voted" src="' . url::base() . '/media/images/states/' . $icon . '.png" title="';
if ($count_votes > 0)
{
echo __('You have voted in') . ' ' . $count_votes . ' ' . __('of') . ' ' . $votes->count() . "\n";
echo __('Your votes') . ': ' . $tvotes[1] . '/' . $tvotes[-1] . '/' . $tvotes[0];
echo ' (' . __('Agree') . '/' . __('Disagree') . '/' . __('Abstain') . ')';
}
echo '" />';
}
}
}
}
freenetis/branches/testing/application/models/job_report.php
", $user_id, $user_id)->current()->count;
}
/**
* Gets votes of a voter on a work report
*
* @param integer $work_report_id ID of report
* @param integer $user_id ID of voter
* @return Mysql_Result
*/
public function get_votes_of_voter_on_work_report($work_report_id, $user_id)
{
return $this->db->query("
SELECT v.id, v.vote
FROM jobs j
LEFT JOIN votes v ON v.fk_id = j.id AND v.user_id = ?
WHERE j.job_report_id = ?
", $user_id, $work_report_id);
}
/**
* Gets workd of montly workreport in array, blank days are filled by NULL
*
* @see Work_reports_Controller#edit()
freenetis/branches/testing/application/controllers/work_reports.php
$grid->order_callback_field('suggest_amount')
->callback('callback::money');
$grid->order_callback_field('your_votes')
->callback('callback::votes_of_voter');
$actions = $grid->grouped_action_field();
if ($this->acl_check_view('Users_Controller', 'work'))

Také k dispozici: Unified diff