uproj_inprocess_pending_task.blade.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  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. Description
  52. </label>
  53. <textarea name="description" class="form-control" id="editor1" placeholder="Description" rows="5"></textarea>
  54. </div>
  55. <div class="form-group">
  56. <label for="Add new Project">
  57. Deadline
  58. </label>
  59. <br>
  60. <input type="text" id="test" name="dead_line" class="form-control">
  61. </div>
  62. <button type="submit" class="btn btn-primary">Add</button>
  63. </div>
  64. </form>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="col-md-6">
  70. <section class="panel tasks-widget">
  71. <header class="panel-heading">
  72. Pending
  73. </header>
  74. <div class="panel-body">
  75. <div class=" add-task-row">
  76. <?php $count=1; ?>
  77. <input type="hidden" class="cls-project-id" value="{{$project_id}}">
  78. @if(!empty($pending))
  79. @foreach($pending as $tsk)
  80. {{$count++.'. '}}
  81. {{-- {{$tsk->name}} --}}
  82. <input type="hidden" value="{{$tsk->id}}">
  83. <span class="cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;">{{$tsk->name}}</span>
  84. <span style="color:green;">
  85. @if($tsk->priority == 1)
  86. (Low)
  87. @elseif($tsk->priority == 2)
  88. (Mid)
  89. @elseif($tsk->priority == 3)
  90. (High)
  91. @endif
  92. </span>
  93. <span class="cls-show-time">
  94. @if($tsk->user_id > 0)
  95. A:{{date("d-m-Y/ H:i",strtotime($tsk->assign_time))}}
  96. @else
  97. C:{{date("d-m-Y/ H:i",strtotime($tsk->created_time))}}
  98. @endif
  99. @if(date("Y",strtotime($tsk->dead_line))>2000)
  100. <span style="color:red;">
  101. Dline:{{date("d-m-Y/ H:i",strtotime($tsk->dead_line))}}
  102. </span>
  103. @endif
  104. </span>
  105. @if($tsk->user_id == 0)
  106. <span style="color:#32CD32"><b>(!)</b></span>
  107. @endif
  108. {{-- <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_task/$tsk->id")}}" data-toggle="tooltip" title="Remove {{$tsk->name}}" style="color:#FD4B39;">
  109. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  110. </a> --}}
  111. <span class="pull-right">
  112. <input type="checkbox" data-id="{{$tsk->id}}" class="change-to-inprocess" data-toggle="tooltip" title="{{$tsk->name}}">In-process
  113. </span>
  114. <br>
  115. <hr>
  116. @endforeach
  117. @endif
  118. </div>
  119. <div class="table-foot">
  120. </div>
  121. </div>
  122. </section>
  123. </div>
  124. <div class="col-md-6">
  125. <section class="panel tasks-widget">
  126. <header class="panel-heading">
  127. In process
  128. </header>
  129. <div class="panel-body">
  130. <div class=" add-task-row">
  131. <?php $count=1; ?>
  132. @if(!empty($in_process))
  133. @foreach($in_process as $tsk)
  134. {{$count++.'. '}}
  135. {{-- {{$tsk->name}} --}}
  136. <input type="hidden" value="{{$tsk->id}}">
  137. <span class="cls-assign" data-toggle="modal" data-target=".bs-example-modal-lg" aria-hidden="true" style="cursor:pointer;">{{$tsk->name}}</span>
  138. <span style="color:green;">
  139. @if($tsk->priority == 1)
  140. (Low)
  141. @elseif($tsk->priority == 2)
  142. (Mid)
  143. @elseif($tsk->priority == 3)
  144. (High)
  145. @endif
  146. </span>
  147. <span class="cls-show-time">
  148. S:{{date("d-m-Y/ H:i",strtotime($tsk->start_time))}}
  149. # E:{{date("H:i",strtotime($tsk->estimated_time))}}
  150. @if(date("Y",strtotime($tsk->dead_line))>2000)
  151. <span style="color:red;">
  152. #Dline:{{date("d-m-Y/ H:i",strtotime($tsk->dead_line))}}
  153. </span>
  154. @endif
  155. </span>
  156. {{-- <a onclick="return confirm ('want to delete?')" href="{{url("admin/remove_task/$tsk->id")}}" data-toggle="tooltip" title="Remove {{$tsk->name}}" style="color:#FD4B39;">
  157. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  158. </a> --}}
  159. <span class="pull-right">
  160. <input type="checkbox" data-id="{{$tsk->id}}" class="change-to-done" data-toggle="tooltip" title="{{$tsk->name}}">Done
  161. </span>
  162. <br>
  163. <hr>
  164. @endforeach
  165. @endif
  166. </div>
  167. <div class="table-foot">
  168. </div>
  169. </div>
  170. </section>
  171. </div>
  172. </div>
  173. <div class="col-md-3">
  174. <div class="panel" style="margin-bottom:40px;">
  175. <a href="{{url("user/uproject_details/$project_id")}}" class="btn btn-success pull-right">Proj Details -></a>
  176. </div>
  177. <div class="panel">
  178. <header class="panel-heading">
  179. USERS
  180. </header>
  181. <div class="panel-body">
  182. <div class=" add-task-row">
  183. @if(!empty($proj_assign_user))
  184. <?php $count_a =1 ; ?>
  185. @foreach($proj_assign_user as $info)
  186. {{$count_a++.'. '.$info->one_user->name}}
  187. @if($info->pm_status == 1)
  188. <span style="color:#48C2A9;">{{"- PM"}}</span>
  189. @endif
  190. <br>
  191. @endforeach
  192. @endif
  193. </div>
  194. </div>
  195. <header class="panel-heading">
  196. DOCUMENT
  197. <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>
  198. </header>
  199. <div class="panel-body">
  200. <div class=" add-task-row">
  201. @if(!empty($documents))
  202. <?php $count_a =1 ; ?>
  203. @foreach($documents as $info_document)
  204. {{$count_a++.'. '}}
  205. <a style="color:#4d4d4d;" target="_blank" href="{{url("assets/document/project/$info_document->url")}}">{{$info_document->name}}</a>
  206. <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;">
  207. <i class="fa fa-times pull-right" aria-hidden="true"></i>
  208. </a>
  209. <br>
  210. @endforeach
  211. @endif
  212. </div>
  213. </div>
  214. <header class="panel-heading">
  215. ACTIVITY LOG
  216. </header>
  217. <div class="panel-body" style="overflow: scroll; height:450px;">
  218. <div class=" add-task-row">
  219. @if(!empty($logss))
  220. <?php $countt =1 ; ?>
  221. @foreach($logss as $logg)
  222. {{$countt++.". "}}
  223. {!! $logg->msg !!}
  224. - {{$logg->one_user->name}}
  225. <br>
  226. @endforeach
  227. @endif
  228. </div>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. </section>
  234. <!-- row end -->
  235. <!-- /.content -->
  236. <!-- Assign task finished -->
  237. <!-- Assign modal -->
  238. <!-- Assign modal -->
  239. @include('user.modal_assign_task')
  240. @endsection
  241. @section('script')
  242. <link rel="stylesheet" href="{{ URL::asset('assets/css/jquery.datetimepicker.css') }}">
  243. <script type="text/javascript" src="{{ URL::asset('assets/js/jquery.datetimepicker.full.min.js') }}"></script>
  244. <script src="{{URL::asset('assets/dropzone.js')}}" type="text/javascript"></script>
  245. <script src="{{URL::asset('assets/ckeditor/ckeditor.js')}}"></script>
  246. <script type="text/javascript">
  247. $('.bs-example-modal-lg').on('shown.bs.modal', function () {
  248. datePicker1();
  249. });
  250. function datePicker1(){
  251. $( "#test2" ).datetimepicker({
  252. });
  253. }
  254. $(document).ready(function(){
  255. $( "#test" ).datetimepicker({
  256. });
  257. $('.cls-group').hide();
  258. $('.cls-user').hide();
  259. $('.show-change-btn').hide();
  260. $('input:checkbox').removeAttr('checked');
  261. CKEDITOR.replace( 'editor1' );
  262. });
  263. $('.change-to-inprocess').click(function(event) {
  264. if($(this).prop("checked") == true){
  265. var task_id = $(this).attr("data-id");
  266. var status = 2;
  267. if(confirm('Want to change status?')){
  268. $('.change-to-inprocess').hide();
  269. $.ajax({
  270. url: '{{url("user/change_to_inprocess")}}',
  271. type: 'POST',
  272. data: {task_id: task_id,status: status},
  273. })
  274. .done(function(){
  275. location.reload();
  276. });
  277. }
  278. }
  279. });
  280. $('.change-to-done').click(function(event) {
  281. if($(this).prop("checked") == true){
  282. var task_id = $(this).attr("data-id");
  283. var status = 6;
  284. if(confirm('Want to change status?')){
  285. $('.change-to-done').hide();
  286. $.ajax({
  287. url: '{{url("user/change_to_inprocess")}}',
  288. type: 'POST',
  289. data: {task_id: task_id,status: status},
  290. })
  291. .done(function(){
  292. location.reload();
  293. });
  294. }
  295. }
  296. });
  297. $('.cls-proj').change(function(event){
  298. var proj_id = $(this).val();
  299. $.ajax({
  300. url: "{{url("user/change_tast_by_proj")}}",
  301. type: 'POST',
  302. data: { proj_id:proj_id},
  303. })
  304. .done(function(data){
  305. $('.cls-tasks').html(data);
  306. });
  307. });
  308. $('#id-group-user').change(function(event)
  309. {
  310. var chk_id = $(this).val();
  311. if(chk_id == 1){
  312. $('.cls-group').show();
  313. $('.cls-user').hide();
  314. }
  315. else if(chk_id == 2){
  316. $('.cls-group').hide();
  317. $('.cls-user').show();
  318. }
  319. else{
  320. $('.cls-group').hide();
  321. $('.cls-user').hide();
  322. }
  323. });
  324. $('.cls-assign').click(function(event)
  325. {
  326. var proj_id = $('.cls-project-id').val();
  327. var task_id = $(this).prev().val();
  328. $('#id_task_id').val(task_id);
  329. $.ajax({
  330. url: "{{url('user/user_list_for_task_assign')}}",
  331. type: 'POST',
  332. data: {proj_id: proj_id, task_id: task_id},
  333. })
  334. .done(function(data) {
  335. var status = data[4];
  336. if(status > 1)
  337. {
  338. $('.show-change-btn').show();
  339. }
  340. else{
  341. $('.show-change-btn').hide();
  342. }
  343. $('.cls-proj-user').html(data[0]);
  344. $('.assinged-users').html(data[1]);
  345. $('.show-logs').html(data[2]);
  346. $('.comments-cls').html(data[3]);
  347. $('.cls-task-details').html(data[5]);
  348. });
  349. });
  350. $('.assign-task-user').click(function(event)
  351. {
  352. var id_estimated_time = $('#test2').val();
  353. alert(id_estimated_time);
  354. var id_user_id = $('#id_user_id').val();
  355. var id_task_id = $('#id_task_id').val();
  356. if(id_estimated_time !=''){
  357. $.ajax({
  358. url: "{{url('user/task_assign_to_user')}}",
  359. type: 'POST',
  360. data: {id_estimated_time: id_estimated_time,id_user_id: id_user_id,id_task_id: id_task_id},
  361. })
  362. .done(function(data) {
  363. $('.assinged-users').html(data);
  364. });
  365. }
  366. else{
  367. alert('Please define time estimate!');
  368. }
  369. });
  370. $('.assinged-users').on('click','.remove-task-assign-user',function(){
  371. var id = $(this).prev('input').val();
  372. var task_id = $('#id_task_id').val();
  373. $.ajax({
  374. url: "{{url('user/remove_assign_task_user')}}",
  375. type: 'POST',
  376. data: {id: id,task_id: task_id},
  377. })
  378. .done(function(data) {
  379. $('.assinged-users').html(data);
  380. });
  381. });
  382. $('.add-task-comment').click(function(event) {
  383. var comment = CKEDITOR.instances.comment_txt.getData();
  384. var task_id = $('#id_task_id').val();
  385. if(comment.length > 0){
  386. $.ajax({
  387. url: "{{url('user/add_task_comment')}}",
  388. type: 'POST',
  389. data: {comment: comment,task_id: task_id},
  390. })
  391. .done(function(data) {
  392. $('.comments-cls').html(data);
  393. });
  394. }
  395. else{
  396. alert('Please fill-up comment field.');
  397. }
  398. });
  399. $('.comments-cls').on('click','.edit_comment',function(){
  400. var id = $(this).data('id');
  401. $.ajax({
  402. url: '{{url('user/edit_comment_form')}}',
  403. type: 'POST',
  404. data: {id: id},
  405. })
  406. .done(function(data) {
  407. $('.modal-edit').modal('show');
  408. $('.update-comment').val(data['comment']);
  409. $('.update-comment-id').val(data['id']);
  410. });
  411. });
  412. $('.comments-cls').on('click','.remove_comment',function(){
  413. var id = $(this).data('id');
  414. var task_id = $('#id_task_id').val();
  415. $.ajax({
  416. url: "{{url('user/remove_comment')}}",
  417. type: 'POST',
  418. data: {id: id,task_id: task_id},
  419. })
  420. .done(function(data) {
  421. $('.comments-cls').html(data);
  422. });
  423. });
  424. $('.save-updated-comment').click(function(event) {
  425. var id = $('.update-comment-id').val();
  426. var comment = $('.update-comment').val();
  427. var task_id = $('#id_task_id').val();
  428. $.ajax({
  429. url: '{{url('user/save_update_comment')}}',
  430. type: 'POST',
  431. data: {id: id,comment: comment,task_id: task_id},
  432. })
  433. .done(function(data) {
  434. $('.modal-edit').modal('hide');
  435. $('.comments-cls').html(data);
  436. $('.update-comment').val('');
  437. alert('Data updated successfully!');
  438. });
  439. });
  440. $('.cls-change-created').click(function(event)
  441. {
  442. if(confirm("Are you sure you want to change status ?"))
  443. {
  444. var task_id = $('#id_task_id').val();
  445. var status = $(this).data('id');
  446. $.ajax({
  447. url: "{{url('user/change_to_process')}}",
  448. type: 'POST',
  449. data: {task_id: task_id, status: status},
  450. })
  451. .done(function(data) {
  452. if(data == 'Yes'){
  453. alert('Status Changed !!');
  454. location.reload();
  455. }
  456. else{
  457. alert('Status Not Changed !!');
  458. }
  459. });
  460. }
  461. });
  462. $('.upload-cls').click(function(event){
  463. var id = $('.cls-project-id').val();
  464. $('.cls-proj-id').val(id);
  465. });
  466. $('.add-task-comment-doc').click(function(event){
  467. var task_id = $('#id_task_id').val();
  468. $('.cls-task-doc-id').val(task_id);
  469. });
  470. $('.attatch-close-btn').click(function(event) {
  471. location.reload();
  472. });
  473. $('.attatchment-doc-comment').click(function(event) {
  474. //this event only for fetch the comments after close
  475. //attatchemnt dropzone.
  476. var comment = '';
  477. var task_id = $('#id_task_id').val();
  478. $.ajax({
  479. url: "{{url('user/add_task_comment')}}",
  480. type: 'POST',
  481. data: {comment: comment,task_id: task_id},
  482. })
  483. .done(function(data){
  484. $('.comments-cls').html(data);
  485. });
  486. });
  487. </script>
  488. @endsection