PageRenderTime 55ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 1ms

/apps/bpm/views/requests_reply2.php

https://github.com/jplante815/meican
PHP | 193 lines | 109 code | 17 blank | 67 comment | 3 complexity | c8ca90a17d865f690eadf584c98d6280 MD5 | raw file
  1. <?php extract(get_object_vars($request)); ?>
  2. <h1><?php echo _("Reply request"); ?></h1>
  3. <h4 style="margin:0;" class="float-left">
  4. <dl>
  5. <dt><?php echo _("Reservation name"); ?></dt>
  6. <dd><?php echo $res_name; ?></dd>
  7. <dt><?php echo _("Requester Domain"); ?></dt>
  8. <dd><?php echo $flow->source->domain; ?></dd>
  9. <dt><?php echo _("Requester User"); ?></dt>
  10. <dd><?php echo $usr_login; ?></dd>
  11. </dl>
  12. </h4>
  13. <div class="float-right" style="padding-left: 4px;">
  14. <?php if ($gris): ?>
  15. <form method="POST" style="min-height:64px;width:100%;min-width: 550px;" action="<?php echo $this->buildLink(array('action' => 'cancel', 'param' => "res_id:$res_id,refresh:1")); ?>">
  16. <?php if (!empty($refresh)): ?>
  17. <div class="controls">
  18. <input type="button" class="refresh" value="<?php echo _("Refresh") ?>" onclick="griRefreshStatus(<?php echo $res_id; ?>);" />
  19. <input type="submit" class="cancel" disabled="disabled" id="cancel_button" value="<?php echo _("Cancel reservations"); ?>" onclick="return confirm('<?php echo _('Cancel the selected reservations?'); ?>')"/>
  20. </div>
  21. <?php endif; ?>
  22. <?=
  23. $this->element('list_gris',
  24. compact('gris', 'refresh') + array('app' => 'circuits', 'authorization' => true));
  25. ?>
  26. </form>
  27. <?php endif; ?>
  28. </div>
  29. <div style="clear:both;"></div>
  30. <div id="subtab-map" class="tab_subcontent shadow-box">
  31. <div id="res_mapCanvas" style="width:400px; height:400px;"></div>
  32. </div>
  33. <div id="calendar" class="float-right" style="width:550px;height: 402px;"></div>
  34. <div id="subtab-points" class="tab_subcontent float-right" style="padding-left:8px;">
  35. <?=
  36. $this->element('view_point',
  37. array('app' => 'circuits', 'type' => 'source', 'flow' => $flow));
  38. ?>
  39. <div id="bandwidth_bar">
  40. <div id="bandwidth_bar_text">
  41. <div style="text-align:center;">
  42. <label id="lb_bandwidth"><?php echo $bandwidth . " " . _("Mbps") ?></label>
  43. </div>
  44. </div>
  45. <div id="bandwidth_bar_inside" style="width: <?= round($bandwidth * 100 / 1000); //TODO: calcular ?>%"></div>
  46. </div>
  47. <?=
  48. $this->element('view_point',
  49. array('app' => 'circuits', 'type' => 'destination', 'flow' => $flow));
  50. ?>
  51. </div>
  52. <div style="clear:both;"></div>
  53. <div id="tabs-2" class="tab_content">
  54. <?=
  55. $this->element('view_timer', array('app' => 'circuits', 'timer' => $timer));
  56. ?>
  57. <?=
  58. false && $request ? $this->element('view_request',
  59. compact('request') + array('app' => 'circuits')) : null;
  60. ?>
  61. </div>
  62. <div id="tabs-4" class="control_tab">
  63. <input type="button" id="bc1" class="cancel" value="<?php echo _('Back'); ?>" onclick="redir('<?= $this->url(array("action" => "show")); ?>');"/>
  64. </div>
  65. <div id="dialog-form" title="<?= _("Authorization"); ?>">
  66. <form>
  67. <div id="MessageBandwidth"></div>
  68. <img id="MessageImg" alt="" src=""/>
  69. <label for="name" id="MessageLabel"><?= _("Provide a message") ?></label>
  70. <textarea type="text" name="name" id="Message" class="text ui-widget-content ui-corner-all" style="width:100%;margin-top:10px;" cols="20" rows="5"></textarea>
  71. </form>
  72. </div>
  73. <?php
  74. /* <div id="tabs-4" class="control_tab">
  75. <form method="POST" id="FormReply" action="<?php echo $this->buildLink(array('action' => 'saveResponse', 'param' => array('loc_id' => $request->loc_id))); ?>">
  76. <div>
  77. <label for="response"><?php echo _('Response'); ?></label>
  78. <input type="radio" name="response" value="accept"/><?php echo _('ACCEPT'); ?>
  79. <input type="radio" name="response" value="reject"/><?php echo _('REJECT'); ?>
  80. </div>
  81. <label for="message"><?php echo _('Message'); ?></label>
  82. <input type="text" id="Message" name="message" size="120"/>
  83. <input class="ok" type='submit' value='<?php echo _('Reply'); ?>'/>
  84. </form>
  85. </div> */
  86. $events = array();
  87. $i = 5;
  88. foreach ($gris as $gri) {
  89. $i++;
  90. $events[] = array(
  91. 'id' => $i,
  92. 'start' => strtotime($gri->start_date) * 1000,
  93. 'end' => strtotime($gri->finish_date) * 1000,
  94. 'title' => '',
  95. 'hclass' => 'reservation-status-' . strtolower($gri->original_status)
  96. );
  97. }
  98. foreach ($calendar_gris as $gri) {
  99. $i++;
  100. $events[] = array(
  101. 'id' => $i,
  102. 'start' => strtotime($gri->start_date) * 1000,
  103. 'end' => strtotime($gri->finish_date) * 1000,
  104. 'title' => '',
  105. 'hclass' => 'cal-old'
  106. );
  107. }
  108. /* .concat([
  109. {
  110. "id":1,
  111. "start": new Date(year, month, day, 12),
  112. "end": new Date(year, month, day, 13, 30),
  113. "title":"Reservation1",
  114. "status": 1
  115. },
  116. {
  117. "id":2,
  118. "start": new Date(year, month, day, 14),
  119. "end": new Date(year, month, day, 14, 45),
  120. "title":"Reservation2",
  121. "class": "test2",
  122. "status": -1
  123. },
  124. {
  125. "id":3,
  126. "start": new Date(year, month, day + 1, 12),
  127. "end": new Date(year, month, day + 1, 17, 45),
  128. "title":"Reservation3",
  129. "status": 0
  130. },
  131. {
  132. "id":4,
  133. "start": new Date(year, month, day - 1, 8),
  134. "end": new Date(year, month, day - 1, 9, 30),
  135. "title":"Reservation4",
  136. "status": -1
  137. },
  138. {
  139. "id":5,
  140. "start": new Date(year, month, day + 1, 14),
  141. "end": new Date(year, month, day + 1, 15),
  142. "title":"Reservation5",
  143. "status": 1
  144. },
  145. {
  146. "id":6,
  147. "start": new Date(year, month, day + 1, 14),
  148. "end": new Date(year, month, day + 1, 15),
  149. "title":"Reservation7",
  150. "status": 1
  151. },
  152. {
  153. "id":6,
  154. "start": new Date(year, month, day, 10),
  155. "end": new Date(year, month, day, 11),
  156. "title":"Reservation6 (read only)",
  157. "status": 0,
  158. readOnly : true
  159. }
  160. ]) */
  161. ?>
  162. <script type="text/javascript" src="<?php echo $this->url(); ?>webroot/js/jquery.weekcalendar.js"></script>
  163. <link rel="stylesheet" type="text/css" href="<?php echo $this->url(); ?>webroot/css/jquery.weekcalendar.css" />
  164. <link rel='stylesheet' type='text/css' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/smoothness/jquery-ui.css' />
  165. <script type="text/javascript" src="<?php echo $this->url(); ?>apps/circuits/webroot/js/reservations.js"></script>
  166. <script type="text/javascript" src="<?php echo $this->url(); ?>apps/circuits/webroot/js/reservations_view.js"></script>
  167. <script type="text/javascript">
  168. request.setBandwidth('<?= $bandwidth ?>');
  169. request.setActionUrl('<?= $this->url(array('action' => 'saveResponse', 'param' => array('loc_id' => $request->loc_id))) ?>');
  170. request.set({gris: <?= json_encode($events); ?>});
  171. request.buildCalendar();
  172. </script>
  173. <a href="<?= $this->url(array('action' => 'saveResponse', 'param' => array('loc_id' => $request->loc_id))) ?>" id="UrlPost" style="display:none;"></a>
  174. <div id="Response" style="display:none;"></div>