Repo for the search and displace core module including the interface to select files and search and displace operations to run on them.
https://searchanddisplace.com
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
37 KiB
80 lines
37 KiB
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\SearchDisplace\Documents\DocumentFile;
|
|
use App\SearchDisplace\SearchAndDisplace;
|
|
|
|
class SearchAndDisplaceController extends Controller
|
|
{
|
|
public function show($id)
|
|
{
|
|
$handler = new DocumentFile();
|
|
|
|
try {
|
|
$documentContent = $handler->getAfterIngest($id);
|
|
|
|
return response()->json([
|
|
'content' => $documentContent,
|
|
'ingest_status' => !! $documentContent ? 'success' : 'fail',
|
|
], 200);
|
|
} catch (\Exception $exception) {
|
|
return response()->json([
|
|
'message' => $exception->getMessage(),
|
|
], 400);
|
|
}
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
request()->validate([
|
|
'content' => 'required', // String or file.
|
|
'searchers' => 'required|array', // Check if matches all rules, must have 'key' and 'replace_with'.
|
|
]);
|
|
|
|
$text = <<<EOT
|
|
# Dated {EffectiveDate}\n## HIDDEN_MAIL {P1_Name} and {P2_Name} AGREEMENT FOR THE SUPPLY OF HARDWARE, SOFTWARE & SERVICES AGREEMENT FOR THE SUPPLY OF HARDWARE, SOFTWARE & SERVICES This Agreement is made on {EffectiveDate} BETWEEN and (2) {P2_Name} a company incorporated in England and Wales with registered number {P2_CoN}and having its registered office at {P2_Reg} (the \"Customer\"). BACKGROUND (A)\t{P1_Name} is a supplier of software, hardware and related services. (B)\t{P1_Name} and the Customer have agreed that {P1_Name} will supply software and/or hardware and/or related services to the Customer on the terms and conditions set out in this Agreement.\n### (1) {P1_Name} a company incorporated in England and Wales with registered number 5985564 and having its registered office at Woodbank, 2 Beeches Grove, Manor Road, Penn, High Wycombe, Buckinghamshire, HP10 8QZ (\"{P1_Name}\")\n# 1. Definitions and Interpretation\n## 1.1 In this Agreement the following terms have the following meanings:\n### \"Affiliate\" means, in respect of a party, any company which is a subsidiary of that party or its holding company (within the definitions of section 1159 of the Companies Act 2006);\n### \"Agreement\" this agreement, including the Schedules and any Orders;\n### \"Bespoke Software\" software which is created or developed by or on behalf of {P1_Name} or an Affiliate for the Customer under this Agreement;\n### \"Charges\" the fees, charges and expenses payable by the Customer to {P1_Name} under the Schedules and any Order, and as otherwise agreed under this Agreement;\n### \"Confidential Information\" all information which relates to the operations, plans, know-how, trade secrets, business affairs, personnel, customers or suppliers of either party or their respective shareholders or Affiliates or which is otherwise of a confidential nature;\n### \"Customer\"\n### {P2_Name} and all of its Subsidiaries;\n### \"Customer Specifications\" the agreed written specifications for any Software, as set out or referred to in Schedule 2 or any Order;\n### \"Documentation\" the operating manuals, user instructions, technical literature and other related materials in eye-readable form or as electronic document files supplied to the Customer by {P1_Name} for aiding the use and application of the {P1_Name} Software;\n### \"Effective Date\" the date of this agreement;\n### \"Hardware\" the hardware (if any) to be supplied to the Customer by {P1_Name}, as set out in Schedule 1 or any Order;\n### \"{P1_Name} Software Licence\" a separate software licence for the use of {P1_Name} Software entered into by the parties;\n### \"{P1_Name} Software\" software in which the Intellectual Property Rights are owned by {P1_Name} or an Affiliate, including the software applications (if any) designated as \"{P1_Name} Software\" in Schedule 2 or any Order;\n### \"Intellectual Property Rights\" patents, rights to inventions, copyright and related rights, moral rights, trade marks and service marks, trade names and domain names, rights in designs, rights in computer software, database rights, rights in confidential information (including know-how and trade secrets) and any other intellectual or industrial property rights, in each case whether registered or unregistered and including all applications (or rights to apply) for, and renewals or extensions of, such rights and all similar or equivalent rights or forms of protection which subsist or will subsist now or in the future in any part of the world;\n### \"Order\" an agreement for the supply of further or additional Hardware, Software and/or Services made after the Effective Date, in accordance with clause 2.3;\n### \"{P3_Pro}\" any version and all releases and updates of the software application(s) of that name owned by {P3_Name} or its Affiliates (or any successor to such software application(s));\n### \"{P3_Pro} Licence Terms\" the licence terms relating to {P3_Pro}, as provided to the Customer by {P1_Name};\n### \"Service Levels\" the response times, resolution times and other service standards to which the Support Services shall be provided, as set out in Schedule 4;\n### \"Services\" such consultancy, design, development, implementation, training and other services (if any) as are set out in Schedule 3 or any Order, and any other services which {P1_Name} has agreed to supply to the Customer under this Agreement (including Support Services);\n### \"Software\" the software (if any) to be supplied to the Customer by {P1_Name}, as set out in Schedule 2 or any Order, and which may be {P1_Name} Software and/or Third Party Software;\n### \"Support Services\" support and maintenance services in respect of Software and Hardware, as set out in Schedule 5;\n### \"Term\" the term of this Agreement from the Effective Date until Termination;\n### \"Termination\" termination or expiry of this Agreement for any reason;\n### \"Third Party Licence Terms\" the licence terms under which Third Party Software is available for use by the Customer, as notified to the Customer by {P1_Name} and including, in respect of {P3_Pro}, the {P3_Pro} Licence; and \"Third Party Software\" software in which the Intellectual Property Rights are owned by third parties, including {P3_Pro} and any other software applications designated as \"Third Party Software\" in Schedule 3 or any Order.\n## 1.2 The Schedules form part of this Agreement. In the event of any inconsistency between the terms of the main body of this agreement and the contents of any Schedule or Order, the Schedule or Order will prevail.\n## 1.3 Clause and paragraph headings are for convenience only and are not intended to form part of this Agreement.\n# 2. Duration of Agreement and Supply\n## 1.4 This Agreement commences on the Effective Date and, unless terminated earlier in accordance with its terms, shall continue until termination of the provision of all Support Services in accordance with Schedule 4.\n## 1.5 In consideration for the payment of the Charges, {P1_Name} shall supply the Software and the Services to the Customer in accordance with the Schedules and any applicable Order, and in any event with reasonable skill and care.\n## 1.6 The parties may amend this Agreement at any time by the addition of further or additional Hardware, Software or Services by signing an order specifying such Hardware, Software and Services, the Charges to be paid for them, and any additional terms and conditions that will apply (an \"Order\").\n## 1.7 {P1_Name} shall use all reasonable commercial endeavours to ensure that agreed timeframes and delivery dates for the supply of Hardware, Software and Services (including those set out in the Schedules or any Order) are met, but time shall not be of the essence.\n## 1.8 {P1_Name} shall not be liable to the Customer for any delay or failure in the performance of any of {P1_Name}'s obligations under this Agreement to the extent that such delay or failure is caused by any delay, failure, act or omission of the Customer (including the delay or failure to perform any Customer responsibilities identified in any Schedule or Order).\n# 3. Supply of Hardware\n## 1.9 {P1_Name} shall use all reasonable endeavours to pass through to the Customer any manufacturer's warranty available with Hardware.\n## 1.10 Except in relation to Hardware which is manufactured by {P1_Name}, {P1_Name} shall not be liable to the Customer for any operational defects in Hardware other than such defects which {P1_Name}, as a result of a physical examination of the Hardware, could reasonably be expected to have been aware of when supplying such Hardware to the Customer. {P1_Name} shall use all reasonable endeavours to assist the Customer in having such Hardware repaired or replaced under the manufacturer's warranty.\n## 1.11 {P1_Name} warrants that Hardware will be fit for any purpose set out in Customer specifications agreed between the parties in writing, but not for any other purpose. {P1_Name} gives no other warranties in respect of the Hardware except those expressly set out in this Agreement, and all other warranties in relation to the Hardware (including those relating to merchantability and fitness for purpose) are hereby excluded to the maximum extent permitted by law.\n## 1.12 Title to Hardware does not pass to the Customer until all sums owed by the Customer to {P1_Name} (whether under this Agreement or otherwise) have been paid. Risk in the Hardware shall pass to the Customer on delivery.\n## 1.13 The Customer grants {P1_Name} an irrevocable licence to enter any of the Customer's premises where Hardware is kept to repossess Hardware if (i) the Customer is in breach of its payment obligations under this Agreement, and (ii) {P1_Name} has a right to terminate this Agreement.\n## 1.14 The fact that title in Hardware has not passed to the Customer shall not prevent {P1_Name} from instituting proceedings against the Customer for non-payment of the price of that Hardware.\n## 1.15 If delivery of Hardware to the Customer is delayed for any reason beyond {P1_Name}'s reasonable control and during the period of such delay the price at which {P1_Name} purchases such Hardware increases, {P1_Name} shall have the right to add the amount of the increase in such price to the Charges paid by the Customer for the Hardware.\n# 4. Supply of Software\n## 1.16 Subject to clauses 4.2 and 4.4, {P1_Name} warrants that any {P1_Name} Software will substantially comply in all material respects with the Documentation and the Customer Specifications for the agreed Warranty Period(s) set out in Schedule 2 or the applicable Order (which, if no Warranty Period is expressly stated, shall be deemed to be 3 months). The Customer's sole remedy for breach of this warranty is the right to require {P1_Name} promptly and at its own costs to replace, rectify or correct the Software such that it complies with the warranty. The Customer acknowledges that Software will not be error-free and that its availability will not be uninterrupted.\n## 1.17 The warranty in clause 4.1 shall not apply if:\n### 1.17.1 the {P1_Name} Software is not used in accordance with the relevant documentation;\n### 1.17.2 a defect has been caused by the malfunctioning of any of the Customer's equipment;\n### 1.17.3 any other cause within the control of the Customer causes the {P1_Name} Software to be damaged or to malfunction;\n### 1.17.4 the Customer has made any modification to the Software; or\n### 1.17.5 the Customer's claim results wholly or in part from the operator being insufficiently trained by the Customer in the use of the {P1_Name} Software.\n## 1.18 Third Party Software is subject to the performance warranty for that Software contained in the relevant Third Party Licence Terms and no other warranty, unless expressly agreed otherwise in writing.\n## 1.19 The supply to the Customer of any Software under this Agreement and its subsequent use by the Customer shall be subject to:\n### 1.19.1 in the case of {P1_Name} Software, the licence contained in clause 4.5, or (at {P1_Name}'s option), a separate {P1_Name} Software Licence; and\n### 1.19.2 in the case of Third Party Software, the relevant Third Party Licence Terms. Without prejudice to the foregoing, {P1_Name} shall have no obligation to supply any Third Party Software to the Customer until the Customer has signed a copy of the applicable Third Party Licence Terms. The Customer agrees to comply with such Third Party Licence Terms and to indemnify {P1_Name} from any loss suffered by {P1_Name} as a result of the Customer's breach of such terms.\n## 1.20 Subject to clause 4.7 and any additional licence terms contained in Schedule 2 or any applicable Order, {P1_Name} hereby grants the Customer a non-exclusive, non-transferable licence to use the Bespoke Software, and any other {P1_Name} Software which is not licensed under a separate {P1_Name} Software Licence, for the Customer's internal business purposes only.\n## 1.21 {P1_Name} warrants that where it supplies Third Party Software it shall have all necessary rights and licences to do so and to authorise the Customer to use such Third Party Software in accordance with the Third Party Licence Terms.\n## 1.22 The Customer shall not and is not in any way licensed to:\n### 1.22.1 use or copy the {P1_Name} Software other than as permitted by this agreement;\n### 1.22.2 offer use of or access to the {P1_Name} Software as part of a bureau or application provider service;\n### 1.22.3 sell, assign, rent, sub-license, loan, mortgage, charge or otherwise deal with the {P1_Name} Software or the Documentation, whether in written form or otherwise, or with any interest in them except as expressly provided in this agreement;\n### 1.22.4 modify or make additions to the {P1_Name} Software, except to the extent permitted by law; or\n### 1.22.5 copy any Documentation.\n## 1.23 Where {P1_Name} Software is licensed to the Customer under a separate {P1_Name} Software Licence, such {P1_Name} Software shall (unless expressly agreed otherwise in writing) only be subject to the warranties contained in that {P1_Name} Software Licence, and not to the warranties in clauses 4.1 and 7.2.\n## 1.24 Unless expressly agreed otherwise in writing, the Customer shall have no right to use Software in a live environment unless the Customer also pays for Support Services in accordance with this Agreement.\n## 1.25 {P1_Name} has no obligation to place any Software in escrow unless expressly agreed otherwise under a separate escrow agreement.\n# 5. Supply of Support Services\n## 1.26 Without prejudice to clause 4.9, where the parties agree that {P1_Name} shall supply Support Services, the Customer shall pay the Charges for such Support Services as set out in Schedule 4.\n## 1.27 Subject to payment by the Customer of the relevant Charges, {P1_Name} shall:\n### 1.27.1 use all reasonable commercial endeavours to ensure the Services are provided in accordance with the Service Levels; and\n### 1.27.2 in any event provide the Support Services with reasonable skill and care.\n## 1.28 {P1_Name} shall not be obliged to provide Support Services for And any support provided by {P1_Name} which falls or is later found to fall within the above categories may be charged for by {P1_Name} at its then-current time and materials rates.\n### 1.28.1 Rectification of lost or corrupted data caused other than by {P1_Name}'s negligence;\n### 1.28.2 Software or hardware not supplied to the Customer by {P1_Name} and expressly stated to be covered by Support Services (\"Supported Items\");\n### 1.28.3 Any faults caused by the Customer's failure to use the Supported Items in accordance with its documentation or other instructions provided by {P1_Name} or caused by the Customer's error or omission;\n### 1.28.4 Faults attributable to faults in or interaction with the Customer's hardware (other than hardware itself subject to support from {P1_Name}) or the Supported Items' use or interaction with software not supplied by or approved by {P1_Name} in writing;\n### 1.28.5 Faults attributable to mis-configuration, development or support or attempted configuration, development or support provided by the Customer itself or any third party not authorised by {P1_Name};\n## 1.29 The Customer expressly undertakes to obtain its own support and maintenance for the following, either through a competent third party or suitable internal provision, unless {P1_Name} has expressly agreed in writing to provide Support services in these categories:\n### 1.29.1 Server hardware and operating system and database environment;\n### 1.29.2 Networking infrastructure (hardware, firmware, software and connectivity);\n### 1.29.3 Backups of all data, software and configuration information including but not limited to {P3_Pro};\n### 1.29.4 Antivirus, anti-malware and firewall software and hardware;\n### 1.29.5 Monitoring of all the above categories, including SQL database.\n## 1.30 The Customer undertakes to keep {P1_Name} informed of any changes to its equipment, networking infrastructure, hardware, software environment, configuration or usage volume where such changes may have an impact on the Support Services.\n# 6. Payment\n## 1.31 The Customer shall pay the Charges within 30 days of receipt of a valid tax invoice from {P1_Name} unless otherwise agreed in the relevant Schedule or Order.\n## 1.32 All amounts stated in this Agreement (or any quotation documentation or correspondence) are exclusive of VAT unless stated otherwise. The Customer agrees to pay any VAT for which it is properly liable, together with any other applicable taxes.\n## 1.33 Unless agreed otherwise in writing, the Customer agrees to reimburse {P1_Name} (at cost) for all expenses properly incurred by {P1_Name} in performing the Services, subject to receiving documentary evidence of such expenses. Mileage will be charged at {P1_Name}'s published rate, or such other rate as the parties agree.\n## 1.34 {P1_Name} may charge the Customer interest at the rate of 3% per annum above the base rate from time to time of Barclays Bank plc on all late payments under this Agreement.\n## 1.35 The Customer may not set off or deduct from Charges owed to {P1_Name} any amounts which may be owed from time to time by {P1_Name} to the Customer, whether under this Agreement or otherwise.\n# 7. Intellectual Property Rights\n## 1.36 All Intellectual Property Rights in {P1_Name} Software are and shall remain the property of {P1_Name} and its Affiliates; and\n## 1.37 All Intellectual Property Rights in Third Party Software are and shall remain the property of the relevant third party proprietor.\n## 1.38 {P1_Name} warrants that {P1_Name} Software will not infringe the Intellectual Property Rights of any third party. If any third party claims that {P1_Name} Software infringes that party's Intellectual Property Rights, {P1_Name} shall have the right to replace and/or modify such software at its own cost. The Customer shall promptly notify {P1_Name} of any such claim of which the Customer becomes aware.\n## 1.39 Except as expressly set out in the relevant Third Party Licence Terms, no warranty is given by {P1_Name} or the relevant third party in respect of Third Party Software.\n# 8. Sub Contracting and Third Party Recommendations\n## 1.40 {P1_Name} may sub-contract any of its obligations under this Agreement without notice to the Customer, provided that (subject to clause 8.2) it remains liable for the performance of such obligations under this Agreement.\n## 1.41 Where {P1_Name} has sub-contracted any services to a third party specified by the Customer, {P1_Name} shall not be liable for any non-performance of that third party's obligations, and for the purposes of this Agreement, any delay or hindrance caused by or attributable to that third party shall be considered to have been caused by the Customer.\n## 1.42 As part of carrying out its obligations under this Agreement, {P1_Name} may recommend or suggest that a third party carry out work, or supplies goods, software or services. By making this recommendation or suggestion, {P1_Name} does not guarantee that work or those goods, software or services.\n# 9. Liability and Indemnity\n## 1.43 Subject to clause 9.2, the liability of {P1_Name} to the Customer under or in connection with this Agreement (including in tort (including negligence)) shall be limited as follows:\n### 1.43.1 in the case of liability arising in connection with Hardware, {P1_Name}'s maximum aggregate liability shall be the amount of the Charges paid for the Hardware;\n### 1.43.2 in the case of liability arising in connection with Software, {P1_Name}'s maximum aggregate liability shall be the amount of the Charges paid for the Software;\n### 1.43.3 in the case of liability arising in connection with Services, {P1_Name}'s maximum aggregate liability shall be the amount of the Charges paid for the Services;\n### 1.43.4 by the exclusion of any liability for indirect or consequential loss or any loss of profits, business or goodwill or loss or corruption of data;\n### 1.43.5 by the exclusion of any liability for third party claims; and\n### 1.43.6 without prejudice to the foregoing, {P1_Name}'s maximum aggregate liability shall in any case not exceed the total amount of the Charges payable to {P1_Name} by the Customer under this Agreement.\n## 1.44 Nothing in this Agreement shall reduce or restrict {P1_Name}'s liability for fraud or for the death of or personal injury to anyone that is caused by the negligence of {P1_Name} or anyone for whom it is responsible.\n# 10 Confidentiality and Poaching\n## 1.45 Each party shall:\n### 1.45.1 only use the Confidential Information disclosed to it by the other for the purposes of this Agreement; and\n### 1.45.2 not disclose to any third party any Confidential Information disclosed to it by the other without the other's prior written agreement.\n## 1.46 Each party to this Agreement shall observe strict confidentiality as to the contents of this Agreement and the commercial relationships to which it relates.\n## 1.47 Clauses 10.1 and 10.2 shall not apply:\n### 1.47.1 to communications made in confidence between the parties and (i) their respective professional advisers and bankers and (ii) potential investors and their respective professional advisers and bankers;\n### 1.47.2 if disclosure is required by any applicable Laws, any relevant regulatory authority, any court of competent jurisdiction or the rules of any stock exchange on which the shares of either party are listed; or\n### 1.47.3 to information that has come into the public domain otherwise than by reason of the default of the relevant party or its advisers.\n## 1.48 Nothing in this Agreement shall restrict {P1_Name} from using any technical know-how gained or utilised by {P1_Name} or its personnel or contractors in the course of performing {P1_Name}'s obligations under this Agreement.\n## 1.49 The Customer agrees that during the Term and for the Post-Termination Period it shall not:\n### 1.49.1 approach with a view to engaging or engage any of {P1_Name}'s staff with whom the Customer has previously had contact; or\n### 1.49.2 introduce or identify any such member of {P1_Name}'s staff to any other person with a view to that other person engaging such staff member.\n### In this clause the \"Post-Termination Period\" means the longer of: (a) the period after Termination which falls within 12 months of the last contact (during the Term) between the relevant member of {P1_Name}'s staff and the Customer; and (b) six months.\n# 11 Termination\n## 1.50 Either party may terminate this Agreement immediately by written notice to the other if:\n### 1.50.1 the other party has an insolvency practitioner appointed over any of its assets or otherwise is unable to pay its debts as they fall due (as defined in s.123(1) of the Insolvency Act 1986);\n### 1.50.2 the other party ceases, or threatens to cease, to carry on business; or\n### 1.50.3 the other party breaches any provision of this Agreement and, where such breach is capable of remedy, has failed to remedy it within 30 days of receipt of a notice specifying the breach and requiring it to be remedied.\n## 1.51 {P1_Name} may terminate this Agreement by giving not less than 30 days' written notice to the Customer if there is at any time a material change of control (as that phrase is defined in Section 840 of the Income and Corporation Taxes Act 1988) of the Customer.\n## 1.52 {P1_Name} may terminate the provision of any Services (other than the Support Services) on reasonable notice. The Support Services may be terminated in accordance with Schedule 4.\n## 1.53 Unless expressly agreed otherwise in writing, termination of this Agreement by {P1_Name} pursuant to clauses 11.1 or 11.2 shall automatically terminate the Customer's licence(s) to use Software.\n## 1.54 Subject to any rights or obligations which have accrued prior to Termination, and any provisions which by their nature are intended to survive Termination (including clauses 2.5, 3.4, 3.5, 3.6, 4.6, 7.1, 7.3, 8.2, 8.3, 9, 10 and 12-15), following Termination neither party shall have any further obligation to the other under this Agreement.\n# 12 Disputes\n## 1.55 If any dispute or grievance arises between the parties in connection with this Agreement, before taking any further action the parties agree that the dispute will be discussed by staff members of each of them who are most closely involved with the running of the contract. If that does not produce a resolution, the problem will be escalated to the respective superiors of each staff member respectively, until the problem is dealt with. Only if the respective CEOs (or equivalent) of each party cannot reach agreement on the dispute will the matter be taken to the next stage as set out below.\n## 1.56 Should the escalation mechanism set out in clause 12.1 above fail to be effective, before taking any other action the parties agree to submit in good faith to a mediation procedure administered by CEDR, or, failing that, such other similar organisation as the President for the time being of the Law Society of England and Wales shall nominate. Unless the parties agree otherwise, the costs of the mediation shall be borne between them equally.\n# 13 Notices\n## 1.57 Where any notice is required to be given under this agreement (where the word \"notify\" is used it means \"to give notice\"), it is validly given if it is in writing and sent by fax, email or prepaid first-class or airmail post to the correct fax number, email address or postal address of the relevant party as previously notified to the other party. Where sent by fax, the notice is deemed to have arrived immediately upon sending. If sent by email, the notice is deemed to have arrived 24 hours after it was sent (unless within those 24 hours the sender has been sent an email saying that the notice has not been delivered). If sent by post, the notice is deemed to have arrived on the third working day after the day on which it was sent (if sent to an address within the UK), the fifth working day (if sent to an address within the EEA) or on the seventh working day (anywhere else in the world) (unless in each case within that period it was returned as undelivered).\n# 14 Force majeure\n## 1.58 Neither party shall be liable to the other for any delay or failure in the performance of its obligations under this Agreement to the extent that such delay or failure was caused by any event or circumstance beyond its reasonable control.\n# 15 General\n## 1.59 This Agreement supersedes all prior representations, arrangements, understandings and agreements between the parties, and is the entire complete and exclusive agreement and understanding between the parties, relating to its subject matter. All warranties, conditions and other terms implied by statute or common law are, to the fullest extent permitted by law, excluded from this Agreement.\n## 1.60 This Agreement may be amended from time to time by the agreement of the parties but no such amendment shall be effective unless recorded in writing and duly signed by the parties.\n## 1.61 Unless expressly agreed in writing otherwise, any software or services supplied to the Customer by {P1_Name} shall be subject to this Agreement.\n## 1.62 Any quotation provided by {P1_Name} at the request of the Customer shall remain the property of {P1_Name} and may only be used by the Customer to evaluate whether it wishes to enter into an agreement as set out in the quotation. In particular, the Customer acknowledges that a quotation may contain proprietary information of {P1_Name} and may not disclose it in full or part to any third party for the purposes of obtaining a competing quotation, or otherwise. Any quotation remains valid for 60 days after its date of issue, unless withdrawn earlier in writing by {P1_Name}. Any quotation is not a contractual offer and shall not be binding on {P1_Name} or the Customer until {P1_Name} accepts the Customer's purchase confirmation.\n## 1.63 Neither party may assign its rights or obligations under this Agreement without the written consent of the other, save that {P1_Name} may assign all its rights and obligations in connection with the sale of all or a substantial part of its assets.\n## 1.64 If the whole or any part of any term, condition or provision of this Agreement is determined invalid, unlawful or unenforceable to any extent then such term, condition or provision or part thereof shall be severed from the remaining terms, conditions and provisions, which shall continue to be valid and enforceable to the fullest extent permitted by law.\n## 1.65 This Agreement is not intended to convey a benefit on any person not a party to it and accordingly the provisions of the Contracts (Rights of Third parties) Act 1999 are excluded.\n## 1.66 This agreement is governed by English Law and the parties hereby submit to the non-exclusive jurisdiction of the English courts.\n## THIS AGREEMENT is entered into on the date stated at the beginning of it.\n### For and on behalf of\t ) {P1_Name}\t ) acting by a Director\t ) For and on behalf of\t ) {P2_Name} \t ) acting by a Director\t ) PRINT NAME\n#### ??????????????..\n#### Director ??????????????..\n#### PRINT NAME ??????????????..\n#### Director ??????????????..\n## SCHEDULE 1: HARDWARE\n### A. Hardware [Insert Details here] B. Delivery dates [Insert Details here]\n## SCHEDULE 2: SOFTWARE\n### A. {P1_Name} Software - [Insert Details here] B. Third Party Software - {P3_Pro} and related other third party software as defined in {P1_Name} Proposal, Version xx, dated xx - Appendix A. C. Delivery/Implementation Schedule - To be discussed and agreed at Project Kick off Meeting.\n#### - {P1_Name} {P3_Pro} Enhanced Document Management Module - Bespoke Software to be discussed and specified as part of the implementation.\n## SCHEDULE 3: SERVICES\n### A. Services - Professional services as defined in {P1_Name} Proposal, Version XX, dated xxx - Appendix A. B. Fee rates Current fee rates are as follows: Scoping & Documentation \t{Val_2} per day Consultancy \t\t{Val_3} per day Development\t\t{Val_4} per day - Mileage \t\t {Val_6} per mile (measured from consultants' home address)\n#### - Day rate for services\tProject Management\t{Val_1} per day - Expenses\t\tCharged at cost\n## SCHEDULE 4: SUPPORT SERVICES\n### The Support Services Support Services will be provided by {P1_Name}. Hours of operation Support services in the UK are available 9:00am - 5:30 pm, Monday to Friday, excluding English Bank Holidays. Support services on Christmas eve and New years eve are 9:00am - 12:00pm. Commencement Date of Support Services Support Services will commence upon delivery of the {P3_Pro} software. Hardware supported None. Software supported The Software supported under the Support Services is that Software defined in the {P1_Name} Proposal, Version xx, dated xx - Appendix A. Charges The charges payable by the Customer for the Support Services shall be: Description Value {P3_Name} Software - {P3_Pro} - {P3_Name} Annual Licence Plan - Access to {P1_Name}'s software support service - Backed up by {P3_Name}'s support team - Supply of patches and upgrades to {P3_Pro} {P4_Name} SQL Server Database (also covered under the {P3_Name} Annual Licence Plan) {P1_Name} {P3_Pro} Enhanced Document Management Module for XXXX Users Spindle Professional for XXXX Users Total Annual Support Termination and other conditions relating to Support Services\n#### - Calculated as 20% of Software costs (at List Price)\n# 1. Support Services are provided on an annual basis from the commencement date specified above. On each anniversary of that date the provision of Support Services shall automatically renew for a further period of 12 months unless either party gives the other 90 days' notice to terminate, such notice to expire at the end of the then-current 12-month period.\n# 2. The Support Services shall be terminated along with the rest of the Agreement if either party terminates the Agreement in accordance with clause 11 of the Agreement.\n# 3. Where the Customer obtains additional hardware or software from {P1_Name} which is not already supported under this Agreement, that additional hardware and software shall automatically be deemed to be supported under this Agreement and the Charges shall be increased accordingly in line with {P1_Name}'s then-current standard rates for support and maintenance of such hardware and software.\n# 4. The Charges for Support Services are subject to review no more than once in each 12-month period. {P1_Name} shall give the Customer at least 45 days' notice before the new Charges take effect.\n# 5. {P1_Name} may also act as the Customer's agent in relation to the provision to the Customer of third party support and maintenance services which {P1_Name} does not provide, as set out in the Schedules to this Agreement, in which case (unless otherwise agreed) the Customer shall pay the relevant fees for such services to {P1_Name} (to be passed through to the supplier of the services), but {P1_Name} shall have no liability to the Customer whatsoever in respect of the provision (or non-provision) of those services.\n## SCHEDULE 5: CHARGES AND PAYMENT\n### Software & Support Services Payment for the Software and Support Services defined in this agreement is being funded by the Customer. The Payment Plan is defined as follows: Description Proposal Value Invoice 1 Contract Signing Invoice 2 Software Delivery Invoice 3 Annual Support {P3_Pro} Main Software {P4_Name} SQL Database Runtime {P1_Name} {P3_Pro} Enhanced Document Management Module Spindle Professional for xxx Users Annual Licence / Support - {P3_Name} Software Annual Licence / Support - {P4_Name} SQL Database Runtime Annual Licence / Support - {P1_Name} {P3_Pro} Enhanced Document Management Module Annual Licence / Support - Spindle Professional for xxxx Users Total VAT @ % Total Invoice Value The agreed steps of the invoicing and payment plan are as follows: Date / Event Actions Date Contract signed by Customer and {P1_Name}. Invoice 1 raised to Customer for {Val_7}.00. Deposit cheque / BACS payment raised by Customer to {P1_Name} Limited for the value of the above Invoice. Following Clearance of Payment {P1_Name} place order for Software with {P3_Name} UK Limited. Approx w/c Date 2 {P1_Name} deliver Software to Customer. This will be delivered on DVD, ready for installation. Invoice 2 raised to Customer for {Val_8}.00. Payment of this invoice due in 30 days. Date Invoice 3 raised to Customer for Annual Licence and Support for {Val_9}.00. Payment of this invoice due in 30 days. Professional Services Invoices will be raised to the Customer for the Professional Services at the end of each calendar month. Each invoice will contain the charges for the Professional Services that have been carried out during that month. The terms of these invoices will be 30 days. Charges for Mileage and other expenses will be included on these invoices, as required. Development Services Reference section x.x of proposal. Following the specification and costing of identified development requirements, {P1_Name} will invoice the Customer for 50% of such development costs on order, followed by 50% of such development costs upon delivery. Development will be subject to Annual Licence and Support charges upon delivery, which will be calculated at 20% of the list development costs. The terms for these invoices will be 30 days."
|
|
EOT;
|
|
|
|
return response()->json([
|
|
'content' => $text,
|
|
'diff' => [
|
|
'email' => [
|
|
[
|
|
'start' => 31,
|
|
'end' => 41,
|
|
],
|
|
// [
|
|
// 'start' => 910,
|
|
// 'end' => 908,
|
|
// ],
|
|
// [
|
|
// 'start' => 125,
|
|
// 'end' => 140,
|
|
// ],
|
|
// [
|
|
// 'start' => 10000,
|
|
// 'end' => 10100
|
|
// ],
|
|
// [
|
|
// 'start' => 15000,
|
|
// 'end' => 15008
|
|
// ]
|
|
]
|
|
]
|
|
]);
|
|
|
|
$searchAndDisplace = new SearchAndDisplace(request()->input('content'), [
|
|
'searchers' => request()->input('searchers'),
|
|
]);
|
|
|
|
try {
|
|
return response()->json($searchAndDisplace->execute(), 200);
|
|
} catch (\Exception $exception) {
|
|
return response()->json([
|
|
'message' => $exception->getMessage(),
|
|
'trace' => $exception->getTrace(),
|
|
], 400);
|
|
}
|
|
}
|
|
}
|