} } } print $msg . "</div>"; } else { if (!$items) { print "<div style='color:red'><br />Unrecognized Error: cannot connect to Zotero API: returns response code: {$code}</div>"; if ($code == 0) { print "<div style='color:red'><br />Please ask your system administrator to check that the Heurist proxy settings are correctly set.</div>"; } } else { //DEBUG print '<xmp>'.$items.'</xmp>'; //it does not work anymore //intval(substr($items,strpos($items, "<zapi:totalResults>") + 19,strpos($items, "</zapi:totalResults>") - strpos($items, "<zapi:totalResults>") - 19)); //Responses for multi-object read requests will include a custom HTTP header, Total-Results $totalitems = $zotero->getTotalCount(); //print $items; print "<div>Count items in Zotero: {$totalitems}</div>"; if ($totalitems > 0) { print "<div id='divStart2'><br /><br /><a href='syncZotero.php?step=2&cnt=" . $totalitems . "&db=" . HEURIST_DBNAME . "&lib_key=" . $lib_key_idx . "' onclick='__showLoading()'><button>Start</button></a></div>"; print "<div id='divLoading' style='display:none;height:40px;background-color:#FFF; background-image: url(../../common/images/loading-animation-white.gif);background-repeat: no-repeat;background-position:50%;'>loading...</div>"; } // 2) show mapping issues report if (count($mapping_rt_errors) > 0 || count($mapping_rt_errors2) > 0 || count($mapping_dt_errors) > 0) { /* old version of message print "<div style='color:red'><br /> The following record types required for Zotero synchronisation are not present in your database Synchronisation requires bibliographic record types to be defined in the database (Zotero to Heurist type mappings are defined in the code at /import/biblio/zoteroMap.xml)."; */ if (count($mapping_rt_errors) > 0) { print "<p style='color:red'>The following record types required for Zotero synchronisation are not present in your database:";