FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
Job_report_Model Class Reference
Inheritance diagram for Job_report_Model:
ORM

Public Member Functions

 get_state ()
 Gets state of work reports from it's works.
 get_suggest_amount ()
 Gets suggest amount of work report from it's works.
 get_rating ()
 Gets rating of work report from it's works.
 get_votes_of_voter_on_work_report ($work_report_id, $user_id)
 Gets votes of a voter on a work report.
 get_works_of_monthly_workreport ()
 Gets workd of montly workreport in array, blank days are filled by NULL.
 get_work_report ($work_report_id=NULL)
 Gets work report with details.
 delete_works ($preserved_keys=array(), $work_report_id=NULL)
 Delete works of report.
 get_all_work_reports ($limit_from=0, $limit_results=50, $order_by= 'id', $order_by_direction= 'ASC', $filter_sql= '', $user_id=NULL)
 Gets all work reports with given state.
 count_all_work_reports ($filter_sql= '')
 Counts all work reports with given state.
 get_concepts_work_reports_of_user ($user_id)
 Gets all concepted work reports of user.
 get_approved_work_reports_of_user ($user_id)
 Gets all approved work reports of user.
 get_rejected_work_reports_of_user ($user_id)
 Gets all rejected work reports of user.
 get_pending_work_reports_of_user ($user_id)
 Gets all pending work reports of user.

Static Public Member Functions

static get_payment_types ()
 Gets translated payments types.
static get_name_of_payment_type ($type)
 Gets name of payment type.

Public Attributes

const PAYMENT_BY_CREDIT = 0
 Constant of credit payment for column payment_type.
const PAYMENT_BY_CASH = 1
 Constant of cash payment for column payment_type.

Protected Attributes

 $belongs_to
 $has_many = array('jobs')

Static Protected Attributes

static $PAYMENT_TYPES

Member Function Documentation

Job_report_Model::count_all_work_reports (   $filter_sql = '')

Counts all work reports with given state.

Parameters
integer$state
boolean$lowerShould be operant to state < (= otherwise)
string$filter_sql
Returns
integer
Job_report_Model::delete_works (   $preserved_keys = array(),
  $work_report_id = NULL 
)

Delete works of report.

Parameters
array$preserved_keysArray of preserved works (ID of work as value)
integer$work_report_idID of report
Job_report_Model::get_all_work_reports (   $limit_from = 0,
  $limit_results = 50,
  $order_by = 'id',
  $order_by_direction = 'ASC',
  $filter_sql = '',
  $user_id = NULL 
)

Gets all work reports with given state.

Parameters
integer$state
integer$limit_from
integer$limit_results
string$order_by
string$order_by_direction
string$filter_sql
boolean$lowerShould be operant to state < (= otherwise)
integer$user_id
Returns
Mysql_Result
Job_report_Model::get_approved_work_reports_of_user (   $user_id)

Gets all approved work reports of user.

Parameters
integer$user_id
Returns
Mysql_Result
Job_report_Model::get_concepts_work_reports_of_user (   $user_id)

Gets all concepted work reports of user.

Parameters
integer$user_id
Returns
Mysql_Result
static Job_report_Model::get_name_of_payment_type (   $type)
static

Gets name of payment type.

Parameters
integer$type
Returns
string
static Job_report_Model::get_payment_types ( )
static

Gets translated payments types.

Returns
array
Job_report_Model::get_pending_work_reports_of_user (   $user_id)

Gets all pending work reports of user.

Parameters
integer$user_id
Returns
Mysql_Result
Job_report_Model::get_rating ( )

Gets rating of work report from it's works.

Author
Ondřej Fibich array $cache Cache for amounts
Returns
double
Job_report_Model::get_rejected_work_reports_of_user (   $user_id)

Gets all rejected work reports of user.

Parameters
integer$user_id
Returns
Mysql_Result
Job_report_Model::get_state ( )

Gets state of work reports from it's works.

Author
Ondřej Fibich array $cache Cache for states
Returns
integer
Job_report_Model::get_suggest_amount ( )

Gets suggest amount of work report from it's works.

Author
Ondřej Fibich array $cache Cache for amounts
Returns
double
Job_report_Model::get_votes_of_voter_on_work_report (   $work_report_id,
  $user_id 
)

Gets votes of a voter on a work report.

Parameters
integer$work_report_idID of report
integer$user_idID of voter
Returns
Mysql_Result
Job_report_Model::get_work_report (   $work_report_id = NULL)

Gets work report with details.

See Also
Work_reports_Controller::edit()
Author
Ondřej Fibich
Parameters
integer$work_report_id
Returns
object
Job_report_Model::get_works_of_monthly_workreport ( )

Gets workd of montly workreport in array, blank days are filled by NULL.

See Also
Work_reports_Controller::edit()
Author
Ondřej Fibich
Returns
array[object]

Member Data Documentation

Job_report_Model::$belongs_to
protected
Initial value:
array
(
'user', 'approval_template', 'transfer',
'added_by' => 'user'
)
Job_report_Model::$PAYMENT_TYPES
staticprotected
Initial value:
array
(
self::PAYMENT_BY_CREDIT => 'Payment by FreenetIS credit',
self::PAYMENT_BY_CASH => 'Payment by cash'
)

The documentation for this class was generated from the following file: