%PDF- %PDF-
Direktori : /home/opti/workflow/src/views/workflow/ |
Current File : /home/opti/workflow/src/views/workflow/itRequest.ejs |
<% include ../partials/header %> <!-- ////////////////////////////////////////////////////////////////////////////--> <% include ../partials/sidebar %> <div class="app-content content"> <div class="content-wrapper"> <div class="content-body"> <!-- Breadcrumb starts--> <div class="content-header row"> <div class="content-header-left col-md-6 col-12 mb-1"> <h2 class="content-header-title"><%= workflow.name %></h2> </div> <div class="content-header-right breadcrumbs-right breadcrumbs-top col-md-6 col-12"> <div class="breadcrumb-wrapper col-12"> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="/">Home</a></li> <li class="breadcrumb-item"><a href="/workflow">Workflow</a></li> <li class="breadcrumb-item active"><%= workflow.name %> </li> </ol> </div> </div> </div> <!-- Breadcrumb ends--> <section class="row"> <div class="col-12"> <div class="card"> <div class="card-head"> <div class="card-header"> <h4 class="card-title"><%= workflow.name %></h4> <a class="heading-elements-toggle"><i class="la la-ellipsis-h font-medium-3"></i></a> <div class="heading-elements"> <button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#newRequest"><i class="ft-plus white"></i> Make New Request</button> <!-- <span class="dropdown"> <button id="btnSearchDrop1" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" class="btn btn-warning btn-sm dropdown-toggle dropdown-menu-right"><i class="ft-download-cloud white"></i></button> <span aria-labelledby="btnSearchDrop1" class="dropdown-menu mt-1 dropdown-menu-right"> <a href="#" class="dropdown-item"><i class="la la-calendar"></i> Approved</a> <a href="#" class="dropdown-item"><i class="la la-random"></i> New </a> <a href="#" class="dropdown-item"><i class="la la-bar-chart"></i> Rejected</a> <a href="#" class="dropdown-item"><i class="la la-user"></i> Assign to</a> </span> </span> --> <!-- <button class="btn btn-success btn-sm"><i class="ft-settings white"></i></button> --> </div> </div> </div> <div class="card-content"> <div class="card-body"> <!-- Invoices List table --> <table class="table table-striped table-bordered zero-configuration"> <thead> <tr> <th>S/N</th> <th>Title</th> <th>Title</th> <th>Status</th> <th>Next Officer</th> <th>Created Date</th> <th>Last Reviewed</th> <th>Action</th> </tr> </thead> <tbody> <% requests.forEach((request, index)=>{ %> <tr> <td><%= index + 1 %></td> <td><%= request.serviceType %></td> <td><%= request.description %></td> <td><%= request.status %></td> <td><%= request.requestNextOfficer.firstName %></td> <td><%= moment(request.createdAt).fromNow() %></td> <td><%= moment(request.updatedAt).fromNow() %></td> <td> <a href="/workflow/request/<%= request.uuid %>" class="btn btn-primary btn-sm ">View</a> </td> </tr> <% }) %> </tbody> <tfoot> <tr> <th>S/N</th> <th>Description</th> <th>Status</th> <th>Next Officer</th> <th>Created Date</th> <th>Last Reviewed</th> <th>Action</th> </tr> </tfoot> </table> <!--/ Invoices table --> </div> </div> </div> </div> </section> </div> </div> </div> <!-- </div> </div> --> <!-- ////////////////////////////////////////////////////////////////////////////--> <!-----Modal for creating Organ--> <div class="modal fade text-left" id="newRequest" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="display: none;" aria-hidden="true"> <div class="modal-dialog modal-lg" role="document"> <form action="/workflow/<%= workflow.id %>" method="POST"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title" id="myModalLabel16">New <%= workflow.name %></h4> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="card-body "> <div class="row"> <div class="col-lg-6"> <div class="form-group col-lg-12"> <label for="name">Name : </label> <strong><%= user.firstName +" "+user.lastName %></strong> </div> <div class="form-group col-lg-12"> <label for="email">Email : </label> <strong class=""> <%= user.email %> </strong> </div> </div> <div class="form-group col-lg-6"> <fieldset class="form-group col-lg-12"> <label for="email">Description</label> <textarea class="form-control" id="placeTextarea" rows="3" placeholder="Request/Service description" name="description"></textarea> </fieldset> <div class="col-12"> <label for="service-type">Service Type</label> <fieldset> <div class="custom-control custom-radio"> <input type="radio" class="custom-control-input" name="serviceType" id="serviceType1" value="Software"> <label class="custom-control-label" for="serviceType1">Software</label> </div> </fieldset> <fieldset> <div class="custom-control custom-radio"> <input type="radio" class="custom-control-input" name="serviceType" id="serviceType2" value="Hardware"> <label class="custom-control-label" for="serviceType2">Hardware</label> </div> </fieldset> <fieldset> <div class="custom-control custom-radio"> <input type="radio" class="custom-control-input" name="serviceType" id="serviceType3" value="Network"> <label class="custom-control-label" for="serviceType3">Network</label> </div> </fieldset> <fieldset> <div class="custom-control custom-radio"> <input type="radio" class="custom-control-input" name="serviceType" id="serviceType4" value="Don't Know"> <label class="custom-control-label" for="serviceType4">Don't Know</label> </div> </fieldset> </div> </div> <!-- <input type="submit" value="Submit Request" class="btn btn-primary"/> --> </div> </div> </div> <div class="modal-footer"> <button type="button" class="btn grey btn-secondary" data-dismiss="modal">Close</button> <input type="submit" class="btn btn-primary" value="Submit Request" /> </div> </div> </form> </div> </div> <% include ../partials/footer %> <script > $(document).ready(function() { $("#structureTypeId").change(function() { var structureTypeId = $("#structureTypeId option:selected").val(); if(isNaN(structureTypeId)){ $("._label").html('') return; // $('#invoiceType').empty($("#structureTypeId option:selected").text()); } $("._label").html($("#structureTypeId option:selected").text()) // if(structureTypeId) if(structureTypeId == 1){//its the first on list, it has no parent $("#structureParent_div").addClass('d-none') } else{ $("#structureParent_div").removeClass('d-none') $.ajax({ type: 'POST', url: '/structure/getParents', dataType: 'json', data: { parentStructureId: structureTypeId }, success: function(data) { console.log(data); $('#structureParentId').empty(); $('#structureParentId').append('<option>Select Invoice Type</option>'); for(row in data) { if(data[row]._productId !== null){ $('#structureParentId').append($('<option></option>').attr('value', data[row].id).text(data[row].name)); } } // if(typeCategoryId == 2){ //its purchase // $('#contactLabel').html("To Contact"); // $("#partyId").attr('name', "partyToId") // }else{ // $('#contactLabel').html("From Contact"); // $("#partyId").attr('name', "partyFromId"); // } // }, // error: function(jqXHR, textStatus, errorThrow) { // $.alert(errorThrow); } }); } }); }); let counter = 0; //hold d last id let name_list = []; function getStructure(){ jQuery.ajax({ type: "POST", // Post / Get method url: "structure/get", //Where form data is sent on submission dataType:"text", // Data type, HTML, json etc. data:{ "_token": "{{ csrf_token() }}"}, //Form variables success:function(response){ var data=JSON.parse(response); // console.log((data)) $("#basic-list-group").html(''); data.forEach(structure => { // console.log(structure); $("#basic-list-group").append( `<li class="list-group-item col-12"> ${structure.name} <span class=" pull-right"> <span aria-hidden="true" class="btn btn-danger" onclick="removeStructure(this)">×</span> <input type="hidden" class="structures" name="structure_ids" value="${structure.id}"> <input type="hidden" class="" name="structure_names" value="${structure.name}"> <i class="icon-cursor-move btn btn-success font-medium-1"></i> </span> </li>` ) counter = structure.id; }); }, error:function (xhr, ajaxOptions, thrownError){ //$("#loading").hide(); Swal.fire("Error!", "An error occurred!", "error"); } }); } </script>