project_details1.blade.php 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832
  1. @extends('layouts.master')
  2. @section('style')
  3. <link href="{{URL::asset('assets/dropzone/dropzone.css')}}" rel="stylesheet" type="text/css" />
  4. <style type="text/css">
  5. .panel-body{
  6. color: #4d4d4d;
  7. }
  8. .cls-assign:hover{
  9. color:#1ab394;
  10. }
  11. .cls-show-time{
  12. color: #000;
  13. font-style: italic;
  14. font-size: 11px;
  15. }
  16. </style>
  17. @endsection
  18. @section('content')
  19. <!-- Main content -->
  20. <section class="content">
  21. <!-- Main row -->
  22. <div class="row">
  23. <div class="col-md-9">
  24. @if(!empty($self->description))
  25. <div class="col-md-12">
  26. <section class="panel tasks-widget">
  27. <div class="panel-body">
  28. <b>Description:</b> {{$self->description}}
  29. </div>
  30. </section>
  31. </div>
  32. @endif
  33. <div class="col-md-6" style="">
  34. <div class="panel">
  35. <div class="panel-body" role="document">
  36. <div class="">
  37. <div class="modal-body">
  38. <h4 class="modal-title" id="gridSystemModalLabel">ADD TASK</h4>
  39. <form role="form" action="{{url('admin/add_task')}}" method="POST">
  40. {!! csrf_field() !!}
  41. <input type="hidden" name="proj_id" value="{{$project_id}}">
  42. <div class="form-group">
  43. <label for="Add new Project">
  44. New Task
  45. </label>
  46. <input name="name" class="form-control" id="new-project" placeholder="Add new task" required="" type="new-project">
  47. </input>
  48. </div>
  49. <div class="form-group">
  50. <label for="Add new Project">
  51. Type
  52. </label>
  53. <select name="task_type" id="" class="form-control">
  54. <option value="2">Normal</option>
  55. <option value="1">Regular</option>
  56. </select>
  57. </div>
  58. <div class="form-group">
  59. <label for="Add new Project">
  60. Priority
  61. </label>
  62. <select name="priority" id="" class="form-control">
  63. <option value="1">Low</option>
  64. <option value="2">Mid</option>
  65. <option value="3">High</option>
  66. </select>
  67. </div>
  68. <div class="form-group">
  69. <label for="Add new Project">
  70. Dead Line
  71. </label>
  72. <br>
  73. <b>Date:</b>
  74. <input name="dead_line" class="form-control" id="dead-pik" placeholder="Select dead" required="" type="new-project">
  75. </input>
  76. </div>
  77. <b>Hours:</b>
  78. <select name="dead_hour">
  79. @for($i=0;$i<=23;$i++)
  80. <option value="{{$i}}">{{$i}}</option>
  81. @endfor
  82. </select>
  83. <b>Min:</b>
  84. <select name="dead_min">
  85. @for($i=0;$i<=59;$i+=5)
  86. <option value="{{$i}}">{{$i}}</option>
  87. @endfor
  88. </select>
  89. <br>
  90. <div class="form-group">
  91. <label for="Add new Project">
  92. Description
  93. </label>
  94. <textarea name="description" class="form-control" id="editor1" placeholder="Description" rows="5"></textarea>
  95. </div>
  96. <button type="submit" class="btn btn-primary">Add</button>
  97. </div>
  98. </form>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="col-md-6">
  104. <section class="panel tasks-widget">
  105. <header class="panel-heading">
  106. Created
  107. </header>
  108. <div class="panel-body">
  109. <div class=" add-task-row">
  110. <?php $count=1; ?>
  111. <input type="hidden" class="cls-project-id" value="{{$project_id}}">
  112. @if(!empty($tasks))
  113. @foreach($tasks as $tsk)
  114. {{$count++ ."."}}
  115. {{-- {{$tsk->name}} --}}
  116. <input type="hidden" value="{{$tsk->id}}">
  117. <span class="cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;">{{$tsk->name}}</span>
  118. <span style="color:green;">
  119. @if($tsk->priority == 1)
  120. (Low)
  121. @elseif($tsk->priority == 2)
  122. (Mid)
  123. @elseif($tsk->priority == 3)
  124. (High)
  125. @endif
  126. </span>
  127. <span class="cls-show-time">
  128. @if($tsk->user_id > 0)
  129. A:{{date("d-m-Y/ H:i",strtotime($tsk->assign_time))}}
  130. @else
  131. C:{{date("d-m-Y/ H:i",strtotime($tsk->created_time))}}
  132. @endif
  133. </span>
  134. @if($tsk->user_id == 0)
  135. <span style="color:#32CD32"><b>(!)</b></span>
  136. @endif
  137. <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_task/$tsk->id")}}" data-toggle="tooltip" title="Remove {{$tsk->name}}" style="color:#FD4B39;">
  138. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  139. </a>
  140. {{-- <input type="hidden" value="{{$tsk->id}}">
  141. <i class="fa fa-plus-circle pull-right cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;"></i> --}}
  142. <br>
  143. @endforeach
  144. @else
  145. {{"No task available ..."}}
  146. @endif
  147. </div>
  148. <div class="table-foot">
  149. </div>
  150. </div>
  151. </section>
  152. </div>
  153. <div class="col-md-6">
  154. <section class="panel tasks-widget">
  155. <header class="panel-heading">
  156. In process
  157. </header>
  158. <div class="panel-body">
  159. <div class=" add-task-row">
  160. <?php $count=1; ?>
  161. @if(!empty($in_process))
  162. @foreach($in_process as $tsk)
  163. {{$count++.'. '}}
  164. {{-- {{$tsk->name}} --}}
  165. <input type="hidden" value="{{$tsk->id}}">
  166. <span class="cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;">{{$tsk->name}}</span>
  167. <span class="cls-show-time">
  168. S:{{date("d-m-Y/ H:i",strtotime($tsk->start_time))}}
  169. # E:{{date("H:i",strtotime($tsk->estimated_time))}}
  170. </span>
  171. <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_task/$tsk->id")}}" data-toggle="tooltip" title="Remove {{$tsk->name}}" style="color:#FD4B39;">
  172. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  173. </a>
  174. {{-- <input type="hidden" value="{{$tsk->id}}">
  175. <i class="fa fa-plus-circle pull-right cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;"></i> --}}
  176. <br>
  177. @endforeach
  178. @else
  179. {{"No task available ..."}}
  180. @endif
  181. </div>
  182. <div class="table-foot">
  183. </div>
  184. </div>
  185. </section>
  186. </div>
  187. <div class="col-md-6">
  188. <section class="panel tasks-widget">
  189. <header class="panel-heading">
  190. Completed
  191. </header>
  192. <div class="panel-body">
  193. <div class=" add-task-row">
  194. </div>
  195. <div class="table-foot">
  196. <?php $count=1; ?>
  197. @if(!empty($complete))
  198. @foreach($complete as $tsk)
  199. {{$count++.'. '}}
  200. {{-- {{$tsk->name}} --}}
  201. <input type="hidden" value="{{$tsk->id}}">
  202. <span class="cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;">{{$tsk->name}}</span>
  203. <span class="cls-show-time">
  204. S:{{date("d-m-Y/ H:i",strtotime($tsk->start_time))}}
  205. # E:{{date("H:i",strtotime($tsk->estimated_time))}}
  206. </span>
  207. <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_task/$tsk->id")}}" data-toggle="tooltip" title="Remove {{$tsk->name}}" style="color:#FD4B39;">
  208. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  209. </a>
  210. {{-- <input type="hidden" value="{{$tsk->id}}">
  211. <i class="fa fa-plus-circle pull-right cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;"></i> --}}
  212. <br>
  213. @endforeach
  214. @else
  215. {{"No task available ..."}}
  216. @endif
  217. </div>
  218. </div>
  219. </section>
  220. </div>
  221. <div class="col-md-6">
  222. <section class="panel tasks-widget">
  223. <header class="panel-heading">
  224. Checking
  225. </header>
  226. <div class="panel-body">
  227. <div class=" add-task-row">
  228. </div>
  229. <div class="table-foot">
  230. <?php $count=1; ?>
  231. @if(!empty($check))
  232. @foreach($check as $tsk)
  233. {{$count++.'. '}}
  234. {{-- {{$tsk->name}} --}}
  235. <input type="hidden" value="{{$tsk->id}}">
  236. <span class="cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;">{{$tsk->name}}</span>
  237. <span class="cls-show-time">
  238. S:{{date("d-m-Y/ H:i",strtotime($tsk->start_time))}}
  239. # E:{{date("H:i",strtotime($tsk->estimated_time))}}
  240. </span>
  241. <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_task/$tsk->id")}}" data-toggle="tooltip" title="Remove {{$tsk->name}}" style="color:#FD4B39;">
  242. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  243. </a>
  244. {{-- <input type="hidden" value="{{$tsk->id}}">
  245. <i class="fa fa-plus-circle pull-right cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;"></i> --}}
  246. <br>
  247. @endforeach
  248. @else
  249. {{"No task available ..."}}
  250. @endif
  251. </div>
  252. </div>
  253. </section>
  254. </div>
  255. <div class="col-md-6">
  256. <section class="panel tasks-widget">
  257. <header class="panel-heading">
  258. Bug-fixing
  259. </header>
  260. <div class="panel-body">
  261. <div class=" add-task-row">
  262. </div>
  263. <div class="table-foot">
  264. <?php $count=1; ?>
  265. @if(!empty($bug))
  266. @foreach($bug as $tsk)
  267. {{$count++.'. '}}
  268. {{-- {{$tsk->name}} --}}
  269. <input type="hidden" value="{{$tsk->id}}">
  270. <span class="cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;">{{$tsk->name}}</span>
  271. <span class="cls-show-time">
  272. S:{{date("d-m-Y/ H:i",strtotime($tsk->start_time))}}
  273. # E:{{date("H:i",strtotime($tsk->estimated_time))}}
  274. </span>
  275. <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_task/$tsk->id")}}" data-toggle="tooltip" title="Remove {{$tsk->name}}" style="color:#FD4B39;">
  276. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  277. </a>
  278. {{-- <input type="hidden" value="{{$tsk->id}}">
  279. <i class="fa fa-plus-circle pull-right cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;"></i> --}}
  280. <br>
  281. @endforeach
  282. @else
  283. {{"No task available ..."}}
  284. @endif
  285. </div>
  286. </div>
  287. </section>
  288. </div>
  289. <div class="col-md-6">
  290. <section class="panel tasks-widget">
  291. <header class="panel-heading">
  292. Done
  293. </header>
  294. <div class="panel-body">
  295. <div class=" add-task-row">
  296. </div>
  297. <div class="table-foot">
  298. <?php $count=1; ?>
  299. @if(!empty($done))
  300. @foreach($done as $tsk)
  301. {{$count++.'. '}}
  302. {{-- {{$tsk->name}} --}}
  303. <input type="hidden" value="{{$tsk->id}}">
  304. <span class="cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;">{{$tsk->name}}</span>
  305. <span class="cls-show-time">
  306. S:{{date("d-m-Y/ H:i",strtotime($tsk->start_time))}}
  307. # D:{{date("d-m-Y/ H:i",strtotime($tsk->closing_time))}}
  308. # E:{{date("H:i",strtotime($tsk->estimated_time))}}
  309. </span>
  310. <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_task/$tsk->id")}}" data-toggle="tooltip" title="Remove {{$tsk->name}}" style="color:#FD4B39;">
  311. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  312. </a>
  313. {{-- <input type="hidden" value="{{$tsk->id}}">
  314. <i class="fa fa-plus-circle pull-right cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;"></i> --}}
  315. <br>
  316. @endforeach
  317. @else
  318. {{"No task available ..."}}
  319. @endif
  320. </div>
  321. </div>
  322. </section>
  323. </div>
  324. <div class="col-md-6">
  325. <section class="panel tasks-widget">
  326. <header class="panel-heading">
  327. Notes
  328. </header>
  329. <div class="panel-body">
  330. <div class=" add-task-row">
  331. </div>
  332. <div class="table-foot">
  333. No task available ...
  334. </div>
  335. </div>
  336. </section>
  337. </div>
  338. </div>
  339. <div class="col-md-3">
  340. <div class="panel">
  341. <header class="panel-heading">
  342. USERS
  343. <button class="btn btn-success btn-xs pull-right" data-toggle="modal" data-target="#myModal1"><i class="fa fa-plus-circle" data-toggle="modal" data-target="#myModal1" aria-hidden="true"></i> ADD USER</button>
  344. </header>
  345. <div class="panel-body">
  346. <div class=" add-task-row">
  347. @if(!empty($proj_assign_user))
  348. <?php $count_a =1 ; ?>
  349. <table>
  350. @foreach($proj_assign_user as $info)
  351. <tr>
  352. <td>
  353. {{$count_a++.'. '.$info->one_user->name}}
  354. </td>
  355. <td>
  356. &nbsp;&nbsp;&nbsp;&nbsp;
  357. <input class="cls-pm" value="{{$info->id}}" data-toggle="tooltip" title="Assign {{$info->one_user->name}} as PM" @if($info->pm_status==1){{'checked'}} @endif type="checkbox"><i class="fa fa-user" aria-hidden="true"></i>
  358. &nbsp;
  359. <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_proj_user/$info->id")}}" data-toggle="tooltip" title="Remove {{$info->one_user->name}}" style="color:#FD4B39;">
  360. <i class="fa fa-times" aria-hidden="true"></i>
  361. </a>
  362. </td>
  363. </tr>
  364. @endforeach
  365. </table>
  366. @endif
  367. </div>
  368. </div>
  369. <header class="panel-heading">
  370. DOCUMENT
  371. <button class="btn btn-success btn-xs pull-right upload-cls" data-toggle="modal" data-target="#att_modal"><i class="fa fa-plus-circle" aria-hidden="true"></i> ADD DOCUMENT</button>
  372. </header>
  373. <div class="panel-body">
  374. <div class=" add-task-row">
  375. @if(!empty($documents))
  376. <?php $count_a =1 ; ?>
  377. @foreach($documents as $info_document)
  378. {{$count_a++.'. '}}
  379. <a style="color:#4d4d4d;" target="_blank" href="{{url("assets/document/project/$info_document->url")}}">{{$info_document->name}}</a>
  380. <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_proj_document/$info_document->id")}}" data-toggle="tooltip" title="Remove {{$info_document->name}}" style="color:#FD4B39;">
  381. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  382. </a>
  383. <br>
  384. @endforeach
  385. @endif
  386. </div>
  387. </div>
  388. <header class="panel-heading">
  389. ACTIVITY LOG
  390. </header>
  391. <div class="panel-body" style="overflow: scroll; height:450px;">
  392. <div class=" add-task-row">
  393. @if(!empty($logss))
  394. <?php $countt =1 ; ?>
  395. @foreach($logss as $logg)
  396. {{$countt++.". "}}
  397. {!! $logg->msg !!}
  398. - {{$logg->one_user->name}}
  399. <br>
  400. @endforeach
  401. @endif
  402. </div>
  403. </div>
  404. </div>
  405. </div>
  406. </div>
  407. </section>
  408. <!-- row end -->
  409. <!-- /.content -->
  410. <!-- Modal Add USER -->
  411. <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  412. <div class="modal-dialog" role="document">
  413. <div class="modal-content">
  414. <div class="modal-header">
  415. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  416. <h4 class="modal-title" id="gridSystemModalLabel">Add User</h4>
  417. </div>
  418. <div class="modal-body">
  419. <form role="form" action="{{url('admin/assign_project')}}" method="POST">
  420. {!! csrf_field() !!}
  421. <input type="hidden" name="proj_id" value="{{$project_id}}">
  422. <div class="form-group">
  423. <label for="Add new Project">
  424. Add
  425. </label>
  426. <select name="types" id="id-group-user" class="form-control">
  427. <option value="0">Select type</option>
  428. <option value="1">Group</option>
  429. <option value="2">User</option>
  430. </select>
  431. </div>
  432. <div class="form-group cls-group">
  433. <label for="Add new Project">
  434. Group
  435. </label>
  436. <select name="group_id" id="" class="form-control">
  437. @foreach($groups as $grps)
  438. <option value="{{$grps->id}}">{{$grps->group_name}}</option>
  439. @endforeach
  440. </select>
  441. </div>
  442. <div class="form-group cls-user">
  443. <label for="Add new Project">
  444. User
  445. </label>
  446. <select name="user_id" id="" class="form-control">
  447. @foreach($users as $usr)
  448. <option value="{{$usr->id}}">{{$usr->name}}</option>
  449. @endforeach
  450. </select>
  451. </div>
  452. </div>
  453. <div class="modal-footer">
  454. <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  455. <button type="submit" class="btn btn-primary">Add</button>
  456. </div>
  457. </form>
  458. </div><!-- /.modal-content -->
  459. </div><!-- /.modal-dialog -->
  460. </div>
  461. <!-- Assign modal -->
  462. @include('admin.modal_assign_task')
  463. @endsection
  464. @section('script')
  465. <script src="{{URL::asset('assets/dropzone.js')}}" type="text/javascript"></script>
  466. <script src="{{URL::asset('assets/ckeditor/ckeditor.js')}}"></script>
  467. <script type="text/javascript">
  468. $(document).ready(function(){
  469. $('.cls-group').hide();
  470. $('.cls-user').hide();
  471. $('.show-change-btn').hide();
  472. // Replace the <textarea id="editor1"> with a CKEditor
  473. // instance, using default configuration.
  474. CKEDITOR.replace( 'editor1' );
  475. CKEDITOR.replace( 'comment_txt' );
  476. $( function() {
  477. $( "#dead-pik" ).datepicker({
  478. changeMonth: true,
  479. changeYear: true,
  480. dateFormat: 'yy-mm-dd'
  481. });
  482. });
  483. });
  484. $('.cls-proj').change(function(event){
  485. var proj_id = $(this).val();
  486. $.ajax({
  487. url: "{{url("admin/change_tast_by_proj")}}",
  488. type: 'POST',
  489. data: { proj_id:proj_id},
  490. })
  491. .done(function(data){
  492. $('.cls-tasks').html(data);
  493. });
  494. });
  495. $('#id-group-user').change(function(event)
  496. {
  497. var chk_id = $(this).val();
  498. if(chk_id == 1){
  499. $('.cls-group').show();
  500. $('.cls-user').hide();
  501. }
  502. else if(chk_id == 2){
  503. $('.cls-group').hide();
  504. $('.cls-user').show();
  505. }
  506. else{
  507. $('.cls-group').hide();
  508. $('.cls-user').hide();
  509. }
  510. });
  511. $('.cls-assign').click(function(event)
  512. {
  513. var proj_id = $('.cls-project-id').val();
  514. var task_id = $(this).prev().val();
  515. $('#id_task_id').val(task_id);
  516. $.ajax({
  517. url: "{{url('admin/user_list_for_task_assign')}}",
  518. type: 'POST',
  519. data: {proj_id: proj_id, task_id: task_id},
  520. })
  521. .done(function(data) {
  522. var status = data[4];
  523. if(status > 1)
  524. {
  525. $('.show-change-btn').show();
  526. }
  527. else{
  528. $('.show-change-btn').hide();
  529. }
  530. $('.cls-proj-user').html(data[0]);
  531. $('.assinged-users').html(data[1]);
  532. $('.show-logs').html(data[2]);
  533. $('.comments-cls').html(data[3]);
  534. $('.cls-task-details').html(data[5]);
  535. });
  536. });
  537. $('.assign-task-user').click(function(event)
  538. {
  539. //url('admin/task_assign_to_user')
  540. //var id_estimated_time = $('#id_estimated_time').val();
  541. var hours = $('#id_estimated_time_hours').val();
  542. var min = $('#id_estimated_time_min').val();
  543. var id_estimated_time = hours+":"+min+":00";
  544. var id_user_id = $('#id_user_id').val();
  545. var id_task_id = $('#id_task_id').val();
  546. if(hours > 0 || min > 0){
  547. $.ajax({
  548. url: "{{url('admin/task_assign_to_user')}}",
  549. type: 'POST',
  550. data: {id_estimated_time: id_estimated_time,id_user_id: id_user_id,id_task_id: id_task_id},
  551. })
  552. .done(function(data) {
  553. $('.assinged-users').html(data);
  554. });
  555. }
  556. else{
  557. alert('Please define time estimate!');
  558. }
  559. });
  560. $('.assinged-users').on('click','.remove-task-assign-user',function(){
  561. var id = $(this).prev('input').val();
  562. var task_id = $('#id_task_id').val();
  563. $.ajax({
  564. url: "{{url('admin/remove_assign_task_user')}}",
  565. type: 'POST',
  566. data: {id: id,task_id: task_id},
  567. })
  568. .done(function(data) {
  569. $('.assinged-users').html(data);
  570. });
  571. });
  572. $('.add-task-comment').click(function(event) {
  573. var comment = CKEDITOR.instances.comment_txt.getData();
  574. var task_id = $('#id_task_id').val();
  575. if(comment.length > 0){
  576. $.ajax({
  577. url: "{{url('admin/add_task_comment')}}",
  578. type: 'POST',
  579. data: {comment: comment,task_id: task_id},
  580. })
  581. .done(function(data) {
  582. $('.comments-cls').html(data);
  583. });
  584. }
  585. else{
  586. alert('Please fill-up comment field.');
  587. }
  588. });
  589. $('.comments-cls').on('click','.edit_comment',function(){
  590. var id = $(this).data('id');
  591. $.ajax({
  592. url: '{{url('admin/edit_comment_form')}}',
  593. type: 'POST',
  594. data: {id: id},
  595. })
  596. .done(function(data) {
  597. $('.modal-edit').modal('show');
  598. $('.update-comment').val(data['comment']);
  599. $('.update-comment-id').val(data['id']);
  600. });
  601. });
  602. $('.comments-cls').on('click','.remove_comment',function(){
  603. var id = $(this).data('id');
  604. var task_id = $('#id_task_id').val();
  605. $.ajax({
  606. url: "{{url('admin/remove_comment')}}",
  607. type: 'POST',
  608. data: {id: id,task_id: task_id},
  609. })
  610. .done(function(data) {
  611. $('.comments-cls').html(data);
  612. });
  613. });
  614. $('.save-updated-comment').click(function(event) {
  615. var id = $('.update-comment-id').val();
  616. var comment = $('.update-comment').val();
  617. var task_id = $('#id_task_id').val();
  618. $.ajax({
  619. url: '{{url('admin/save_update_comment')}}',
  620. type: 'POST',
  621. data: {id: id,comment: comment,task_id: task_id},
  622. })
  623. .done(function(data) {
  624. $('.modal-edit').modal('hide');
  625. $('.comments-cls').html(data);
  626. $('.update-comment').val('');
  627. alert('Data updated successfully!');
  628. });
  629. });
  630. $('.cls-change-created').click(function(event)
  631. {
  632. if(confirm("Are you sure you want to change status ?"))
  633. {
  634. var task_id = $('#id_task_id').val();
  635. var status = $(this).data('id');
  636. $.ajax({
  637. url: "{{url('admin/change_to_process')}}",
  638. type: 'POST',
  639. data: {task_id: task_id, status: status},
  640. })
  641. .done(function(data) {
  642. if(data == 'Yes'){
  643. alert('Status Changed !!');
  644. location.reload();
  645. }
  646. else{
  647. alert('Status Not Changed !!');
  648. }
  649. });
  650. }
  651. });
  652. $('.upload-cls').click(function(event)
  653. {
  654. var id = $('.cls-project-id').val();
  655. $('.cls-proj-id').val(id);
  656. });
  657. $('.cls-pm').click(function(event) {
  658. var id = $(this).val();
  659. var pm_status;
  660. if($(this).attr('checked')){
  661. pm_status = 1 ; //check
  662. }
  663. else{
  664. pm_status = 0 ; //uncheck
  665. }
  666. $.ajax({
  667. url: "{{url('admin/make_pm')}}",
  668. type: 'POST',
  669. data: {id: id,pm_status: pm_status},
  670. })
  671. .done(function(data) {
  672. alert(data);
  673. });
  674. });
  675. $('.add-task-comment-doc').click(function(event) {
  676. var task_id = $('#id_task_id').val();
  677. $('.cls-task-doc-id').val(task_id);
  678. });
  679. $('.attatch-close-btn').click(function(event) {
  680. location.reload();
  681. });
  682. $('.attatchment-doc-comment').click(function(event) {
  683. //this event only for fetch the comments after close
  684. //attatchemnt dropzone.
  685. var comment = '';
  686. var task_id = $('#id_task_id').val();
  687. $.ajax({
  688. url: "{{url('admin/add_task_comment')}}",
  689. type: 'POST',
  690. data: {comment: comment,task_id: task_id},
  691. })
  692. .done(function(data){
  693. $('.comments-cls').html(data);
  694. });
  695. });
  696. $('#timepicker_hours_2').timepicker({
  697. hours: {
  698. starts: 10,
  699. ends: 40
  700. },
  701. rows: 8,
  702. showPeriodLabels: false,
  703. showPeriod: false,
  704. showMinutes: false
  705. });
  706. </script>
  707. @endsection