TEST : Phone numbers utilization

In this quick demo you can see how the phone numbers utilization could be implemented with ConfiForms Form and visualized with ConfiForms CalendarView

We can register phones, and their "use time" - with validation for "overlaps"

Register phone use

-


Source code for the solution

<p>In this quick demo you can see how the phone numbers utilization could be implemented with ConfiForms Form and visualized with ConfiForms CalendarView</p>
<ac:structured-macro ac:macro-id="f53b7389-0803-47ed-bed9-05f8363a03c2" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">myphones1</ac:parameter>
  <ac:parameter ac:name="registrationFormTitle">Register phone use</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="653d2dab-56d9-43d6-9b08-5f1e493db648" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">phone</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Phone</ac:parameter>
        <ac:parameter ac:name="values">false[phone1=Phone 1|phone2=Phone 2|phone3=Phone 3|phone4=Phone 4|phone5=Phone 5|]</ac:parameter>
        <ac:parameter ac:name="extras">label;false</ac:parameter>
        <ac:parameter ac:name="type">select2</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="01306d95-8bc4-4360-9ba0-96904312f7d6" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">usetime</ac:parameter>
        <ac:parameter ac:name="fieldLabel">Use time</ac:parameter>
        <ac:parameter ac:name="type">datetimeinterval</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="ca9a60d8-99f8-42c5-adbe-d06ae0a66c14" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="condition">(usetime.startDate:&lt;=[entry.usetime.endDate] AND usetime.endDate:&gt;=[entry.usetime.startDate] AND !id:[entry.id] AND phone:[entry.phone])</ac:parameter>
        <ac:parameter ac:name="fieldName">This phone is in use at these dates - dates overlap</ac:parameter>
        <ac:parameter ac:name="action">Validation rule dataset</ac:parameter>
      </ac:structured-macro>
    </p>
    <ac:structured-macro ac:macro-id="e7e75c61-212d-4698-97f0-c7b2e002fb83" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="embedded">true</ac:parameter>
      <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter>
      <ac:rich-text-body>
        <p>
          <br/>
        </p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>
<ac:structured-macro ac:macro-id="d2b2a0aa-36de-405a-a1f0-c91f48f31f20" ac:name="confiform-calendar" ac:schema-version="1">
  <ac:parameter ac:name="eventTitleFieldName">[entry.phone] - [entry.usetime.asPeriodFormatted]</ac:parameter>
  <ac:parameter ac:name="groupingFieldName">usetime</ac:parameter>
  <ac:parameter ac:name="formName">myphones1</ac:parameter>
  <ac:parameter ac:name="placement">Calendar only</ac:parameter>
  <ac:rich-text-body>
    <p>
      <ac:structured-macro ac:macro-id="63ede68c-a9cf-476d-a665-93fd7e503c24" ac:name="confiform-field-css" ac:schema-version="1">
        <ac:parameter ac:name="condition">phone:phone1</ac:parameter>
        <ac:parameter ac:name="css">background-color:pink !important;</ac:parameter>
        <ac:parameter ac:name="fieldName">usetime</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="59d5219a-d9de-4c1d-a944-f1e237938e8f" ac:name="confiform-field-css" ac:schema-version="1">
        <ac:parameter ac:name="condition">phone:phone2</ac:parameter>
        <ac:parameter ac:name="css">background-color:red !important;</ac:parameter>
        <ac:parameter ac:name="fieldName">usetime</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="a7b7a0e8-4b3e-481c-bed5-0992f5d906b1" ac:name="confiform-field-css" ac:schema-version="1">
        <ac:parameter ac:name="condition">phone:phone3</ac:parameter>
        <ac:parameter ac:name="css">background-color:yellow !important;</ac:parameter>
        <ac:parameter ac:name="fieldName">usetime</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="a6fe4da3-7a4d-470f-8c45-da3404803ade" ac:name="confiform-field-css" ac:schema-version="1">
        <ac:parameter ac:name="condition">phone:phone4</ac:parameter>
        <ac:parameter ac:name="css">background-color:green !important;</ac:parameter>
        <ac:parameter ac:name="fieldName">usetime</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="97dee011-e7f1-4c2c-a99c-2b048dcbff38" ac:name="confiform-field-css" ac:schema-version="1">
        <ac:parameter ac:name="condition">phone:phone5</ac:parameter>
        <ac:parameter ac:name="css">background-color:magenta !important;</ac:parameter>
        <ac:parameter ac:name="fieldName">usetime</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>