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