New fields in "Members"

Help
2009-09-19
2013-05-30
  • Hello friends.

    I need Your assistence.
    In "New Member" page i need add new combo field, which contains names of faculties and majors.
    Which php and db files change?

    pls hlp me.

    ilhomjon2906@yahoo.com

     
  • You don't have to change PHP scripts and change the database structure if you are using OpenBiblio 0.5.2 or higher. Use the feature "Custom member fields"; Admin tab : Member Fields, Add new custom field.

    You can use the custom member field in reports. The example below is a modified Bibliography Checkout Listing for the reports system in OpenBiblio 0.6.0 and higher (which is preferred over the reports system in 0.5.2 and lower).
    The example has two custum member fields:

    1) Code: schoolGrade  Description:  School Grade

    2) Code: schoolTeacher Description: School Teacher

    **/reports/defs/checkouts.rpt**
    <pre>
    .title "Bibliography Checkout Listing : Grade, Teacher"
    .category Circulation
    .column bibid hidden
    .column copyid hidden
    .column mbrid hidden
    .column barcode_nmbr sort=barcode_nmbr
    .column title sort=title func=biblio_link
    .column author sort=author
    .column member_bcode sort=member_bcode
    .column name sort=name func=member_link
    .column school_grade title="Grade" sort=school_grade
    .column school_teacher title="Teacher" sort=school_teacher
    .column status_begin_dt sort=status_begin_dt
    .column due_back_dt sort=due_back_dt
    .parameters
    . date due_before title="Due before"
    . date out_since title="Out since"
    . select grade_sel title="Grade"
    . item ''
    .sql
    # To prevent error  ,
    # SQL section in RPT .select parameter is one (long) line, not wrapped.
    # This occurs only with 0.6.0 file release, bug is fixed in CVS.
    SELECT DISTINCT data AS value, data AS title FROM member_fields WHERE code = 'schoolGrade' ORDER BY title
    .end sql
    . end select
    . select criteria1 default=start title="… or Grade"
    . item start title="Starts With"
    . item trunc title="Contains"
    . end select
    . string grade title="…"
    . select criteria2 default=trunc title="Teacher Name"
    . item start title="Starts With"
    . item trunc title="Contains"
    . end select
    . string teacher title="…"
    . order_by default=school_grade
    . item barcode_nmbr expr='c.barcode_nmbr'
    . item title
    . item author
    . item member_bcode expr='m.barcode_nmbr'
    . item name expr="concat(m.last_name, ', ', m.first_name)"
    . item school_grade title="Grade, Name" expr="concat_ws(' ', school_grade, m.last_name, ', ', m.first_name)"
    . item school_teacher title="Teacher, Grade, Name" expr="concat_ws(' ', school_teacher, school_grade, m.last_name, ', ', m.first_name)"
    . item status_begin_dt
    . item due_back_dt
    . end order_by
    .end parameters
    .sql
    SELECT c.bibid, c.copyid, m.mbrid, c.barcode_nmbr,
    b.title, b.author, c.status_begin_dt,
    c.due_back_dt, m.barcode_nmbr member_bcode,
    concat(m.last_name, ', ', m.first_name) name,
    school_grade.data school_grade, school_teacher.data school_teacher
    FROM biblio b, biblio_copy c, member m
    LEFT JOIN member_fields AS school_grade ON school_grade.mbrid=m.mbrid
    AND school_grade.code='schoolGrade'
    LEFT JOIN member_fields AS school_teacher ON school_teacher.mbrid=m.mbrid
    AND school_teacher.code='schoolTeacher'
    WHERE b.bibid = c.bibid
    AND c.mbrid = m.mbrid
    AND c.status_cd = 'out'
    . if_set due_before
    AND c.due_back_dt <= %due_before%
    . end if_set
    . if_set out_since
    AND c.status_begin_dt >= %out_since%
    . end if_set
    . if_set grade
    . if_equal criteria1 start
    AND school_grade.data LIKE '%"grade%%%'
    . end if_set
    . if_equal criteria1 trunc
    AND school_grade.data LIKE '%%%"grade%%%'
    . end if_set
    . else
    . if_not_equal grade_sel ''
    AND school_grade.data = %grade_sel%
    . end if_set
    . end if_set
    . if_set teacher
    . if_equal criteria2 start
    AND school_teacher.data LIKE '%"teacher%%%'
    . end if_set
    . if_equal criteria2 trunc
    AND school_teacher.data LIKE '%%%"teacher%%%'
    . end if_set
    . end if_set
    . order_by_expr
    .end sql
    </pre>