}
}
-?>
\ No newline at end of file
+?>
+++ /dev/null
-{"docURL":"","reportColumns":{"0":{"name":"Circulating Library","aggregate":false,"transformLabel":"Raw Data"},"1":{"name":"Shelving Location","aggregate":false,"transformLabel":"Raw Data"},"2":{"name":"Copy Status","aggregate":false,"transformLabel":"Raw Data"},"3":{"name":"Precat Title","aggregate":false,"transformLabel":"Raw Data"},"4":{"name":"Precat Author","aggregate":false,"transformLabel":"Raw Data"},"5":{"name":"Precat Call Number","aggregate":false,"transformLabel":"Raw Data"},"6":{"name":"Barcode","aggregate":false,"transformLabel":"Raw Data"},"7":{"name":"Creation Date\/Time","aggregate":false,"transformLabel":"Raw Data"},"8":{"name":"Last Edit Date\/Time","aggregate":false,"transformLabel":"Raw Data"},"9":{"name":"Name","aggregate":false,"transformLabel":"Raw Data"},"10":{"name":"OPAC\/Staff Client User Name","aggregate":false,"transformLabel":"Raw Data"}},"userParams":{"0":{"column":"Item","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"::P0","fieldDoc":"","aggregate":"","dataType":"bool","table":"asset.copy","paramType":"user"}},"staticParams":{"0":{"column":"Item -> Call Number\/Volume","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"1","fieldDoc":"","aggregate":"","dataType":"org_unit","table":"asset.call_number","paramType":"static"},"1":{"column":"Item -> Call Number\/Volume","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"UNCATALOGED","fieldDoc":"","aggregate":"","dataType":"org_unit","table":"asset.call_number","paramType":"static"},"2":{"column":"Item","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"f","fieldDoc":"","aggregate":"","dataType":"bool","table":"asset.copy","paramType":"static"}}}
\ No newline at end of file
+++ /dev/null
-{"version":5,"doc_url":"","core_class":"acp","select":[{"alias":"Circulating Library","path":"aou-shortname","field_doc":"","relation":"d9bb0f1ae1cb5d9aac6e4deeef4da9af","column":{"colname":"shortname","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Shelving Location","path":"acpl-name","field_doc":"","relation":"997a0e361cbf1f5a57941642d5fb088a","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Copy Status","path":"ccs-name","field_doc":"","relation":"8129cbef75ca108b4c84d2b9874ab89a","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Title","path":"acp-dummy_title","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_title","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Author","path":"acp-dummy_author","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_author","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Call Number","path":"acp-dummy_isbn","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_isbn","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Barcode","path":"acp-barcode","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"barcode","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Creation Date/Time","path":"acp-create_date","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"create_date","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Last Edit Date/Time","path":"acp-edit_date","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"edit_date","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Name","path":"ccm-name","field_doc":"","relation":"851029826a8f1e629d4b7136a04f86f8","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"OPAC/Staff Client User Name","path":"au-usrname","field_doc":"","relation":"7ebcb384ce3181abb47f6deefdb5c79f","column":{"colname":"usrname","transform":"Bare","transform_label":"Raw Data","aggregate":false}}],"from":{"alias":"7d74f3b92b19da5e606d737d339a9679","path":"acp-acp","table":"asset.copy","idlclass":"acp","join":{"circ_lib-eb2d7f1fefe6a54c8f29fd69d7d4f600":{"type":"inner","key":"id","alias":"d9bb0f1ae1cb5d9aac6e4deeef4da9af","path":"acp-circ_lib","table":"actor.org_unit","idlclass":"aou","label":"Item -> Circulating Library"},"location-ccdc1d371ff6eeb5e16397677300bf76":{"type":"inner","key":"id","alias":"997a0e361cbf1f5a57941642d5fb088a","path":"acp-location","table":"asset.copy_location","idlclass":"acpl","label":"Item -> Shelving Location"},"status-8f0bbe545ab37e7c4d7759476aec9631":{"type":"inner","key":"id","alias":"8129cbef75ca108b4c84d2b9874ab89a","path":"acp-status","table":"config.copy_status","idlclass":"ccs","label":"Item -> Copy Status"},"circ_modifier-706fb26126e429c6ec8e61be820fe758":{"type":"inner","key":"code","alias":"851029826a8f1e629d4b7136a04f86f8","path":"acp-circ_modifier","table":"config.circ_modifier","idlclass":"ccm","label":"Item -> Circulation Modifier"},"creator-38cb3a347e51d3575f004b7007dffc47":{"type":"inner","key":"id","alias":"7ebcb384ce3181abb47f6deefdb5c79f","path":"acp-creator","table":"actor.usr","idlclass":"au","label":"Item -> Creating User"},"call_number-ed55d72666ad50c3c4b9652f5627aba0":{"type":"inner","key":"id","alias":"b2cf79747613caddc0cc6635315db347","path":"acp-call_number","table":"asset.call_number","idlclass":"acn","label":"Item -> Call Number/Volume"}},"label":"Item"},"where":[{"alias":"Owning Library","path":"acn-owning_lib","field_doc":"","relation":"b2cf79747613caddc0cc6635315db347","column":{"colname":"owning_lib","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"1"}},{"alias":"Call Number Label","path":"acn-label","field_doc":"","relation":"b2cf79747613caddc0cc6635315db347","column":{"colname":"label","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"UNCATALOGED"}},{"alias":"Is Deleted","path":"acp-deleted","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"deleted","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"f"}},{"alias":"Circulating Library","path":"acp-circ_lib","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"circ_lib","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"in":"::P0"}}],"having":[],"display_cols":[{"name":"shortname","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Organizational Unit","from":"acp","link":{"name":"circ_lib","label":"Circulating Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"org_unit"},"id":"acp.aou","uplink":{"name":"circ_lib","label":"Circulating Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"org_unit"},"classname":"aou","struct":{"name":"aou","label":"Organizational Unit","table":"actor.org_unit","pkey":"id","pkey_sequence":"actor.org_unit_id_seq","core_label":"Non-core sources","classname":"aou"},"table":"actor.org_unit"}],"label":"Circulating Library","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Circulating Library","index":0},{"name":"name","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Copy/Shelving Location","from":"acp","link":{"name":"location","label":"Shelving Location","type":"link","key":"id","class":"acpl","reltype":"has_a","datatype":"link"},"id":"acp.acpl","uplink":{"name":"location","label":"Shelving Location","type":"link","key":"id","class":"acpl","reltype":"has_a","datatype":"link"},"classname":"acpl","struct":{"name":"acpl","label":"Copy/Shelving Location","table":"asset.copy_location","pkey":"id","pkey_sequence":"asset.copy_location_id_seq","core_label":"Non-core sources","classname":"acpl"},"table":"asset.copy_location"}],"label":"Shelving Location","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Shelving Location","index":1},{"name":"name","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Copy Status","from":"acp","link":{"name":"status","label":"Copy Status","type":"link","key":"id","class":"ccs","reltype":"has_a","datatype":"link"},"id":"acp.ccs","uplink":{"name":"status","label":"Copy Status","type":"link","key":"id","class":"ccs","reltype":"has_a","datatype":"link"},"classname":"ccs","struct":{"name":"ccs","label":"Copy Status","restrict_primary":"100","table":"config.copy_status","pkey":"id","pkey_sequence":"config.copy_status_id_seq","core_label":"Non-core sources","classname":"ccs"},"table":"config.copy_status"}],"label":"Copy Status","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Copy Status","index":2},{"name":"dummy_title","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Title","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":3},{"name":"dummy_author","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Author","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":4},{"name":"dummy_isbn","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Call Number","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":5},{"name":"barcode","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Barcode","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":6},{"name":"create_date","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Creation Date/Time","datatype":"timestamp","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":7},{"name":"edit_date","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Last Edit Date/Time","datatype":"timestamp","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":8},{"name":"name","label":"Name","i18n":true,"datatype":"text","index":9,"path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Circulation Modifier","from":"acp","link":{"name":"circ_modifier","label":"Circulation Modifier","type":"link","key":"code","class":"ccm","reltype":"has_a","datatype":"link"},"id":"acp.ccm","uplink":{"name":"circ_modifier","label":"Circulation Modifier","type":"link","key":"code","class":"ccm","reltype":"has_a","datatype":"link"},"classname":"ccm","struct":{"name":"ccm","label":"Circulation Modifier","table":"config.circ_modifier","pkey":"code","core_label":"Non-core sources","classname":"ccm"},"table":"config.circ_modifier"}],"path_label":"Item -> Circulation Modifier","transform":{"transform":"Bare","label":"Raw Data","aggregate":false},"doc_text":""},{"name":"usrname","label":"OPAC/Staff Client User Name","datatype":"text","index":10,"path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Creating User","from":"acp","link":{"name":"creator","label":"Creating User","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"id":"acp.au","uplink":{"name":"creator","label":"Creating User","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"classname":"au","struct":{"name":"au","label":"ILS User","table":"actor.usr","core":true,"pkey":"id","pkey_sequence":"actor.usr_id_seq","core_label":"Core sources","classname":"au"},"table":"actor.usr"}],"path_label":"Item -> Creating User","transform":{"transform":"Bare","label":"Raw Data","aggregate":false},"doc_text":""}],"filter_cols":[{"name":"owning_lib","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Call Number/Volume","from":"acp","link":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"id":"acp.acn","uplink":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"classname":"acn","struct":{"name":"acn","label":"Call Number/Volume","table":"asset.call_number","pkey":"id","pkey_sequence":"asset.call_number_id_seq","core_label":"Non-core sources","classname":"acn"},"table":"asset.call_number"}],"label":"Owning Library","datatype":"org_unit","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Call Number/Volume","operator":{"op":"=","label":"Equals"},"index":0,"value":"1"},{"name":"label","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Call Number/Volume","from":"acp","link":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"id":"acp.acn","uplink":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"classname":"acn","struct":{"name":"acn","label":"Call Number/Volume","table":"asset.call_number","pkey":"id","pkey_sequence":"asset.call_number_id_seq","core_label":"Non-core sources","classname":"acn"},"table":"asset.call_number"}],"label":"Call Number Label","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Call Number/Volume","operator":{"op":"=","label":"Equals"},"index":1,"value":"UNCATALOGED"},{"name":"deleted","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Is Deleted","datatype":"bool","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","operator":{"op":"=","label":"Equals"},"index":2,"value":"f"},{"name":"circ_lib","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Circulating Library","datatype":"org_unit","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","operator":{"op":"in","label":"In list"},"index":3}]}
\ No newline at end of file
+++ /dev/null
-{"version":5,"doc_url":"","core_class":"acp","select":[{"alias":"Circulating Library","path":"aou-shortname","field_doc":"","relation":"d9bb0f1ae1cb5d9aac6e4deeef4da9af","column":{"colname":"shortname","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Shelving Location","path":"acpl-name","field_doc":"","relation":"997a0e361cbf1f5a57941642d5fb088a","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Copy Status","path":"ccs-name","field_doc":"","relation":"8129cbef75ca108b4c84d2b9874ab89a","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Title","path":"acp-dummy_title","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_title","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Author","path":"acp-dummy_author","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_author","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Precat Call Number","path":"acp-dummy_isbn","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"dummy_isbn","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Barcode","path":"acp-barcode","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"barcode","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Creation Date/Time","path":"acp-create_date","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"create_date","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Last Edit Date/Time","path":"acp-edit_date","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"edit_date","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Name","path":"ccm-name","field_doc":"","relation":"851029826a8f1e629d4b7136a04f86f8","column":{"colname":"name","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"OPAC/Staff Client User Name","path":"au-usrname","field_doc":"","relation":"7ebcb384ce3181abb47f6deefdb5c79f","column":{"colname":"usrname","transform":"Bare","transform_label":"Raw Data","aggregate":false}}],"from":{"alias":"7d74f3b92b19da5e606d737d339a9679","path":"acp-acp","table":"asset.copy","idlclass":"acp","join":{"circ_lib-eb2d7f1fefe6a54c8f29fd69d7d4f600":{"type":"inner","key":"id","alias":"d9bb0f1ae1cb5d9aac6e4deeef4da9af","path":"acp-circ_lib","table":"actor.org_unit","idlclass":"aou","label":"Item -> Circulating Library"},"location-ccdc1d371ff6eeb5e16397677300bf76":{"type":"inner","key":"id","alias":"997a0e361cbf1f5a57941642d5fb088a","path":"acp-location","table":"asset.copy_location","idlclass":"acpl","label":"Item -> Shelving Location"},"status-8f0bbe545ab37e7c4d7759476aec9631":{"type":"inner","key":"id","alias":"8129cbef75ca108b4c84d2b9874ab89a","path":"acp-status","table":"config.copy_status","idlclass":"ccs","label":"Item -> Copy Status"},"circ_modifier-706fb26126e429c6ec8e61be820fe758":{"type":"inner","key":"code","alias":"851029826a8f1e629d4b7136a04f86f8","path":"acp-circ_modifier","table":"config.circ_modifier","idlclass":"ccm","label":"Item -> Circulation Modifier"},"creator-38cb3a347e51d3575f004b7007dffc47":{"type":"inner","key":"id","alias":"7ebcb384ce3181abb47f6deefdb5c79f","path":"acp-creator","table":"actor.usr","idlclass":"au","label":"Item -> Creating User"},"call_number-ed55d72666ad50c3c4b9652f5627aba0":{"type":"inner","key":"id","alias":"b2cf79747613caddc0cc6635315db347","path":"acp-call_number","table":"asset.call_number","idlclass":"acn","label":"Item -> Call Number/Volume"}},"label":"Item"},"where":[{"alias":"Owning Library","path":"acn-owning_lib","field_doc":"","relation":"b2cf79747613caddc0cc6635315db347","column":{"colname":"owning_lib","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"1"}},{"alias":"Call Number Label","path":"acn-label","field_doc":"","relation":"b2cf79747613caddc0cc6635315db347","column":{"colname":"label","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"UNCATALOGED"}},{"alias":"Is Deleted","path":"acp-deleted","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"deleted","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"f"}},{"alias":"Circulating Library","path":"acp-circ_lib","field_doc":"","relation":"7d74f3b92b19da5e606d737d339a9679","column":{"colname":"circ_lib","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"in":"::P0"}}],"having":[],"display_cols":[{"name":"shortname","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Organizational Unit","from":"acp","link":{"name":"circ_lib","label":"Circulating Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"org_unit"},"id":"acp.aou","uplink":{"name":"circ_lib","label":"Circulating Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"org_unit"},"classname":"aou","struct":{"name":"aou","label":"Organizational Unit","table":"actor.org_unit","pkey":"id","pkey_sequence":"actor.org_unit_id_seq","core_label":"Non-core sources","classname":"aou"},"table":"actor.org_unit"}],"label":"Circulating Library","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Circulating Library","index":0},{"name":"name","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Copy/Shelving Location","from":"acp","link":{"name":"location","label":"Shelving Location","type":"link","key":"id","class":"acpl","reltype":"has_a","datatype":"link"},"id":"acp.acpl","uplink":{"name":"location","label":"Shelving Location","type":"link","key":"id","class":"acpl","reltype":"has_a","datatype":"link"},"classname":"acpl","struct":{"name":"acpl","label":"Copy/Shelving Location","table":"asset.copy_location","pkey":"id","pkey_sequence":"asset.copy_location_id_seq","core_label":"Non-core sources","classname":"acpl"},"table":"asset.copy_location"}],"label":"Shelving Location","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Shelving Location","index":1},{"name":"name","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Copy Status","from":"acp","link":{"name":"status","label":"Copy Status","type":"link","key":"id","class":"ccs","reltype":"has_a","datatype":"link"},"id":"acp.ccs","uplink":{"name":"status","label":"Copy Status","type":"link","key":"id","class":"ccs","reltype":"has_a","datatype":"link"},"classname":"ccs","struct":{"name":"ccs","label":"Copy Status","restrict_primary":"100","table":"config.copy_status","pkey":"id","pkey_sequence":"config.copy_status_id_seq","core_label":"Non-core sources","classname":"ccs"},"table":"config.copy_status"}],"label":"Copy Status","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Copy Status","index":2},{"name":"dummy_title","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Title","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":3},{"name":"dummy_author","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Author","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":4},{"name":"dummy_isbn","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Precat Call Number","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":5},{"name":"barcode","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Barcode","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":6},{"name":"create_date","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Creation Date/Time","datatype":"timestamp","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":7},{"name":"edit_date","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Last Edit Date/Time","datatype":"timestamp","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","index":8},{"name":"name","label":"Name","i18n":true,"datatype":"text","index":9,"path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Circulation Modifier","from":"acp","link":{"name":"circ_modifier","label":"Circulation Modifier","type":"link","key":"code","class":"ccm","reltype":"has_a","datatype":"link"},"id":"acp.ccm","uplink":{"name":"circ_modifier","label":"Circulation Modifier","type":"link","key":"code","class":"ccm","reltype":"has_a","datatype":"link"},"classname":"ccm","struct":{"name":"ccm","label":"Circulation Modifier","table":"config.circ_modifier","pkey":"code","core_label":"Non-core sources","classname":"ccm"},"table":"config.circ_modifier"}],"path_label":"Item -> Circulation Modifier","transform":{"transform":"Bare","label":"Raw Data","aggregate":false},"doc_text":""},{"name":"usrname","label":"OPAC/Staff Client User Name","datatype":"text","index":10,"path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Creating User","from":"acp","link":{"name":"creator","label":"Creating User","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"id":"acp.au","uplink":{"name":"creator","label":"Creating User","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"classname":"au","struct":{"name":"au","label":"ILS User","table":"actor.usr","core":true,"pkey":"id","pkey_sequence":"actor.usr_id_seq","core_label":"Core sources","classname":"au"},"table":"actor.usr"}],"path_label":"Item -> Creating User","transform":{"transform":"Bare","label":"Raw Data","aggregate":false},"doc_text":""}],"filter_cols":[{"name":"owning_lib","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Call Number/Volume","from":"acp","link":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"id":"acp.acn","uplink":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"classname":"acn","struct":{"name":"acn","label":"Call Number/Volume","table":"asset.call_number","pkey":"id","pkey_sequence":"asset.call_number_id_seq","core_label":"Non-core sources","classname":"acn"},"table":"asset.call_number"}],"label":"Owning Library","datatype":"org_unit","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Call Number/Volume","operator":{"op":"=","label":"Equals"},"index":0,"value":"1"},{"name":"label","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"},{"label":"Call Number/Volume","from":"acp","link":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"id":"acp.acn","uplink":{"name":"call_number","label":"Call Number/Volume","type":"link","key":"id","class":"acn","reltype":"has_a","datatype":"link"},"classname":"acn","struct":{"name":"acn","label":"Call Number/Volume","table":"asset.call_number","pkey":"id","pkey_sequence":"asset.call_number_id_seq","core_label":"Non-core sources","classname":"acn"},"table":"asset.call_number"}],"label":"Call Number Label","datatype":"text","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item -> Call Number/Volume","operator":{"op":"=","label":"Equals"},"index":1,"value":"UNCATALOGED"},{"name":"deleted","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Is Deleted","datatype":"bool","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","operator":{"op":"=","label":"Equals"},"index":2,"value":"f"},{"name":"circ_lib","path":[{"label":"Item","id":"acp","classname":"acp","struct":{"name":"acp","label":"Item","table":"asset.copy","core":true,"pkey":"id","pkey_sequence":"asset.copy_id_seq","core_label":"Core sources","classname":"acp"},"table":"asset.copy"}],"label":"Circulating Library","datatype":"org_unit","doc_text":"","transform":{"label":"Raw Data","transform":"Bare","aggregate":null},"path_label":"Item","operator":{"op":"in","label":"In list"},"index":3}]}
- [data] => {"docURL":"","reportColumns":{"0":{"name":"Circulating Library","aggregate":false,"transformLabel":"Raw Data"},"1":{"name":"Shelving Location","aggregate":false,"transformLabel":"Raw Data"},"2":{"name":"Copy Status","aggregate":false,"transformLabel":"Raw Data"},"3":{"name":"Precat Title","aggregate":false,"transformLabel":"Raw Data"},"4":{"name":"Precat Author","aggregate":false,"transformLabel":"Raw Data"},"5":{"name":"Precat Call Number","aggregate":false,"transformLabel":"Raw Data"},"6":{"name":"Barcode","aggregate":false,"transformLabel":"Raw Data"},"7":{"name":"Creation Date\/Time","aggregate":false,"transformLabel":"Raw Data"},"8":{"name":"Last Edit Date\/Time","aggregate":false,"transformLabel":"Raw Data"},"9":{"name":"Name","aggregate":false,"transformLabel":"Raw Data"},"10":{"name":"OPAC\/Staff Client User Name","aggregate":false,"transformLabel":"Raw Data"}},"userParams":{"0":{"column":"Item","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"::P0","fieldDoc":"","aggregate":"","dataType":"bool","table":"asset.copy","paramType":"user"}},"staticParams":{"0":{"column":"Item -> Call Number\/Volume","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"1","fieldDoc":"","aggregate":"","dataType":"org_unit","table":"asset.call_number","paramType":"static"},"1":{"column":"Item -> Call Number\/Volume","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"UNCATALOGED","fieldDoc":"","aggregate":"","dataType":"org_unit","table":"asset.call_number","paramType":"static"},"2":{"column":"Item","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"f","fieldDoc":"","aggregate":"","dataType":"bool","table":"asset.copy","paramType":"static"}}}
\ No newline at end of file
if ( isset( $jsonData->filter_cols ) ) {
foreach ( $jsonData->filter_cols as $fc ) {
- if ( $fc->path_label === $columnLabel ) {
+ $fcFullLabel = $fc->path_label . " -> " . $fc->label;
+ if ( $fcFullLabel === $columnLabelFull ) {
$dataType = $fc->datatype;
$op = $fc->operator->op;
$opLabel = $fc->operator->label;
,'paramType' => $paramType
);
}
-
- function returnColumnLabel( $d, $rel, $tag, $val, $retVal ) {
- $val = "";
- foreach( $d as $d1 ) {
- if ( isset( $d1->$tag ) ) {
- if ( $d1->$tag == $val ) {
- $val = $d1->$retVal;
- break;
- }
- }
- }
- return $val;
- }
}
?>
+++ /dev/null
-<?php
-class templateDecoder
-{
-
- function __construct( ){}
-
- function createTemplateObject ($reporterTemplateID) {
-
- $templateObj = new stdClass();
- $templateObj->id = $result["id"];
- $templateObj->name = $result["name"];
- $templateObj->description = $result["description"];
- $templateObj->owner = $result["owner"];
- $templateObj->folder = $result["folder"];
- $templateObj->createTime = $result["create_time"];
- $templateObj->data = $result["data"];
- $templateObj->dataDecoded = $this->getDecodedTemplateData($result["data"]);
- }
-
- public function decodeTemplateData ($templateData) {
- $validData = false;
- $version = 3;
-
- $userParamsArray = array();
- $staticParamsArray = array();
- $reportColumnsArray = array();
- $returnObj = new stdClass();
-
- $jsonData = json_decode( $templateData, false );
- if ( $jsonData != NULL ) {
- $validData = $jsonData->version != NULL ? true : false;
- $version = $jsonData->version;
- }
- if ( $validData ) {
- $version === 3 || $version === 4 ? $jsonData = $this->convertXULTemplate( $jsonData ) : false;
- $select = $jsonData->select;
- $where = ( isset( $jsonData->where ) ? $jsonData->where : NULL );
- $having = ( isset( $jsonData->having ) ? $jsonData->having : NULL );
-
- foreach ( $select as $s ) {
- $columnName = $s->column->colname;
- $r = $s->relation;
- $relCol = $s->column;
- $displayAggregate = isset( $relCol->aggregate ) ? $relCol->aggregate : NULL;
- $displayTransformLabel = isset ( $relCol->transform_label ) ? $relCol->transform_label : NULL;
-
- $columnArray = array(
- "name" => $s->alias,
- "aggregate" => $displayAggregate,
- "transformLabel"=>$displayTransformLabel
- );
-
- $reportColumnsArray[] = (object) $columnArray;
-
- $where = isset( $jsonData->where ) ?
- array(
- "name" => "where",
- "columns" => $jsonData->where
- ) : NULL;
- $having = isset( $jsonData->having ) ?
- array(
- "name" => "having",
- "columns" => $jsonData->having
- ) : NULL;
-
- foreach ( array( "where", "having" ) as $c ) {
- if ( $c == "where" ) {
- if ( !isset( $where ) ) continue;
- $clause = $where;
- }
- if ( $c == "having" ) {
- if ( !isset( $having ) ) continue;
- $clause = $having;
- }
-
- foreach ( $clause as $cl ) {
- $relation = isset( $cl->relation ) ? $cl->relation : null;
- $colName = isset( $cl->column->colname ) ? $cl->column->colname : null;
-
- $columnLabel = "";
- $this->pullLabel( $jsonData->from, $relation, $columnLabel, "alias", "join", "label" );
- $columnLabel = str_replace( '::', '->', $columnLabel);
-
- $transform = isset( $cl->column->transform ) ? $cl->column->transform : null;
- $transformLabel = isset( $cl->column->transform_label ) ? $cl->column->transform_label : "";
-
- $dataType = "";
- $op = "";
- $opLabel = "";
- $fieldDoc = "";
- $aggregate = "";
- foreach ( $jsonData->filter_cols as $fc ) {
- if ( $fc->name === $colName ) {
- $dataType = $fc->datatype;
- $op = $fc->operator->op;
- $opLabel = $fc->operator->label;
- isset( $fc->doc_text ) ? $fieldDoc = $fc->doc_text : false;
- if ( isset( $fc->transform->aggregate ) ) {
- if ( $fc->transform->aggregate != "undefined" ) {
- $aggregate = $fc->transform->aggregate;
- }
- }
- break;
- }
- }
- $tableName = "";
- $this->pullLabel( $jsonData->from, $relation, $tableName, "alias", "join", "table" );
- $P = isset( $cl->condition ) ? $cl->condition : null;
-
- if ( isset( $P ) ) {
- list($key, $opValue) = each($P); //get the first (and only) value
- }
- if ( isset( $opValue ) ) {
- if (is_array($opValue)) $opValue = implode(',', $opValue); //if array convert it back to a string
- } else {
- $opValue = null;
- }
-
- $paramsArray = array(
- 'column' => $columnLabel
- ,'transform' => $transform
- ,'transformLabel' => $transformLabel
- ,'op' => $op
- ,'opLabel' => $opLabel
- ,'param'=> $opValue
- ,'fieldDoc' => $fieldDoc
- ,'aggregate' => $aggregate
- ,'dataType' => $dataType
- ,'table' => $tableName
- );
- //if (mb_substr($opValue,0,3,'UTF-8')=='::P') {
- if (substr($opValue,0,3) == '::P') {
- $userParamsArray[] = (object) $paramsArray;
- }
- else {
- $staticParamsArray[] = (object) $paramsArray;
- }
- }
- }
- $returnObj->docURL = isset($jsonData->doc_url) ? $jsonData->doc_url : NULL; //version 4 templates only
- $returnObj->reportColumns = (object) $reportColumnsArray;
- $returnObj->userParams = (object) $userParamsArray;
- $returnObj->staticParams = (object) $staticParamsArray;
-
- return($returnObj);
- }
- } else {
- new displayMessageView( "JSON format error decoding template data." );
- }
- }
-
- function convertXULTemplate ( $template ) {
- $data = ( object )[
- "version" => 5,
- "core_class" => $template->core_class,
- "select" => $template->select,
- "from" => $template->from,
- "where" => $template->where,
- "having" => $template->having,
- "display_cols" => array(),
- "filter_cols" => array()
- ];
-
- $rels = [];
- $order_by = "";
-
- foreach( $template->rel_cache as $k => $v ) {
- $k == "order_by" ? $order_by = $v : $rels{$k} = $v; //array_push( $rels, $v );
- }
-
- $select = $template->select;
- $sel_order = array();
- $idx = 0;
- foreach ( $select as $s ) {
- $sel_order[strval($s->relation) . strval($s->column->colname)] = $idx;
- $idx++;
- }
-
- $idx = 0;
-
- $IDL = json_decode( file_get_contents( 'config/IDL.json' ) );
-
- foreach ( $rels as $r ) {
- if ( is_array($r) || is_object($r) ) {
- $this->buildCols( $r, 'dis_tab', $sel_order, $data->display_cols, $IDL);
- $this->buildCols( $r, 'filter_tab', NULL, $data->filter_cols, $IDL);
- $this->buildCols( $r, 'aggfilter_tab', NULL, $data->filter_cols, $IDL);
- }
-
- }
-
- return $data;
- }
-
- function buildCols( $r, $tt, $sel_order, &$d, $IDL ) {
- $colType = $tt == 'dis_tab' ? 'display_cols' : 'filter_cols';
- $ci = 0;
- foreach ( $r->fields->{$tt} as $n =>$c ) {
- $orig = $r->fields->{$tt}->$n;
- $col = ( object ) [
- "name" => $c->colname,
- "path" => $this->convertPath( $orig, $r , $IDL), //needs fixed
- "label" => $orig->alias,
- "datatype" => $c->datatype,
- "doc_text" => $c->field_doc,
- "transform" => ( object ) [
- "label" => $orig->transform_label,
- "transform" => $orig->transform,
- "aggregate" => !isset( $orig->aggregate ) ? NULL : $orig->aggregate
- ],
- "path_label" => preg_replace( "/\:\:/", "->", $r->label),
- "index" => false
- ];
- if ( $colType == "filter_cols" ) {
- @$col->operator = [
- "op" => $orig->op,
- "label" => $orig->op_label
- ];
- @$col->index = $ci++;
- isset( $orig->op_value->value ) ? @$col->value = $orig->op_value->value : FALSE;
- } else {
- isset( $sel_order[$r->alias . $orig->colname] ) ? @$col->index = $sel_order[$r->alias . $orig->colname] : @$col->index = false;
- }
- array_push( $d, $col );
- }
- }
-
- function buildNode( $cls, $args, $IDL ) {
- if ( !isset( $cls ) || !isset( $args ) ) {
- return null;
- } else {
- $n = isset( $IDL->{ $cls } ) ? $IDL->{ $cls } : null;
- }
-
- if ( !$n ) {
- return null;
- } else {
- if ( !$args ) {
- $args = ( object ) [
- "label" => $n->label
- ];
- }
- $args->id = $cls;
- if ( isset( $args->from ) ) {
- $args->id = $args->from . "." . $args->id;
- }
- $links = array();
- foreach( $n->fields as $x ) {
- if ( isset( $x->type ) ) {
- $x->type == "link" ? array_push( $links, $x ) : false;
- }
- }
-
- $args->idl = $this->service($cls, null);
- $args->uplink = isset( $args->link ) ? $args->link : null;
- $args->classname = $cls;
- $args->struct = $n;
- $args->table = isset( $n->table ) ? $n->table : null;
- $args->fields = $this->_sort_class_fields($n->fields);
- $args->links = $this->_sort_class_fields($links);
- $args->children = [];
-
- $args = json_encode( $args );
-
- return $args;
- }
- }
-
- function convertPath( $orig, $rel, $IDL ) {
- $new_path = [];
- $table_path = preg_split( "/\./", $rel->path );
- if ( count( $table_path ) > 1 || strpos( $rel->path, "-" ) ) {
- array_push( $table_path, $rel->idlclass );
- }
- $prev_type= "";
- $prev_link = "";
-
- foreach( $table_path as $tp ) {
- $cl_split = preg_split( "/-/", $tp);
- $cls = $cl_split[0];
- $fld = isset( $cl_split[1] ) ? $cl_split[1] : null;
- $args = ( object )[
- "label" => isset( $IDL->{$cls}->label ) ? $IDL->{$cls}->label : null
- ];
-
- if( $prev_link != "" ) {
- $link_parts = preg_split( "/-/", $prev_link );
- $args->from = $link_parts[0];
- $join_parts = preg_split( "/>/", $link_parts[1]);
- $prev_col = $join_parts[0];
- foreach( $IDL->{$link_parts[0]}->fields as $f ) {
- if ( $prev_col == $f->name ) {
- $args->link = $f;
- }
- }
- $args->jtype = isset( $join_parts[1] ) ? $join_parts[1] : null;
- }
-
- array_push( $new_path, $this->buildNode($cls, $args, $IDL));
- $prev_link = $tp;
- }
- }
-
- function pullLabel ( $d, $str, &$out, $tag, $subtag, $val ) {
- if ( $d->$tag == $str ) {
- $out = $d->$val;
- return;
- } else {
- if ( isset( $d->$subtag ) ) {
- if ( $d->$subtag ) {
- foreach ( $d->$subtag as $j ) {
- $this->pullLabel( $j, $str, $out, $tag, $subtag, $val );
- }
- }
- } else {
- return;
- }
- }
- }
-
- function service( $cls, $seed) {
- return ( object ) [
- "a" => ( $seed ? $seed : ( object )[] ),
- "classname" => $cls,
- "_isfieldmapper" => true
- ];
- }
-
- function _sort_class_fields( $arr ) {
- $out = array();
- if ( isset( $arr[0] ) ) {
- array_push( $out, $arr[0] );
- array_shift($arr);
- $i = 0;
- while ( count($arr) > 0 ) {
- $arrLabel = isset( $arr[0]->label ) ? $arr[0]->label : "";
- $arrName = isset( $arr[0]->name ) ? $arr[0]->name : "";
-
- //$aname = $arr[0]->label ? $arr[0]->label : $arr[0]->name;
-
- $bName = isset( $out[$i]->label ) ? $out[$i]->label : "";
- $bLabel = isset( $out[$i]->label ) ? $out[$i]->label : $bName;
- $bName = isset( $bLabel ) ? $bLabel : $bName; //$out[$i]->label ? $out[$i]->label : $out[$i]->name;
- while ( strcmp( $arrName, $bName) > 0 && $i < count( $arr ) ) {
- $i++;
- }
- array_splice( $out, $i, 0, array( $arr[0] ) );
- array_shift( $arr );
- $i = 0;
- }
- }
- return $out;
- }
-}
-?>
+++ /dev/null
-<?php
-class templateDecoder
-{
-
- function __construct( ){}
-
- function createTemplateObject ($reporterTemplateID) {
-
- $templateObj = new stdClass();
- $templateObj->id = $result["id"];
- $templateObj->name = $result["name"];
- $templateObj->description = $result["description"];
- $templateObj->owner = $result["owner"];
- $templateObj->folder = $result["folder"];
- $templateObj->createTime = $result["create_time"];
- $templateObj->data = $result["data"];
- $templateObj->dataDecoded = $this->getDecodedTemplateData($result["data"]);
- }
-
- public function decodeTemplateData ($templateData) {
- $validData = false;
- $version = 3;
-
- $userParamsArray = array();
- $staticParamsArray = array();
- $reportColumnsArray = array();
- $returnObj = new stdClass();
-
- $jsonData = json_decode( $templateData, false );
- if ( $jsonData != NULL ) {
- $validData = $jsonData->version != NULL ? true : false;
- $version = $jsonData->version;
- }
- if ( $validData ) {
- $version === 3 || $version === 4 ? $jsonData = $this->convertXULTemplate( $jsonData ) : false;
- $select = $jsonData->select;
- $where = ( isset( $jsonData->where ) ? $jsonData->where : NULL );
- $having = ( isset( $jsonData->having ) ? $jsonData->having : NULL );
-
- foreach ( $select as $s ) {
- $columnName = $s->column->colname;
- $r = $s->relation;
- $relCol = $s->column;
- $displayAggregate = isset( $relCol->aggregate ) ? $relCol->aggregate : NULL;
- $displayTransformLabel = isset ( $relCol->transform_label ) ? $relCol->transform_label : NULL;
-
- $columnArray = array(
- "name" => $s->alias,
- "aggregate" => $displayAggregate,
- "transformLabel"=>$displayTransformLabel
- );
-
- $reportColumnsArray[] = (object) $columnArray;
-
- $where = isset( $jsonData->where ) ?
- array(
- "name" => "where",
- "columns" => $jsonData->where
- ) : NULL;
- $having = isset( $jsonData->having ) ?
- array(
- "name" => "having",
- "columns" => $jsonData->having
- ) : NULL;
-
- foreach ( array( "where", "having" ) as $c ) {
- if ( $c == "where" ) {
- if ( !isset( $where ) ) continue;
- $clause = $where;
- }
- if ( $c == "having" ) {
- if ( !isset( $having ) ) continue;
- $clause = $having;
- }
-
- foreach ( $clause as $cl ) {
- $relation = isset( $cl->relation ) ? $cl->relation : null;
- $colName = isset( $cl->column->colname ) ? $cl->column->colname : null;
-
- $columnLabel = "";
- $this->pullLabel( $jsonData->from, $relation, $columnLabel, "alias", "join", "label" );
- $columnLabel = str_replace( '::', '->', $columnLabel);
-
- $transform = isset( $cl->column->transform ) ? $cl->column->transform : null;
- $transformLabel = isset( $cl->column->transform_label ) ? $cl->column->transform_label : "";
-
- $dataType = "";
- $op = "";
- $opLabel = "";
- $fieldDoc = "";
- $aggregate = "";
- foreach ( $jsonData->filter_cols as $fc ) {
- if ( $fc->name === $colName ) {
- $dataType = $fc->datatype;
- $op = $fc->operator->op;
- $opLabel = $fc->operator->label;
- isset( $fc->doc_text ) ? $fieldDoc = $fc->doc_text : false;
- if ( isset( $fc->transform->aggregate ) ) {
- if ( $fc->transform->aggregate != "undefined" ) {
- $aggregate = $fc->transform->aggregate;
- }
- }
- break;
- }
- }
- $tableName = "";
- $this->pullLabel( $jsonData->from, $relation, $tableName, "alias", "join", "table" );
- $P = isset( $cl->condition ) ? $cl->condition : null;
-
- if ( isset( $P ) ) {
- list($key, $opValue) = each($P); //get the first (and only) value
- }
- if ( isset( $opValue ) ) {
- if (is_array($opValue)) $opValue = implode(',', $opValue); //if array convert it back to a string
- } else {
- $opValue = null;
- }
-
- $paramsArray = array(
- 'column' => $columnLabel
- ,'transform' => $transform
- ,'transformLabel' => $transformLabel
- ,'op' => $op
- ,'opLabel' => $opLabel
- ,'param'=> $opValue
- ,'fieldDoc' => $fieldDoc
- ,'aggregate' => $aggregate
- ,'dataType' => $dataType
- ,'table' => $tableName
- );
- //if (mb_substr($opValue,0,3,'UTF-8')=='::P') {
- if (substr($opValue,0,3) == '::P') {
- $userParamsArray[] = (object) $paramsArray;
- }
- else {
- $staticParamsArray[] = (object) $paramsArray;
- }
- }
- }
- $returnObj->docURL = isset($jsonData->doc_url) ? $jsonData->doc_url : NULL; //version 4 templates only
- $returnObj->reportColumns = (object) $reportColumnsArray;
- $returnObj->userParams = (object) $userParamsArray;
- $returnObj->staticParams = (object) $staticParamsArray;
-
- return($returnObj);
- }
- } else {
- new displayMessageView( "JSON format error decoding template data." );
- }
- }
-
- function convertXULTemplate ( $template ) {
- $data = ( object )[
- "version" => 5,
- "core_class" => $template->core_class,
- "select" => $template->select,
- "from" => $template->from,
- "where" => $template->where,
- "having" => $template->having,
- "display_cols" => array(),
- "filter_cols" => array()
- ];
-
- $rels = [];
- $order_by = "";
-
- foreach( $template->rel_cache as $k => $v ) {
- $k == "order_by" ? $order_by = $v : $rels{$k} = $v; //array_push( $rels, $v );
- }
-
- $select = $template->select;
- $sel_order = array();
- $idx = 0;
- foreach ( $select as $s ) {
- $sel_order[strval($s->relation) . strval($s->column->colname)] = $idx;
- $idx++;
- }
-
- $idx = 0;
-
- $IDL = json_decode( file_get_contents( 'config/IDL.json' ) );
-
- foreach ( $rels as $r ) {
- if ( is_array($r) || is_object($r) ) {
- $this->buildCols( $r, 'dis_tab', $sel_order, $data->display_cols, $IDL);
- $this->buildCols( $r, 'filter_tab', NULL, $data->filter_cols, $IDL);
- $this->buildCols( $r, 'aggfilter_tab', NULL, $data->filter_cols, $IDL);
- }
-
- }
-
- return $data;
- }
-
- function buildCols( $r, $tt, $sel_order, &$d, $IDL ) {
- $colType = $tt == 'dis_tab' ? 'display_cols' : 'filter_cols';
- $ci = 0;
- foreach ( $r->fields->{$tt} as $n =>$c ) {
- $orig = $r->fields->{$tt}->$n;
- $col = ( object ) [
- "name" => $c->colname,
- "path" => $this->convertPath( $orig, $r , $IDL), //needs fixed
- "label" => $orig->alias,
- "datatype" => $c->datatype,
- "doc_text" => $c->field_doc,
- "transform" => ( object ) [
- "label" => $orig->transform_label,
- "transform" => $orig->transform,
- "aggregate" => !isset( $orig->aggregate ) ? NULL : $orig->aggregate
- ],
- "path_label" => preg_replace( "/\:\:/", "->", $r->label),
- "index" => false
- ];
- if ( $colType == "filter_cols" ) {
- @$col->operator = [
- "op" => $orig->op,
- "label" => $orig->op_label
- ];
- @$col->index = $ci++;
- isset( $orig->op_value->value ) ? @$col->value = $orig->op_value->value : FALSE;
- } else {
- isset( $sel_order[$r->alias . $orig->colname] ) ? @$col->index = $sel_order[$r->alias . $orig->colname] : @$col->index = false;
- }
- array_push( $d, $col );
- }
- }
-
- function buildNode( $cls, $args, $IDL ) {
- if ( !isset( $cls ) || !isset( $args ) ) {
- return null;
- } else {
- $n = isset( $IDL->{ $cls } ) ? $IDL->{ $cls } : null;
- }
-
- if ( !$n ) {
- return null;
- } else {
- if ( !$args ) {
- $args = ( object ) [
- "label" => $n->label
- ];
- }
- $args->id = $cls;
- if ( isset( $args->from ) ) {
- $args->id = $args->from . "." . $args->id;
- }
- $links = array();
- foreach( $n->fields as $x ) {
- if ( isset( $x->type ) ) {
- $x->type == "link" ? array_push( $links, $x ) : false;
- }
- }
-
- $args->idl = $this->service($cls, null);
- $args->uplink = isset( $args->link ) ? $args->link : null;
- $args->classname = $cls;
- $args->struct = $n;
- $args->table = isset( $n->table ) ? $n->table : null;
- $args->fields = $this->_sort_class_fields($n->fields);
- $args->links = $this->_sort_class_fields($links);
- $args->children = [];
-
- $args = json_encode( $args );
-
- return $args;
- }
- }
-
- function convertPath( $orig, $rel, $IDL ) {
- $new_path = [];
- $table_path = preg_split( "/\./", $rel->path );
- if ( count( $table_path ) > 1 || strpos( $rel->path, "-" ) ) {
- array_push( $table_path, $rel->idlclass );
- }
- $prev_type= "";
- $prev_link = "";
-
- foreach( $table_path as $tp ) {
- $cl_split = preg_split( "/-/", $tp);
- $cls = $cl_split[0];
- $fld = isset( $cl_split[1] ) ? $cl_split[1] : null;
- $args = ( object )[
- "label" => isset( $IDL->{$cls}->label ) ? $IDL->{$cls}->label : null
- ];
-
- if( $prev_link != "" ) {
- $link_parts = preg_split( "/-/", $prev_link );
- $args->from = $link_parts[0];
- $join_parts = preg_split( "/>/", $link_parts[1]);
- $prev_col = $join_parts[0];
- foreach( $IDL->{$link_parts[0]}->fields as $f ) {
- if ( $prev_col == $f->name ) {
- $args->link = $f;
- }
- }
- $args->jtype = isset( $join_parts[1] ) ? $join_parts[1] : null;
- }
-
- array_push( $new_path, $this->buildNode($cls, $args, $IDL));
- $prev_link = $tp;
- }
- }
-
- function pullLabel ( $d, $str, &$out, $tag, $subtag, $val ) {
- if ( $d->$tag == $str ) {
- $out = $d->$val;
- return;
- } else {
- if ( isset( $d->$subtag ) ) {
- if ( $d->$subtag ) {
- foreach ( $d->$subtag as $j ) {
- $this->pullLabel( $j, $str, $out, $tag, $subtag, $val );
- }
- }
- } else {
- return;
- }
- }
- }
-
- function service( $cls, $seed) {
- return ( object ) [
- "a" => ( $seed ? $seed : ( object )[] ),
- "classname" => $cls,
- "_isfieldmapper" => true
- ];
- }
-
- function _sort_class_fields( $arr ) {
- $out = array();
- if ( isset( $arr[0] ) ) {
- array_push( $out, $arr[0] );
- array_shift($arr);
- $i = 0;
- while ( count($arr) > 0 ) {
- $arrLabel = isset( $arr[0]->label ) ? $arr[0]->label : "";
- $arrName = isset( $arr[0]->name ) ? $arr[0]->name : "";
-
- //$aname = $arr[0]->label ? $arr[0]->label : $arr[0]->name;
-
- $bName = isset( $out[$i]->label ) ? $out[$i]->label : "";
- $bLabel = isset( $out[$i]->label ) ? $out[$i]->label : $bName;
- $bName = isset( $bLabel ) ? $bLabel : $bName; //$out[$i]->label ? $out[$i]->label : $out[$i]->name;
- while ( strcmp( $arrName, $bName) > 0 && $i < count( $arr ) ) {
- $i++;
- }
- array_splice( $out, $i, 0, array( $arr[0] ) );
- array_shift( $arr );
- $i = 0;
- }
- }
- return $out;
- }
-}
-?>
+++ /dev/null
-{\r
- "version": 5,\r
- "core_class": "acp",\r
- "select": [\r
- {\r
- "alias": "Barcode",\r
- "column": {\r
- "colname": "barcode",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-barcode",\r
- "relation": "7d74f3b92b19da5e606d737d339a9679"\r
- },\r
- {\r
- "alias": "TCN Value",\r
- "column": {\r
- "colname": "tcn_value",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-call_number-acn-record-bre-tcn_value",\r
- "relation": "640e9f1ba83104cf4de312413f51b877"\r
- },\r
- {\r
- "alias": "Creation Date/Time",\r
- "column": {\r
- "colname": "create_date",\r
- "transform": "date",\r
- "transform_label": "Date"\r
- },\r
- "path": "acp-create_date",\r
- "relation": "7d74f3b92b19da5e606d737d339a9679"\r
- },\r
- {\r
- "alias": "Call Number Label",\r
- "column": {\r
- "colname": "label",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-call_number-acn-label",\r
- "relation": "286d7899ae25bee8bdd7dcde49f9e0b7"\r
- },\r
- {\r
- "alias": "Title Proper (normalized)",\r
- "column": {\r
- "colname": "title",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-call_number-acn-record-bre-simple_record-rmsr-title",\r
- "relation": "df8d81aecbe6b10702cbd762ac04cac9"\r
- },\r
- {\r
- "alias": "Author (normalized)",\r
- "column": {\r
- "colname": "author",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-call_number-acn-record-bre-simple_record-rmsr-author",\r
- "relation": "df8d81aecbe6b10702cbd762ac04cac9"\r
- },\r
- {\r
- "alias": "Shelving Location",\r
- "column": {\r
- "colname": "name",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-location-acpl-name",\r
- "relation": "c17ecc44e3cd2de457e5c9f1e6e0a26f"\r
- },\r
- {\r
- "alias": "Copy Status",\r
- "column": {\r
- "colname": "name",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-status-ccs-name",\r
- "relation": "9547fadabf916ce4fd3eb232e0902c9c"\r
- },\r
- {\r
- "alias": "Publication Year (normalized)",\r
- "column": {\r
- "colname": "pubdate",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-call_number-acn-record-bre-simple_record-rmsr-pubdate",\r
- "relation": "df8d81aecbe6b10702cbd762ac04cac9"\r
- },\r
- {\r
- "alias": "Check Out Date/Time",\r
- "column": {\r
- "colname": "xact_start",\r
- "transform": "max",\r
- "transform_label": "Max"\r
- },\r
- "path": "acp-circulations-circ-xact_start",\r
- "relation": "ddeeaf1839fe1496b309babab563fea7"\r
- },\r
- {\r
- "alias": "Circulation Modifier",\r
- "column": {\r
- "colname": "circ_modifier",\r
- "transform": "upper",\r
- "transform_label": "Upper case"\r
- },\r
- "path": "acp-circ_modifier",\r
- "relation": "7d74f3b92b19da5e606d737d339a9679"\r
- },\r
- {\r
- "alias": "Circ ID",\r
- "column": {\r
- "colname": "id",\r
- "transform": "count_distinct",\r
- "transform_label": "Count Distinct"\r
- },\r
- "path": "acp-circulations-circ-id",\r
- "relation": "ddeeaf1839fe1496b309babab563fea7"\r
- }\r
- ],\r
- "from": {\r
- "path": "acp-status",\r
- "table": "asset.copy",\r
- "label": "Item",\r
- "alias": "7d74f3b92b19da5e606d737d339a9679",\r
- "idlclass": "acp",\r
- "template_path": "acp",\r
- "join": {\r
- "call_number-7d74f3b92b19da5e606d737d339a9679": {\r
- "key": "id",\r
- "path": "acp-call_number-acn-record",\r
- "table": "asset.call_number",\r
- "label": "Item :: Call Number/Volume",\r
- "alias": "286d7899ae25bee8bdd7dcde49f9e0b7",\r
- "idlclass": "acn",\r
- "template_path": "acp-call_number",\r
- "type": "left",\r
- "join": {\r
- "record-286d7899ae25bee8bdd7dcde49f9e0b7": {\r
- "type": "left",\r
- "key": "id",\r
- "path": "acp-call_number-acn-record-bre",\r
- "table": "biblio.record_entry",\r
- "alias": "640e9f1ba83104cf4de312413f51b877",\r
- "join": {\r
- "id-rmsr-id-7f0e2da56d7bdf7c7434e87c5abaab5c": {\r
- "type": "left",\r
- "key": "id",\r
- "path": "acp-call_number-acn-record-bre-simple_record-rmsr",\r
- "table": "reporter.materialized_simple_record",\r
- "label": "Item -> Call Number/Volume -> Bibliographic Record :: Simple Record Extracts ",\r
- "alias": "df8d81aecbe6b10702cbd762ac04cac9",\r
- "idlclass": "rmsr",\r
- "template_path": "acp-call_number.acn-record.bre-simple_record"\r
- }\r
- },\r
- "label": "Item -> Call Number/Volume :: Bib Record",\r
- "idlclass": "bre",\r
- "template_path": "acp-call_number.acn-record"\r
- }\r
- }\r
- },\r
- "id-circ-target_copy-7d74f3b92b19da5e606d737d339a9679": {\r
- "key": "target_copy",\r
- "type": "left",\r
- "path": "acp-circulations-circ",\r
- "table": "action.circulation",\r
- "label": "Item :: Circulations",\r
- "alias": "ddeeaf1839fe1496b309babab563fea7",\r
- "idlclass": "circ",\r
- "template_path": "acp-circulations"\r
- },\r
- "circ_lib-7d74f3b92b19da5e606d737d339a9679": {\r
- "key": "id",\r
- "path": "acp-circ_lib-aou",\r
- "table": "actor.org_unit",\r
- "label": "Item :: Circulating Library",\r
- "alias": "ab9ff91ac334900edb50f0a5a8e3501f",\r
- "idlclass": "aou",\r
- "template_path": "acp-circ_lib"\r
- },\r
- "location-7d74f3b92b19da5e606d737d339a9679": {\r
- "key": "id",\r
- "path": "acp-location-acpl",\r
- "table": "asset.copy_location",\r
- "label": "Item :: Shelving Location",\r
- "alias": "c17ecc44e3cd2de457e5c9f1e6e0a26f",\r
- "idlclass": "acpl",\r
- "template_path": "acp-location"\r
- },\r
- "status-7d74f3b92b19da5e606d737d339a9679": {\r
- "key": "id",\r
- "path": "acp-status-ccs",\r
- "table": "config.copy_status",\r
- "label": "Item :: Copy Status",\r
- "alias": "9547fadabf916ce4fd3eb232e0902c9c",\r
- "idlclass": "ccs",\r
- "template_path": "acp-status"\r
- }\r
- }\r
- },\r
- "where": [\r
- {\r
- "alias": "Creation Date/Time",\r
- "column": {\r
- "colname": "create_date",\r
- "transform": "date",\r
- "transform_label": "Date"\r
- },\r
- "path": "acp-create_date",\r
- "relation": "7d74f3b92b19da5e606d737d339a9679",\r
- "condition": { "<=": "::P0" }\r
- },\r
- {\r
- "alias": "Is Deleted",\r
- "column": {\r
- "colname": "deleted",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-deleted",\r
- "relation": "7d74f3b92b19da5e606d737d339a9679",\r
- "condition": { "=": "f" }\r
- },\r
- {\r
- "alias": "Call Number Label",\r
- "column": {\r
- "colname": "label",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-call_number-acn-label",\r
- "relation": "286d7899ae25bee8bdd7dcde49f9e0b7",\r
- "condition": { "between": ["J 000", "J 100"] }\r
- },\r
- {\r
- "alias": "Organizational Unit ID",\r
- "column": {\r
- "colname": "id",\r
- "transform": "Bare",\r
- "transform_label": "Raw Data"\r
- },\r
- "path": "acp-circ_lib-aou-id",\r
- "relation": "ab9ff91ac334900edb50f0a5a8e3501f",\r
- "condition": { "in": "::P2" }\r
- }\r
- ],\r
- "having": [\r
- {\r
- "alias": "Circ ID",\r
- "column": {\r
- "colname": "id",\r
- "transform": "count_distinct",\r
- "transform_label": "Count Distinct"\r
- },\r
- "path": "acp-circulations-circ-id",\r
- "relation": "ddeeaf1839fe1496b309babab563fea7",\r
- "condition": { "<=": "::P1" }\r
- }\r
- ],\r
- "display_cols": [\r
- {\r
- "name": "barcode",\r
- "path": null,\r
- "label": "Barcode",\r
- "datatype": "text",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item",\r
- "index": 0\r
- },\r
- {\r
- "name": "create_date",\r
- "path": null,\r
- "label": "Creation Date/Time",\r
- "datatype": "timestamp",\r
- "doc_text": null,\r
- "transform": { "label": "Date", "transform": "date", "aggregate": null },\r
- "path_label": "Item",\r
- "index": 2\r
- },\r
- {\r
- "name": "circ_modifier",\r
- "path": null,\r
- "label": "Circulation Modifier",\r
- "datatype": "text",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Upper case",\r
- "transform": "upper",\r
- "aggregate": null\r
- },\r
- "path_label": "Item",\r
- "index": 10\r
- },\r
- {\r
- "name": "label",\r
- "path": null,\r
- "label": "Call Number Label",\r
- "datatype": "text",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item -> Call Number/Volume",\r
- "index": 3\r
- },\r
- {\r
- "name": "title",\r
- "path": null,\r
- "label": "Title Proper (normalized)",\r
- "datatype": "text",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item -> Call Number/Volume -> Bibliographic Record -> Simple Record Extracts ",\r
- "index": 4\r
- },\r
- {\r
- "name": "author",\r
- "path": null,\r
- "label": "Author (normalized)",\r
- "datatype": "text",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item -> Call Number/Volume -> Bibliographic Record -> Simple Record Extracts ",\r
- "index": 5\r
- },\r
- {\r
- "name": "pubdate",\r
- "path": null,\r
- "label": "Publication Year (normalized)",\r
- "datatype": "int",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item -> Call Number/Volume -> Bibliographic Record -> Simple Record Extracts ",\r
- "index": 8\r
- },\r
- {\r
- "name": "xact_start",\r
- "path": null,\r
- "label": "Check Out Date/Time",\r
- "datatype": "timestamp",\r
- "doc_text": null,\r
- "transform": { "label": "Max", "transform": "max", "aggregate": true },\r
- "path_label": "Item -> Circulations",\r
- "index": 9\r
- },\r
- {\r
- "name": "id",\r
- "path": null,\r
- "label": "Circ ID",\r
- "datatype": "id",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Count Distinct",\r
- "transform": "count_distinct",\r
- "aggregate": true\r
- },\r
- "path_label": "Item -> Circulations",\r
- "index": 11\r
- },\r
- {\r
- "name": "name",\r
- "path": null,\r
- "label": "Shelving Location",\r
- "datatype": "text",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item -> Shelving Location",\r
- "index": 6\r
- },\r
- {\r
- "name": "tcn_value",\r
- "path": null,\r
- "label": "TCN Value",\r
- "datatype": "text",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item -> Call Number/Volume -> Bib Record",\r
- "index": 1\r
- },\r
- {\r
- "name": "name",\r
- "path": null,\r
- "label": "Copy Status",\r
- "datatype": "text",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item -> Copy Status",\r
- "index": 7\r
- }\r
- ],\r
- "filter_cols": [\r
- {\r
- "name": "create_date",\r
- "path": null,\r
- "label": "Creation Date/Time",\r
- "datatype": "timestamp",\r
- "doc_text": null,\r
- "transform": { "label": "Date", "transform": "date", "aggregate": null },\r
- "path_label": "Item",\r
- "index": 0,\r
- "operator": { "op": "<=", "label": "On or Before (Date/Time)" }\r
- },\r
- {\r
- "name": "deleted",\r
- "path": null,\r
- "label": "Is Deleted",\r
- "datatype": "bool",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item",\r
- "index": 1,\r
- "operator": { "op": "=", "label": "Equals" },\r
- "value": "f"\r
- },\r
- {\r
- "name": "label",\r
- "path": null,\r
- "label": "Call Number Label",\r
- "datatype": "text",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": "undefined"\r
- },\r
- "path_label": "Item -> Call Number/Volume",\r
- "index": 0,\r
- "operator": { "op": "between", "label": "Between" },\r
- "value": ["J 000", "J 100"]\r
- },\r
- {\r
- "name": "id",\r
- "path": null,\r
- "label": "Circ ID",\r
- "datatype": "id",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Count Distinct",\r
- "transform": "count_distinct",\r
- "aggregate": true\r
- },\r
- "path_label": "Item -> Circulations",\r
- "index": 0,\r
- "operator": { "op": "<=", "label": "Less than or equal to" }\r
- },\r
- {\r
- "name": "id",\r
- "path": null,\r
- "label": "Organizational Unit ID",\r
- "datatype": "org_unit",\r
- "doc_text": null,\r
- "transform": {\r
- "label": "Raw Data",\r
- "transform": "Bare",\r
- "aggregate": null\r
- },\r
- "path_label": "Item -> Circulating Library",\r
- "index": 0,\r
- "operator": { "op": "in", "label": "In list" }\r
- }\r
- ]\r
-}\r
+++ /dev/null
-<?php
-
- $data = file_get_contents( "/openils/var/web/report-creator/ver5.json" );
-
- $data = json_encode( decodeTemplateData( $data ) );
- // print_r( $data );
-
- function decodeTemplateData ($templateData) {
-
- $userParamsArray = array();
- $staticParamsArray = array();
- $reportColumnsArray = array();
- $returnObj = new stdClass();
-
- $jsonData = json_decode( $templateData, false );
- $select = $jsonData->select;
- // $returnObj->select = $select;
-
- $where = ( isset( $jsonData->where ) ? $jsonData->where : NULL );
- $having = ( isset( $jsonData->having ) ? $jsonData->having : NULL );
-
- // $returnObj->where = $where;
- // $returnObj->having = $having;
- foreach ( $select as $s ) {
- $columnName = $s->column->colname;
- $r = $s->relation;
- $relCol = $s->column;
- $displayAggregate = isset( $relCol->aggregate ) ? $relCol->aggregate : NULL;
- $displayTransformLabel = isset ( $relCol->transform_label ) ? $relCol->transform_label : NULL;
-
- $columnArray = array(
- "name" => $s->alias,
- "aggregate" => $displayAggregate,
- "transformLabel"=>$displayTransformLabel
- );
-
- $reportColumnsArray[] = (object) $columnArray;
-
-
- $where = $jsonData->where ?? null;
- $having = $jsonData->having ?? null;
-
- if ( isset( $where ) ) {
- foreach ( $where as $w ) {
- $relation = $w->relation;
- $colName = $w->column->colname;
- print_r( $colName );
-
- $columnLabel = "";
- pullLabel( $jsonData->from, $relation, $columnLabel, "alias", "join", "label");
- }
- }
-
- }
- // $returnObj->docURL = isset($jsonData->doc_url) ? $jsonData->doc_url : NULL; //version 4 templates only
- $returnObj->reportColumns = (object) $reportColumnsArray;
- // $returnObj->userParams = (object) $userParamsArray;
- // $returnObj->staticParams = (object) $staticParamsArray;
-
- return($returnObj);
- }
-
- // function convertXULTemplate ( $template ) {
- // $data = ( object )[
- // "version" => 5,
- // "core_class" => $template->core_class,
- // "select" => $template->select,
- // "from" => $template->from,
- // "where" => $template->where,
- // "having" => $template->having,
- // "display_cols" => array(),
- // "filter_cols" => array()
- // ];
-
- // $rels = [];
- // $order_by = "";
-
- // foreach( $template->rel_cache as $k => $v ) {
- // $k == "order_by" ? $order_by = $v : $rels{$k} = $v; //array_push( $rels, $v );
- // }
-
- // $select = $template->select;
- // $sel_order = array();
- // $idx = 0;
- // foreach ( $select as $s ) {
- // $sel_order[strval($s->relation) . strval($s->column->colname)] = $idx;
- // $idx++;
- // }
-
- // $idx = 0;
-
- // $IDL = json_decode( file_get_contents( 'config/IDL.json' ) );
-
- // foreach ( $rels as $r ) {
- // if ( is_array($r) || is_object($r) ) {
- // $this->buildCols( $r, 'dis_tab', $sel_order, $data->display_cols, $IDL);
- // $this->buildCols( $r, 'filter_tab', NULL, $data->filter_cols, $IDL);
- // $this->buildCols( $r, 'aggfilter_tab', NULL, $data->filter_cols, $IDL);
- // }
-
- // }
-
- // return $data;
- // }
-
-// function buildCols( $r, $tt, $sel_order, &$d, $IDL ) {
-// $colType = $tt == 'dis_tab' ? 'display_cols' : 'filter_cols';
-// $ci = 0;
-// foreach ( $r->fields->{$tt} as $n =>$c ) {
-// $orig = $r->fields->{$tt}->$n;
-// $col = ( object ) [
-// "name" => $c->colname,
-// "path" => $this->convertPath( $orig, $r , $IDL), //needs fixed
-// "label" => $orig->alias,
-// "datatype" => $c->datatype,
-// "doc_text" => $c->field_doc,
-// "transform" => ( object ) [
-// "label" => $orig->transform_label,
-// "transform" => $orig->transform,
-// "aggregate" => !isset( $orig->aggregate ) ? NULL : $orig->aggregate
-// ],
-// "path_label" => preg_replace( "/\:\:/", "->", $r->label),
-// "index" => false
-// ];
-// if ( $colType == "filter_cols" ) {
-// @$col->operator = [
-// "op" => $orig->op,
-// "label" => $orig->op_label
-// ];
-// @$col->index = $ci++;
-// isset( $orig->op_value->value ) ? @$col->value = $orig->op_value->value : FALSE;
-// } else {
-// isset( $sel_order[$r->alias . $orig->colname] ) ? @$col->index = $sel_order[$r->alias . $orig->colname] : @$col->index = false;
-// }
-// array_push( $d, $col );
-// }
-// }
-
-// function buildNode( $cls, $args, $IDL ) {
-// if ( !isset( $cls ) || !isset( $args ) ) {
-// return null;
-// } else {
-// $n = isset( $IDL->{ $cls } ) ? $IDL->{ $cls } : null;
-// }
-
-// if ( !$n ) {
-// return null;
-// } else {
-// if ( !$args ) {
-// $args = ( object ) [
-// "label" => $n->label
-// ];
-// }
-// $args->id = $cls;
-// if ( isset( $args->from ) ) {
-// $args->id = $args->from . "." . $args->id;
-// }
-// $links = array();
-// foreach( $n->fields as $x ) {
-// if ( isset( $x->type ) ) {
-// $x->type == "link" ? array_push( $links, $x ) : false;
-// }
-// }
-
-// $args->idl = $this->service($cls, null);
-// $args->uplink = isset( $args->link ) ? $args->link : null;
-// $args->classname = $cls;
-// $args->struct = $n;
-// $args->table = isset( $n->table ) ? $n->table : null;
-// $args->fields = $this->_sort_class_fields($n->fields);
-// $args->links = $this->_sort_class_fields($links);
-// $args->children = [];
-
-// $args = json_encode( $args );
-
-// return $args;
-// }
-// }
-
-// function convertPath( $orig, $rel, $IDL ) {
-// $new_path = [];
-// $table_path = preg_split( "/\./", $rel->path );
-// if ( count( $table_path ) > 1 || strpos( $rel->path, "-" ) ) {
-// array_push( $table_path, $rel->idlclass );
-// }
-// $prev_type= "";
-// $prev_link = "";
-
-// foreach( $table_path as $tp ) {
-// $cl_split = preg_split( "/-/", $tp);
-// $cls = $cl_split[0];
-// $fld = isset( $cl_split[1] ) ? $cl_split[1] : null;
-// $args = ( object )[
-// "label" => isset( $IDL->{$cls}->label ) ? $IDL->{$cls}->label : null
-// ];
-
-// if( $prev_link != "" ) {
-// $link_parts = preg_split( "/-/", $prev_link );
-// $args->from = $link_parts[0];
-// $join_parts = preg_split( "/>/", $link_parts[1]);
-// $prev_col = $join_parts[0];
-// foreach( $IDL->{$link_parts[0]}->fields as $f ) {
-// if ( $prev_col == $f->name ) {
-// $args->link = $f;
-// }
-// }
-// $args->jtype = isset( $join_parts[1] ) ? $join_parts[1] : null;
-// }
-
-// array_push( $new_path, $this->buildNode($cls, $args, $IDL));
-// $prev_link = $tp;
-// }
-// }
-
- function pullLabel ( $d, $str, &$out, $tag, $subtag, $val ) {
- if ( $d->$tag == $str ) {
- $out = $d->$val;
- return;
- } else {
- if ( isset( $d->$subtag ) ) {
- if ( $d->$subtag ) {
- foreach ( $d->$subtag as $j ) {
- pullLabel( $j, $str, $out, $tag, $subtag, $val );
- }
- }
- } else {
- return;
- }
- }
- }
-
-// function service( $cls, $seed) {
-// return ( object ) [
-// "a" => ( $seed ? $seed : ( object )[] ),
-// "classname" => $cls,
-// "_isfieldmapper" => true
-// ];
-// }
-
-// function _sort_class_fields( $arr ) {
-// $out = array();
-// if ( isset( $arr[0] ) ) {
-// array_push( $out, $arr[0] );
-// array_shift($arr);
-// $i = 0;
-// while ( count($arr) > 0 ) {
-// $arrLabel = isset( $arr[0]->label ) ? $arr[0]->label : "";
-// $arrName = isset( $arr[0]->name ) ? $arr[0]->name : "";
-
-// //$aname = $arr[0]->label ? $arr[0]->label : $arr[0]->name;
-
-// $bName = isset( $out[$i]->label ) ? $out[$i]->label : "";
-// $bLabel = isset( $out[$i]->label ) ? $out[$i]->label : $bName;
-// $bName = isset( $bLabel ) ? $bLabel : $bName; //$out[$i]->label ? $out[$i]->label : $out[$i]->name;
-// while ( strcmp( $arrName, $bName) > 0 && $i < count( $arr ) ) {
-// $i++;
-// }
-// array_splice( $out, $i, 0, array( $arr[0] ) );
-// array_shift( $arr );
-// $i = 0;
-// }
-// }
-// return $out;
-// }
-// }
-?>
+++ /dev/null
-<?php
-
- $data = file_get_contents( "/openils/var/web/report-creator/ver5.json" );
- $data = json_encode( decodeTemplateData( $data ) );
-
- function decodeTemplateData ($templateData) {
-
- $userParamsArray = array();
- $staticParamsArray = array();
- $reportColumnsArray = array();
- $returnObj = new stdClass();
-
- $jsonData = json_decode( $templateData, false );
- $select = $jsonData->select;
- $where = ( isset( $jsonData->where ) ? $jsonData->where : NULL );
- $having = ( isset( $jsonData->having ) ? $jsonData->having : NULL );
-
- foreach ( $select as $s ) {
- $columnName = $s->column->colname;
- $r = $s->relation;
- $relCol = $s->column;
- $displayAggregate = isset( $relCol->aggregate ) ? $relCol->aggregate : NULL;
- $displayTransformLabel = isset ( $relCol->transform_label ) ? $relCol->transform_label : NULL;
-
- $columnArray = array(
- "name" => $s->alias,
- "aggregate" => $displayAggregate,
- "transformLabel"=>$displayTransformLabel
- );
-
- $reportColumnsArray[] = (object) $columnArray;
- }
-
- foreach( array( $where, $having ) as $clause ) {
- if ( isset( $clause ) ) {
- foreach ( $clause as $cl ) {
- $paramsArray = returnClause( $cl, $jsonData );
- if ( substr( $paramsArray->param, 0, 3) == "::P" ) {
- $userParamsArray[] = (object) $paramsArray;
- } else {
- $staticParamsArray[] = (object) $paramsArray;
- }
- }
- }
- }
-
- $returnObj->docURL = isset($jsonData->doc_url) ? $jsonData->doc_url : NULL; //version 4 templates only
- $returnObj->reportColumns = (object) $reportColumnsArray;
- $returnObj->userParams = (object) $userParamsArray;
- $returnObj->staticParams = (object) $staticParamsArray;
-
- print_r( $returnObj );
-
- return($returnObj);
- }
-
- function pullLabel ( $d, $str, &$out, $tag, $subtag, $val ) {
- if ( $d->$tag == $str ) {
- $out = $d->$val;
- return;
- } else {
- if ( isset( $d->$subtag ) ) {
- if ( $d->$subtag ) {
- foreach ( $d->$subtag as $j ) {
- pullLabel( $j, $str, $out, $tag, $subtag, $val );
- }
- }
- } else {
- return;
- }
- }
- }
-
- function returnClause( $cl, $jsonData ) {
- $relation = isset( $cl->relation ) ? $cl->relation : null;
- $colName = isset( $cl->column->colname ) ? $cl->column->colname : null;
-
- $columnLabel = "";
- pullLabel( $jsonData->from, $relation, $columnLabel, "alias", "join", "label" );
- $columnLabel = str_replace( '::', '->', $columnLabel);
-
- $transform = isset( $cl->column->transform ) ? $cl->column->transform : null;
- $transformLabel = isset( $cl->column->transform_label ) ? $cl->column->transform_label : "";
-
- $dataType = "";
- $op = "";
- $opLabel = "";
- $fieldDoc = "";
- $aggregate = "";
-
- foreach ( $jsonData->filter_cols as $fc ) {
- if ( $fc->name === $colName ) {
- $dataType = $fc->datatype;
- $op = $fc->operator->op;
- $opLabel = $fc->operator->label;
- isset( $fc->doc_text ) ? $fieldDoc = $fc->doc_text : false;
- if ( isset( $fc->transform->aggregate ) ) {
- if ( $fc->transform->aggregate != "undefined" ) {
- $aggregate = $fc->transform->aggregate;
- }
- }
- break;
- }
- }
-
- $tableName = "";
- pullLabel( $jsonData->from, $relation, $tableName, "alias", "join", "table" );
- $P = isset( $cl->condition ) ? $cl->condition : null;
-
- if ( isset( $P ) ) {
- list( $key, $opValue ) = each( $P ); //get the first (and only) value
- }
-
- if ( isset( $opValue ) ) {
- if ( is_array( $opValue ) ) $opValue = implode( ',', $opValue ); //if array convert it back to a string
- } else {
- $opValue = "";
- }
-
- return array(
- 'column' => $columnLabel
- ,'transform' => $transform
- ,'transformLabel' => $transformLabel
- ,'op' => $op
- ,'opLabel' => $opLabel
- ,'param'=> $opValue
- ,'fieldDoc' => $fieldDoc
- ,'aggregate' => $aggregate
- ,'dataType' => $dataType
- ,'table' => $tableName
- );
- }
-?>
+++ /dev/null
-{
- "version": 5,
- "core_class": "ahr",
- "select": [
- {
- "alias": "Hold ID",
- "path": "ahr-id",
- "field_doc": "",
- "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
- "column": {
- "colname": "id",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": false
- }
- },
- {
- "alias": "Request Date/Time",
- "path": "ahr-request_time",
- "field_doc": "",
- "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
- "column": {
- "colname": "request_time",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": false
- }
- },
- {
- "alias": "Target Object ID",
- "path": "ahr-target",
- "field_doc": "",
- "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
- "column": {
- "colname": "target",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": false
- }
- },
- {
- "alias": "Currently Frozen",
- "path": "ahr-frozen",
- "field_doc": "",
- "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
- "column": {
- "colname": "frozen",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": false
- }
- },
- {
- "alias": "Pickup Lib",
- "path": "aou-shortname",
- "field_doc": "",
- "relation": "413df8472eb3495de6137209d94c2539",
- "column": {
- "colname": "shortname",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": false
- }
- },
- {
- "alias": "Request Lib",
- "path": "aou-shortname",
- "field_doc": "",
- "relation": "462716f66fc7b046f1eb8a64b9beff2b",
- "column": {
- "colname": "shortname",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": false
- }
- },
- {
- "alias": "Hold User",
- "path": "au-id",
- "field_doc": "",
- "relation": "0d692e82dd1cfc230f6c9d0b5f9c76ee",
- "column": {
- "colname": "id",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": false
- }
- },
- {
- "alias": "User Placed the Hold",
- "path": "au-id",
- "field_doc": "",
- "relation": "21dac70a3544f1b89d90c251302902ad",
- "column": {
- "colname": "id",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": false
- }
- }
- ],
- "from": {
- "alias": "3b0d7d05c65006de7b2ca20f5fe39690",
- "path": "ahr-ahr",
- "table": "action.hold_request",
- "idlclass": "ahr",
- "label": "Hold Request",
- "join": {
- "pickup_lib-a83aec92287ef2eed487e52c74b46f81": {
- "type": "inner",
- "key": "id",
- "alias": "413df8472eb3495de6137209d94c2539",
- "path": "ahr-pickup_lib",
- "table": "actor.org_unit",
- "idlclass": "aou",
- "label": "Hold Request -> Pickup Library"
- },
- "request_lib-1c6ab274a890bb96a1991321619cfea5": {
- "type": "inner",
- "key": "id",
- "alias": "462716f66fc7b046f1eb8a64b9beff2b",
- "path": "ahr-request_lib",
- "table": "actor.org_unit",
- "idlclass": "aou",
- "label": "Hold Request -> Requesting Library"
- },
- "usr-4e09cff1d200f1b2657c55ddd4fdf2ee": {
- "type": "inner",
- "key": "id",
- "alias": "0d692e82dd1cfc230f6c9d0b5f9c76ee",
- "path": "ahr-usr",
- "table": "actor.usr",
- "idlclass": "au",
- "label": "Hold Request -> Hold User"
- },
- "requestor-ec37b94ce77dcc7440f642f250a33297": {
- "type": "inner",
- "key": "id",
- "alias": "21dac70a3544f1b89d90c251302902ad",
- "path": "ahr-requestor",
- "table": "actor.usr",
- "idlclass": "au",
- "label": "Hold Request -> Requesting User"
- }
- }
- },
- "where": [
- {
- "alias": "Fulfillment Date/Time",
- "path": "ahr-fulfillment_time",
- "field_doc": "",
- "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
- "column": {
- "colname": "fulfillment_time",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": 0
- },
- "condition": { "is": null }
- },
- {
- "alias": "Hold Cancel Date/Time",
- "path": "ahr-cancel_time",
- "field_doc": "",
- "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
- "column": {
- "colname": "cancel_time",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": 0
- },
- "condition": { "is": null }
- },
- {
- "alias": "Hold Type",
- "path": "ahr-hold_type",
- "field_doc": "",
- "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
- "column": {
- "colname": "hold_type",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": 0
- },
- "condition": { "=": "T" }
- },
- {
- "alias": "Capture Date/Time",
- "path": "ahr-capture_time",
- "field_doc": "",
- "relation": "3b0d7d05c65006de7b2ca20f5fe39690",
- "column": {
- "colname": "capture_time",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": 0
- },
- "condition": { "is": null }
- },
- {
- "alias": "Organizational Unit ID",
- "path": "aou-id",
- "field_doc": "",
- "relation": "462716f66fc7b046f1eb8a64b9beff2b",
- "column": {
- "colname": "id",
- "transform": "Bare",
- "transform_label": "Raw Data",
- "aggregate": 0
- },
- "condition": { "in": "::P0" }
- }
- ],
- "having": [],
- "display_cols": [
- {
- "name": "id",
- "label": "Hold ID",
- "datatype": "id",
- "index": 0,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- }
- ],
- "path_label": "Hold Request",
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "request_time",
- "label": "Request Date/Time",
- "datatype": "timestamp",
- "index": 1,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- }
- ],
- "path_label": "Hold Request",
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "target",
- "label": "Target Object ID",
- "datatype": "link",
- "index": 2,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- }
- ],
- "path_label": "Hold Request",
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "frozen",
- "label": "Currently Frozen",
- "datatype": "bool",
- "index": 3,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- }
- ],
- "path_label": "Hold Request",
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "shortname",
- "label": "Pickup Lib",
- "required": true,
- "datatype": "text",
- "index": 4,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- },
- {
- "label": "Pickup Library",
- "from": "ahr",
- "link": {
- "name": "pickup_lib",
- "label": "Pickup Library",
- "type": "link",
- "key": "id",
- "class": "aou",
- "reltype": "has_a",
- "datatype": "org_unit"
- },
- "id": "ahr.aou",
- "uplink": {
- "name": "pickup_lib",
- "label": "Pickup Library",
- "type": "link",
- "key": "id",
- "class": "aou",
- "reltype": "has_a",
- "datatype": "org_unit"
- },
- "classname": "aou",
- "struct": {
- "name": "aou",
- "label": "Organizational Unit",
- "table": "actor.org_unit",
- "pkey": "id",
- "pkey_sequence": "actor.org_unit_id_seq",
- "core_label": "Non-core sources",
- "classname": "aou"
- },
- "table": "actor.org_unit"
- }
- ],
- "path_label": "Hold Request -> Pickup Library",
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "shortname",
- "label": "Request Lib",
- "required": true,
- "datatype": "text",
- "index": 5,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- },
- {
- "label": "Requesting Library",
- "from": "ahr",
- "link": {
- "name": "request_lib",
- "label": "Requesting Library",
- "type": "link",
- "key": "id",
- "class": "aou",
- "reltype": "has_a",
- "datatype": "org_unit"
- },
- "id": "ahr.aou",
- "uplink": {
- "name": "request_lib",
- "label": "Requesting Library",
- "type": "link",
- "key": "id",
- "class": "aou",
- "reltype": "has_a",
- "datatype": "org_unit"
- },
- "classname": "aou",
- "struct": {
- "name": "aou",
- "label": "Organizational Unit",
- "table": "actor.org_unit",
- "pkey": "id",
- "pkey_sequence": "actor.org_unit_id_seq",
- "core_label": "Non-core sources",
- "classname": "aou"
- },
- "table": "actor.org_unit"
- }
- ],
- "path_label": "Hold Request -> Requesting Library",
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "id",
- "label": "Hold User",
- "selector": "usrname",
- "datatype": "id",
- "index": 6,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- },
- {
- "label": "Hold User",
- "from": "ahr",
- "link": {
- "name": "usr",
- "label": "Hold User",
- "type": "link",
- "key": "id",
- "class": "au",
- "reltype": "has_a",
- "datatype": "link"
- },
- "id": "ahr.au",
- "uplink": {
- "name": "usr",
- "label": "Hold User",
- "type": "link",
- "key": "id",
- "class": "au",
- "reltype": "has_a",
- "datatype": "link"
- },
- "classname": "au",
- "struct": {
- "name": "au",
- "label": "ILS User",
- "table": "actor.usr",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "actor.usr_id_seq",
- "core_label": "Core sources",
- "classname": "au"
- },
- "table": "actor.usr"
- }
- ],
- "path_label": "Hold Request -> Hold User",
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "id",
- "label": "User Placed the Hold",
- "selector": "usrname",
- "datatype": "id",
- "index": 7,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- },
- {
- "label": "Requesting User",
- "from": "ahr",
- "link": {
- "name": "requestor",
- "label": "Requesting User",
- "type": "link",
- "key": "id",
- "class": "au",
- "reltype": "has_a",
- "datatype": "link"
- },
- "id": "ahr.au",
- "uplink": {
- "name": "requestor",
- "label": "Requesting User",
- "type": "link",
- "key": "id",
- "class": "au",
- "reltype": "has_a",
- "datatype": "link"
- },
- "classname": "au",
- "struct": {
- "name": "au",
- "label": "ILS User",
- "table": "actor.usr",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "actor.usr_id_seq",
- "core_label": "Core sources",
- "classname": "au"
- },
- "table": "actor.usr"
- }
- ],
- "path_label": "Hold Request -> Requesting User",
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- }
- ],
- "filter_cols": [
- {
- "name": "fulfillment_time",
- "label": "Fulfillment Date/Time",
- "datatype": "timestamp",
- "index": 0,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- }
- ],
- "path_label": "Hold Request",
- "operator": { "label": "Is NULL", "op": "is" },
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "cancel_time",
- "label": "Hold Cancel Date/Time",
- "datatype": "timestamp",
- "index": 1,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- }
- ],
- "path_label": "Hold Request",
- "operator": { "label": "Is NULL", "op": "is" },
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "hold_type",
- "label": "Hold Type",
- "type": "link",
- "key": "hold_type",
- "class": "cht",
- "reltype": "has_a",
- "datatype": "text",
- "index": 2,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- }
- ],
- "path_label": "Hold Request",
- "operator": { "op": "=", "label": "Equals" },
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": "",
- "value": "T"
- },
- {
- "name": "capture_time",
- "label": "Capture Date/Time",
- "datatype": "timestamp",
- "index": 3,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- }
- ],
- "path_label": "Hold Request",
- "operator": { "label": "Is NULL", "op": "is" },
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- },
- {
- "name": "id",
- "label": "Organizational Unit ID",
- "selector": "shortname",
- "datatype": "org_unit",
- "index": 4,
- "path": [
- {
- "label": "Hold Request",
- "id": "ahr",
- "classname": "ahr",
- "struct": {
- "name": "ahr",
- "label": "Hold Request",
- "table": "action.hold_request",
- "core": true,
- "pkey": "id",
- "pkey_sequence": "action.hold_request_id_seq",
- "core_label": "Core sources",
- "classname": "ahr"
- },
- "table": "action.hold_request"
- },
- {
- "label": "Requesting Library",
- "from": "ahr",
- "link": {
- "name": "request_lib",
- "label": "Requesting Library",
- "type": "link",
- "key": "id",
- "class": "aou",
- "reltype": "has_a",
- "datatype": "org_unit"
- },
- "id": "ahr.aou",
- "uplink": {
- "name": "request_lib",
- "label": "Requesting Library",
- "type": "link",
- "key": "id",
- "class": "aou",
- "reltype": "has_a",
- "datatype": "org_unit"
- },
- "classname": "aou",
- "struct": {
- "name": "aou",
- "label": "Organizational Unit",
- "table": "actor.org_unit",
- "pkey": "id",
- "pkey_sequence": "actor.org_unit_id_seq",
- "core_label": "Non-core sources",
- "classname": "aou"
- },
- "table": "actor.org_unit"
- }
- ],
- "path_label": "Hold Request -> Requesting Library",
- "operator": { "label": "In list", "op": "in" },
- "transform": {
- "transform": "Bare",
- "label": "Raw Data",
- "aggregate": false
- },
- "doc_text": ""
- }
- ]
-}
+++ /dev/null
-{"version":5,"core_class":"combcirc","select":[{"alias":"Home Library","path":"aou-shortname","field_doc":"","relation":"84577380bb6510842561b7f81382af5b","column":{"colname":"shortname","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"School","path":"au-guardian","field_doc":"","relation":"6811e1745e0c3f5d8a9832a43993b722","column":{"colname":"guardian","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Grade","path":"au-name_keywords","field_doc":"","relation":"6811e1745e0c3f5d8a9832a43993b722","column":{"colname":"name_keywords","transform":"Bare","transform_label":"Raw Data","aggregate":false}},{"alias":"Count of Circulations","path":"combcirc-id","field_doc":"","relation":"a28abd4e77ad39f3bff5d8d720b02230","column":{"colname":"id","transform":"count","transform_label":"Count","aggregate":true}}],"from":{"alias":"a28abd4e77ad39f3bff5d8d720b02230","path":"combcirc-combcirc","table":"action.all_circulation","idlclass":"combcirc","join":{"usr_home_ou-812c537716bbeffc37e22c7f0bc829dd":{"type":"inner","key":"id","alias":"84577380bb6510842561b7f81382af5b","path":"combcirc-usr_home_ou","table":"actor.org_unit","idlclass":"aou","label":"Combined Aged and Active Circulations -> Patron Home Library"},"usr-8cee82ea4c86f6887c478253de5f1525":{"type":"inner","key":"id","alias":"6811e1745e0c3f5d8a9832a43993b722","path":"combcirc-usr","table":"actor.usr","idlclass":"au","label":"Combined Aged and Active Circulations -> Patron"},"usr_profile-0b448630158e25fe461a4dab76ed7cb4":{"type":"inner","key":"id","alias":"fbb47dba4979508d40938a2bdde82c77","path":"combcirc-usr_profile","table":"permission.grp_tree","idlclass":"pgt","label":"Combined Aged and Active Circulations -> Patron Profile Group"}},"label":"Combined Aged and Active Circulations"},"where":[{"alias":"Checkout Date/Time","path":"combcirc-xact_start","field_doc":"","relation":"a28abd4e77ad39f3bff5d8d720b02230","column":{"colname":"xact_start","transform":"date","transform_label":"Date","aggregate":0},"condition":{"between":"::P0"}},{"alias":"Group ID","path":"pgt-id","field_doc":"","relation":"fbb47dba4979508d40938a2bdde82c77","column":{"colname":"id","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"=":"61"}},{"alias":"Organizational Unit ID","path":"aou-id","field_doc":"","relation":"84577380bb6510842561b7f81382af5b","column":{"colname":"id","transform":"Bare","transform_label":"Raw Data","aggregate":0},"condition":{"in":"::P1"}}],"having":[],"display_cols":[{"name":"shortname","label":"Home Library","required":true,"datatype":"text","index":0,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron Home Library","from":"combcirc","link":{"name":"usr_home_ou","label":"Patron Home Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"link"},"id":"combcirc.aou","uplink":{"name":"usr_home_ou","label":"Patron Home Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"link"},"classname":"aou","struct":{"name":"aou","label":"Organizational Unit","table":"actor.org_unit","pkey":"id","pkey_sequence":"actor.org_unit_id_seq","core_label":"Non-core sources","classname":"aou"},"table":"actor.org_unit"}],"path_label":"Combined Aged and Active Circulations -> Patron Home Library","transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":""},{"name":"guardian","label":"School","datatype":"text","index":1,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron","from":"combcirc","link":{"name":"usr","label":"Patron","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"id":"combcirc.au","uplink":{"name":"usr","label":"Patron","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"classname":"au","struct":{"name":"au","label":"ILS User","table":"actor.usr","core":true,"pkey":"id","pkey_sequence":"actor.usr_id_seq","core_label":"Core sources","classname":"au"},"table":"actor.usr"}],"path_label":"Combined Aged and Active Circulations -> Patron","transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":""},{"name":"name_keywords","label":"Grade","datatype":"text","index":2,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron","from":"combcirc","link":{"name":"usr","label":"Patron","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"id":"combcirc.au","uplink":{"name":"usr","label":"Patron","type":"link","key":"id","class":"au","reltype":"has_a","datatype":"link"},"classname":"au","struct":{"name":"au","label":"ILS User","table":"actor.usr","core":true,"pkey":"id","pkey_sequence":"actor.usr_id_seq","core_label":"Core sources","classname":"au"},"table":"actor.usr"}],"path_label":"Combined Aged and Active Circulations -> Patron","transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":""},{"name":"id","label":"Count of Circulations","datatype":"id","index":3,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"}],"path_label":"Combined Aged and Active Circulations","transform":{"label":"Count","transform":"count","aggregate":true},"doc_text":""}],"filter_cols":[{"name":"xact_start","label":"Checkout Date/Time","datatype":"timestamp","index":0,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"}],"path_label":"Combined Aged and Active Circulations","operator":{"label":"Between","op":"between"},"transform":{"transform":"date","label":"Date","aggregate":false},"doc_text":""},{"name":"id","label":"Group ID","selector":"name","datatype":"id","index":1,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron Profile Group","from":"combcirc","link":{"name":"usr_profile","label":"Patron Profile Group","type":"link","key":"id","class":"pgt","reltype":"has_a","datatype":"link"},"id":"combcirc.pgt","uplink":{"name":"usr_profile","label":"Patron Profile Group","type":"link","key":"id","class":"pgt","reltype":"has_a","datatype":"link"},"classname":"pgt","struct":{"name":"pgt","label":"Permission Group","table":"permission.grp_tree","pkey":"id","pkey_sequence":"permission.grp_tree_id_seq","core_label":"Non-core sources","classname":"pgt"},"table":"permission.grp_tree"}],"path_label":"Combined Aged and Active Circulations -> Patron Profile Group","operator":{"op":"=","label":"Equals"},"transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":"","value":"61"},{"name":"id","label":"Organizational Unit ID","selector":"shortname","datatype":"org_unit","index":2,"path":[{"label":"Combined Aged and Active Circulations","id":"combcirc","classname":"combcirc","struct":{"name":"combcirc","label":"Combined Aged and Active Circulations","table":"action.all_circulation","core":true,"pkey":"id","pkey_sequence":"money.billable_xact_id_seq","core_label":"Core sources","classname":"combcirc"},"table":"action.all_circulation"},{"label":"Patron Home Library","from":"combcirc","link":{"name":"usr_home_ou","label":"Patron Home Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"link"},"id":"combcirc.aou","uplink":{"name":"usr_home_ou","label":"Patron Home Library","type":"link","key":"id","class":"aou","reltype":"has_a","datatype":"link"},"classname":"aou","struct":{"name":"aou","label":"Organizational Unit","table":"actor.org_unit","pkey":"id","pkey_sequence":"actor.org_unit_id_seq","core_label":"Non-core sources","classname":"aou"},"table":"actor.org_unit"}],"path_label":"Combined Aged and Active Circulations -> Patron Home Library","operator":{"label":"In list","op":"in"},"transform":{"label":"Raw Data","transform":"Bare","aggregate":false},"doc_text":""}]}
+++ /dev/null
-{"docURL":null,"reportColumns":{"0":{"name":"Home Library","aggregate":false,"transformLabel":"Raw Data"},"1":{"name":"School","aggregate":false,"transformLabel":"Raw Data"},"2":{"name":"Grade","aggregate":false,"transformLabel":"Raw Data"},"3":{"name":"Count of Circulations","aggregate":true,"transformLabel":"Count"}},"userParams":{"0":{"column":"Combined Aged and Active Circulations","transform":"date","transformLabel":"Date","op":"between","opLabel":"Between","param":"::P0","fieldDoc":"","aggregate":false,"dataType":"timestamp","table":"action.all_circulation","paramType":"user"},"1":{"column":"Combined Aged and Active Circulations -> Patron Home Library","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"::P1","fieldDoc":"","aggregate":false,"dataType":"id","table":"actor.org_unit","paramType":"user"}},"staticParams":{"0":{"column":"Combined Aged and Active Circulations -> Patron Profile Group","transform":"Bare","transformLabel":"Raw Data","op":"=","opLabel":"Equals","param":"61","fieldDoc":"","aggregate":false,"dataType":"id","table":"permission.grp_tree","paramType":"static"}}}
\ No newline at end of file