image() static public method

This method will set an empty alt attribute if no alt and no title is not supplied
static public image ( $path, $options = [] ) : string
$path Path to the image file
$options Array of HTML attributes - `url` If provided an image link will be generated and the link will point at `$options['url']`.
return string completed img tag
Ejemplo n.º 1
0
 public function overviewImage()
 {
     if (!$this->isNewRecord) {
         if ($this->hasIcon()) {
             return Html::image('/uploads/' . $this->icon_file, $this->name);
         }
     }
 }
Ejemplo n.º 2
0
 public function getImageView()
 {
     // die($this->image);
     if (file_exists(Yii::getPathOfAlias('webroot.uploads.manufacturer') . DS . $this->image) && !empty($this->image)) {
         return Html::image($this->getImageUrl('image', 'manufacturer', '100x100'), $this->name, array('class' => 'overview-image'));
     } else {
         return Html::image('http://placehold.it/125x75/&text=No image', $this->name, array('class' => 'overview-image'));
     }
 }
Ejemplo n.º 3
0
 protected function _field($obj)
 {
     if (empty($obj[$this->get_name()])) {
         return '<td>no image</td>';
     }
     $path = $obj[$this->get_name()];
     if (!is_null($this->_resize)) {
         $path = Resizer::thumb($path, $this->_resize);
     }
     return '<td>' . Html::image($path) . '</td>';
 }
Ejemplo n.º 4
0
 /**
  * Output HTML image tag from array
  *
  * @param array $array
  * @param array $param
  * @return string
  */
 public static function image(array $array, $param = array())
 {
     $out = "\n";
     foreach ($array as $key => $item) {
         if (is_array($item)) {
             $out .= Html::image($item[0], $item[1]) . "\n";
         } else {
             $out .= Html::image($item) . "\n";
         }
     }
     return $out;
 }
function display_channels($display_channels, $loginstatus)
{
    $current_item = 0;
    foreach ($display_channels as $channel) {
        if ($loginstatus) {
            echo "<div id='is_" . $channel->id . "'>" . $channel->name . "&nbsp;<a href=\"javascript:DeleteIdentifiedSourcesChannel('" . $channel->id . "');\">" . Html::image("media/images/button-markas-inaccurate.png") . "</a></div>";
        } else {
            echo "<div>" . $channel->name . "</div>";
        }
        $current_item++;
    }
}
function display_channels($display_channels, $loginstatus)
{
    $output = "";
    foreach ($display_channels as $channel) {
        if (!$loginstatus) {
            $output .= $channel->name . ", ";
        } else {
            $output .= $channel->name . "<a href=\"javascript:DeleteTermsToMonitorChannel('" . $channel->id . "');\">" . Html::image("media/images/button-markas-inaccurate.png") . "</a>";
        }
    }
    if (!$loginstatus) {
        rtrim($output, ", ");
    }
    echo $output;
}
Ejemplo n.º 7
0
 public static function getRowHost($refer, $ip, $proxy, $host)
 {
     $content = '';
     $p = self::$LANG[mb_strtoupper($host)];
     if ($proxy == "") {
         $content .= "<font color=grey>неизвестно</font>";
     } else {
         $content .= "<a target=_blank href=\"http://www.tcpiputils.com/browse/ip-address/" . ($ip != "" ? $ip : $host) . "\">" . $proxy . "</a>";
     }
     if ($refer != "") {
         $content .= "<br>Язык: " . (!empty($p) ? $p : "<font color=grey>неизвестно</font>");
         if (file_exists(Yii::getPathOfAlias('webroot.stats.flags') . DS . mb_strtolower($p) . ".gif")) {
             $content .= Html::image('/stats/flags/' . mb_strtolower($p) . '.gif', $p);
         }
     }
     return $content;
 }
Ejemplo n.º 8
0
<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'comment-reply-form-' . $model->id, 'action' => '/comments/reply_submit/', 'htmlOptions' => array('class' => 'form', 'name' => 'comment-reply-form')));
?>


<div class="input-group">
    <span class="input-group-addon"><?php 
echo Html::image(Yii::app()->user->avatarPath);
?>
</span>
    <?php 
echo $form->textArea($model, 'text', array('rows' => 3, 'class' => 'form-control', 'placeholder' => $model->getAttributeLabel('text')));
?>
    <?php 
echo $form->error($model, 'text');
?>
</div>
<div class="text-right" style="margin-top:10px;">
    <?php 
echo Html::link(Yii::t('default', 'Ответить'), 'javascript:void(0)', array('onClick' => '$("#comment_' . $model->id . '").comment("reply_submit",{pk:"' . $model->id . '", model:"' . $model->model . '"}); return false;', 'class' => 'btn btn-success'));
?>
</div>

<?php 
$this->endWidget();
Ejemplo n.º 9
0
    /** form for Task
     *
     * @param $ID        Integer : Id of the task
     * @param $options   array
     *     -  parent Object : the object
     **/
    function showForm($ID, $options = array())
    {
        global $DB, $CFG_GLPI;
        $rand_template = mt_rand();
        $rand_text = mt_rand();
        $rand_type = mt_rand();
        $rand_time = mt_rand();
        if (isset($options['parent']) && !empty($options['parent'])) {
            $item = $options['parent'];
        }
        $fkfield = $item->getForeignKeyField();
        if ($ID > 0) {
            $this->check($ID, READ);
        } else {
            // Create item
            $options[$fkfield] = $item->getField('id');
            $this->check(-1, CREATE, $options);
        }
        $rand = mt_rand();
        $this->showFormHeader($options);
        $canplan = !$item->isStatusExists(CommonITILObject::PLANNED) || $item->isAllowedStatus($item->fields['status'], CommonITILObject::PLANNED);
        $rowspan = 5;
        if ($this->maybePrivate()) {
            $rowspan++;
        }
        if (isset($this->fields["state"])) {
            $rowspan++;
        }
        echo "<tr class='tab_bg_1'>";
        echo "<td rowspan='{$rowspan}' style='width:100px'>" . __('Description') . "</td>";
        echo "<td rowspan='{$rowspan}' style='width:50%' id='content{$rand_text}'>" . "<textarea name='content' style='width: 95%; height: 160px' id='task{$rand_text}'>" . $this->fields["content"] . "</textarea>";
        echo Html::scriptBlock("\$(document).ready(function() { \$('#content{$rand}').autogrow(); });");
        echo "</td>";
        echo "<input type='hidden' name='{$fkfield}' value='" . $this->fields[$fkfield] . "'>";
        echo "</td></tr>\n";
        echo "<tr class='tab_bg_1'>";
        echo "<td style='width:100px'>" . _n('Task template', 'Task templates', 1) . "</td><td>";
        TaskTemplate::dropdown(array('value' => 0, 'entity' => $this->getEntityID(), 'rand' => $rand_template, 'on_change' => 'tasktemplate_update(this.value)'));
        echo "</td>";
        echo "</tr>";
        echo Html::scriptBlock('
         function tasktemplate_update(value) {
            jQuery.ajax({
               url: "' . $CFG_GLPI["root_doc"] . '/ajax/task.php",
               type: "POST",
               data: {
                  tasktemplates_id: value
               }
            }).done(function(datas) {
               datas.taskcategories_id = isNaN(parseInt(datas.taskcategories_id)) ? 0 : parseInt(datas.taskcategories_id);
               datas.actiontime = isNaN(parseInt(datas.actiontime)) ? 0 : parseInt(datas.actiontime);

               $("#task' . $rand_text . '").html(datas.content);
               $("#dropdown_taskcategories_id' . $rand_type . '").select2("val", parseInt(datas.taskcategories_id));
               $("#dropdown_actiontime' . $rand_time . '").select2("val", parseInt(datas.actiontime));
            });
         }
      ');
        if ($ID > 0) {
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . __('Date') . "</td>";
            echo "<td>";
            Html::showDateTimeField("date", array('value' => $this->fields["date"], 'timestep' => 1, 'maybeempty' => false));
            echo "</tr>";
        } else {
            echo "<tr class='tab_bg_1'>";
            echo "<td colspan='2'>&nbsp;";
            echo "</tr>";
        }
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . __('Category') . "</td><td>";
        TaskCategory::dropdown(array('value' => $this->fields["taskcategories_id"], 'rand' => $rand_type, 'entity' => $item->fields["entities_id"], 'condition' => "`is_active` = '1'"));
        echo "</td></tr>\n";
        if (isset($this->fields["state"])) {
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . __('Status') . "</td><td>";
            Planning::dropdownState("state", $this->fields["state"]);
            echo "</td></tr>\n";
        }
        if ($this->maybePrivate()) {
            echo "<tr class='tab_bg_1'>";
            echo "<td>" . __('Private') . "</td>";
            echo "<td>";
            Dropdown::showYesNo('is_private', $this->fields["is_private"]);
            echo "</td>";
            echo "</tr>";
        }
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . __('Duration') . "</td><td>";
        $toadd = array();
        for ($i = 9; $i <= 100; $i++) {
            $toadd[] = $i * HOUR_TIMESTAMP;
        }
        Dropdown::showTimeStamp("actiontime", array('min' => 0, 'max' => 8 * HOUR_TIMESTAMP, 'value' => $this->fields["actiontime"], 'rand' => $rand_time, 'addfirstminutes' => true, 'inhours' => true, 'toadd' => $toadd));
        echo "</td></tr>\n";
        if ($ID <= 0) {
            Document_Item::showSimpleAddForItem($item);
        }
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . __('By') . "</td>";
        echo "<td colspan='2'>";
        echo Html::image($CFG_GLPI['root_doc'] . "/pics/user.png") . "&nbsp;";
        echo _n('User', 'Users', 1);
        $rand_user = mt_rand();
        $params = array('name' => "users_id_tech", 'value' => $ID > -1 ? $this->fields["users_id_tech"] : Session::getLoginUserID(), 'right' => "own_ticket", 'rand' => $rand_user, 'entity' => $item->fields["entities_id"], 'width' => '');
        $params['toupdate'] = array('value_fieldname' => 'users_id', 'to_update' => "user_available{$rand_user}", 'url' => $CFG_GLPI["root_doc"] . "/ajax/planningcheck.php");
        User::dropdown($params);
        echo " <a href='#' onClick=\"" . Html::jsGetElementbyID('planningcheck' . $rand) . ".dialog('open');\">";
        echo "&nbsp;<img src='" . $CFG_GLPI["root_doc"] . "/pics/reservation-3.png'\n             title=\"" . __s('Availability') . "\" alt=\"" . __s('Availability') . "\"\n             class='calendrier'>";
        echo "</a>";
        Ajax::createIframeModalWindow('planningcheck' . $rand, $CFG_GLPI["root_doc"] . "/front/planning.php?checkavailability=checkavailability" . "&itemtype=" . $item->getType() . "&{$fkfield}=" . $item->getID(), array('title' => __('Availability')));
        echo "<br />";
        echo Html::image($CFG_GLPI['root_doc'] . "/pics/group.png") . "&nbsp;";
        echo _n('Group', 'Groups', 1) . "&nbsp;";
        $rand_group = mt_rand();
        $params = array('name' => "groups_id_tech", 'value' => $ID > -1 ? $this->fields["groups_id_tech"] : Dropdown::EMPTY_VALUE, 'condition' => "is_task", 'rand' => $rand_group, 'entity' => $item->fields["entities_id"]);
        $params['toupdate'] = array('value_fieldname' => 'users_id', 'to_update' => "group_available{$rand_group}", 'url' => $CFG_GLPI["root_doc"] . "/ajax/planningcheck.php");
        Group::dropdown($params);
        echo "</td>\n";
        echo "<td>";
        if ($canplan) {
            echo __('Planning');
        }
        if (!empty($this->fields["begin"])) {
            if (Session::haveRight('planning', Planning::READMY)) {
                echo "<script type='text/javascript' >\n";
                echo "function showPlan" . $ID . $rand_text . "() {\n";
                echo Html::jsHide("plan{$rand_text}");
                $params = array('action' => 'add_event_classic_form', 'form' => 'followups', 'users_id' => $this->fields["users_id_tech"], 'groups_id' => $this->fields["groups_id_tech"], 'id' => $this->fields["id"], 'begin' => $this->fields["begin"], 'end' => $this->fields["end"], 'rand_user' => $rand_user, 'rand_group' => $rand_group, 'entity' => $item->fields["entities_id"], 'itemtype' => $this->getType(), 'items_id' => $this->getID());
                Ajax::updateItemJsCode("viewplan{$rand_text}", $CFG_GLPI["root_doc"] . "/ajax/planning.php", $params);
                echo "}";
                echo "</script>\n";
                echo "<div id='plan{$rand_text}' onClick='showPlan" . $ID . $rand_text . "()'>\n";
                echo "<span class='showplan'>";
            }
            if (isset($this->fields["state"])) {
                echo Planning::getState($this->fields["state"]) . "<br>";
            }
            printf(__('From %1$s to %2$s'), Html::convDateTime($this->fields["begin"]), Html::convDateTime($this->fields["end"]));
            if (isset($this->fields["users_id_tech"]) && $this->fields["users_id_tech"] > 0) {
                echo "<br>" . getUserName($this->fields["users_id_tech"]);
            }
            if (isset($this->fields["groups_id_tech"]) && $this->fields["groups_id_tech"] > 0) {
                echo "<br>" . Dropdown::getDropdownName('glpi_groups', $this->fields["groups_id_tech"]);
            }
            if (Session::haveRight('planning', Planning::READMY)) {
                echo "</span>";
                echo "</div>\n";
                echo "<div id='viewplan{$rand_text}'></div>\n";
            }
        } else {
            if ($canplan) {
                echo "<script type='text/javascript' >\n";
                echo "function showPlanUpdate{$rand_text}() {\n";
                echo Html::jsHide("plan{$rand_text}");
                $params = array('action' => 'add_event_classic_form', 'form' => 'followups', 'entity' => $item->fields['entities_id'], 'rand_user' => $rand_user, 'rand_group' => $rand_group, 'itemtype' => $this->getType(), 'items_id' => $this->getID());
                Ajax::updateItemJsCode("viewplan{$rand_text}", $CFG_GLPI["root_doc"] . "/ajax/planning.php", $params);
                echo "};";
                echo "</script>";
                if ($canplan) {
                    echo "<div id='plan{$rand_text}'  onClick='showPlanUpdate{$rand_text}()'>\n";
                    echo "<span class='vsubmit'>" . __('Plan this task') . "</span>";
                    echo "</div>\n";
                    echo "<div id='viewplan{$rand_text}'></div>\n";
                }
            } else {
                _e('None');
            }
        }
        echo "</td></tr>";
        if (!empty($this->fields["begin"]) && PlanningRecall::isAvailable()) {
            echo "<tr class='tab_bg_1'><td>" . _x('Planning', 'Reminder') . "</td><td class='center'>";
            PlanningRecall::dropdown(array('itemtype' => $this->getType(), 'items_id' => $this->getID()));
            echo "</td><td colspan='2'></td></tr>";
        }
        $this->showFormButtons($options);
        return true;
    }
Ejemplo n.º 10
0
 public function renderWatermarkImageTag()
 {
     if (file_exists(Yii::getPathOfAlias('webroot') . '/uploads/watermark.png')) {
         return Html::image('/uploads/watermark.png?' . time());
     }
 }
Ejemplo n.º 11
0
    } elseif ($data->productLabel['class'] == 'hit') {
        $color = 'purple';
    } else {
        $color = 'blue';
    }
    echo Html::tag('div', array('class' => 'corner-right-' . $color . ' ' . $data->productLabel['class']), '', true);
}
?>

        <?php 
if ($data->mainImage) {
    $imgSource = $data->mainImage->getUrl('270x347');
} else {
    $imgSource = 'http://placehold.it/270x347';
}
echo Html::link(Html::image($imgSource, $data->mainImageTitle, array()), $data->getRelativeUrl(), array('class' => 'product-image'));
?>
        <div class="text-center product-title">
            <?php 
echo Html::link(Html::encode($data->name), $data->getRelativeUrl());
?>
        </div>
        <div class="text-center">
            <span class="price">
                <span><?php 
echo $data->priceRange();
?>
</span>
                <small><?php 
echo Yii::app()->currency->active->symbol;
?>
Ejemplo n.º 12
0
')" title="Mark this content as inaccurate"><?php 
echo Html::image("media/images/button-markas-inaccurate.png");
?>
</a>
            <a href="javascript:listController.MarkContentAsCrossTalk('<?php 
echo $content->id;
?>
')" title="Mark this content as cross talk"><?php 
echo Html::image("media/images/button-markas-crosstalk.png");
?>
</a>
            <a href="<?php 
echo $content->link;
?>
" title="View original content" target="_blank"><?php 
echo Html::image("media/images/button-view-article.png");
?>
</a>
        </div>
        <div class="veracity">
            <p class="<?php 
echo $content->source->id;
?>
">
                <?php 
echo $content->source->score == "null" ? "not rated" : $content->source->score . "&#37;";
?>
            </p>
        </div>
    </div>
?>
            <?php 
foreach ($soal as $row) {
    ?>
                <?php 
    $no++;
    ?>
                <tr>
                    <td><?php 
    echo e($no);
    ?>
</td>
                    <td>
                        <a href="#" class="">
                            <?php 
    echo e(Html::image('uploads/small/' . $row->gambar_kecil, '', ['class' => 'img-responsive', 'style' => 'width:100px;']));
    ?>

                        </a>
                    </td>
                    <td><?php 
    echo e($row->kunci_jawaban);
    ?>
</td>
                    <td></td>
                    <td></td>
                </tr>
            <?php 
}
?>
        </tbody>
Ejemplo n.º 14
0
 /**
  * @since version 0.90
  *
  * @param $rand
  **/
 function showTimeline($rand)
 {
     global $CFG_GLPI, $DB, $autolink_options;
     //get ticket actors
     $ticket_users_keys = $this->getTicketActors();
     $user = new User();
     $group = new Group();
     $followup_obj = new TicketFollowup();
     $pics_url = $CFG_GLPI['root_doc'] . "/pics/timeline";
     $timeline = $this->getTimelineItems();
     $autolink_options['strip_protocols'] = false;
     //display timeline
     echo "<div class='timeline_history'>";
     $tmp = array_values($timeline);
     $first_item = array_shift($tmp);
     // show approbation form on top when ticket is solved
     if ($this->fields["status"] == CommonITILObject::SOLVED) {
         echo "<div class='approbation_form' id='approbation_form{$rand}'>";
         $followup_obj->showApprobationForm($this);
         echo "</div>";
     }
     // show title for timeline
     self::showTimelineHeader();
     $timeline_index = 0;
     foreach ($timeline as $item) {
         $options = array('parent' => $this, 'rand' => $rand);
         if ($obj = getItemForItemtype($item['type'])) {
             $obj->fields = $item['item'];
         } else {
             $obj = $item;
         }
         Plugin::doHook('pre_show_item', array('item' => &$obj, 'options' => &$options));
         if (is_array($obj)) {
             $item_i = $obj['item'];
         } else {
             $item_i = $obj->fields;
         }
         $date = "";
         if (isset($item_i['date'])) {
             $date = $item_i['date'];
         }
         if (isset($item_i['date_mod'])) {
             $date = $item_i['date_mod'];
         }
         // check if curent item user is assignee or requester
         $user_position = 'left';
         if (isset($ticket_users_keys[$item_i['users_id']]) && $ticket_users_keys[$item_i['users_id']] == CommonItilActor::ASSIGN || $item['type'] == 'Assign') {
             $user_position = 'right';
         }
         //display solution in middle
         if ($timeline_index == 0 && $item['type'] == "Solution" && $this->fields["status"] == CommonITILObject::SOLVED) {
             $user_position .= ' middle';
         }
         echo "<div class='h_item {$user_position}'>";
         echo "<div class='h_info'>";
         echo "<div class='h_date'>" . Html::convDateTime($date) . "</div>";
         if ($item_i['users_id'] !== false) {
             echo "<div class='h_user'>";
             if (isset($item_i['users_id']) && $item_i['users_id'] != 0) {
                 $user->getFromDB($item_i['users_id']);
                 echo "<div class='tooltip_picture_border'>";
                 echo "<img class='user_picture' alt=\"" . __s('Picture') . "\" src='" . User::getThumbnailURLForPicture($user->fields['picture']) . "'>";
                 echo "</div>";
                 echo "<span class='h_user_name'>";
                 $userdata = getUserName($item_i['users_id'], 2);
                 echo $user->getLink() . "&nbsp;";
                 echo Html::showToolTip($userdata["comment"], array('link' => $userdata['link']));
                 echo "</span>";
             } else {
                 _e("Requester");
             }
             echo "</div>";
             // h_user
         }
         echo "</div>";
         //h_date
         echo "<div class='h_content " . $item['type'] . (isset($item_i['status']) ? " " . $item_i['status'] : "") . "'" . "id='viewitem" . $item['type'] . $item_i['id'] . $rand . "'>";
         if (isset($item_i['can_edit']) && $item_i['can_edit']) {
             echo "<div class='edit_item_content'></div>";
             echo "<span class='cancel_edit_item_content'></span>";
         }
         echo "<div class='displayed_content'>";
         if (!in_array($item['type'], array('Document_Item', 'Assign')) && $item_i['can_edit']) {
             echo "<span class='edit_item' ";
             echo "onclick='javascript:viewEditSubitem" . $this->fields['id'] . "{$rand}(event, \"" . $item['type'] . "\", " . $item_i['id'] . ", this, \"viewitem" . $item['type'] . $item_i['id'] . $rand . "\")'";
             echo "></span>";
         }
         if (isset($item_i['requesttypes_id']) && file_exists("{$pics_url}/" . $item_i['requesttypes_id'] . ".png")) {
             echo "<img src='{$pics_url}/" . $item_i['requesttypes_id'] . ".png' title='' class='h_requesttype' />";
         }
         if (isset($item_i['content'])) {
             $content = $item_i['content'];
             $content = autolink($content, 40);
             //$content = nl2br($content);
             $long_text = "";
             if (substr_count($content, "<br") > 30 || strlen($content) > 2000) {
                 $long_text = "long_text";
             }
             echo "<div class='item_content {$long_text}'>";
             echo "<p>";
             if (isset($item_i['state'])) {
                 $onClick = "onclick='change_task_state(" . $item_i['id'] . ", this)'";
                 if (!$item_i['can_edit']) {
                     $onClick = "style='cursor: not-allowed;'";
                 }
                 echo "<span class='state state_" . $item_i['state'] . "'\n                           {$onClick}\n                           title='" . Planning::getState($item_i['state']) . "'>";
                 echo "</span>";
             }
             echo $content;
             echo "</p>";
             if (!empty($long_text)) {
                 echo "<p class='read_more'>";
                 echo "<a class='read_more_button'>.....</a>";
                 echo "</p>";
             }
             echo "</div>";
         }
         echo "<div class='b_right'>";
         if (isset($item_i['solutiontypes_id']) && !empty($item_i['solutiontypes_id'])) {
             echo Dropdown::getDropdownName("glpi_solutiontypes", $item_i['solutiontypes_id']) . "<br>";
         }
         if (isset($item_i['taskcategories_id']) && !empty($item_i['taskcategories_id'])) {
             echo Dropdown::getDropdownName("glpi_taskcategories", $item_i['taskcategories_id']) . "<br>";
         }
         if (isset($item_i['requesttypes_id']) && !empty($item_i['requesttypes_id'])) {
             echo Dropdown::getDropdownName("glpi_requesttypes", $item_i['requesttypes_id']) . "<br>";
         }
         if (isset($item_i['actiontime']) && !empty($item_i['actiontime'])) {
             echo "<span class='actiontime'>";
             echo Html::timestampToString($item_i['actiontime'], false);
             echo "</span>";
         }
         if (isset($item_i['begin'])) {
             echo "<span class='planification'>";
             echo Html::convDateTime($item_i["begin"]);
             echo " &rArr; ";
             echo Html::convDateTime($item_i["end"]);
             echo "</span>";
         }
         if (isset($item_i['users_id_tech']) && $item_i['users_id_tech'] > 0) {
             echo "<div class='users_id_tech' id='users_id_tech_" . $item_i['users_id_tech'] . "'>";
             $user->getFromDB($item_i['users_id_tech']);
             echo Html::image($CFG_GLPI['root_doc'] . "/pics/user.png") . "&nbsp;";
             $userdata = getUserName($item_i['users_id_tech'], 2);
             echo $user->getLink() . "&nbsp;";
             echo Html::showToolTip($userdata["comment"], array('link' => $userdata['link']));
             echo "</div>";
         }
         if (isset($item_i['groups_id_tech']) && $item_i['groups_id_tech'] > 0) {
             echo "<div class='groups_id_tech'>";
             $group->getFromDB($item_i['groups_id_tech']);
             echo Html::image($CFG_GLPI['root_doc'] . "/pics/group.png") . "&nbsp;";
             echo $group->getLink() . "&nbsp;";
             echo Html::showToolTip($group->getComments(), array('link' => $group->getLinkURL()));
             echo "</div>";
         }
         // show "is_private" icon
         if (isset($item_i['is_private']) && $item_i['is_private']) {
             echo "<div class='private'>" . __('Private') . "</div>";
         }
         echo "</div>";
         // b_right
         if ($item['type'] == 'Document_Item') {
             $filename = $item_i['filename'];
             $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
             echo "<img src='";
             if (empty($filename)) {
                 $filename = $item_i['name'];
             }
             if (file_exists(GLPI_ROOT . "/pics/icones/{$ext}-dist.png")) {
                 echo $CFG_GLPI['root_doc'] . "/pics/icones/{$ext}-dist.png";
             } else {
                 echo "{$pics_url}/file.png";
             }
             echo "' title='file' />&nbsp;";
             echo "<a href='" . $CFG_GLPI['root_doc'] . "/front/document.send.php?docid=" . $item_i['id'] . "&tickets_id=" . $this->getID() . "' target='_blank'>{$filename}";
             if (in_array($ext, array('jpg', 'jpeg', 'png', 'bmp'))) {
                 echo "<div class='timeline_img_preview'>";
                 echo "<img src='" . $CFG_GLPI['root_doc'] . "/front/document.send.php?docid=" . $item_i['id'] . "&tickets_id=" . $this->getID() . "'/>";
                 echo "</div>";
             }
             echo "</a>";
             if (!empty($item_i['mime'])) {
                 echo "&nbsp;(" . $item_i['mime'] . ")";
             }
             echo "<a href='" . $CFG_GLPI['root_doc'] . "/front/document.form.php?id=" . $item_i['id'] . "' class='edit_document' title='" . _sx("button", "Update") . "'>";
             echo "<img src='{$pics_url}/edit.png' /></a>";
             echo "<a href='" . $CFG_GLPI['root_doc'] . "/front/ticket.form.php?delete_document&documents_id=" . $item_i['id'] . "&tickets_id=" . $this->getID() . "' class='delete_document' title='" . _sx("button", "Delete permanently") . "'>";
             echo "<img src='{$pics_url}/delete.png' /></a>";
         }
         echo "</div>";
         // displayed_content
         echo "</div>";
         //end h_content
         echo "</div>";
         //end  h_info
         $timeline_index++;
         Plugin::doHook('post_show_item', array('item' => $obj, 'options' => $options));
     }
     // end foreach timeline
     echo "<div class='break'></div>";
     // recall ticket content (not needed in classic and splitted layout)
     if (!CommonGLPI::isLayoutWithMain()) {
         echo "<div class='h_item middle'>";
         echo "<div class='h_info'>";
         echo "<div class='h_date'>" . Html::convDateTime($this->fields['date']) . "</div>";
         echo "<div class='h_user'>";
         $dem = '0';
         foreach ($DB->request("glpi_tickets_users", "`tickets_id` = " . $this->fields['id'] . " AND `type` = 1") as $req) {
             $dem = $req['users_id'];
         }
         if ((!isset($item_i['users_id_recipient']) || $item_i['users_id_recipient'] == 0) && $dem == 0) {
             _e("Requester");
         } else {
             if (isset($item_i['users_id_recipient']) && $item_i['users_id_recipient'] != 0) {
                 $user->getFromDB($this->fields['users_id_recipient']);
             } else {
                 if ($dem > 0) {
                     $requester = new User();
                     if ($requester->getFromDB($dem)) {
                         $user = $requester;
                     }
                 }
             }
             echo "<div class='tooltip_picture_border'>";
             $picture = "";
             if (isset($user->fields['picture'])) {
                 $picture = $user->fields['picture'];
             }
             echo "<img class='user_picture' alt=\"" . __s('Picture') . "\" src='" . User::getThumbnailURLForPicture($picture) . "'>";
             echo "</div>";
             echo $user->getLink();
         }
         echo "</div>";
         // h_user
         echo "</div>";
         //h_info
         echo "<div class='h_content TicketContent'>";
         echo "<div class='b_right'>" . __("Ticket recall") . "</div>";
         echo "<div class='ticket_title'>";
         echo html_entity_decode($this->fields['name']);
         echo "</div>";
         echo "<div class='ticket_description'>";
         echo $this->setSimpleTextContent($this->fields['content']);
         echo "</div>";
         echo "</div>";
         // h_content TicketContent
         echo "</div>";
         // h_item middle
         echo "<div class='break'></div>";
     }
     // end timeline
     echo "</div>";
     // h_item $user_position
     echo "<script type='text/javascript'>read_more();</script>";
 }
Ejemplo n.º 15
0
 /**
  * Print a nice HTML head for every page
  *
  * @param $title     title of the page
  * @param $url       not used anymore (default '')
  * @param $sector    sector in which the page displayed is (default 'none')
  * @param $item      item corresponding to the page displayed (default 'none')
  * @param $option    option corresponding to the page displayed (default '')
  **/
 static function header($title, $url = '', $sector = "none", $item = "none", $option = "")
 {
     global $CFG_GLPI, $PLUGIN_HOOKS, $HEADER_LOADED, $DB;
     // If in modal : display popHeader
     if (isset($_REQUEST['_in_modal']) && $_REQUEST['_in_modal']) {
         return self::popHeader($title, $url);
     }
     // Print a nice HTML-head for every page
     if ($HEADER_LOADED) {
         return;
     }
     $HEADER_LOADED = true;
     // Force lower case for sector and item
     $sector = strtolower($sector);
     $item = strtolower($item);
     self::includeHeader($title);
     $body_class = "layout_" . $_SESSION['glpilayout'];
     if (strpos($_SERVER['REQUEST_URI'], "form.php") !== false && isset($_GET['id']) && $_GET['id'] > 0) {
         if (!CommonGLPI::isLayoutExcludedPage()) {
             $body_class .= " form";
         } else {
             $body_class = "";
         }
     }
     // Body
     echo "<body class='{$body_class}'>";
     // Generate array for menu and check right
     if (!isset($_SESSION['glpimenu']) || !is_array($_SESSION['glpimenu']) || count($_SESSION['glpimenu']) == 0) {
         // INVENTORY
         //don't change order in array
         $showallassets = false;
         $menu = self::getMenuInfos();
         // Permit to plugins to add entry to others sector !
         if (isset($PLUGIN_HOOKS["menu_toadd"]) && count($PLUGIN_HOOKS["menu_toadd"])) {
             foreach ($PLUGIN_HOOKS["menu_toadd"] as $plugin => $items) {
                 if (count($items)) {
                     foreach ($items as $key => $val) {
                         if (isset($menu[$key])) {
                             $menu[$key]['types'][] = $val;
                         }
                     }
                 }
             }
         }
         foreach ($menu as $category => $datas) {
             if (isset($datas['types']) && count($datas['types'])) {
                 foreach ($datas['types'] as $type) {
                     if ($data = $type::getMenuContent()) {
                         // Multi menu entries management
                         if (isset($data['is_multi_entries']) && $data['is_multi_entries']) {
                             if (!isset($menu[$category]['content'])) {
                                 $menu[$category]['content'] = array();
                             }
                             $menu[$category]['content'] += $data;
                         } else {
                             $menu[$category]['content'][strtolower($type)] = $data;
                         }
                     }
                 }
             }
             // Define default link :
             if (isset($menu[$category]['content']) && count($menu[$category]['content'])) {
                 foreach ($menu[$category]['content'] as $val) {
                     if (isset($val['page'])) {
                         $menu[$category]['default'] = $val['page'];
                         break;
                     }
                 }
             }
         }
         $allassets = array('Computer', 'Monitor', 'Peripheral', 'NetworkEquipment', 'Phone', 'Printer');
         foreach ($allassets as $type) {
             if (isset($menu['assets']['content'][strtolower($type)])) {
                 $menu['assets']['content']['allassets']['title'] = __('Global');
                 $menu['assets']['content']['allassets']['shortcut'] = '';
                 $menu['assets']['content']['allassets']['page'] = '/front/allassets.php';
                 $menu['assets']['content']['allassets']['links']['search'] = '/front/allassets.php';
                 break;
             }
         }
         //  PLUGINS
         //          if (isset($PLUGIN_HOOKS["menu_entry"]) && count($PLUGIN_HOOKS["menu_entry"])) {
         //             $plugins = array();
         //
         //             foreach  ($PLUGIN_HOOKS["menu_entry"] as $plugin => $active) {
         //                if ($active) { // true or a string
         //                   $plugins[$plugin] = Plugin::getInfo($plugin);
         //                }
         //             }
         //
         //             if (count($plugins)) {
         //                $list = array();
         //
         //                foreach ($plugins as $key => $val) {
         //                   $list[$key] = $val["name"];
         //                }
         //                asort($list);
         //
         //                foreach ($list as $key => $val) {
         //                   $menu['plugins']['content'][$key]['title'] = $val;
         //                   $menu['plugins']['content'][$key]['page']  = '/plugins/'.$key.'/';
         //
         //                   if (is_string($PLUGIN_HOOKS["menu_entry"][$key])) {
         //                      $menu['plugins']['content'][$key]['page'] .= $PLUGIN_HOOKS["menu_entry"][$key];
         //                   }
         //
         //                   // Set default link for plugins
         //                   if (!isset($menu['plugins']['default'])) {
         //                      $menu['plugins']['default'] = $menu['plugins']['content'][$key]['page'];
         //                   }
         //
         //                   if (($sector == "plugins")
         //                      && ($item == $key)) {
         //
         //                      if (isset($PLUGIN_HOOKS["submenu_entry"][$key])
         //                         && is_array($PLUGIN_HOOKS["submenu_entry"][$key])) {
         //
         //                         foreach ($PLUGIN_HOOKS["submenu_entry"][$key] as $name => $link) {
         //                            // New complete option management
         //                            if ($name == "options") {
         //                               $menu['plugins']['content'][$key]['options'] = $link;
         //                            } else { // Keep it for compatibility
         //
         //                               if (is_array($link)) {
         //                                  // Simple link option
         //                                  if (isset($link[$option])) {
         //                                     $menu['plugins']['content'][$key]['links'][$name]
         //                                                    ='/plugins/'.$key.'/'.$link[$option];
         //                                  }
         //                               } else {
         //                                  $menu['plugins']['content'][$key]['links'][$name]
         //                                                    ='/plugins/'.$key.'/'.$link;
         //                               }
         //                            }
         //                         }
         //                      }
         //                   }
         //                }
         //             }
         //          }
         $_SESSION['glpimenu'] = $menu;
         //          echo 'menu load';
     } else {
         $menu = $_SESSION['glpimenu'];
     }
     $already_used_shortcut = array('1');
     echo "<div id='header'>";
     echo "<div id='header_top'>";
     echo "<div id='c_logo'>";
     echo Html::link('', $CFG_GLPI["root_doc"] . "/front/central.php", array('accesskey' => '1', 'title' => __('Home')));
     echo "</div>";
     /// Prefs / Logout link
     echo "<div id='c_preference' >";
     echo "<ul>";
     echo "<li id='deconnexion'>";
     echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/logout.php";
     /// logout witout noAuto login for extauth
     if (isset($_SESSION['glpiextauth']) && $_SESSION['glpiextauth']) {
         echo "?noAUTO=1";
     }
     echo "' title=\"" . __s('Logout') . "\">";
     echo "<span id='logout_icon' title=\"" . __s('Logout') . "\"  alt=\"" . __s('Logout') . "\" class='button-icon' />";
     echo "</a>";
     echo "</li>\n";
     echo "<li id='preferences_link'><a href='" . $CFG_GLPI["root_doc"] . "/front/preference.php' title=\"" . __s('My settings') . "\">";
     echo "<span id='preferences_icon' title=\"" . __s('My settings') . "\"  alt=\"" . __s('My settings') . "\" class='button-icon' /></span>";
     // check user id : header used for display messages when session logout
     if (Session::getLoginUserID()) {
         echo "<span id='myname'>";
         echo formatUserName(0, $_SESSION["glpiname"], $_SESSION["glpirealname"], $_SESSION["glpifirstname"], 0, 20);
         echo "</span>";
     }
     echo "</a></li>";
     /// Bookmark load
     echo "<li id='bookmark_link'>";
     Ajax::createIframeModalWindow('loadbookmark', $CFG_GLPI["root_doc"] . "/front/bookmark.php?action=load", array('title' => __('Load a bookmark'), 'reloadonclose' => true));
     echo "<a href='#' onClick=\"" . Html::jsGetElementbyID('loadbookmark') . ".dialog('open');\">";
     echo "<span id='bookmark_icon' title=\"" . __s('Load a bookmark') . "\"  alt=\"" . __s('Load a bookmark') . "\" class='button-icon' />";
     echo "</a></li>";
     echo "<li id='help_link'><a href='" . (empty($CFG_GLPI["central_doc_url"]) ? "http://glpi-project.org/help-central" : $CFG_GLPI["central_doc_url"]) . "' target='_blank' title=\"" . __s('Help') . "\">" . "<span id='help_icon' title=\"" . __s('Help') . "\"  alt=\"" . __s('Help') . "\" class='button-icon' />";
     "</a></li>";
     echo "<li id='language_link'><a href='" . $CFG_GLPI["root_doc"] . "/front/preference.php?forcetab=User\$1' title=\"" . addslashes(Dropdown::getLanguageName($_SESSION['glpilanguage'])) . "\">" . Dropdown::getLanguageName($_SESSION['glpilanguage']) . "</a></li>";
     /// Search engine
     echo "<li id='c_recherche'>\n";
     if ($CFG_GLPI['allow_search_global']) {
         echo "<form method='get' action='" . $CFG_GLPI["root_doc"] . "/front/search.php'>\n";
         echo "<span id='champRecherche'><input size='15' type='text' name='globalsearch'\n                                         placeholder='" . __s('Search') . "'>";
         echo "</span>";
         Html::closeForm();
     }
     echo "</li>";
     echo "</ul>";
     echo "</div>\n";
     echo "</div>";
     ///Main menu
     echo "<div id='c_menu'>";
     echo "<ul id='menu'>";
     // Get object-variables and build the navigation-elements
     $i = 1;
     foreach ($menu as $part => $data) {
         if (isset($data['content']) && count($data['content'])) {
             $menu_class = "";
             if (isset($menu[$sector]) && $menu[$sector]['title'] == $data['title']) {
                 $menu_class = "active";
             }
             echo "<li id='menu{$i}' class='{$menu_class}' onmouseover=\"javascript:menuAff('menu{$i}','menu');\" >";
             $link = "#";
             if (isset($data['default']) && !empty($data['default'])) {
                 $link = $CFG_GLPI["root_doc"] . $data['default'];
             }
             if (Toolbox::strlen($data['title']) > 14) {
                 $data['title'] = Toolbox::substr($data['title'], 0, 14) . "...";
             }
             echo "<a href='{$link}' class='itemP'>" . $data['title'] . "</a>";
             echo "<ul class='ssmenu'>";
             // list menu item
             foreach ($data['content'] as $key => $val) {
                 $menu_class = "";
                 $tmp_active_item = explode("/", $item);
                 $active_item = array_pop($tmp_active_item);
                 if (isset($menu[$sector]['content']) && isset($menu[$sector]['content'][$active_item]) && isset($val['title']) && $menu[$sector]['content'][$active_item]['title'] == $val['title']) {
                     $menu_class = "active";
                 }
                 if (isset($val['page']) && isset($val['title'])) {
                     echo "<li class='{$menu_class}'><a href='" . $CFG_GLPI["root_doc"] . $val['page'] . "'";
                     if (isset($val['shortcut']) && !empty($val['shortcut'])) {
                         if (!isset($already_used_shortcut[$val['shortcut']])) {
                             echo " accesskey='" . $val['shortcut'] . "'";
                             $already_used_shortcut[$val['shortcut']] = $val['shortcut'];
                         }
                         echo ">" . Toolbox::shortcut($val['title'], $val['shortcut']) . "</a></li>\n";
                     } else {
                         echo ">" . $val['title'] . "</a></li>\n";
                     }
                 }
             }
             echo "</ul></li>";
             $i++;
         }
     }
     echo "</ul>";
     // #menu
     // Display MENU ALL
     echo "<div id='show_all_menu' class='invisible'>";
     $items_per_columns = 15;
     $i = -1;
     foreach ($menu as $part => $data) {
         if (isset($data['content']) && count($data['content'])) {
             echo "<table class='all_menu_block'>";
             $link = "#";
             if (isset($data['default']) && !empty($data['default'])) {
                 $link = $CFG_GLPI["root_doc"] . $data['default'];
             }
             echo "<tr><td class='tab_bg_1 b'>";
             echo "<a href='{$link}' title=\"" . $data['title'] . "\" class='itemP'>" . $data['title'] . "</a>";
             echo "</td></tr>";
             $i++;
             // list menu item
             foreach ($data['content'] as $key => $val) {
                 /*if ($i > $items_per_columns) {
                      $i = 0;
                      echo "</table></td><td class='top'><table>";
                   }*/
                 if (isset($val['page']) && isset($val['title'])) {
                     echo "<tr><td><a href='" . $CFG_GLPI["root_doc"] . $val['page'] . "'";
                     if (isset($data['shortcut']) && !empty($data['shortcut'])) {
                         echo " accesskey='" . $val['shortcut'] . "'";
                     }
                     echo ">" . $val['title'] . "</a></td></tr>\n";
                     $i++;
                 }
             }
             echo "</table>";
         }
     }
     echo "</div>";
     Html::scriptStart();
     echo self::jsGetElementbyID('show_all_menu') . ".dialog({\n         height: 'auto',\n         width: 'auto',\n         modal: true,\n         autoOpen: false\n         });";
     echo Html::scriptEnd();
     /// MENU ALL
     echo "<a href='#' onClick=\"" . self::jsGetElementbyID('show_all_menu') . ".dialog('open');\"\n            id='menu_all_button' class='button-icon'>";
     echo "</a>";
     echo "</div>";
     // End navigation bar
     // End headline
     //  Le fil d ariane
     echo "<div id='c_ssmenu2' >";
     echo "<ul>";
     // Display item
     echo "<li class='breadcrumb_item'><a href='" . $CFG_GLPI["root_doc"] . "/front/central.php' title=\"" . __s('Home') . "\">" . __('Home') . "</a></li>";
     if (isset($menu[$sector])) {
         $link = "/front/central.php";
         if (isset($menu[$sector]['default'])) {
             $link = $menu[$sector]['default'];
         }
         echo "<li class='breadcrumb_item'><a href='" . $CFG_GLPI["root_doc"] . $link . "' title=\"" . $menu[$sector]['title'] . "\">" . $menu[$sector]['title'] . "</a></li>";
     }
     if (isset($menu[$sector]['content'][$item])) {
         // Title
         $with_option = false;
         if (!empty($option) && isset($menu[$sector]['content'][$item]['options'][$option]['title']) && isset($menu[$sector]['content'][$item]['options'][$option]['page'])) {
             $with_option = true;
         }
         if (isset($menu[$sector]['content'][$item]['page'])) {
             echo "<li class='breadcrumb_item'><a href='" . $CFG_GLPI["root_doc"] . $menu[$sector]['content'][$item]['page'] . "' " . ($with_option ? "" : "class='here'") . " title=\"" . $menu[$sector]['content'][$item]['title'] . "\" >" . $menu[$sector]['content'][$item]['title'] . "</a>" . "</li>";
         }
         if ($with_option) {
             echo "<li class='breadcrumb_item'><a href='" . $CFG_GLPI["root_doc"] . $menu[$sector]['content'][$item]['options'][$option]['page'] . "' class='here' title=\"" . $menu[$sector]['content'][$item]['options'][$option]['title'] . "\" >";
             echo self::resume_name($menu[$sector]['content'][$item]['options'][$option]['title'], 17);
             echo "</a></li>";
         }
         $links = array();
         // Item with Option case
         if (!empty($option) && isset($menu[$sector]['content'][$item]['options'][$option]['links']) && is_array($menu[$sector]['content'][$item]['options'][$option]['links'])) {
             $links = $menu[$sector]['content'][$item]['options'][$option]['links'];
             // Without option case : only item links
         } else {
             if (isset($menu[$sector]['content'][$item]['links']) && is_array($menu[$sector]['content'][$item]['links'])) {
                 $links = $menu[$sector]['content'][$item]['links'];
             }
         }
         // Add item
         echo "<li class='icons_block'>";
         echo "<span>";
         if (isset($links['add'])) {
             echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_add.png", array('alt' => __('Add'), 'url' => $CFG_GLPI["root_doc"] . $links['add']));
         } else {
             echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_add_off.png", array('alt' => __('Add')));
         }
         echo "</span>";
         // Search Item
         echo "<span>";
         if (isset($links['search'])) {
             echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_search.png", array('alt' => __('Search'), 'url' => $CFG_GLPI["root_doc"] . $links['search']));
         } else {
             echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_search_off.png", array('alt' => __('Search')));
         }
         echo "</span>";
         // Links
         if (count($links) > 0) {
             foreach ($links as $key => $val) {
                 switch ($key) {
                     case "add":
                     case "search":
                         break;
                     case "template":
                         echo "<span>";
                         echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_addtemplate.png", array('alt' => __('Manage templates...'), 'url' => $CFG_GLPI["root_doc"] . $val));
                         echo "</span>";
                         break;
                     case "showall":
                         echo "<span>";
                         echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_showall.png", array('alt' => __('Show all'), 'url' => $CFG_GLPI["root_doc"] . $val));
                         echo "</span>";
                         break;
                     case "summary":
                         echo "<span>";
                         echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_show.png", array('alt' => __('Summary'), 'url' => $CFG_GLPI["root_doc"] . $val));
                         echo "</span>";
                         break;
                     case "config":
                         echo "<span>";
                         echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_config.png", array('alt' => __('Setup'), 'url' => $CFG_GLPI["root_doc"] . $val));
                         echo "</span>";
                         break;
                     default:
                         echo "<span>" . Html::link($key, $CFG_GLPI["root_doc"] . $val) . "</span>";
                         break;
                 }
             }
         }
         echo "</li>";
     } else {
         echo "<li>&nbsp;</li>";
     }
     // Add common items
     // Profile selector
     // check user id : header used for display messages when session logout
     if (Session::getLoginUserID()) {
         self::showProfileSelecter($CFG_GLPI["root_doc"] . "/front/central.php");
     }
     echo "</ul>";
     echo "</div>";
     echo "</div>\n";
     // fin header
     echo "<div id='page' >";
     if ($DB->isSlave() && !$DB->first_connection) {
         echo "<div id='dbslave-float'>";
         echo "<a href='#see_debug'>" . __('MySQL replica: read only') . "</a>";
         echo "</div>";
     }
     // Back to top
     Html::scriptStart();
     echo "\$(document).ready(function(){\n               BackToTop({\n               text : '^',\n               class: 'vsubmit',\n               autoShow : true,\n               timeEffect : 100,\n               autoShowOffset : '0',\n               appearMethod : '',\n               effectScroll : 'linear'\n               });\n            });";
     echo Html::scriptEnd();
     // call static function callcron() every 5min
     CronTask::callCron();
     self::displayMessageAfterRedirect();
 }
Ejemplo n.º 16
0
			format: "YYYY-MM-DD"
		}));

		$('#fechaRetiroTerceroInformacion').datetimepicker(({
			format: "YYYY-MM-DD"
		}));

		
		$('#imagenTercero').fileinput({
			language: 'es',
			uploadUrl: '#',
			allowedFileExtensions : ['jpg', 'png','gif'],
			 initialPreview: [
			 '<?php 
if (isset($tercero->imagenTercero)) {
    echo Html::image("imagenes/" . $tercero->imagenTercero, "Imagen no encontrada", array("style" => "width:148px;height:158px;"));
}
?>
'
            ],
			dropZoneTitle: 'Seleccione su foto',
			removeLabel: '',
			uploadLabel: '',
			browseLabel: '',
			uploadClass: "",
			uploadLabel: "",
			uploadIcon: "",
		});

	//--------------------------------- DROPZONE ---------------------------------------
	var baseUrl = "{{ url("/") }}";
Ejemplo n.º 17
0
 /**
  * Display a single oberver selector
  *
  *  * @param $options array options for default values ($options of showActorAddFormOnCreate)
  **/
 static function showFormHelpdeskObserver($options = array())
 {
     global $CFG_GLPI;
     //default values
     $ticket = new Ticket();
     $params['_users_id_observer_notif']['use_notification'] = true;
     $params['_users_id_observer'] = 0;
     $params['entities_id'] = $_SESSION["glpiactive_entity"];
     $values['_right'] = "groups";
     // overide default value by function parameters
     if (is_array($options) && count($options)) {
         foreach ($options as $key => $val) {
             $params[$key] = $val;
         }
     }
     // add a user selector
     $rand_observer = $ticket->showActorAddFormOnCreate(CommonITILActor::OBSERVER, $params);
     // add an additionnal observer on user selection
     Ajax::updateItemOnSelectEvent("dropdown__users_id_observer[]{$rand_observer}", "observer_{$rand_observer}", $CFG_GLPI["root_doc"] . "/ajax/helpdesk_observer.php", $params);
     //remove 'new observer' anchor on user selection
     echo Html::scriptBlock("\n      \$('#dropdown__users_id_observer__{$rand_observer}').on('change', function(event) {\n         \$('#addObserver{$rand_observer}').remove();\n      });");
     // add "new observer" anchor
     echo "<a id='addObserver{$rand_observer}' class='add-observer' onclick='this.remove()'>";
     echo Html::image($CFG_GLPI['root_doc'] . "/pics/meta_plus.png", array('alt' => __('Add')));
     echo "</a>";
     // add an additionnal observer on anchor click
     Ajax::updateItemOnEvent("addObserver{$rand_observer}", "observer_{$rand_observer}", $CFG_GLPI["root_doc"] . "/ajax/helpdesk_observer.php", $params, array('click'));
     // div for an additionnal observer
     echo "<div class='actor_single' id='observer_{$rand_observer}'></div>";
 }
    echo e($k->kd_kelas);
    ?>
</option>
                    <?php 
}
?>
                </select>
            </div>
        </div>
    </div>
    <hr>

    <div id="loading" style="display:none;">
        <div class="alert alert-info">
            <?php 
echo e(Html::image('assets/img/loading.gif', '', array('style' => 'width:80px;')));
?>
 Loading....
        </div>
    </div>

    <div id="tampil"></div>
<?php 
$__env->stopSection();
?>

<?php 
$__env->startSection('footer');
?>
    <script>
        $(function(){
Ejemplo n.º 19
0
<center>
<?php 
foreach ($avatars as $ava) {
    //print_r($ava);
    ?>
    <?php 
    echo Html::link(Html::image("/uploads/users/avatars/" . $collection . "/" . $ava), '/uploads/users/avatars/' . $collection . '/' . $ava, array('class' => 'avatar'));
    ?>

<?php 
}
?>
</center>

<input type="hidden" id="selected_avatar" name="img" />
<script>
   $(function(){
      $('.avatar img').click(function(){
          var url = $(this).parent().attr('href');
          $('.avatar img').css({'outline':'none'});
          $(this).css({'outline':'1px solid red'});
          $('#selected_avatar').val(url);
          return false;
      });
   });
</script>
Ejemplo n.º 20
0
<li class="dropdown"><a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
        <?php 
echo Html::image('/uploads/language/' . $language->active->flag_name);
?>
        <?php 
echo $language->active->name;
?>
 <span class="caret"></span></a>
    <ul class="dropdown-menu" role="menu">
        <?php 
foreach ($language->getLanguages() as $lang) {
    $classLi = $lang->code == Yii::app()->language ? $lang->code . ' active' : $lang->code;
    $link = $lang->default ? CMS::currentUrl() : '/' . $lang->code . CMS::currentUrl();
    //Html::link(Html::image('/images/language/' . $lang->flag_name, $lang->name), $link, array('title' => $lang->name));
    ?>
            <li>
                <?php 
    echo Html::link(Html::image('/uploads/language/' . $lang->flag_name, $lang->name) . ' ' . $lang->name, $link);
    ?>
            </li>
        <?php 
}
?>
    </ul>
</li>
Ejemplo n.º 21
0
                                    </a>
                                <?php 
            } else {
                ?>
                                    <a href="javascript:listController.SelectFacet('<?php 
                echo $group["key"];
                ?>
', '<?php 
                echo $facet["id"];
                ?>
');" title="Select <?php 
                echo $facet['name'];
                ?>
">
                                        <?php 
                echo Html::image("media/images/button-activate.png", array());
                ?>
                                        <?php 
                echo strlen($facet["name"]) > $maxNameLength ? substr($facet["name"], 0, $maxNameLength) . " ..." : $facet["name"];
                ?>
                                        <?php 
                echo "(" . $facet["count"] . ")";
                ?>
                                    </a>
                                <?php 
            }
            ?>
                            </li>
                        <?php 
        }
        ?>
<legend>Soal No. <?php 
echo e($soal->soal_ke);
?>
</legend>
	<a class="single_image" href="<?php 
echo e(URL::asset('uploads/big/' . $soal->detail->gambar_besar));
?>
">
		<?php 
echo e(Html::image('uploads/small/' . $soal->detail->gambar_kecil, '', array('class' => 'img-responsive', 'style' => ' max-height:350px;')));
?>

	</a>

	<hr>

	<div class="form-group">
		<label for="">Jawaban Anda</label>
		<select name="jawaban" id="jawaban" class="form-control">
			<option value="">--Pilih Jawaban--</option>
			<option value="a" <?php 
if ($soal->jawaban == 'a') {
    ?>
 selected='selected' <?php 
}
?>
>A</option>
			<option value="b" <?php 
if ($soal->jawaban == 'b') {
    ?>
 selected='selected' <?php 
Ejemplo n.º 23
0
</th>
    </tr>
    <?php 
foreach ($model->getOrderedProducts()->getData() as $product) {
    //$model->getOrderedProducts()->getData()
    ?>
 
        <tr>
            <td align="center">
                <?php 
    if ($product->prd->mainImage) {
        $imgSource = $product->prd->mainImage->getUrl($config['img_view_thumbs_size']);
    } else {
        $imgSource = 'http://placehold.it/' . $config['img_view_thumbs_size'];
    }
    echo Html::link(Html::image($imgSource, $product->prd->mainImageTitle), array('product/view', 'seo_alias' => $product->prd->seo_alias), array('class' => 'thumbnail'));
    ?>
            </td>
            <td>
                <?php 
    echo Html::openTag('h3');
    ?>
                <?php 
    echo $product->getRenderFullName(false);
    ?>
                <?php 
    echo Html::closeTag('h3');
    ?>
                <?php 
    echo Html::openTag('span', array('class' => 'price'));
    ?>
Ejemplo n.º 24
0
 /**
  * @param $item         CommonITILObject
  * @param $rand
  * @param $showprivate  (false by default)
  **/
 function showInObjectSumnary(CommonITILObject $item, $rand, $showprivate = false)
 {
     global $DB, $CFG_GLPI;
     $canedit = $this->canEdit($this->fields['id']);
     echo "<tr class='tab_bg_";
     if ($this->maybePrivate() && $this->fields['is_private'] == 1) {
         echo "4' ";
     } else {
         echo "2' ";
     }
     if ($canedit) {
         echo "style='cursor:pointer' onClick=\"viewEditTask" . $item->fields['id'] . $this->fields['id'] . "{$rand}();\"";
     }
     echo " id='viewfollowup" . $this->fields[$item->getForeignKeyField()] . $this->fields["id"] . "{$rand}'>";
     echo "<td>";
     switch ($this->fields['state']) {
         case Planning::INFO:
             echo Html::image($CFG_GLPI['root_doc'] . "/pics/faqedit.png", array('title' => _n('Information', 'Information', 1)));
             break;
         case Planning::TODO:
             if (empty($this->fields['begin'])) {
                 echo Html::image($CFG_GLPI['root_doc'] . "/pics/redbutton.png", array('title' => __('To do')));
             } else {
                 echo Html::image($CFG_GLPI['root_doc'] . "/pics/rdv.png", array('title' => __('Planned')));
             }
             break;
         case Planning::DONE:
             echo Html::image($CFG_GLPI['root_doc'] . "/pics/greenbutton.png", array('title' => __('Done')));
             break;
     }
     echo "</td>";
     echo "<td>";
     $typename = $this->getTypeName(1);
     if ($this->fields['taskcategories_id']) {
         printf(__('%1$s - %2$s'), $typename, Dropdown::getDropdownName('glpi_taskcategories', $this->fields['taskcategories_id']));
     } else {
         echo $typename;
     }
     echo "</td>";
     echo "<td>";
     if ($canedit) {
         echo "\n<script type='text/javascript' >\n";
         echo "function viewEditTask" . $item->fields['id'] . $this->fields["id"] . "{$rand}() {\n";
         $params = array('type' => $this->getType(), 'parenttype' => $item->getType(), $item->getForeignKeyField() => $this->fields[$item->getForeignKeyField()], 'id' => $this->fields["id"]);
         Ajax::updateItemJsCode("viewfollowup" . $item->fields['id'] . "{$rand}", $CFG_GLPI["root_doc"] . "/ajax/viewsubitem.php", $params);
         echo "};";
         echo "</script>\n";
     }
     //else echo "--no--";
     echo Html::convDateTime($this->fields["date"]) . "</td>";
     echo "<td class='left'>" . nl2br($this->fields["content"]) . "</td>";
     echo "<td>";
     echo Html::timestampToString($this->fields["actiontime"], 0);
     echo "</td>";
     echo "<td>" . getUserName($this->fields["users_id"]) . "</td>";
     if ($this->maybePrivate() && $showprivate) {
         echo "<td>" . Dropdown::getYesNo($this->fields["is_private"]) . "</td>";
     }
     echo "<td>";
     if (empty($this->fields["begin"])) {
         if (isset($this->fields["state"])) {
             echo Planning::getState($this->fields["state"]) . "<br>";
         }
         if ($this->fields["users_id_tech"]) {
             echo sprintf('%1$s %2$s', __('By'), getUserName($this->fields["users_id_tech"]));
         } else {
             _e('None');
         }
     } else {
         echo "<table width='100%'>";
         if (isset($this->fields["state"])) {
             echo "<tr><td>" . _x('item', 'State') . "</td><td>";
             echo Planning::getState($this->fields["state"]) . "</td></tr>";
         }
         echo "<tr><td>" . __('Begin') . "</td><td>";
         echo Html::convDateTime($this->fields["begin"]) . "</td></tr>";
         echo "<tr><td>" . __('End') . "</td><td>";
         echo Html::convDateTime($this->fields["end"]) . "</td></tr>";
         echo "<tr><td>" . __('By') . "</td><td>";
         echo getUserName($this->fields["users_id_tech"]) . "</td></tr>";
         if (PlanningRecall::isAvailable() && $_SESSION["glpiactiveprofile"]["interface"] == "central") {
             echo "<tr><td>" . _x('Planning', 'Reminder') . "</td><td>";
             PlanningRecall::specificForm(array('itemtype' => $this->getType(), 'items_id' => $this->fields["id"]));
             echo "</td></tr>";
         }
         echo "</table>";
     }
     echo "</td>";
     echo "</tr>\n";
 }
Ejemplo n.º 25
0
    /**
     * Print a nice HTML head for every page
     *
     * @param $title     title of the page
     * @param $url       not used anymore (default '')
     * @param $sector    sector in which the page displayed is (default 'none')
     * @param $item      item corresponding to the page displayed (default 'none')
     * @param $option    option corresponding to the page displayed (default '')
     **/
    static function header($title, $url = '', $sector = "none", $item = "none", $option = "")
    {
        global $CFG_GLPI, $PLUGIN_HOOKS, $HEADER_LOADED, $DB;
        // If in modal : display popHeader
        if (isset($_REQUEST['_in_modal']) && $_REQUEST['_in_modal']) {
            return self::popHeader($title, $url);
        }
        // Print a nice HTML-head for every page
        if ($HEADER_LOADED) {
            return;
        }
        $HEADER_LOADED = true;
        // Force lower case for sector and item
        $sector = strtolower($sector);
        $item = strtolower($item);
        self::includeHeader($title);
        // Body
        echo "<body>";
        // Generate array for menu and check right
        if (!isset($_SESSION['glpimenu']) || !is_array($_SESSION['glpimenu']) || count($_SESSION['glpimenu']) == 0) {
            // INVENTORY
            //don't change order in array
            $showallassets = false;
            $menu['assets']['title'] = __('Assets');
            $menu['assets']['types'] = array('Computer', 'Monitor', 'Software', 'NetworkEquipment', 'Peripheral', 'Printer', 'CartridgeItem', 'ConsumableItem', 'Phone');
            $menu['helpdesk']['title'] = __('Assistance');
            $menu['helpdesk']['types'] = array('Ticket', 'Problem', 'Change', 'Planning', 'Stat', 'TicketRecurrent');
            $menu['management']['title'] = __('Management');
            $menu['management']['types'] = array('Budget', 'Supplier', 'Contact', 'Contract', 'Document');
            $menu['tools']['title'] = __('Tools');
            $menu['tools']['types'] = array('Project', 'Reminder', 'RSSFeed', 'KnowbaseItem', 'ReservationItem', 'Report', 'MigrationCleaner');
            $menu['plugins']['title'] = _n('Plugin', 'Plugins', Session::getPluralNumber());
            $menu['plugins']['types'] = array();
            $menu['admin']['title'] = __('Administration');
            $menu['admin']['types'] = array('User', 'Group', 'Entity', 'Rule', 'Profile', 'QueuedMail', 'Backup', 'Event');
            $menu['config']['title'] = __('Setup');
            $menu['config']['types'] = array('CommonDropdown', 'CommonDevice', 'Notification', 'SLA', 'Config', 'Control', 'Crontask', 'Auth', 'MailCollector', 'Link', 'Plugin');
            // Special items
            $menu['preference']['title'] = __('My settings');
            $menu['preference']['default'] = '/front/preference.php';
            // Permit to plugins to add entry to others sector !
            if (isset($PLUGIN_HOOKS["menu_toadd"]) && count($PLUGIN_HOOKS["menu_toadd"])) {
                foreach ($PLUGIN_HOOKS["menu_toadd"] as $plugin => $items) {
                    if (count($items)) {
                        foreach ($items as $key => $val) {
                            if (isset($menu[$key])) {
                                $menu[$key]['types'][] = $val;
                            }
                        }
                    }
                }
            }
            foreach ($menu as $category => $datas) {
                if (isset($datas['types']) && count($datas['types'])) {
                    foreach ($datas['types'] as $type) {
                        if ($data = $type::getMenuContent()) {
                            // Multi menu entries management
                            if (isset($data['is_multi_entries']) && $data['is_multi_entries']) {
                                if (!isset($menu[$category]['content'])) {
                                    $menu[$category]['content'] = array();
                                }
                                $menu[$category]['content'] += $data;
                            } else {
                                $menu[$category]['content'][strtolower($type)] = $data;
                            }
                        }
                    }
                }
                // Define default link :
                if (isset($menu[$category]['content']) && count($menu[$category]['content'])) {
                    foreach ($menu[$category]['content'] as $val) {
                        if (isset($val['page'])) {
                            $menu[$category]['default'] = $val['page'];
                            break;
                        }
                    }
                }
            }
            $allassets = array('Computer', 'Monitor', 'Peripheral', 'NetworkEquipment', 'Phone', 'Printer');
            foreach ($allassets as $type) {
                if (isset($menu['assets']['content'][strtolower($type)])) {
                    $menu['assets']['content']['allassets']['title'] = __('Global');
                    $menu['assets']['content']['allassets']['shortcut'] = '';
                    $menu['assets']['content']['allassets']['page'] = '/front/allassets.php';
                    $menu['assets']['content']['allassets']['links']['search'] = '/front/allassets.php';
                    break;
                }
            }
            //  PLUGINS
            //          if (isset($PLUGIN_HOOKS["menu_entry"]) && count($PLUGIN_HOOKS["menu_entry"])) {
            //             $plugins = array();
            //
            //             foreach  ($PLUGIN_HOOKS["menu_entry"] as $plugin => $active) {
            //                if ($active) { // true or a string
            //                   $plugins[$plugin] = Plugin::getInfo($plugin);
            //                }
            //             }
            //
            //             if (count($plugins)) {
            //                $list = array();
            //
            //                foreach ($plugins as $key => $val) {
            //                   $list[$key] = $val["name"];
            //                }
            //                asort($list);
            //
            //                foreach ($list as $key => $val) {
            //                   $menu['plugins']['content'][$key]['title'] = $val;
            //                   $menu['plugins']['content'][$key]['page']  = '/plugins/'.$key.'/';
            //
            //                   if (is_string($PLUGIN_HOOKS["menu_entry"][$key])) {
            //                      $menu['plugins']['content'][$key]['page'] .= $PLUGIN_HOOKS["menu_entry"][$key];
            //                   }
            //
            //                   // Set default link for plugins
            //                   if (!isset($menu['plugins']['default'])) {
            //                      $menu['plugins']['default'] = $menu['plugins']['content'][$key]['page'];
            //                   }
            //
            //                   if (($sector == "plugins")
            //                      && ($item == $key)) {
            //
            //                      if (isset($PLUGIN_HOOKS["submenu_entry"][$key])
            //                         && is_array($PLUGIN_HOOKS["submenu_entry"][$key])) {
            //
            //                         foreach ($PLUGIN_HOOKS["submenu_entry"][$key] as $name => $link) {
            //                            // New complete option management
            //                            if ($name == "options") {
            //                               $menu['plugins']['content'][$key]['options'] = $link;
            //                            } else { // Keep it for compatibility
            //
            //                               if (is_array($link)) {
            //                                  // Simple link option
            //                                  if (isset($link[$option])) {
            //                                     $menu['plugins']['content'][$key]['links'][$name]
            //                                                    ='/plugins/'.$key.'/'.$link[$option];
            //                                  }
            //                               } else {
            //                                  $menu['plugins']['content'][$key]['links'][$name]
            //                                                    ='/plugins/'.$key.'/'.$link;
            //                               }
            //                            }
            //                         }
            //                      }
            //                   }
            //                }
            //             }
            //          }
            $_SESSION['glpimenu'] = $menu;
            //          echo 'menu load';
        } else {
            $menu = $_SESSION['glpimenu'];
        }
        $already_used_shortcut = array('1');
        //stevenes donato
        echo "\n<style>\n.dropdown-menu > li > a:hover,\n.dropdown-menu > li > a:focus {\n  color: #fff;\n  text-decoration: none;\n  background-color: #428bca; //#f5f5f5;\n}\n</style>";
        echo '
<nav class="navbar navbar-default" id="menuHeader">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="' . $CFG_GLPI["root_doc"] . '/front/central.php"><img src="' . $CFG_GLPI["root_doc"] . '/pics/fd_logo1.png" style="margin-top:-4px;" /> </a>

      </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
    <ul  class="nav navbar-nav">';
        // id = "menu" is used with javascript but also as styling selector
        //echo "<ul id='menu'>";
        // Get object-variables and build the navigation-elements
        $i = 1;
        foreach ($menu as $part => $data) {
            if (isset($data['content']) && count($data['content'])) {
                //echo "<li id='menu$i' onmouseover=\"javascript:menuAff('menu$i','menu');\" >";
                echo "<li id='menu{$i}'>";
                $link = "#";
                if (isset($data['default']) && !empty($data['default'])) {
                    $link = $CFG_GLPI["root_doc"] . $data['default'];
                }
                if (Toolbox::strlen($data['title']) > 14) {
                    $data['title'] = Toolbox::substr($data['title'], 0, 14) . "...";
                }
                echo "<a href='{$link}' class='itemP dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded='false'>" . $data['title'] . "<span class='caret'></span></a>";
                echo "<ul class='ssmenu dropdown-menu' role='menu'>";
                // list menu item
                foreach ($data['content'] as $key => $val) {
                    if (isset($val['page']) && isset($val['title'])) {
                        echo "<li><a href='" . $CFG_GLPI["root_doc"] . $val['page'] . "'";
                        if (isset($val['shortcut']) && !empty($val['shortcut'])) {
                            if (!isset($already_used_shortcut[$val['shortcut']])) {
                                echo " accesskey='" . $val['shortcut'] . "'";
                                $already_used_shortcut[$val['shortcut']] = $val['shortcut'];
                            }
                            echo ">" . Toolbox::shortcut($val['title'], $val['shortcut']) . "</a></li>\n";
                        } else {
                            echo ">" . $val['title'] . "</a></li>\n";
                        }
                    }
                }
                echo "</ul>";
                echo "</li>";
                $i++;
            }
        }
        echo '</ul>';
        //count due tickets
        $sql_due = "SELECT DISTINCT COUNT(glpi_tickets.id) AS due\n\t\tFROM glpi_tickets_users, glpi_tickets, glpi_users\n\t\tWHERE glpi_tickets.status NOT IN (5,6)\n\t\tAND glpi_tickets.is_deleted = 0\n\t\tAND glpi_tickets.id = glpi_tickets_users.tickets_id\n\t\tAND glpi_tickets_users.users_id = glpi_users.id\n\t\tAND glpi_tickets.due_date IS NOT NULL\n\t\tAND glpi_tickets.due_date < NOW()\n\t\tAND glpi_tickets_users.type = 2\n\t\tAND glpi_users.id = " . $_SESSION['glpiID'] . " ";
        $result_due = $DB->query($sql_due);
        $due = $DB->result($result_due, 0, 'due');
        if ($due > 0) {
            $href_due = "" . $CFG_GLPI["root_doc"] . "/front/ticket.php?is_deleted=0&criteria[0][field]=5\n\t\t\t\t&criteria[0][searchtype]=equals&criteria[0][value]=" . $_SESSION['glpiID'] . "&criteria[1][link]=AND\n\t\t\t\t&criteria[1][field]=12&criteria[1][searchtype]=equals&criteria[1][value]=notold\n\t\t\t\t&itemtype=Ticket&start=0";
        } else {
            $href_due = "#";
        }
        //count open tickets
        $sql_cham = "SELECT DISTINCT COUNT(glpi_tickets.id) AS number\n\t\tFROM glpi_tickets_users, glpi_tickets, glpi_users\n\t\tWHERE glpi_tickets.status NOT IN (5,6)\n\t\tAND glpi_tickets.is_deleted = 0\n\t\tAND glpi_tickets.id = glpi_tickets_users.`tickets_id`\n\t\tAND glpi_tickets_users.`users_id` = glpi_users.id\n\t\tAND glpi_tickets_users.type = 2\n\t\tAND glpi_users.id = " . $_SESSION['glpiID'] . " ";
        $result_cham = $DB->query($sql_cham);
        $number = $DB->result($result_cham, 0, 'number');
        if ($number > 0) {
            $href_cham = $CFG_GLPI["root_doc"] . "/front/ticket.php?is_deleted=0&criteria[0][field]=5\n\t\t\t\t&criteria[0][searchtype]=equals&criteria[0][value]=" . $_SESSION['glpiID'] . "&criteria[1][link]=AND\n\t\t\t\t&criteria[1][field]=12&criteria[1][searchtype]=equals&criteria[1][value]=notold\n\t\t\t\t&itemtype=Ticket&start=0";
        } else {
            $href_cham = "#";
        }
        //select tasks
        $query_task = "\n\t\tSELECT glpi_tickettasks.id AS id, glpi_tickettasks.content AS content, glpi_tickettasks.tickets_id AS tid\n\t\tFROM glpi_tickettasks, glpi_tickets\n\t\tWHERE glpi_tickettasks.users_id_tech = " . $_SESSION['glpiID'] . "\n\t\tAND glpi_tickettasks.state NOT IN (2)\n\t\tAND glpi_tickettasks.tickets_id = glpi_tickets.id\n\t\tAND glpi_tickets.is_deleted = 0\n\t\tAND glpi_tickets.status NOT IN (5,6)";
        $res_task = $DB->query($query_task);
        $num_tasks = $DB->numrows($res_task);
        //task label color
        if ($num_tasks <= 0) {
            $label3 = 'label-success';
        }
        if ($num_tasks >= 1 && $num_tasks <= 5) {
            $label3 = 'label-warning';
        }
        if ($num_tasks > 5) {
            $label3 = 'label-danger';
        }
        //label color
        if ($due <= 0) {
            $label = 'label-success';
        }
        if ($due >= 1 && $due <= 5) {
            $label = 'label-warning';
        }
        if ($due > 5) {
            $label = 'label-danger';
        }
        if ($number <= 0) {
            $label2 = 'label-success';
        }
        if ($number >= 1 && $number <= 5) {
            $label2 = 'label-warning';
        }
        if ($number > 5) {
            $label2 = 'label-danger';
        }
        echo '<ul class="nav navbar-nav navbar-right">';
        echo "<li id='count' class='dropdown' style='margin-left:2px; margin-right: -5px; font-size:12px; margin-top:-5px;' title='" . _n('Ticket task', 'Ticket tasks', 2) . "'>";
        //echo "<a href='".$CFG_GLPI["root_doc"]."/front/planning.php?type=month'>
        echo "<a href='#' class='dropdown-toggle' data-toggle='dropdown' role='button' aria-expanded='false'>\n\t\t\t\t\t<i style='vertical-align:bottom;' class='fa fa-tasks' ></i> <span class='label " . $label3 . "' style='font-size:11px;' >" . $num_tasks . "</span></a>";
        echo "<ul class=\"dropdown-menu\" role=\"menu\">";
        while ($row = $DB->fetch_assoc($res_task)) {
            echo "<li class='task'>";
            echo "<a href='" . $CFG_GLPI['url_base'] . "/front/ticket.form.php?forcetab=TicketTask\$1&id=" . $row['tid'] . "'>" . substr($row['content'], 0, 30) . "\n\t\t\t\t\t<br>" . _n('Ticket', 'Tickets', 1) . "  #" . $row['tid'] . "</a>";
            echo "</li>";
        }
        echo "</ul>";
        echo "</li>";
        echo "<li id='count' class='dropdown' style='margin-left:2px; margin-right: -5px; font-size:12px; margin-top:-5px;' title='" . _nx('ticket', 'Opened', 'Opened', 2) . "'>\n\t\t\t\t<a href='" . $href_cham . "'>\n\t\t\t\t<i style='vertical-align:bottom;' class='fa fa-ticket' ></i>\n\t\t\t\t<span class='label " . $label2 . "' style='font-size:11px;' >" . $number . "</span></a></li>";
        echo "<li id='count' class='dropdown' style='margin-left:8px; margin-right: -5px; font-size:12px; margin-top:-5px;' title='" . __('Late') . "'>\n\t\t\t\t<a href='" . $href_due . "'>\n\t\t\t\t<i style='vertical-align:bottom;' class='fa fa-clock-o'></i>\n\t\t\t\t<span class='label " . $label . "' style='font-size:11px;'>" . $due . "</span></a></li>";
        //echo "<div id='c_recherche' class='form-group'>\n";
        if ($CFG_GLPI['allow_search_global']) {
            echo "<form class='navbar-form navbar-left' role='search' method='get' action='" . $CFG_GLPI["root_doc"] . "/front/search.php'>\n";
            echo '<div class="searchbox" style="width:10px; float:right; margin-right:70px;">';
            echo '    <div class="input-group champRecherche">';
            echo '      <input type="text" class="form-control" name="globalsearch" placeholder="' . __s('Search') . '" onfocus=\\"this.value="";\\">';
            echo '      <span class="input-group-btn">';
            echo '        <button class="btn btn-default searchbtn" type="submit"><i class="fa fa-search" style="font-size:20px;" ></i></button>';
            echo '      </span>';
            echo '    </div>';
            echo '</div>';
            Html::closeForm();
        }
        //user image and name
        $sql_photo = "SELECT picture\n\t\t\t\t\t\t\t\tFROM glpi_users\n\t\t\t\t\t\t\t\tWHERE id = " . $_SESSION["glpiID"] . " ";
        $res_photo = $DB->query($sql_photo);
        $pic = $DB->result($res_photo, 0, 'picture');
        $photo_url = User::getURLForPicture($pic);
        echo ' <li class="dropdown" id="avatar">';
        echo '<a href="#" style="padding:0px; margin:0px;" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><img src="' . $photo_url . '" class="avatar" alt="" title="' . formatUserName(0, $_SESSION["glpiname"], $_SESSION["glpirealname"], $_SESSION["glpifirstname"], 0, 20) . '" /></a>';
        echo "<ul class=\"dropdown-menu\" role=\"menu\">";
        echo "<li><a href='" . (empty($CFG_GLPI["central_doc_url"]) ? "http://glpi-project.org/help-central" : $CFG_GLPI["central_doc_url"]) . "' target='_blank' title=\"" . __s('Help') . "\"><i class='fa fa-question-circle'></i> " . __('Help') . "</a></li>";
        echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/front/preference.php' title=\"" . __s('My settings') . "\"><i class='fa fa-cog'></i> " . __('My settings') . "</a></li>";
        echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/front/preference.php' title=\"" . addslashes(Dropdown::getLanguageName($_SESSION['glpilanguage'])) . "\"><i class='fa fa-flag'></i> " . Dropdown::getLanguageName($_SESSION['glpilanguage']) . "</a></li>";
        echo "<li id='deconnexion'><a href='" . $CFG_GLPI["root_doc"] . "/front/logout.php";
        /// logout witout noAuto login for extauth
        if (isset($_SESSION['glpiextauth']) && $_SESSION['glpiextauth']) {
            echo "?noAUTO=1";
        }
        echo "' title=\"" . __s('Logout') . "\"><i class='fa fa-sign-out'></i> " . __('Logout') . "</a>";
        // check user id : header used for display messages when session logout
        if (Session::getLoginUserID()) {
            //echo " (";
            // echo formatUserName (0, $_SESSION["glpiname"], $_SESSION["glpirealname"], $_SESSION["glpifirstname"], 0, 20);
            // echo ")";
        }
        echo "</li>\n";
        echo "</ul>";
        echo '  </li>';
        echo '
			      </ul>
			    </div><!-- /.navbar-collapse -->
			  </div><!-- /.container-fluid -->
			</nav> ';
        echo '<nav class="navbar navbar-default nav2" style="margin-top: -20px;">';
        echo "<div id='c_ssmenu1'>";
        echo "<ul>";
        // list sous-menu item
        if (isset($menu[$sector])) {
            if (isset($menu[$sector]['content']) && is_array($menu[$sector]['content'])) {
                $ssmenu = $menu[$sector]['content'];
                if (count($ssmenu) > 12) {
                    foreach ($ssmenu as $key => $val) {
                        if (isset($val['hide'])) {
                            unset($ssmenu[$key]);
                        }
                    }
                    $ssmenu = array_splice($ssmenu, 0, 12);
                }
                foreach ($ssmenu as $key => $val) {
                    if (isset($val['page']) && isset($val['title'])) {
                        echo "<a href='" . $CFG_GLPI["root_doc"] . $val['page'] . "'";
                        if (isset($val['shortcut']) && !empty($val['shortcut'])) {
                            echo ">" . Toolbox::shortcut($val['title'], $val['shortcut']) . "</a>\n";
                        } else {
                            echo ">" . $val['title'] . "</a>\n";
                        }
                    }
                }
            } else {
                echo "&nbsp;";
            }
        } else {
            echo "&nbsp;";
        }
        echo "</ul></div>";
        //echo "</div>";
        // Display item
        echo "<div id='c_ssmenu2'>";
        echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/central.php' title=\"" . __s('Home') . "\">" . __('Home') . "</a> >";
        if (isset($menu[$sector])) {
            $link = "/front/central.php";
            if (isset($menu[$sector]['default'])) {
                $link = $menu[$sector]['default'];
            }
            echo "<a href='" . $CFG_GLPI["root_doc"] . $link . "' title=\"" . $menu[$sector]['title'] . "\">" . $menu[$sector]['title'] . "</a> >";
        }
        if (isset($menu[$sector]['content'][$item])) {
            // Title
            $with_option = false;
            if (!empty($option) && isset($menu[$sector]['content'][$item]['options'][$option]['title']) && isset($menu[$sector]['content'][$item]['options'][$option]['page'])) {
                $with_option = true;
            }
            if (isset($menu[$sector]['content'][$item]['page'])) {
                echo "<a href='" . $CFG_GLPI["root_doc"] . $menu[$sector]['content'][$item]['page'] . "' " . ($with_option ? "" : "class='here'") . " title=\"" . $menu[$sector]['content'][$item]['title'] . "\" >" . $menu[$sector]['content'][$item]['title'] . "</a>" . (!$with_option ? "" : " > ") . "";
            }
            if ($with_option) {
                echo "<a href='" . $CFG_GLPI["root_doc"] . $menu[$sector]['content'][$item]['options'][$option]['page'] . "' class='here' title=\"" . $menu[$sector]['content'][$item]['options'][$option]['title'] . "\" >";
                echo self::resume_name($menu[$sector]['content'][$item]['options'][$option]['title'], 17);
                echo "</a>";
            }
            echo "<a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
            $links = array();
            // Item with Option case
            if (!empty($option) && isset($menu[$sector]['content'][$item]['options'][$option]['links']) && is_array($menu[$sector]['content'][$item]['options'][$option]['links'])) {
                $links = $menu[$sector]['content'][$item]['options'][$option]['links'];
                // Without option case : only item links
            } else {
                if (isset($menu[$sector]['content'][$item]['links']) && is_array($menu[$sector]['content'][$item]['links'])) {
                    $links = $menu[$sector]['content'][$item]['links'];
                }
            }
            // Add item
            //echo "<li>";
            if (isset($links['add'])) {
                echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_add.png", array('alt' => __('Add'), 'url' => $CFG_GLPI["root_doc"] . $links['add']));
            } else {
                echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_add_off.png", array('alt' => __('Add')));
            }
            //echo "</li>";
            // Search Item
            //echo "<li>";
            if (isset($links['search'])) {
                echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_search.png", array('alt' => __('Search'), 'url' => $CFG_GLPI["root_doc"] . $links['search']));
            } else {
                echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_search_off.png", array('alt' => __('Search')));
            }
            // echo "</li>";
            // Links
            if (count($links) > 0) {
                foreach ($links as $key => $val) {
                    switch ($key) {
                        case "add":
                        case "search":
                            break;
                        case "template":
                            //echo "<li>";
                            echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_addtemplate.png", array('alt' => __('Manage templates...'), 'url' => $CFG_GLPI["root_doc"] . $val));
                            //echo "</li>";
                            break;
                        case "showall":
                            //echo "<li>";
                            echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_showall.png", array('alt' => __('Show all'), 'url' => $CFG_GLPI["root_doc"] . $val));
                            //echo "</li>";
                            break;
                        case "summary":
                            //echo "<li>";
                            echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_show.png", array('alt' => __('Summary'), 'url' => $CFG_GLPI["root_doc"] . $val));
                            //echo "</li>";
                            break;
                        case "config":
                            //echo "<li>";
                            echo Html::image($CFG_GLPI["root_doc"] . "/pics/menu_config.png", array('alt' => __('Setup'), 'url' => $CFG_GLPI["root_doc"] . $val));
                            //echo "</li>";
                            break;
                        default:
                            echo "" . Html::link($key, $CFG_GLPI["root_doc"] . $val) . "";
                            break;
                    }
                }
            }
        } else {
            echo "<a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>";
            echo "<a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . "&nbsp;&nbsp;&nbsp;&nbsp;</a>";
        }
        // Add common items
        //echo "<li>";
        // Display MENU ALL
        echo "<div id='show_all_menu' class='starthidden invisiblex'>";
        $items_per_columns = 15;
        $i = -1;
        echo "<table class='table table-striped'><tr><td class='top'><table>";
        foreach ($menu as $part => $data) {
            if (isset($data['content']) && count($data['content'])) {
                if ($i > $items_per_columns) {
                    $i = 0;
                    echo "</table></td><td class='top'><table>";
                }
                $link = "#";
                if (isset($data['default']) && !empty($data['default'])) {
                    $link = $CFG_GLPI["root_doc"] . $data['default'];
                }
                echo "<tr><td class='tab_bg_1 b'>";
                echo "<a href='{$link}' title=\"" . $data['title'] . "\" class='itemP'>" . $data['title'] . "</a>";
                echo "</td></tr>";
                $i++;
                // list menu item
                foreach ($data['content'] as $key => $val) {
                    if ($i > $items_per_columns) {
                        $i = 0;
                        echo "</table></td><td class='top'><table>";
                    }
                    if (isset($val['page']) && isset($val['title'])) {
                        echo "<tr><td><a href='" . $CFG_GLPI["root_doc"] . $val['page'] . "'";
                        if (isset($data['shortcut']) && !empty($data['shortcut'])) {
                            echo " accesskey='" . $val['shortcut'] . "'";
                        }
                        echo ">" . $val['title'] . "</a></td></tr>\n";
                        $i++;
                    }
                }
            }
        }
        echo "</table></td></tr></table>";
        echo "</div>";
        //end show_all
        Html::scriptStart();
        echo self::jsGetElementbyID('show_all_menu') . ".dialog({\n         height: 'auto',\n         width: 'auto',\n         modal: true,\n         autoOpen: false\n         }); ";
        echo Html::scriptEnd();
        echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
        // echo "</li>";
        /// Bookmark load
        //echo "<li>";
        Ajax::createIframeModalWindow('loadbookmark', $CFG_GLPI["root_doc"] . "/front/bookmark.php?action=load", array('title' => __('Load a bookmark'), 'reloadonclose' => true));
        echo "<a href='#' onClick=\"" . Html::jsGetElementbyID('loadbookmark') . ".dialog('open');\">";
        echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/bookmark.png' title=\"" . __s('Load a bookmark') . "\"  alt=\"" . __s('Load a bookmark') . "\">";
        echo "</a>";
        /// MENU ALL
        //echo "<li>";
        echo "<a href='#' onClick=\"" . self::jsGetElementbyID('show_all_menu') . ".dialog('open');\">";
        echo "<img alt='' src='" . $CFG_GLPI["root_doc"] . "/pics/menu_all.png'>";
        echo "</a>";
        // check user id : header used for display messages when session logout
        if (Session::getLoginUserID()) {
            echo self::showProfileSelecter($CFG_GLPI["root_doc"] . "/front/central.php");
        }
        echo "</div>";
        echo '</nav>';
        echo "</div>\n";
        // fin header
        echo "<div id='page' >";
        if ($DB->isSlave() && !$DB->first_connection) {
            echo "<div id='dbslave-float'>";
            echo "<a href='#see_debug'>" . __('MySQL replica: read only') . "</a>";
            echo "</div>";
        }
        // Back to top
        Html::scriptStart();
        echo "\$(document).ready(function(){\n               BackToTop({\n               text : '" . __s("^Top^") . "',\n               autoShow : true,\n               timeEffect : 100,\n               autoShowOffset : '0',\n               appearMethod : '',\n               effectScroll : 'linear'\n               });\n            });";
        echo Html::scriptEnd();
        // call static function callcron() every 5min
        CronTask::callCron();
        self::displayMessageAfterRedirect();
    }
Ejemplo n.º 26
0
<h1 id="logo">
    <a href="<?php 
echo url::base();
?>
"><?php 
echo Html::image("media/images/logo.png", array());
?>
</a>
</h1>
Ejemplo n.º 27
0
    ?>
                                        </div>
                                    </div>

                                </div>
                            </div>
                            <?php 
    echo Html::endForm();
}
?>
                    </div>

                </div>
                <div class="col-md-4 hidden-xs hidden-sm">
                    <?php 
echo Html::image($model->manufacturer->getImageUrl('image', 'manufacturer', '200x100', 'resize'), $model->manufacturer->name, array('class' => 'img-responsive'));
?>
                </div>
            </div>











        </div>
Ejemplo n.º 28
0
 /**
  * @param CommonGLPI $item
  * @param int $withtemplate
  * @return array|string
  */
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     global $CFG_GLPI;
     switch ($item->getType()) {
         case __CLASS__:
             $ocsServers = getAllDatasFromTable('glpi_plugin_ocsinventoryng_ocsservers', "`is_active`='1'");
             if (!empty($ocsServers)) {
                 $ong[0] = __('Server Setup', 'ocsinventoryng');
                 $ong[1] = __('Inventory Import', 'ocsinventoryng');
                 $ong[2] = __('IPDiscover Import', 'ocsinventoryng');
                 if (isset($_POST["plugin_ocsinventoryng_ocsservers_id"])) {
                     $_SESSION["plugin_ocsinventoryng_ocsservers_id"] = $_POST["plugin_ocsinventoryng_ocsservers_id"];
                 } else {
                     $_SESSION["plugin_ocsinventoryng_ocsservers_id"] = PluginOcsinventoryngOcsServer::getFirstServer();
                 }
                 if (isset($_SESSION["plugin_ocsinventoryng_ocsservers_id"]) && $_SESSION["plugin_ocsinventoryng_ocsservers_id"] > 0) {
                     if (PluginOcsinventoryngOcsServer::checkOCSconnection($_SESSION["plugin_ocsinventoryng_ocsservers_id"])) {
                         $ocsClient = new PluginOcsinventoryngOcsServer();
                         $client = $ocsClient->getDBocs($_SESSION["plugin_ocsinventoryng_ocsservers_id"]);
                         $version = $client->getTextConfig('GUI_VERSION');
                         $snmp = $client->getIntConfig('SNMP');
                         if ($version > $ocsClient::OCS2_1_VERSION_LIMIT && $snmp) {
                             $ong[3] = __('SNMP Import', 'ocsinventoryng');
                         }
                     }
                 }
             } else {
                 $ong = array();
                 echo "<div align='center'>";
                 echo Html::image($CFG_GLPI["root_doc"] . "/pics/warning.png", array('alt' => __('Warning')));
                 echo "<br>";
                 echo "<div class='red b'>";
                 _e('No OCSNG server defined', 'ocsinventoryng');
                 echo "<br>";
                 _e('You must to configure a OCSNG server', 'ocsinventoryng');
                 echo " : <a href='" . $CFG_GLPI["root_doc"] . "/plugins/ocsinventoryng/front/ocsserver.form.php'>";
                 _e('Add a OCSNG server', 'ocsinventoryng');
                 echo "</a>";
                 echo "</div></div>";
             }
             return $ong;
         default:
             return '';
     }
 }
    ?>
						<?php 
    $no++;
    ?>
						<tr>
							<td><?php 
    echo e($no);
    ?>
</td>
							<td>
								<a class="single_image" href="<?php 
    echo e(URL::asset('uploads/big/' . $row->gambar_kecil));
    ?>
">
									<?php 
    echo e(Html::image('uploads/small/' . $row->gambar_kecil, '', array('class' => 'kecil img-responsive')));
    ?>

								</a>
							</td>
							<td><?php 
    echo e($row->kunci_jawaban);
    ?>
</td>
						</tr>
					<?php 
}
?>
				</tbody>
			</table>
	<meta charset="UTF-8">
	<title>Login</title>
	<?php 
echo e(Html::style('assets/css/bootstrap.min.css'));
?>

	<?php 
echo e(Html::style('assets/css/smagawi.css'));
?>

</head>
<body>
	<header>
		<div class="container">
			<?php 
echo e(Html::image('assets/img/logo.png', '', array('class' => 'logo')));
?>

			<div class="logo-caption">
				<p class="caption-besar">SMA NEGERI 3 SLAWI</p>
			</div>
		</div>
	</header>

	<br><br>

	<div id="main">
		<div class="container">
			<div class="col-lg-8"></div>

			<div class="col-lg-4">