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


PHP Html::convdate方法代码示例

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


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

示例1: showForm

 function showForm($target, $ID)
 {
     $this->getFromDB($ID);
     $delay_expired = $this->fields["delay_expired"];
     $delay_whichexpire = $this->fields["delay_whichexpire"];
     echo "<div align='center'>";
     echo "<form method='post' action=\"{$target}\">";
     echo "<table class='tab_cadre_fixe' cellpadding='5'><tr><th>";
     echo __('Time of checking of validity of domains', 'domains') . "</th></tr>";
     echo "<tr class='tab_bg_1'><td><div align='center'>";
     $delay_stamp_first = mktime(0, 0, 0, date("m"), date("d") - $delay_expired, date("y"));
     $delay_stamp_next = mktime(0, 0, 0, date("m"), date("d") + $delay_whichexpire, date("y"));
     $date_first = date("Y-m-d", $delay_stamp_first);
     $date_next = date("Y-m-d", $delay_stamp_next);
     echo "<tr class='tab_bg_1'><td><div align='left'>";
     _e('Domains expired since more', 'domains');
     echo "&nbsp;<input type='text' size='5' name='delay_expired' value=\"{$delay_expired}\">";
     echo "&nbsp;" . _n('Day', 'Days', 2);
     echo "&nbsp;( >" . Html::convdate($date_first) . ")<br>";
     _e('Domains expiring in less than', 'domains');
     echo "&nbsp;<input type='text' size='5' name='delay_whichexpire' value=\"{$delay_whichexpire}\">";
     echo "&nbsp;" . _n('Day', 'Days', 2);
     echo "&nbsp;( <" . Html::convdate($date_next) . ")";
     echo "</td>";
     echo "</tr>";
     echo "<tr><th>";
     echo "<input type='hidden' name='id' value='" . $ID . "'>";
     echo "<div align='center'>";
     echo "<input type='submit' name='update' value=\"" . __s('Post') . "\" class='submit' >";
     echo "</div></th></tr>";
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:34,代码来源:config.class.php

示例2: initGraph

 /**
  * init Graph : Show Titles / Date selector
  *
  * @params $options ($rand, short_classname, title, desc, delay)
  */
 function initGraph($options)
 {
     global $LANG, $CFG_GLPI;
     $width = $this->width + 100;
     $randname = $options['randname'];
     echo "<div class='center'><div id='fig' style='width:{$width}px'>";
     //Show global title
     if (isset($LANG['plugin_mreporting'][$options['short_classname']]['title'])) {
         echo "<div class='graph_title'>";
         echo $LANG['plugin_mreporting'][$options['short_classname']]['title'];
         echo "</div>";
     }
     //Show graph title
     echo "<div class='graph_title'>";
     $backtrace = debug_backtrace();
     $prev_function = strtolower(str_replace('show', '', $backtrace[1]['function']));
     echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/mreporting/pics/chart-{$prev_function}.png' class='title_pics' />";
     echo $options['title'];
     echo "</div>";
     $desc = '';
     if (!empty($options['desc'])) {
         $desc = $options['desc'];
     }
     if (!empty($options['desc']) && isset($_REQUEST['date1' . $randname]) && isset($_REQUEST['date1' . $randname])) {
         $desc .= " - ";
     }
     if (isset($_REQUEST['date1' . $randname]) && isset($_REQUEST['date1' . $randname])) {
         $desc .= Html::convdate($_REQUEST['date1' . $randname]) . " / " . Html::convdate($_REQUEST['date2' . $randname]);
     }
     echo "<div class='graph_desc'>" . $desc . "</div>";
     //Show date selector
     //using rand for display x graphs on same page
     if (!isset($_REQUEST['date1' . $randname])) {
         $_REQUEST['date1' . $randname] = strftime("%Y-%m-%d", time() - $options['delay'] * 24 * 60 * 60);
     }
     if (!isset($_REQUEST['date2' . $randname])) {
         $_REQUEST['date2' . $randname] = strftime("%Y-%m-%d");
     }
     echo "<div class='graph_navigation'>";
     PluginMreportingMisc::showSelector($_REQUEST['date1' . $randname], $_REQUEST['date2' . $randname], $randname);
     echo "</div>";
     $ex_func = explode($options['short_classname'], $options['randname']);
     if (!is_numeric($ex_func[0])) {
         $classname = $ex_func[0] . $options['short_classname'];
         $functionname = $ex_func[1];
         // We check if a configuration is needed for the graph
         if (method_exists(new $classname(), 'needConfig')) {
             $configs = PluginMreportingConfig::initConfigParams($functionname, $classname);
             $object = new $classname();
             $object->needConfig($configs);
         }
     }
     //Script for graph display
     if ($randname !== false) {
         echo "<div class='graph' id='graph_content{$randname}'>";
         $colors = "'" . implode("', '", PluginMreportingConfig::getColors()) . "'";
         echo "<script type='text/javascript+protovis'>\n            function showGraph{$randname}() {\n               colors = pv.colors({$colors});";
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:64,代码来源:graph.class.php

示例3: showForm

 function showForm($target, $ID)
 {
     if (!$this->getFromDB($ID)) {
         $this->getEmpty();
     }
     $delay_expired = $this->fields["delay_expired"];
     $delay_whichexpire = $this->fields["delay_whichexpire"];
     $date_expired = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - $delay_expired, date("y")));
     $date_whichexpire = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") + $delay_whichexpire, date("y")));
     echo "<div align='center'>";
     echo "<form method='post' action=\"{$target}\">";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr class='tab_bg_1'>";
     echo "<th colspan='4'>";
     _e('Time of checking of validity of the badges', 'badges');
     echo "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     _e('Badges expired for more than ', 'badges');
     echo "</td>";
     echo "<td>";
     echo "&nbsp;<input type='text' size='15' name='delay_expired' value=\"{$delay_expired}\">";
     echo "&nbsp;" . _n('Day', 'Days', 2) . " ( > " . Html::convdate($date_expired) . ")<br>";
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     _e('Badges expiring in less than ', 'badges');
     echo "</td>";
     echo "<td>";
     echo "&nbsp;<input type='text' size='15' name='delay_whichexpire' value=\"{$delay_whichexpire}\">";
     echo "&nbsp;" . _n('Day', 'Days', 2) . " ( < " . Html::convdate($date_whichexpire) . ")<br>";
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td class='center' colspan='4'>";
     echo "<input type='hidden' name='id' value='" . $ID . "'>";
     echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit' >";
     echo "</td>";
     echo "</tr>";
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
开发者ID:AssAB,项目名称:badges,代码行数:45,代码来源:config.class.php

示例4: showForItem


//.........这里部分代码省略.........
            echo "</table>";
            Html::closeForm();
         }

         echo "</div>";
      }

      echo "<div class='spaced'>";
      if ($canedit && $number && ($withtemplate < 2)) {
         Html::openMassiveActionsForm('mass'.__CLASS__.$rand);
         $massiveactionparams = array('num_displayed'  => $number);
         Html::showMassiveActions($massiveactionparams);
      }
      echo "<table class='tab_cadre_fixe'>";

      echo "<tr>";
      if ($canedit && $number && ($withtemplate < 2)) {
         echo "<th width='10'>".Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."</th>";
      }
      echo "<th>".__('Name')."</th>";
      if (Session::isMultiEntitiesMode()) {
         echo "<th>".__('Entity')."</th>";
      }
      echo "<th>".__('Type')."</th>";
      echo "<th>".__('DNS name', 'certificates')."</th>";
      echo "<th>".__('DNS suffix', 'certificates')."</th>";
      echo "<th>".__('Creation date')."</th>";
      echo "<th>".__('Expiration date')."</th>";
      echo "<th>".__('Status')."</th>";
      echo "</tr>";
      $used = array();

      if ($number) {

         Session::initNavigateListItems('PluginCertificatesCertificate',
                           //TRANS : %1$s is the itemtype name,
                           //        %2$s is the name of the item (used for headings of a list)
                                        sprintf(__('%1$s = %2$s'),
                                                $item->getTypeName(1), $item->getName()));

         
         foreach  ($certificates as $data) {
            $certificateID        = $data["id"];
            $link         = NOT_AVAILABLE;

            if ($certificate->getFromDB($certificateID)) {
               $link         = $certificate->getLink();
            }

            Session::addToNavigateListItems('PluginCertificatesCertificate', $certificateID);
            
            $used[$certificateID] = $certificateID;
            $assocID      = $data["assocID"];

            echo "<tr class='tab_bg_1".($data["is_deleted"]?"_2":"")."'>";
            if ($canedit && ($withtemplate < 2)) {
               echo "<td width='10'>";
               Html::showMassiveActionCheckBox(__CLASS__, $data["assocID"]);
               echo "</td>";
            }
            echo "<td class='center'>$link</td>";
            if (Session::isMultiEntitiesMode()) {
               echo "<td class='center'>".Dropdown::getDropdownName("glpi_entities", $data['entities_id']).
                    "</td>";
            }
            echo "<td class='center'>";
            echo Dropdown::getDropdownName("glpi_plugin_certificates_certificatetypes",
                                          $data["plugin_certificates_certificatetypes_id"]);
            echo "</td>";
            echo "<td class='center'>".$data["dns_name"]."</td>";
            echo "<td class='center'>".$data["dns_suffix"]."</td>";
            echo "<td class='center'>".Html::convdate($data["date_query"])."</td>";
            if ($data["date_expiration"] <= date('Y-m-d') 
                  && !empty($data["date_expiration"])) {
               echo "<td class='center'>";
               echo "<div class='deleted'>".Html::convdate($data["date_expiration"])."</div>";
               echo "</td>";
            } else if (empty($data["date_expiration"])) {
               echo "<td class='center'>".__('Does not expire', 'certificates')."</td>";
            } else {
               echo "<td class='center'>".Html::convdate($data["date_expiration"])."</td>";
            }
            echo "<td class='center'>";
            echo Dropdown::getDropdownName("glpi_plugin_certificates_certificatestates",
                                                $data["plugin_certificates_certificatestates_id"]);
            echo "</td>";
            echo "</tr>";
            $i++;
         }
      }


      echo "</table>";
      if ($canedit && $number && ($withtemplate < 2)) {
         $massiveactionparams['ontop'] = false;
         Html::showMassiveActions($massiveactionparams);
         Html::closeForm();
      }
      echo "</div>";
   }
开发者ID:euqip,项目名称:glpi-smartcities,代码行数:101,代码来源:certificate_item.class.php

示例5: generatePdf

 function generatePdf($itemtype, $data, $saveas)
 {
     global $CFG_GLPI, $PDF, $DB;
     $ID = $data["id"];
     //name
     if (!empty($data["name"])) {
         $name_item = Toolbox::decodeFromUtf8($data["name"]);
     } else {
         $name_item = "";
     }
     //user
     if (!empty($data["users_id"])) {
         $user_item = Toolbox::decodeFromUtf8(Html::clean(getUserName($data["users_id"])));
     } else {
         if (!empty($data["groups_id"])) {
             $user_item = Toolbox::decodeFromUtf8(Dropdown::getDropdownName("glpi_groups", $data["groups_id"]));
         } else {
             $user_item = "";
         }
     }
     //fabricant
     if (!empty($data["manufacturers_id"])) {
         $fabricant_item = Toolbox::decodeFromUtf8(Dropdown::getDropdownName("glpi_manufacturers", $data["manufacturers_id"]));
     } else {
         $fabricant_item = "";
     }
     //serial
     if (!empty($data["serial"])) {
         $serial_item = Toolbox::decodeFromUtf8($data["serial"]);
     } else {
         $serial_item = "";
     }
     $class = $itemtype . "Type";
     $item = new $class();
     $typefield = getForeignKeyFieldForTable(getTableForItemType($itemtype . "Type"));
     $item->getFromDB($data[$typefield]);
     if (!empty($typefield) && !empty($item->fields["name"])) {
         $type_item = Toolbox::decodeFromUtf8($item->fields["name"]);
     } else {
         $type_item = "";
     }
     //infocoms
     $ic = new Infocom();
     if ($ic->getfromDBforDevice($itemtype, $ID)) {
         //immobilizationsheets_item
         if (!empty($ic->fields["immo_number"])) {
             $immobilizationsheets_item = Toolbox::decodeFromUtf8($ic->fields["immo_number"]);
         } else {
             $immobilizationsheets_item = "";
         }
         //buy_date
         if (!empty($ic->fields["buy_date"])) {
             $buy_date_item = Toolbox::decodeFromUtf8(Html::convdate($ic->fields["buy_date"]));
         } else {
             $buy_date_item = "";
         }
         //use_date
         if (!empty($ic->fields["use_date"])) {
             $use_date_item = Toolbox::decodeFromUtf8(Html::convdate($ic->fields["use_date"]));
         } else {
             $use_date_item = "";
         }
         //order_number
         if (!empty($ic->fields["order_number"])) {
             $order_number_item = Toolbox::decodeFromUtf8($ic->fields["order_number"]);
         } else {
             $order_number_item = "";
         }
         //value_item
         if (!empty($ic->fields["value"])) {
             $value_item = Toolbox::decodeFromUtf8(Html::clean(Html::formatNumber($ic->fields["value"])));
         } else {
             $value_item = "";
         }
         //sink_time
         if (!empty($ic->fields["sink_time"])) {
             $sink_time_item = Toolbox::decodeFromUtf8(sprintf(_n('%d year', '%d years', $ic->fields["sink_time"]), $ic->fields["sink_time"]));
         } else {
             $sink_time_item = "";
         }
         //sink_type
         if (!empty($ic->fields["sink_type"])) {
             $sink_type_item = Toolbox::decodeFromUtf8(Infocom::getAmortTypeName($ic->fields["sink_type"]));
         } else {
             $sink_type_item = "";
         }
     } else {
         $immobilizationsheets_item = "";
         $buy_date_item = "";
         $use_date_item = "";
         $order_number_item = "";
         $value_item = "";
         $sink_time_item = "";
         $sink_type_item = "";
     }
     //composants
     $devtypes = self::getDeviceTypes();
     if ($itemtype == 'Computer') {
         $device2 = new $devtypes[2]();
         $query2 = "SELECT `deviceprocessors_id`\n                  FROM `" . getTableForItemType('items_' . $devtypes[2]) . "`\n                  WHERE `items_id` = '{$ID}'";
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:item.class.php

示例6: getSpecificValueToDisplay

 /**
  * display a specific field value
  *
  * @since version 0.83
  *
  * @param $field     String         name of the field
  * @param $values    String/Array   with the value to display or a Single value
  * @param $options   Array          of options
  *
  * @return return the string to display
  **/
 public static function getSpecificValueToDisplay($field, $values, array $options = array())
 {
     if (!is_array($values)) {
         $values = array($field => $values);
     }
     switch ($field) {
         case 'date_expiration':
             if (empty($values[$field])) {
                 return __('Don\'t expire', 'accounts');
             } else {
                 return Html::convdate($values[$field]);
             }
             break;
     }
     return '';
 }
开发者ID:puchadesc,项目名称:accounts,代码行数:27,代码来源:account.class.php

示例7: showForItem


//.........这里部分代码省略.........
         $alert = '';
     } else {
         $alert = __('There is no encryption key for this entity', 'accounts');
     }
     $aeskey = new PluginAccountsAesKey();
     if ($hash) {
         if (!$aeskey->getFromDBByHash($hash_id) || !$aeskey->fields["name"]) {
             echo "<tr><th colspan='" . (8 + $colsup) . "'>";
             _e('Encryption key', 'accounts');
             echo "<input type='password' name='aescrypted_key' id= 'aescrypted_key' autocomplete='off'>";
             echo "</th></tr>";
         }
     } else {
         echo "<tr><th colspan='" . (8 + $colsup) . "'>";
         echo __('Encryption key', 'accounts') . "<div class='red'>";
         echo $alert;
         echo "</div>";
         echo "</th></tr>";
     }
     echo "<tr>";
     if ($canedit && $number && $withtemplate < 2) {
         echo "<th width='10'>" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand) . "</th>";
     }
     echo "<th>" . __('Name') . "</th>";
     if (Session::isMultiEntitiesMode()) {
         echo "<th>" . __('Entity') . "</th>";
     }
     echo "<th>" . __('Login') . "</th>";
     echo "<th>" . __('Password') . "</th>";
     echo "<th>" . __('Affected User', 'accounts') . "</th>";
     echo "<th>" . __('Type') . "</th>";
     echo "<th>" . __('Creation date') . "</th>";
     echo "<th>" . __('Expiration date') . "</th>";
     echo "</tr>";
     $used = array();
     if ($number) {
         Session::initNavigateListItems('PluginAccountsAccount', sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName()));
         foreach ($accounts as $data) {
             $accountID = $data["id"];
             $link = NOT_AVAILABLE;
             if ($account->getFromDB($accountID)) {
                 $link = $account->getLink();
             }
             Session::addToNavigateListItems('PluginAccountsAccount', $accountID);
             $used[$accountID] = $accountID;
             $assocID = $data["assocID"];
             echo "<tr class='tab_bg_1" . ($data["is_deleted"] ? "_2" : "") . "'>";
             if ($canedit && $withtemplate < 2) {
                 echo "<td width='10'>";
                 Html::showMassiveActionCheckBox(__CLASS__, $data["assocID"]);
                 echo "</td>";
             }
             echo "<td class='center'>{$link}</td>";
             if (Session::isMultiEntitiesMode()) {
                 echo "<td class='center'>" . Dropdown::getDropdownName("glpi_entities", $data['entities_id']) . "</td>";
             }
             echo "<td class='center'>" . $data["login"] . "</td>";
             echo "<td class='center'>";
             //hash
             if (isset($hash_id) && $aeskey->getFromDBByHash($hash_id) && $aeskey->fields["name"]) {
                 echo "<input type='hidden' name='aeskey' id= 'aeskey'\n                        value='" . $aeskey->fields["name"] . "' class='' autocomplete='off'>";
                 echo "<input type='hidden' autocomplete='off'\n               name='encrypted_password\${$accountID}' value='" . $data["encrypted_password"] . "'>";
                 echo "<input type='text' name='hidden_password\${$accountID}' value='' size='30' >";
                 echo "<script language='javascript'>\n               var good_hash=\"{$hash}\";\n               var hash=SHA256(SHA256(document.getElementById(\"aeskey\").value));\n               if (hash != good_hash) {\n               document.getElementsByName(\"hidden_password\${$accountID}\").\n               item(0).value=\"" . __s('Wrong encryption key', 'accounts') . "\";\n            } else {\n            document.getElementsByName(\"hidden_password\${$accountID}\").\n            item(0).value=AESDecryptCtr(document.getElementsByName(\"encrypted_password\${$accountID}\").\n            item(0).value,SHA256(document.getElementById(\"aeskey\").value), 256)};</script>";
             } else {
                 $url = $CFG_GLPI["root_doc"] . "/plugins/accounts/front/account.form.php";
                 echo "&nbsp;<input type='button' id='decrypte_link{$accountID}' name='decrypte' value='" . __s('Uncrypt', 'accounts') . "'\n                        class='submit' onclick='return false;'>";
                 echo "<script type='text/javascript'>\n               Ext.get('decrypte_link{$accountID}').on('click', function () {\n\n               Ext.Ajax.request({\n               url: '../plugins/accounts/ajax/get_new_crsf_token.php',\n               success: function(response, opts) {\n               var token = response.responseText;\n               Ext.select('#account_form input[name=_glpi_csrf_token]')\n               .set({'value': token});\n\n            },\n            failure: function(response, opts) {\n            console.log('server-side failure with status code ' + response.status);\n            }\n            });\n\n            var good_hash=\"{$hash}\";\n            var hash=SHA256(SHA256(document.getElementById(\"aescrypted_key\").value));\n            if (hash != good_hash) {\n            alert(\"" . __('Wrong encryption key', 'accounts') . "\");\n                     return false;\n            };\n                     alert(AESDecryptCtr(\"" . $data['encrypted_password'] . "\",\n                     SHA256(document.getElementById(\"aescrypted_key\").value),\n                     256));\n\n                     callAjax(\"{$url}\",\n                     \"{$accountID}\" ,\n                     document.getElementsByName(\"name\").item(0).value,\n                     document.getElementsByName(\"_glpi_csrf_token\").item(0).value);\n\n            });\n            </script>";
             }
             echo "</td>";
             echo "<td class='center'>";
             echo getUsername($data["users_id"]);
             echo "</td>";
             echo "<td class='center'>";
             echo Dropdown::getDropdownName("glpi_plugin_accounts_accounttypes", $data["plugin_accounts_accounttypes_id"]);
             echo "</td>";
             echo "<td class='center'>" . Html::convdate($data["date_creation"]) . "</td>";
             if ($data["date_expiration"] <= date('Y-m-d') && !empty($data["date_expiration"])) {
                 echo "<td class='center'>";
                 echo "<div class='deleted'>" . Html::convdate($data["date_expiration"]) . "</div>";
                 echo "</td>";
             } else {
                 if (empty($data["date_expiration"])) {
                     echo "<td class='center'>" . __('Don\'t expire', 'accounts') . "</td>";
                 } else {
                     echo "<td class='center'>" . Html::convdate($data["date_expiration"]) . "</td>";
                 }
             }
             echo "</tr>";
             $i++;
         }
     }
     echo "</table>";
     if ($canedit && $number && $withtemplate < 2) {
         $massiveactionparams['ontop'] = false;
         Html::showMassiveActions(__CLASS__, $massiveactionparams);
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:account_item.class.php

示例8: affiche_tableau

 /**
  * Fonction permettant de dessiner le tableau des informations générales.
  */
 function affiche_tableau($total, $items, $deviceType, $disposal = 0)
 {
     if ($total != 0) {
         /* en-tete */
         $this->CellLabel(false, $this->largeur_grande_cell, Toolbox::decodeFromUtf8($deviceType));
         $this->SetY($this->GetY() + $this->line_height);
         /* En tete tableau. */
         $this->CellEnTeteTableau(false, 45, Toolbox::decodeFromUtf8(__('Name')), 1, 'C', 1);
         $this->CellEnTeteTableau(false, 35, Toolbox::decodeFromUtf8(__('Inventory number')), 1, 'C', 1);
         $this->CellEnTeteTableau(false, 20, Toolbox::decodeFromUtf8(__('Date of purchase')), 1, 'C', 1);
         if ($disposal != 1) {
             $this->CellEnTeteTableau(false, 40, Toolbox::decodeFromUtf8(__('User / Group', 'financialreports')), 1, 'C', 1);
             $this->CellEnTeteTableau(false, 40, Toolbox::decodeFromUtf8(__('Location')), 1, 'C', 1);
         }
         $this->CellEnTeteTableau(false, 40, Toolbox::decodeFromUtf8(__('Model')), 1, 'C', 1);
         $this->CellEnTeteTableau(false, 40, Toolbox::decodeFromUtf8(__('Supplier')), 1, 'C', 1);
         if ($disposal == 1) {
             $this->CellEnTeteTableau(false, 20, Toolbox::decodeFromUtf8(__('HT', 'financialreports')), 1, 'C', 1);
             $this->CellEnTeteTableau(false, 25, Toolbox::decodeFromUtf8(__('Disposal date', 'financialreports')), 1, 'C', 1);
             $this->CellEnTeteTableau(false, 55, Toolbox::decodeFromUtf8(__('Comments')), 1, 'C', 1);
         } else {
             $this->CellEnTeteTableau(false, 20, Toolbox::decodeFromUtf8(__('HT', 'financialreports')), 1, 'C', 1);
         }
         $this->SetY($this->GetY() + $this->line_height);
         /* ligne. */
         $i = 1;
         foreach ($items as $data) {
             $i++;
             $this->SetFondBlanc();
             if ($i % 2) {
                 $this->SetFondTresClair();
             }
             $this->CellLigneTableau(false, 45, $data["ITEM_0"]);
             $this->CellLigneTableau(false, 35, $data["ITEM_2"]);
             $this->CellLigneTableau(false, 20, Html::convdate($data["ITEM_3"]), 1, 'C', 1);
             $this->SetTextBleu();
             $this->CellLigneTableau(false, 40, Toolbox::decodeFromUtf8(formatUserName($data["ITEM_4_3"], $data["ITEM_4"], $data["ITEM_4_2"], $data["ITEM_4_4"])));
             $this->SetTextNoir();
             if ($disposal != 1) {
                 $this->CellLigneTableau(false, 40, Toolbox::decodeFromUtf8($data["ITEM_9"]));
                 $this->CellLigneTableau(false, 40, Toolbox::decodeFromUtf8($data["ITEM_6"]));
             }
             $this->CellLigneTableau(false, 40, Toolbox::decodeFromUtf8($data["ITEM_7"]));
             if ($disposal == 1) {
                 $this->SetTextRouge();
                 $this->CellLigneTableau(false, 20, Html::clean(Html::formatNumber($data["ITEM_8"])), 1, 'R', 1);
                 $this->SetTextNoir();
                 $this->CellLigneTableau(false, 25, Html::convdate($data["ITEM_10"]), 1, 'C', 1);
                 $this->CellLigneTableau(false, 55, Toolbox::decodeFromUtf8($data["ITEM_9"]));
             } else {
                 $this->SetTextRouge();
                 $this->CellLigneTableau(false, 20, Html::clean(Html::formatNumber($data["ITEM_8"])), 1, 'R', 1);
                 $this->SetTextNoir();
             }
             $this->SetY($this->GetY() + $this->line_height);
         }
         /* pied */
         if ($total != -1) {
             $this->CellEnTeteTableau(true, $this->largeur_grande_cell - 20, Toolbox::decodeFromUtf8(__('Total')), 1, 'R', 1);
             $this->SetTextRouge();
             $this->CellEnTeteTableau(false, 20, Html::clean(Html::formatNumber($total)), 1, 'R', 1);
             $this->SetTextNoir();
             $this->SetY($this->GetY() + $this->line_height);
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:69,代码来源:pdf.class.php

示例9: showForItem


//.........这里部分代码省略.........
     } else {
         $alert = __('There is no encryption key for this entity', 'accounts');
     }
     $aeskey = new PluginAccountsAesKey();
     echo "<tr><th colspan='" . (8 + $colsup) . "'>";
     if ($hash) {
         if (!$aeskey->getFromDBByHash($hash_id) || !$aeskey->fields["name"]) {
             _e('Encryption key', 'accounts');
             echo "<input type='password' name='aeskey' id='aeskey' autocomplete='off'>";
         } else {
             echo Html::hidden('aeskey', array('value' => $aeskey->fields["name"], 'id' => 'aeskey', 'autocomplete' => 'off'));
         }
     } else {
         echo __('Encryption key', 'accounts');
         echo "<div class='red'>";
         echo $alert;
         echo "</div>";
     }
     echo "<tr>";
     if ($canedit && $number && $withtemplate < 2) {
         echo "<th width='10'>" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand) . "</th>";
     }
     echo "<th>" . __('Name') . "</th>";
     if (Session::isMultiEntitiesMode()) {
         echo "<th>" . __('Entity') . "</th>";
     }
     echo "<th>" . __('Login') . "</th>";
     echo "<th>" . __('Password') . "</th>";
     echo "<th>" . __('Affected User', 'accounts') . "</th>";
     echo "<th>" . __('Type') . "</th>";
     echo "<th>" . __('Creation date') . "</th>";
     echo "<th>" . __('Expiration date') . "</th>";
     echo "</tr>";
     $used = array();
     if ($number) {
         Session::initNavigateListItems('PluginAccountsAccount', sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName()));
         foreach ($accounts as $data) {
             $accountID = $data["id"];
             $link = NOT_AVAILABLE;
             if ($account->getFromDB($accountID)) {
                 $link = $account->getLink();
             }
             Session::addToNavigateListItems('PluginAccountsAccount', $accountID);
             $used[$accountID] = $accountID;
             $assocID = $data["assocID"];
             echo "<tr class='tab_bg_1" . ($data["is_deleted"] ? "_2" : "") . "'>";
             if ($canedit && $withtemplate < 2) {
                 echo "<td width='10'>";
                 Html::showMassiveActionCheckBox(__CLASS__, $data["assocID"]);
                 echo "</td>";
             }
             echo "<td class='center'>{$link}</td>";
             if (Session::isMultiEntitiesMode()) {
                 echo "<td class='center'>" . Dropdown::getDropdownName("glpi_entities", $data['entities_id']) . "</td>";
             }
             echo "<td class='center'>" . $data["login"] . "</td>";
             echo "<td class='center'>";
             //hash
             if (isset($hash_id) && $aeskey->getFromDBByHash($hash_id) && $aeskey->fields["name"]) {
                 echo Html::hidden("encrypted_password{$accountID}", array('value' => $data["encrypted_password"], 'id' => "encrypted_password{$accountID}", 'autocomplete' => 'off'));
                 echo "<input type='text' id='hidden_password{$accountID}' value='' size='30' >";
                 echo Html::scriptBlock("\n                  if (!check_hash()) {\n                     \$('#hidden_password{$accountID}')\n                        .after('" . __('Wrong encryption key', 'accounts') . "')\n                        .remove();\n                  } else {\n                     decrypt_password('{$accountID}');\n                  }\n               ");
             } else {
                 $url = $CFG_GLPI["root_doc"] . "/plugins/accounts/front/account.form.php";
                 echo "&nbsp;<input type='button' id='decrypt_link{$accountID}' name='decrypte' value='" . __s('Uncrypt', 'accounts') . "'\n                        class='submit'>";
                 echo Html::hidden("encrypted_password{$accountID}", array('value' => $data["encrypted_password"], 'id' => "encrypted_password{$accountID}", 'autocomplete' => 'off'));
                 echo Html::scriptBlock("\$(document).on('click', '#decrypt_link{$accountID}', function(event) {\n                  if (!check_hash()) {\n                     alert('" . __('Wrong encryption key', 'accounts') . "');\n                  } else {\n                     var decrypted_password = decrypt_password('{$accountID}');\n                     \$('#decrypt_link{$accountID}')\n                        .after(decrypted_password)\n                        .remove();\n                  }\n               });");
             }
             echo "</td>";
             echo "<td class='center'>";
             echo getUsername($data["users_id"]);
             echo "</td>";
             echo "<td class='center'>";
             echo Dropdown::getDropdownName("glpi_plugin_accounts_accounttypes", $data["plugin_accounts_accounttypes_id"]);
             echo "</td>";
             echo "<td class='center'>" . Html::convdate($data["date_creation"]) . "</td>";
             if ($data["date_expiration"] <= date('Y-m-d') && !empty($data["date_expiration"])) {
                 echo "<td class='center'>";
                 echo "<div class='deleted'>" . Html::convdate($data["date_expiration"]) . "</div>";
                 echo "</td>";
             } else {
                 if (empty($data["date_expiration"])) {
                     echo "<td class='center'>" . __('Don\'t expire', 'accounts') . "</td>";
                 } else {
                     echo "<td class='center'>" . Html::convdate($data["date_expiration"]) . "</td>";
                 }
             }
             echo "</tr>";
             $i++;
         }
     }
     echo "</table>";
     echo Html::hidden('good_hash', array('value' => $hash, 'id' => 'good_hash'));
     if ($canedit && $number && $withtemplate < 2) {
         $massiveactionparams['ontop'] = false;
         Html::showMassiveActions($massiveactionparams);
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:puchadesc,项目名称:accounts,代码行数:101,代码来源:account_item.class.php

示例10: cronBadgesAlert

 /**
  * Cron action on badges : ExpiredBadges or BadgesWhichExpire
  *
  * @param $task for log, if NULL display
  *
  **/
 static function cronBadgesAlert($task = NULL)
 {
     global $DB, $CFG_GLPI;
     if (!$CFG_GLPI["use_mailing"]) {
         return 0;
     }
     $message = array();
     $cron_status = 0;
     $query_expired = self::queryExpiredBadges();
     $query_whichexpire = self::queryBadgesWhichExpire();
     $querys = array(PluginBadgesNotificationTargetBadge::BadgesWhichExpire => $query_whichexpire, PluginBadgesNotificationTargetBadge::ExpiredBadges => $query_expired);
     $badge_infos = array();
     $badge_messages = array();
     foreach ($querys as $type => $query) {
         $badge_infos[$type] = array();
         if (!empty($query)) {
             foreach ($DB->request($query) as $data) {
                 $entity = $data['entities_id'];
                 $message = $data["name"] . ": " . Html::convdate($data["date_expiration"]) . "<br>\n";
                 $badge_infos[$type][$entity][] = $data;
                 if (!isset($badges_infos[$type][$entity])) {
                     $badge_messages[$type][$entity] = __('Badges at the end of the validity', 'badges') . "<br />";
                 }
                 $badge_messages[$type][$entity] .= $message;
             }
         }
     }
     foreach ($querys as $type => $query) {
         foreach ($badge_infos[$type] as $entity => $badges) {
             Plugin::loadLang('badges');
             if (NotificationEvent::raiseEvent($type, new PluginBadgesBadge(), array('entities_id' => $entity, 'badges' => $badges))) {
                 $message = $badge_messages[$type][$entity];
                 $cron_status = 1;
                 if ($task) {
                     $task->log(Dropdown::getDropdownName("glpi_entities", $entity) . ":  {$message}\n");
                     $task->addVolume(1);
                 } else {
                     Session::addMessageAfterRedirect(Dropdown::getDropdownName("glpi_entities", $entity) . ":  {$message}");
                 }
             } else {
                 if ($task) {
                     $task->log(Dropdown::getDropdownName("glpi_entities", $entity) . ":  Send badges alert failed\n");
                 } else {
                     Session::addMessageAfterRedirect(Dropdown::getDropdownName("glpi_entities", $entity) . ":  Send badges alert failed", false, ERROR);
                 }
             }
         }
     }
     return $cron_status;
 }
开发者ID:AssAB,项目名称:badges,代码行数:56,代码来源:badge.class.php

示例11: plugin_certificates_giveItem

function plugin_certificates_giveItem($type,$ID,$data,$num) {
   global $DB;

   $searchopt=&Search::getOptions($type);
   $table=$searchopt[$ID]["table"];
   $field=$searchopt[$ID]["field"];

   switch ($table.'.'.$field) {
      case "glpi_plugin_certificates_certificates.date_expiration" :
         if (empty($data[$num][0]['name']))
            $out=__('Does not expire', 'certificates');
         else
            $out= Html::convdate($data[$num][0]['name']);
         return $out;
         break;
      case "glpi_plugin_certificates_certificates_items.items_id" :
      //$type : item type
         $query_device = "SELECT DISTINCT `itemtype`
                     FROM `glpi_plugin_certificates_certificates_items`
                     WHERE `plugin_certificates_certificates_id` = '".$data['id']."'
                     ORDER BY `itemtype` ";
         $result_device = $DB->query($query_device);
         $number_device = $DB->numrows($result_device);

         $out='';
         $certificate=$data['id'];
         if ($number_device>0) {
            for ($i=0 ; $i < $number_device ; $i++) {
               $column="name";
               $itemtype=$DB->result($result_device, $i, "itemtype");
               
               if (!class_exists($itemtype)) {
                  continue;
               }
               
               $item = new $itemtype();
               if ($item->canView()) {
                  $table_item = getTableForItemType($itemtype);
                  
                  $query = "SELECT `".$table_item."`.*, `glpi_plugin_certificates_certificates_items`.`id` AS items_id, `glpi_entities`.`id` AS entity "
                  ." FROM `glpi_plugin_certificates_certificates_items`, `".$table_item
                  ."` LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `".$table_item."`.`entities_id`) "
                  ." WHERE `".$table_item."`.`id` = `glpi_plugin_certificates_certificates_items`.`items_id`
                     AND `glpi_plugin_certificates_certificates_items`.`itemtype` = '$itemtype'
                     AND `glpi_plugin_certificates_certificates_items`.`plugin_certificates_certificates_id` = '".$certificate."' "
                  . getEntitiesRestrictRequest(" AND ",$table_item,'','',$item->maybeRecursive());

                  if ($item->maybeTemplate()) {
                     $query.=" AND ".$table_item.".is_template='0'";
                  }
                  $query.=" ORDER BY `glpi_entities`.`completename`, `".$table_item."`.`$column` ";

                  if ($result_linked=$DB->query($query))
                     if ($DB->numrows($result_linked)) {
                        $item = new $itemtype();
                        while ($data_linked = $DB->fetch_assoc($result_linked)) {
                           if ($item->getFromDB($data_linked['id'])) {
                              $out .= $item::getTypeName(1)." - ".$item->getLink()."<br>";
                           }
                        }
                     } else
                        $out.=' ';
               } else
                  $out.=' ';
            }
         }
         return $out;
         break;
   }
   return "";
}
开发者ID:euqip,项目名称:glpi-smartcities,代码行数:71,代码来源:hook.php

示例12: cronBadgesReturnAlert

 /**
  * Cron action on badges : ExpiredBadges or BadgesWhichExpire
  *
  * @param $task for log, if NULL display
  *
  * */
 static function cronBadgesReturnAlert($task = NULL)
 {
     global $DB, $CFG_GLPI;
     if (!$CFG_GLPI["use_mailing"]) {
         return 0;
     }
     $message = array();
     $cron_status = 0;
     $query_returnexpire = self::queryBadgesReturnExpire();
     $querys = array(PluginBadgesNotificationTargetBadge::BadgesReturn => $query_returnexpire);
     $badge_infos = array();
     $badge_messages = array();
     foreach ($querys as $type => $query) {
         $badge_infos[$type] = array();
         if (!empty($query)) {
             foreach ($DB->request($query) as $data) {
                 $entity = $data['entities_id'];
                 $message = $data["name"] . "<br>" . __("Arrival date", "badges") . " : " . Html::convdate($data["affectation_date"]) . "<br>\n";
                 $badge_infos[$type][$entity][] = $data;
                 if (!isset($badges_infos[$type][$entity])) {
                     $badge_messages[$type][$entity] = __('Badges at the end of the validity', 'badges') . "<br />";
                 }
                 $badge_messages[$type][$entity] .= $message;
             }
         }
     }
     foreach ($querys as $type => $query) {
         foreach ($badge_infos[$type] as $entity => $badges) {
             Plugin::loadLang('badges');
             // Set badge request fields
             foreach ($badges as $badge) {
                 $badgerequest[] = array('visitor_realname' => $badge['visitor_realname'], 'visitor_firstname' => $badge['visitor_firstname'], 'visitor_society' => $badge['visitor_society'], 'affectation_date' => $badge['affectation_date'], 'requesters_id' => $badge['requesters_id']);
             }
             if (NotificationEvent::raiseEvent($type, new PluginBadgesBadge(), array('entities_id' => $entity, 'badges' => $badges, 'badgerequest' => $badgerequest))) {
                 $message = $badge_messages[$type][$entity];
                 $cron_status = 1;
                 if ($task) {
                     $task->log(Dropdown::getDropdownName("glpi_entities", $entity) . ":  {$message}\n");
                     $task->addVolume(1);
                 } else {
                     Session::addMessageAfterRedirect(Dropdown::getDropdownName("glpi_entities", $entity) . ":  {$message}");
                 }
             } else {
                 if ($task) {
                     $task->log(Dropdown::getDropdownName("glpi_entities", $entity) . ":  Send badges alert failed\n");
                 } else {
                     Session::addMessageAfterRedirect(Dropdown::getDropdownName("glpi_entities", $entity) . ":  Send badges alert failed", false, ERROR);
                 }
             }
         }
     }
     return $cron_status;
 }
开发者ID:AssAB,项目名称:badges,代码行数:59,代码来源:return.class.php

示例13: export

 /**
  * Launch export of datas
  *
  * @param $opt
  */
 function export($opt)
 {
     global $LANG;
     switch ($opt['switchto']) {
         default:
         case 'png':
             $graph = new PluginMreportingGraphpng();
             //check the format display charts configured in glpi
             $opt = $this->initParams($opt, true);
             $opt['export'] = 'png';
             $opt['withdata'] = 1;
             break;
         case 'csv':
             $graph = new PluginMreportingGraphcsv();
             $opt['export'] = 'csv';
             $opt['withdata'] = 1;
             break;
         case 'odt':
             $graph = new PluginMreportingGraphpng();
             $opt = $this->initParams($opt, true);
             $opt['export'] = 'odt';
             break;
         case 'odtall':
             $graph = new PluginMreportingGraphpng();
             $opt = $this->initParams($opt, true);
             $opt['export'] = 'odtall';
             break;
     }
     //export all with odt
     if (isset($opt['classname'])) {
         if (isset($opt['check'])) {
             unset($_SESSION['glpi_plugin_mreporting_odtarray']);
             $reports = $this->getAllReports(false, $opt);
             foreach ($reports as $classname => $report) {
                 foreach ($report['functions'] as $func) {
                     foreach ($opt['check'] as $do => $to) {
                         if ($do == $func['function'] . $classname) {
                             //dynamic instanciation of class passed by 'short_classname' GET parameter
                             $class = 'PluginMreporting' . $func['short_classname'];
                             $obj = new $class();
                             $randname = $classname . $func['function'];
                             if (isset($opt['date1']) && isset($opt['date2'])) {
                                 $s = strtotime($opt['date2']) - strtotime($opt['date1']);
                                 // If customExportDates exists in class : we configure the dates
                                 if (method_exists($obj, 'customExportDates')) {
                                     $opt = $obj->customExportDates($opt, $func['function']);
                                 }
                                 $_REQUEST['date1' . $randname] = $opt['date1'];
                                 $_REQUEST['date2' . $randname] = $opt['date2'];
                             }
                             //dynamic call of method passed by 'f_name'
                             //GET parameter with previously instancied class
                             $datas = $obj->{$func}['function']();
                             //show graph (pgrah type determined by
                             //first entry of explode of camelcase of function name
                             $title_func = $LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['title'];
                             $des_func = "";
                             if (isset($LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['desc'])) {
                                 $des_func = $LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['desc'];
                             }
                             if (isset($LANG['plugin_mreporting'][$func['short_classname']][$func['function']]['desc']) && isset($opt['date1']) && isset($opt['date2'])) {
                                 $des_func .= " - ";
                             }
                             if (isset($opt['date1']) && isset($opt['date2'])) {
                                 $des_func .= Html::convdate($opt['date1']) . " / " . Html::convdate($opt['date2']);
                             }
                             $options = array("short_classname" => $func['short_classname'], "f_name" => $func['function'], "class" => $opt['classname'], "gtype" => $func['gtype'], "randname" => $randname, "withdata" => $opt['withdata']);
                             $show_label = 'always';
                             $params = array("raw_datas" => $datas, "title" => $title_func, "desc" => $des_func, "export" => $opt['export'], "opt" => $options);
                             $graph->{'show' . $func['gtype']}($params);
                         }
                     }
                 }
             }
             if (isset($_SESSION['glpi_plugin_mreporting_odtarray']) && !empty($_SESSION['glpi_plugin_mreporting_odtarray'])) {
                 if (PluginMreportingPreference::atLeastOneTemplateExists()) {
                     $template = PluginMreportingPreference::checkPreferenceTemplateValue(Session::getLoginUserID());
                     if ($template) {
                         self::generateOdt($_SESSION['glpi_plugin_mreporting_odtarray']);
                     } else {
                         Html::popHeader($LANG['plugin_mreporting']["export"][0], $_SERVER['PHP_SELF']);
                         echo "<div class='center'><br>" . $LANG['plugin_mreporting']["parser"][2] . "<br><br>";
                         Html::displayBackLink();
                         echo "</div>";
                         Html::popFooter();
                     }
                 } else {
                     Html::popHeader($LANG['plugin_mreporting']["export"][0], $_SERVER['PHP_SELF']);
                     echo "<div class='center'><br>" . $LANG['plugin_mreporting']["parser"][3] . "<br><br>";
                     Html::displayBackLink();
                     echo "</div>";
                     Html::popFooter();
                 }
             }
         } else {
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:common.class.php

示例14: plugin_projet_giveItem

function plugin_projet_giveItem($type, $ID, $data, $num)
{
    global $CFG_GLPI, $DB;
    $searchopt =& Search::getOptions($type);
    $table = $searchopt[$ID]["table"];
    $field = $searchopt[$ID]["field"];
    $output_type = Search::HTML_OUTPUT;
    if (isset($_GET['display_type'])) {
        $output_type = $_GET['display_type'];
    }
    switch ($type) {
        case 'PluginProjetProjet':
            switch ($table . '.' . $field) {
                case "glpi_plugin_projet_projets_projets.plugin_projet_projets_id_1":
                    $out = " ";
                    $split = explode("\$\$\$\$", $data["ITEM_" . $num]);
                    $split2 = explode("\$\$\$\$", $data["ITEM_" . $num . "_2"]);
                    $displayed = array();
                    for ($k = 0; $k < count($split); $k++) {
                        //$linkid = $split2[$k];
                        $linkid = $split[$k] == $data['id'] ? $split2[$k] : $split2[$k];
                        if ($linkid > 0 && $linkid != $data['id'] && !isset($displayed[$linkid])) {
                            $text = $linkid . " - " . Dropdown::getDropdownName('glpi_plugin_projet_projets', $linkid);
                            if (count($displayed)) {
                                $out .= "<br>";
                            }
                            $displayed[$linkid] = $linkid;
                            $out .= $text;
                        }
                    }
                    return $out;
                    break;
                case "glpi_plugin_projet_projets.name":
                    $out = "";
                    if (!empty($data["ITEM_" . $num . "_2"])) {
                        $link = Toolbox::getItemTypeFormURL('PluginProjetProjet');
                        if ($output_type == Search::HTML_OUTPUT) {
                            $out = "<a href=\"" . $link . "?id=" . $data["ITEM_" . $num . "_2"] . "\">";
                        }
                        $out .= $data["ITEM_{$num}"];
                        if ($output_type == Search::HTML_OUTPUT) {
                            if ($_SESSION["glpiis_ids_visible"] || empty($data["ITEM_{$num}"])) {
                                $out .= " (" . $data["ITEM_" . $num . "_2"] . ")";
                            }
                            $out .= "</a>";
                        }
                        if (plugin_projet_haveRight("task", "r") && $output_type == Search::HTML_OUTPUT) {
                            $query_tasks = "SELECT COUNT(`id`) AS nb_tasks\n                                 FROM `glpi_plugin_projet_tasks`\n                                 WHERE `plugin_projet_projets_id` = '" . $data['id'] . "' ";
                            $query_tasks .= "AND `is_deleted` = '0'";
                            $result_tasks = $DB->query($query_tasks);
                            $nb_tasks = $DB->result($result_tasks, 0, "nb_tasks");
                            //select finished tasks
                            $query_states = "SELECT COUNT(`id`) AS nb_tasks\n                                 FROM `glpi_plugin_projet_tasks`\n                                 WHERE `plugin_projet_projets_id` = '" . $data['id'] . "' ";
                            $query_states .= "AND `is_deleted` = '0'";
                            $finished = " `for_dependency` = '1' ";
                            $states = getAllDatasFromTable("glpi_plugin_projet_taskstates", $finished);
                            $tab = array();
                            if (!empty($states)) {
                                foreach ($states as $state) {
                                    $tab[] = $state['id'];
                                }
                            }
                            if (!empty($tab)) {
                                $query_states .= "AND `plugin_projet_taskstates_id` IN (" . implode(',', $tab) . ")";
                            }
                            $result_states = $DB->query($query_states);
                            $is_finished = $DB->result($result_states, 0, "nb_tasks");
                            $out .= "&nbsp;(<a href=\"" . $CFG_GLPI["root_doc"] . "/plugins/projet/front/task.php?plugin_projet_projets_id=" . $data["id"] . "\">";
                            if ($nb_tasks - $is_finished > 0) {
                                $out .= "<span class='red'>";
                                $out .= $nb_tasks - $is_finished . "</span></a>)";
                            } else {
                                $out .= "<span class='green'>";
                                $out .= $nb_tasks . "</span></a>)";
                            }
                        }
                    }
                    return $out;
                    break;
                case "glpi_plugin_projet_projets.date_end":
                    if (!empty($data["ITEM_{$num}"])) {
                        if ($data["ITEM_{$num}"] <= date('Y-m-d') && !empty($data["ITEM_{$num}"])) {
                            $out = "<span class='red'>" . Html::convdate($data["ITEM_{$num}"]) . "</span>";
                        } else {
                            $out = "<span class='green'>" . Html::convdate($data["ITEM_{$num}"]) . "</span>";
                        }
                    } else {
                        $out = "--";
                    }
                    return $out;
                    break;
                case "glpi_plugin_projet_projets.advance":
                    $out = PluginProjetProjet::displayProgressBar('100', $data["ITEM_{$num}"]);
                    return $out;
                    break;
                case "glpi_plugin_projet_projets_items.items_id":
                    $restrict = "`plugin_projet_projets_id` = '" . $data['id'] . "' \n                           ORDER BY `itemtype`, `items_id`";
                    $items = getAllDatasFromTable("glpi_plugin_projet_projets_items", $restrict);
                    $out = '';
                    if (!empty($items)) {
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:hook.php

示例15: showForSupplier

 /**
  * Show domains associated to a supplier
  *
  * @since version 0.84
  *
  * @param $item            CommonDBTM object for which associated domains must be displayed
  * @param $withtemplate    (default '')
  **/
 static function showForSupplier(CommonDBTM $item, $withtemplate = '')
 {
     global $DB, $CFG_GLPI;
     $ID = $item->getField('id');
     if ($item->isNewID($ID)) {
         return false;
     }
     if (!plugin_domains_haveRight('domains', 'r')) {
         return false;
     }
     if (!$item->can($item->fields['id'], 'r')) {
         return false;
     }
     if (empty($withtemplate)) {
         $withtemplate = 0;
     }
     $rand = mt_rand();
     $is_recursive = $item->isRecursive();
     $query = "SELECT `glpi_plugin_domains_domains`.`id` AS assocID,\n                       `glpi_entities`.`id` AS entity,\n                       `glpi_plugin_domains_domains`.`name` AS assocName,\n                       `glpi_plugin_domains_domains`.* " . "FROM `glpi_plugin_domains_domains` " . " LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `glpi_plugin_domains_domains`.`entities_id`) " . " WHERE `suppliers_id` = '{$ID}' " . getEntitiesRestrictRequest(" AND ", "glpi_plugin_domains_domains", '', '', true);
     $query .= " ORDER BY `assocName` ";
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     $i = 0;
     $domains = array();
     $domain = new PluginDomainsDomain();
     $used = array();
     if ($numrows = $DB->numrows($result)) {
         while ($data = $DB->fetch_assoc($result)) {
             $domains[$data['assocID']] = $data;
             $used[$data['id']] = $data['id'];
         }
     }
     echo "<div class='spaced'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr>";
     echo "<th>" . __('Name') . "</th>";
     if (Session::isMultiEntitiesMode()) {
         echo "<th>" . __('Entity') . "</th>";
     }
     echo "<th>" . __('Group in charge of the hardware') . "</th>";
     echo "<th>" . __('Supplier') . "</th>";
     echo "<th>" . __('Technician in charge of the hardware') . "</th>";
     echo "<th>" . __('Type') . "</th>";
     echo "<th>" . __('Creation date') . "</th>";
     echo "<th>" . __('Expiration date') . "</th>";
     echo "</tr>";
     $used = array();
     if ($number) {
         Session::initNavigateListItems('PluginDomainsDomain', sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName()));
         foreach ($domains as $data) {
             $domainID = $data["id"];
             $link = NOT_AVAILABLE;
             if ($domain->getFromDB($domainID)) {
                 $link = $domain->getLink();
             }
             Session::addToNavigateListItems('PluginDomainsDomain', $domainID);
             $used[$domainID] = $domainID;
             $assocID = $data["assocID"];
             echo "<tr class='tab_bg_1" . ($data["is_deleted"] ? "_2" : "") . "'>";
             echo "<td class='center'>{$link}</td>";
             if (Session::isMultiEntitiesMode()) {
                 echo "<td class='center'>" . Dropdown::getDropdownName("glpi_entities", $data['entities_id']) . "</td>";
             }
             echo "<td class='center'>" . Dropdown::getDropdownName("glpi_groups", $data["groups_id_tech"]) . "</td>";
             echo "<td>";
             echo "<a href=\"" . $CFG_GLPI["root_doc"] . "/front/enterprise.form.php?ID=" . $data["suppliers_id"] . "\">";
             echo Dropdown::getDropdownName("glpi_suppliers", $data["suppliers_id"]);
             if ($_SESSION["glpiis_ids_visible"] == 1) {
                 echo " (" . $data["suppliers_id"] . ")";
             }
             echo "</a></td>";
             echo "<td class='center'>" . getUsername($data["users_id_tech"]) . "</td>";
             echo "<td class='center'>" . Dropdown::getDropdownName("glpi_plugin_domains_domaintypes", $data["plugin_domains_domaintypes_id"]) . "</td>";
             echo "<td class='center'>" . Html::convdate($data["date_creation"]) . "</td>";
             if ($data["date_expiration"] <= date('Y-m-d') && !empty($data["date_expiration"])) {
                 echo "<td class='center'><div class='deleted'>" . convdate($data["date_expiration"]) . "</div></td>";
             } else {
                 if (empty($data["date_expiration"])) {
                     echo "<td class='center'>" . __('Does not expire', 'domains') . "</td>";
                 } else {
                     echo "<td class='center'>" . Html::convdate($data["date_expiration"]) . "</td>";
                 }
             }
             echo "</tr>";
             $i++;
         }
     }
     echo "</table>";
     echo "</div>";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:98,代码来源:domain.class.php


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