{
  "Branch_User_Listing": {
    "layout":"grid",
    "table":"{schema}.branch",
    "caption":["Revision","Revisions"],
    "title":"All User Revisions",
    "menu":"jsHarmonyCMS/Branch_User_Listing",
    "breadcrumbs":"#CMS_SITE_BREADCRUMBS",
    "oninit": "jsh.System.RequireSite(xmodel);",
    "actions":"BU",
    "roles": { "PUBLISHER": "*" },
    "sqlwhere":"branch_type='USER' and (branch_user_id is not null) and (site_id={schema}.my_current_site_id())",
    "sort":["vbranch_user_id","vbranch_data_mtstmp_fmt"],
    "hide_system_buttons":["export"],
    "reselectafteredit": "row",
    "rowlimit":1000,
    "tablestyle":"min-width:600px;",
    "noresultsmessage":"No user revision history.",
    "rowclass": "<%=xejs.iif(datarow['branch_is_checked_out']==1,'branch_checked_out')%>",
    "css":[
      ".xform<%=model.class%> .branch_checked_out .branch_checkout_button a { color:#333; cursor:default; pointer-events:none; }",
    ],
    "fields": [
      {"name":"branch_id","control":"hidden","disable_search": true},
      {"name":"branch_is_checked_out","control":"hidden","sqlselect":"(select branch_is_checked_out from {schema}.v_my_branch_desc where branch_id={schema}.branch.branch_id)"},
      {"name":"branch_user_id","disable_search": true,"caption":"Owner","control":"dropdown","lov":{"sql":"select sys_user_id code_val, jsharmony.get_sys_user_name(sys_user_id) code_txt from jsharmony.sys_user where sys_user_sts='ACTIVE'","blank":"Select User..."},"validate":["Required"]},
      {"name":"branch_desc","caption":"Name","cellstyle":"min-width:200px;","sqlselect":"(select branch_desc from {schema}.v_my_branch_desc where branch_id={schema}.branch.branch_id)","link":"update:Branch_Summary"},
      {"name":"branch_sts","caption":"Status"},
      {"name":"branch_review_sts","caption":"Review Sts","control":"label","actions":"B"},
      {"name":"branch_data_mtstmp_fmt","type":"datetime","caption":"Last Modified","sqlselect":"$ifnull(branch_data_mtstmp,branch_mtstmp)","control":"label","actions":"B","format":["date","MM/DD/YYYY h:mm a"]},
      {"name":"branch_data_muser_fmt","caption":"Modified By","sqlselect":"(jsharmony.my_db_user_fmt($ifnull(branch_data_muser,branch_muser)))","control":"label","actions":"B"},
      {"caption":"Details","control":"html","link":"update:Branch_Summary","captionstyle":"text-align:center;","cellstyle":"text-align:center;",
        "value":"<img src='/images/icon_browse.png' class='xicon' />"},
      {"caption":"Checkout","control":"html","link":"update:Branch_Checkout&branch_id","captionstyle":"text-align:center;","cellstyle":"text-align:center;",
        "value":"<%=xejs.iif(datarow['branch_is_checked_out']==1,'(Checked Out)','Checkout')%>",
        "cellclass":"branch_checkout_button"},
      {"caption":"Clone","control":"linkbutton","link":"update:Branch_Clone&branch_id","captionstyle":"text-align:center;","cellstyle":"text-align:center;"}
    ]
  }
}