/** * @file * @brief */ /** * @class * @brief */ class Document_Option { /** * returns true if the operation_detail is enable, otherwise false * * @param int $p_document_type Document_Type.dt_id * @return boolean */ static function is_enable_operation_detail($p_document_type) { $display_operation=false; $cn=Dossier::connect(); if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2", [$p_document_type, 'detail_operation'])=='1') { $display_operation=true; } return $display_operation; } /** * returns option from the operation_detail * * @param int $p_document_type Document_Type.dt_id * @return string */ static function option_operation_detail($p_document_type) { $cn=Dossier::connect(); $option_operation = $cn->get_value("select do_option from document_option where document_type_id=$1 " . " and do_code = $2", [$p_document_type, 'detail_operation']); return $option_operation; } /** * returns true if the operation_detail is enable, otherwise false * * @param int $p_document_type Document_Type.dt_id * @return boolean */ static function is_enable_contact_multiple($p_document_type) { $return=false; $cn=Dossier::connect(); if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2", [$p_document_type, 'contact_multiple'])=='1') { $return=true; } return $return; } /** * returns true if the operation_detail is enable, otherwise false * * @param int $p_document_type Document_Type.dt_id * @return boolean */ static function is_enable_make_invoice($p_document_type) { $return=false; $cn=Dossier::connect(); if ($cn->get_value("select do_enable from document_option where document_type_id=$1 and do_code = $2", [$p_document_type, 'make_invoice'])=='1') { $return=true; } return $return; } }