当前位置: 首页>>代码示例>>PHP>>正文


PHP Entity::generateLinkSatisfaction方法代码示例

本文整理汇总了PHP中Entity::generateLinkSatisfaction方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::generateLinkSatisfaction方法的具体用法?PHP Entity::generateLinkSatisfaction怎么用?PHP Entity::generateLinkSatisfaction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entity的用法示例。


在下文中一共展示了Entity::generateLinkSatisfaction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pdfForTicket

 static function pdfForTicket(PluginPdfSimplePDF $pdf, Ticket $ticket)
 {
     $survey = new TicketSatisfaction();
     $pdf->setColumnsSize(100);
     $pdf->displayTitle("<b>" . __('Satisfaction survey') . "</b>");
     if (!$survey->getFromDB($ticket->getID())) {
         $pdf->displayLine(__('No generated survey'));
     } else {
         if ($survey->getField('type') == 2) {
             $url = Entity::generateLinkSatisfaction($ticket);
             $pdf->displayLine(sprintf(__('%1$s (%2$s)'), __('External survey'), $url));
         } else {
             if ($survey->getField('date_answered')) {
                 $sat = $survey->getField('satisfaction');
                 $tabsat = array(0 => __('None'), 1 => __('1 star', 'pdf'), 2 => __('2 stars', 'pdf'), 3 => __('3 stars', 'pdf'), 4 => __('4 stars', 'pdf'), 5 => __('5 stars', 'pdf'));
                 if (isset($tabsat[$sat])) {
                     $sat = $tabsat[$sat] . "  ({$sat}/5)";
                 }
                 $pdf->displayLine('<b>' . sprintf(__('%1$s: %2$s'), __('Response date to the satisfaction survey') . '</b>', Html::convDateTime($survey->getField('date_answered'))));
                 $pdf->displayLine('<b>' . sprintf(__('%1$s: %2$s'), __('Satisfaction with the resolution of the ticket') . '</b>', $sat));
                 $pdf->displayText('<b>' . sprintf(__('%1$s: %2$s'), __('Comments') . '</b>', $survey->getField('comment')));
             } else {
                 // No answer
                 $pdf->displayLine(sprintf(__('%1$s: %2$s'), __('Creation date of the satisfaction survey'), Html::convDateTime($survey->getField('date_begin'))));
                 $pdf->displayLine(__('No answer', 'pdf'));
             }
         }
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:30,代码来源:ticketsatisfaction.class.php

示例2: getDatasForObject


//.........这里部分代码省略.........
                     $tmp['##problem.id##'] = $data['problems_id'];
                     $tmp['##problem.date##'] = $problem->getField('date');
                     $tmp['##problem.title##'] = $problem->getField('name');
                     $tmp['##problem.url##'] = $this->formatURL($options['additionnaloption']['usertype'], "problem_" . $data['problems_id']);
                     $tmp['##problem.content##'] = $problem->getField('content');
                     $datas['problems'][] = $tmp;
                 }
             }
         }
         $datas['##ticket.numberofproblems##'] = count($datas['problems']);
         $restrict = "`tickets_id`='" . $item->getField('id') . "'";
         $changes = getAllDatasFromTable('glpi_changes_tickets', $restrict);
         $datas['changes'] = array();
         if (count($changes)) {
             $change = new Change();
             foreach ($changes as $data) {
                 if ($change->getFromDB($data['changes_id'])) {
                     $tmp = array();
                     $tmp['##change.id##'] = $data['changes_id'];
                     $tmp['##change.date##'] = $change->getField('date');
                     $tmp['##change.title##'] = $change->getField('name');
                     $tmp['##change.url##'] = $this->formatURL($options['additionnaloption']['usertype'], "change_" . $data['changes_id']);
                     $tmp['##change.content##'] = $change->getField('content');
                     $datas['changes'][] = $tmp;
                 }
             }
         }
         $datas['##ticket.numberofchanges##'] = count($datas['changes']);
         if (!isset($options['additionnaloption']['show_private']) || !$options['additionnaloption']['show_private']) {
             $restrict .= " AND `is_private` = '0'";
         }
         $restrict .= " ORDER BY `date` DESC, `id` ASC";
         //Followup infos
         $followups = getAllDatasFromTable('glpi_ticketfollowups', $restrict);
         $datas['followups'] = array();
         foreach ($followups as $followup) {
             $tmp = array();
             $tmp['##followup.isprivate##'] = Dropdown::getYesNo($followup['is_private']);
             $tmp['##followup.author##'] = Html::clean(getUserName($followup['users_id']));
             $tmp['##followup.requesttype##'] = Dropdown::getDropdownName('glpi_requesttypes', $followup['requesttypes_id']);
             $tmp['##followup.date##'] = Html::convDateTime($followup['date']);
             $tmp['##followup.description##'] = $followup['content'];
             $datas['followups'][] = $tmp;
         }
         $datas['##ticket.numberoffollowups##'] = count($datas['followups']);
         // Approbation of solution
         $restrict .= " LIMIT 1";
         $replysolved = getAllDatasFromTable('glpi_ticketfollowups', $restrict);
         $data = current($replysolved);
         $datas['##ticket.solution.approval.description##'] = $data['content'];
         $datas['##ticket.solution.approval.date##'] = Html::convDateTime($data['date']);
         $datas['##ticket.solution.approval.author##'] = Html::clean(getUserName($data['users_id']));
         //Validation infos
         $restrict = "`tickets_id`='" . $item->getField('id') . "'";
         if (isset($options['validation_id']) && $options['validation_id']) {
             $restrict .= " AND `glpi_ticketvalidations`.`id` = '" . $options['validation_id'] . "'";
         }
         $restrict .= " ORDER BY `submission_date` DESC, `id` ASC";
         $validations = getAllDatasFromTable('glpi_ticketvalidations', $restrict);
         $datas['validations'] = array();
         foreach ($validations as $validation) {
             $tmp = array();
             $tmp['##validation.submission.title##'] = sprintf(__('An approval request has been submitted by %s'), Html::clean(getUserName($validation['users_id'])));
             $tmp['##validation.answer.title##'] = sprintf(__('An answer to an an approval request was produced by %s'), Html::clean(getUserName($validation['users_id_validate'])));
             $tmp['##validation.author##'] = Html::clean(getUserName($validation['users_id']));
             $tmp['##validation.status##'] = TicketValidation::getStatus($validation['status']);
             $tmp['##validation.storestatus##'] = $validation['status'];
             $tmp['##validation.submissiondate##'] = Html::convDateTime($validation['submission_date']);
             $tmp['##validation.commentsubmission##'] = $validation['comment_submission'];
             $tmp['##validation.validationdate##'] = Html::convDateTime($validation['validation_date']);
             $tmp['##validation.validator##'] = Html::clean(getUserName($validation['users_id_validate']));
             $tmp['##validation.commentvalidation##'] = $validation['comment_validation'];
             $datas['validations'][] = $tmp;
         }
         // Ticket Satisfaction
         $inquest = new TicketSatisfaction();
         $datas['##satisfaction.type##'] = '';
         $datas['##satisfaction.datebegin##'] = '';
         $datas['##satisfaction.dateanswered##'] = '';
         $datas['##satisfaction.satisfaction##'] = '';
         $datas['##satisfaction.description##'] = '';
         if ($inquest->getFromDB($item->getField('id'))) {
             // internal inquest
             if ($inquest->fields['type'] == 1) {
                 $datas['##ticket.urlsatisfaction##'] = $this->formatURL($options['additionnaloption']['usertype'], "ticket_" . $item->getField("id") . '_Ticket$3');
                 // external inquest
             } else {
                 if ($inquest->fields['type'] == 2) {
                     $datas['##ticket.urlsatisfaction##'] = Entity::generateLinkSatisfaction($item);
                 }
             }
             $datas['##satisfaction.type##'] = $inquest->getTypeInquestName($inquest->getfield('type'));
             $datas['##satisfaction.datebegin##'] = Html::convDateTime($inquest->fields['date_begin']);
             $datas['##satisfaction.dateanswered##'] = Html::convDateTime($inquest->fields['date_answered']);
             $datas['##satisfaction.satisfaction##'] = $inquest->fields['satisfaction'];
             $datas['##satisfaction.description##'] = $inquest->fields['comment'];
         }
     }
     return $datas;
 }
开发者ID:jose-martins,项目名称:glpi,代码行数:101,代码来源:notificationtargetticket.class.php

示例3: showForm

 /**
  * form for satisfaction
  *
  * @param $ticket Object : the ticket
  **/
 function showForm($ticket)
 {
     $tid = $ticket->fields['id'];
     $options = array();
     $options['colspan'] = 1;
     // for external inquest => link
     if ($this->fields["type"] == 2) {
         $url = Entity::generateLinkSatisfaction($ticket);
         echo "<div class='center spaced'>" . "<a href='{$url}'>" . __('External survey') . "</a><br>({$url})</div>";
         // for internal inquest => form
     } else {
         $this->showFormHeader($options);
         // Set default satisfaction to 3 if not set
         if (is_null($this->fields["satisfaction"])) {
             $this->fields["satisfaction"] = 3;
         }
         echo "<tr class='tab_bg_2'>";
         echo "<td>" . __('Satisfaction with the resolution of the ticket') . "</td>";
         echo "<td>";
         echo "<input type='hidden' name='tickets_id' value='{$tid}'>";
         echo "<select id='satisfaction_data' name='satisfaction'>";
         for ($i = 0; $i <= 5; $i++) {
             echo "<option value='{$i}' " . ($i == $this->fields["satisfaction"] ? 'selected' : '') . ">{$i}</option>";
         }
         echo "</select>";
         echo "<div class='rateit' id='stars'></div>";
         echo "<script type='text/javascript'>\n";
         echo "\$('#stars').rateit({value: " . $this->fields["satisfaction"] . ",\n                                   min : 0,\n                                   max : 5,\n                                   step: 1,\n                                   backingfld: '#satisfaction_data',\n                                   ispreset: true,\n                                   resetable: false});";
         echo "</script>";
         echo "</td></tr>";
         echo "<tr class='tab_bg_2'>";
         echo "<td rowspan='1'>" . __('Comments') . "</td>";
         echo "<td rowspan='1' class='middle'>";
         echo "<textarea cols='45' rows='7' name='comment' class='form-control'>" . $this->fields["comment"] . "</textarea>";
         echo "</td></tr>\n";
         if ($this->fields["date_answered"] > 0) {
             echo "<tr class='tab_bg_2'>";
             echo "<td>" . __('Response date to the satisfaction survey') . "</td><td>";
             echo Html::convDateTime($this->fields["date_answered"]) . "</td></tr>\n";
         }
         $options['candel'] = false;
         $this->showFormButtons($options);
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:49,代码来源:ticketsatisfaction.class.php

示例4: showSatisfactionForm

 /**
  * form for satisfaction
  *
  * @param $ticket Object : the ticket
  **/
 function showSatisfactionForm($ticket)
 {
     $tid = $ticket->fields['id'];
     $options = array();
     $options['colspan'] = 1;
     // for external inquest => link
     if ($this->fields["type"] == 2) {
         $url = Entity::generateLinkSatisfaction($ticket);
         echo "<div class='center spaced'>" . "<a href='{$url}'>" . __('External survey') . "</a><br>({$url})</div>";
         // for internal inquest => form
     } else {
         $this->showFormHeader($options);
         // Set default satisfaction to 3 if not set
         if (is_null($this->fields["satisfaction"])) {
             $this->fields["satisfaction"] = 3;
         }
         echo "<tr class='tab_bg_2'>";
         echo "<td>" . __('Satisfaction with the resolution of the ticket') . "</td>";
         echo "<td>";
         echo "<input type='hidden' name='tickets_id' value='{$tid}'>";
         echo "<input type='hidden' id='satisfaction' name='satisfaction' value='" . $this->fields["satisfaction"] . "'>";
         echo "<script type='text/javascript'>\n\n            Ext.onReady(function() {\n            var md = new Ext.form.StarRate({\n                       hiddenName: 'satisfaction',\n                       starConfig: {\n                       \tminValue: 0,\n                       \tmaxValue: 5,\n                        value:" . $this->fields["satisfaction"] . "\n                       },\n                       applyTo : 'satisfaction'\n            });\n            })\n            </script>";
         echo "</td></tr>";
         echo "<tr class='tab_bg_2'>";
         echo "<td rowspan='1'>" . __('Comments') . "</td>";
         echo "<td rowspan='1' class='middle'>";
         echo "<textarea cols='45' rows='7' name='comment' >" . $this->fields["comment"] . "</textarea>";
         echo "</td></tr>\n";
         if ($this->fields["date_answered"] > 0) {
             echo "<tr class='tab_bg_2'>";
             echo "<td>" . __('Response date to the satisfaction survey') . "</td><td>";
             echo Html::convDateTime($this->fields["date_answered"]) . "</td></tr>\n";
         }
         $options['candel'] = false;
         $this->showFormButtons($options);
     }
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:42,代码来源:ticketsatisfaction.class.php


注:本文中的Entity::generateLinkSatisfaction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。