project_details2.blade.php 35 KB

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