<?function ShowReportList() { global $showHiddenReports; $arFilter = array("REPORT"=>"Y"); if ($showHiddenReports == 'N') { $arFilter['HIDDEN'] = 'N'; } $dbReport = CCheckListResult::GetList(Array(),$arFilter); while ($arReport = $dbReport->Fetch()) $arReports[]=$arReport;?> <form id="bx_project_form" style="display:none;" action="" method="POST" enctype="multipart/form-data"> <div class="checklist-result-form-content" > <?php echo BeginNote(); ?> <div class="checklist-result-form-content-data"><?php echo GetMessage("CL_REPORT_INVITE"); ?> </div> <div class="checklist-result-form-content-field"> <input id="report_id" name="report_id" type="hidden"/> <label><?php echo GetMessage("CL_REPORT_COMPANY_NAME"); ?> </label><input id="COMPANY_NAME" name="COMPANY_NAME" type="text"/> </div> <div class="checklist-result-form-content-field"> <label><?php echo GetMessage("CL_REPORT_CLIENT_NAME"); ?> </label><input id="CLIENT" name="CLIENT" type="text"/> </div> <div class="checklist-result-form-content-field"> <label><?php echo GetMessage("CL_REPORT_CLIENT_POST"); ?> </label><input id="CLIENT_POST" name="CLIENT_POST" type="text"/> </div> <div class="checklist-result-form-content-field"> <label><?php echo GetMessage("CL_REPORT_PHONE"); ?> </label> <table width="100%" style="border-spacing: 0px"> <tr> <td width="65%" style="border: 0px; padding: 0"> <input id="PHONE" name="PHONE" type="text" style="width:100%"/> </td> <td width="10%" style="border: 0px; padding: 0"> <div style="text-align: right"><?php echo GetMessage("CL_REPORT_PHONE_ADD"); ?> </div> </td> <td style="border: 0px"> <input id="PHONE_ADD" name="PHONE_ADD" type="text"/> </td> </tr> </table> </div> <div class="checklist-result-form-content-field"> <label><?php echo GetMessage("CL_REPORT_EMAIL"); ?> </label><input id="EMAIL" name="EMAIL" type="text"/> </div> <div class="checklist-result-textarea-wrap"> <label><?php echo GetMessage("CL_REPORT_COMMENT"); ?> </label> <div class="checklist-result-form-content-data"><?php echo GetMessage("CL_REPORT_COMMENT_HELP"); ?> </div> <div class="checklist-result-textarea"> <textarea id="report_comment" name="COMMENT" class="checklist-textarea"></textarea> </div> </div> <input id="type_action" type="hidden" name="ACTION" value="ADDSENDREPORT"> <div class="checklist-result-form-button"> <a class="adm-btn adm-btn-green adm-btn" onclick="SaveSendReport();"><?php echo GetMessage("CL_SAVE_SEND_REPORT"); ?> </a> </div> <?php echo EndNote(); ?> </div> </form> <form id="report_actions" method="POST"> <?if(count($arReports)>0) {?> <div class="checklist-archive-rept"> <?php echo GetMessage("CL_REPORT_ARCHIVE"); ?> <input type="hidden" name="ACTION" value="SHOWHIDEELEMENTS" /> <table class="checklist-archive-table" cellspacing="0"> <tr class="checklist-archive-table-header"> <td><?php echo GetMessage("CL_REPORT_DATE"); ?> </td> <td><?php echo GetMessage("CL_REPORT_TABLE_TESTER"); ?> </td> <td><?php echo GetMessage("CL_REPORT_TABLE_TOTAL"); ?> </td> <td><?php echo GetMessage("CL_REPORT_TABLE_CHECKED"); ?> </td> <td><?php echo GetMessage("CL_REPORT_TABLE_FAILED"); ?> </td> <td> </td> <td> </td> <td> </td> </tr> <?foreach ($arReports as $k=>$arReport):?> <tr class=""> <td><?php echo $arReport["DATE_CREATE"]; ?> </td> <td><?php echo htmlspecialcharsbx($arReport["TESTER"]); ?> </td> <td><?php echo $arReport["TOTAL"]; ?> </td> <td><?php echo $arReport["SUCCESS"]; ?> </td> <td><?php echo $arReport["FAILED"]; ?> </td> <td><a class="checklist-archive-table-detail" href="/bitrix/admin/checklist_report.php?ID=<?php echo $arReport["ID"]; ?> &lang=<?php echo LANG; ?> "><?php echo GetMessage("CL_REPORT_TABLE_DETAIL"); ?> </a></td> <td> <?if ($k == 0) {?> <?if ($arReport["SENDED_TO_BITRIX"] == 'N') {?> <a href="" onmouseover="ShowHint(this)" onclick="showProjectForm(<?php echo $arReport["ID"]; ?> ); return false;"><?php echo GetMessage("CL_SAVE_SEND_REPORT_CUT"); ?> </a> <?} else {?> <?php echo GetMessage("CL_REPORT_SENDED"); ?> <?}?> <?}?> </td> <td> <?if ($k == 0) {?> <?if ($arReport["HIDDEN"] == 'N') {?> <a href="" onclick="hideReport(<?php echo $arReport["ID"]; ?> ); return false;"><?php echo GetMessage('CL_HIDE_REPORT'); ?> </a> <?} else {?> <a href="" onclick="showReport(<?php echo $arReport["ID"]; ?> ); return false;"><?php echo GetMessage('CL_SHOW_REPORT'); ?> </a> <?}?> <?}?> </td> </tr> <?endforeach;?> </table> <br> </div> <?} else {?> <div style="margin-top:15px"></div> <?}?> <div style="text-align: right"><input type="checkbox" onClick="ShowHideReports()" <?php echo $showHiddenReports == 'Y' ? 'checked' : ''; ?> /> <?php echo GetMessage('CL_SHOW_HIDDEN'); ?> </div> </form> <?}
function ShowReportList() { global $showHiddenReports; $arFilter = array("REPORT" => "Y"); if ($showHiddenReports == 'N') { $arFilter['HIDDEN'] = 'N'; } $dbReport = CCheckListResult::GetList(array(), $arFilter); while ($arReport = $dbReport->Fetch()) { $arReports[] = $arReport; } ?> <form id="bx_project_form" style="display:none;" action="" method="POST" enctype="multipart/form-data"> <?php echo bitrix_sessid_post(); ?> <div class="checklist-result-form-content" > <?php echo BeginNote(); ?> <h2><?php echo GetMessage("CL_FORM_ABOUT_CLIENT_TITLE"); ?> </h2> <div class="checklist-result-form-content-field"> <input id="report_id" name="report_id" type="hidden"/> <label><?php echo GetMessage("CL_REPORT_COMPANY_NAME"); ?> </label><input id="COMPANY_NAME" name="COMPANY_NAME" type="text"/> </div> <div class="checklist-result-form-content-field"> <label><?php echo GetMessage("CL_REPORT_CLIENT_NAME"); ?> </label><input id="CLIENT" name="CLIENT" type="text"/> </div> <div class="checklist-result-form-content-field"> <label><?php echo GetMessage("CL_REPORT_CLIENT_POST"); ?> </label><input id="CLIENT_POST" name="CLIENT_POST" type="text"/> </div> <div class="checklist-result-form-content-field"> <label><?php echo GetMessage("CL_REPORT_PHONE"); ?> </label> <table width="100%" style="border-spacing: 0px"> <tr> <td width="65%" style="border: 0px; padding: 0"> <input id="PHONE" name="PHONE" type="text" style="width:100%"/> </td> <td width="55" style="border: 0px; padding: 0"> <div style="text-align: right"><?php echo GetMessage("CL_REPORT_PHONE_ADD"); ?> </div> </td> <td style="border: 0px"> <input id="PHONE_ADD" name="PHONE_ADD" type="text"/> </td> </tr> </table> </div> <div class="checklist-result-form-content-field"> <label><?php echo GetMessage("CL_REPORT_EMAIL"); ?> </label><input id="EMAIL" name="EMAIL" type="text"/> </div> <div class="checklist-result-textarea-wrap"> <label><?php echo GetMessage("CL_REPORT_COMMENT"); ?> </label> <div class="checklist-result-textarea"> <textarea style="color: #AAAAAA" id="report_comment" OnFocus="if (this.value =='<?php echo GetMessage("CL_REPORT_COMMENT_HELP"); ?> ') {this.value = ''; this.style.color = '#000000';}" OnBlur="if (this.value == '') {this.value = '<?php echo GetMessage("CL_REPORT_COMMENT_HELP"); ?> '; this.style.color = '#AAAAAA';}" name="COMMENT" class="checklist-textarea"><?php echo GetMessage("CL_REPORT_COMMENT_HELP"); ?> </textarea> </div> </div> <input id="type_action" type="hidden" name="ACTION" value="ADDSENDREPORT"> <div class="checklist-result-form-button"> <a class="adm-btn adm-btn-green adm-btn" onclick="SaveSendReport();"><?php echo GetMessage("CL_SAVE_SEND_REPORT"); ?> </a> </div> <?php echo EndNote(); ?> </div> </form> <?php $exists_sended_to_bitrix = CCheckListResult::GetList(array(), array("SENDED_TO_BITRIX" => "Y"))->Fetch(); if (count($arReports) > 0) { ?> <div class="checklist-archive-rept"> <?php echo GetMessage("CL_REPORT_ARCHIVE"); ?> <table class="checklist-archive-table" cellspacing="0"> <tr class="checklist-archive-table-header"> <td><?php echo GetMessage("CL_REPORT_DATE"); ?> </td> <td><?php echo GetMessage("CL_REPORT_FIO_TESTER"); ?> (<?php echo GetMessage("CL_REPORT_COMPANY_NAME"); ?> )</td> <td><?php echo GetMessage("CL_REPORT_TABLE_TOTAL"); ?> </td> <td><?php echo GetMessage("CL_REPORT_TABLE_CHECKED"); ?> </td> <td><?php echo GetMessage("CL_REPORT_TABLE_FAILED"); ?> </td> <td> </td> <td> </td> <td> </td> </tr> <?php foreach ($arReports as $k => $arReport) { ?> <tr class=""> <td><?php echo $arReport["DATE_CREATE"]; ?> </td> <td><?php echo $arReport["TESTER"]; ?> (<?php echo $arReport["COMPANY_NAME"]; ?> )</td> <td><?php echo $arReport["TOTAL"]; ?> </td> <td><?php echo $arReport["SUCCESS"]; ?> </td> <td><?php echo $arReport["FAILED"]; ?> </td> <td><a class="checklist-archive-table-detail" href="/bitrix/admin/checklist_report.php?ID=<?php echo $arReport["ID"]; ?> &lang=<?php echo LANG; ?> "><?php echo GetMessage("CL_REPORT_TABLE_DETAIL"); ?> </a></td> <td> <?php if ($arReport["SENDED_TO_BITRIX"] == 'N' && $k == 0) { ?> <?php if (!$exists_sended_to_bitrix) { ?> <a href="" onmouseover="ShowHint(this)" onclick="showProjectForm(<?php echo $arReport["ID"]; ?> ); return false;"><?php echo GetMessage("CL_SAVE_SEND_REPORT_CUT"); ?> </a> <?php } else { ?> <?php } ?> <?php } elseif ($arReport["SENDED_TO_BITRIX"] == 'Y') { ?> <?php echo GetMessage("CL_REPORT_SENDED"); ?> <?php } else { ?> <?php } ?> </td> <td> <?php if ($arReport["HIDDEN"] == 'N') { ?> <a href="" onclick="hideReport(<?php echo $arReport["ID"]; ?> ); return false;"><?php echo GetMessage('CL_HIDE_REPORT'); ?> </a> <?php } else { ?> <a href="" onclick="showReport(<?php echo $arReport["ID"]; ?> ); return false;"><?php echo GetMessage('CL_SHOW_REPORT'); ?> </a> <?php } ?> </td> </tr> <?php } ?> </table> <br> </div> <div> <div style="float: right"> <input type="checkbox" id="sh_chk" onClick="ShowHideReports()" <?php echo $showHiddenReports == 'Y' ? 'checked' : ''; ?> ><label for="sh_chk"> <?php echo GetMessage('CL_SHOW_HIDDEN'); ?> </label> </div> <div> <?php if ($exists_sended_to_bitrix) { ?> <a class="adm-btn adm-btn-green " onclick="RefreshReportStatuses();"><?php echo GetMessage("CL_REFRESH_REPORT_STATUSES"); ?> </a> <?php } else { ?> <br><br> <?php } ?> </div> </div> <script> BX.adminFormTools.modifyCheckbox(BX('sh_chk')) </script> <?php } else { ?> <div style="margin-top:15px"></div> <?php } }
function AddReport($arReportFields = Array(), $errorCheck = false) {//saving current state to a report if ($this->report_id) return false; if ($errorCheck && !$arReportFields["TESTER"] && !$arReportFields["COMPANY_NAME"]) return Array("ERROR" => GetMessage("EMPTY_NAME")); $arStats = $this->GetSectionStat(); $arFields = Array( "TESTER" => $arReportFields["TESTER"], "COMPANY_NAME" => $arReportFields["COMPANY_NAME"], "PHONE" => $arReportFields["PHONE"], "EMAIL" => $arReportFields["EMAIL"], "PICTURE" => $arReportFields["PICTURE"], "REPORT_COMMENT" => $arReportFields["COMMENT"], "STATE" => $this->current_result, "TOTAL" => $arStats["TOTAL"], "SUCCESS" => $arStats["CHECK"], "SUCCESS_R" => $arStats["CHECK_R"], "FAILED" => $arStats["FAILED"], "PENDING"=> $arStats["WAITING"], "REPORT" =>true ); $arReportID = CCheckListResult::Save($arFields); if ($arReportID>0) { $dbres = CCheckListResult::GetList(Array(),Array("REPORT"=>"N")); if ($res = $dbres->Fetch()) { CCheckListResult::Delete($res["ID"]); CUserOptions::SetOption("checklist","autotest_start","N",true,false); } return $arReportID; } return false; }
*/ global $APPLICATION; $APPLICATION->SetAdditionalCSS("/local/gadgets/codecraft/admin_info/style.css"); $default = $_SERVER['SERVER_NAME']; if ($_SERVER['SERVER_PORT'] != 80) { $default .= ':' . $_SERVER['SERVER_PORT']; } $siteName = COption::GetOptionString('main', 'server_name', $default); unset($default); require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/checklist.php"; $checklist = new CCheckList(); $isStarted = $checklist->started; if ($isStarted == true) { $arStat = $checklist->GetSectionStat(); } else { $arReports = CCheckListResult::GetList(array(), array("REPORT" => "Y")); if ($arReports) { $arReport = $arReports->Fetch(); $arReportData = new CCheckList($arReport["ID"]); $arReportInfo = $arReportData->GetReportInfo(); $arStat = $arReportInfo["STAT"]; } } ?> <table class="cc_gadget_info_table"> <tr> <td> <span class="cc-logo"></span> </td> <td style="min-width: 178px;"> <p><span class="caption"><?php