uproj_inprocess_pending_task2.blade.php 21 KB

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