本文整理汇总了PHP中Supplier::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Supplier::getName方法的具体用法?PHP Supplier::getName怎么用?PHP Supplier::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Supplier
的用法示例。
在下文中一共展示了Supplier::getName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processDatafeed
public static function processDatafeed(Supplier $supplier, array $data)
{
$base = dirname(__FILE__);
if (file_exists($file_name = $base . '/datafeed/' . strtolower($supplier->getName()) . '.php') === true) {
require_once $file_name;
}
$class = ucfirst($supplier->getName()) . 'Connector';
return $class::run($data);
}
示例2: __construct
/**
* TreeUpdate constructor.
*
* @param Channel $chan
* @param array $updateData
*/
public function __construct(Channel $chan, array $updateData)
{
/**
* This represents data from the base64urlsafe encoded JSON blob that is signed by the channel.
*/
$this->channelId = (int) $updateData['id'];
$this->channelName = $chan->getName();
$this->merkleRoot = $updateData['root'];
$this->stored = $updateData['stored'];
$this->action = $this->stored['action'];
$packageRelatedActions = [self::ACTION_CORE_UPDATE, self::ACTION_PACKAGE_UPDATE];
if (\in_array($this->action, $packageRelatedActions)) {
// This is a package-related update:
$this->checksum = $this->stored['checksum'];
// This is the JSON message from the tree node, stored as an array:
$data = \json_decode($updateData['data'], true);
$this->updateMessage = $data;
// What action are we performing?
if ($this->action === self::ACTION_PACKAGE_UPDATE) {
$this->packageType = $data['pkg_type'];
$this->packageName = $data['name'];
} else {
$this->packageType = 'Core';
$this->packageName = 'Airship';
}
if ($this->action === self::ACTION_CORE_UPDATE) {
$state = State::instance();
$trustedSupplier = (string) ($state->universal['airship']['trusted-supplier'] ?? 'paragonie');
$this->supplier = $chan->getSupplier($trustedSupplier);
} else {
$this->supplier = $chan->getSupplier($data['supplier']);
}
} else {
// This is a key-related update:
if (!empty($updateData['master_signature'])) {
$this->masterSig = $updateData['master_signature'];
}
$data = \json_decode($updateData['data'], true);
try {
$this->unpackMessageUpdate($chan, $data);
} catch (NoSupplier $ex) {
$this->isNewSupplier = true;
$chan->createSupplier($data);
$this->supplier = $chan->getSupplier($data['supplier']);
}
$this->keyType = $data['type'];
$this->newPublicKey = $data['public_key'];
}
$this->supplierName = $this->supplier->getName();
}
示例3: showSupplierNotificationForm
/**
* Print the object user form for notification
*
* @since version 0.85
*
* @param $ID integer ID of the item
* @param $options array
*
* @return Nothing (display)
**/
function showSupplierNotificationForm($ID, $options = array())
{
global $CFG_GLPI;
$this->check($ID, UPDATE);
if (!isset($this->fields['suppliers_id'])) {
return false;
}
$item = new static::$itemtype_1();
echo "<br><form method='post' action='" . $_SERVER['PHP_SELF'] . "'>";
echo "<div class='center'>";
echo "<table class='tab_cadre' width='80%'>";
echo "<tr class='tab_bg_2'><td>" . $item->getTypeName(1) . "</td>";
echo "<td>";
if ($item->getFromDB($this->fields[static::getItilObjectForeignKey()])) {
echo $item->getField('name');
}
echo "</td></tr>";
$supplier = new Supplier();
$default_email = "";
if ($supplier->getFromDB($this->fields["suppliers_id"])) {
$default_email = $supplier->fields['email'];
}
echo "<tr class='tab_bg_2'><td>" . __('User') . "</td>";
echo "<td>" . $supplier->getName() . "</td></tr>";
echo "<tr class='tab_bg_1'><td>" . __('Email Followup') . "</td>";
echo "<td>";
Dropdown::showYesNo('use_notification', $this->fields['use_notification']);
echo "</td></tr>";
echo "<tr class='tab_bg_1'><td>" . __('Email') . "</td>";
echo "<td>";
if (empty($this->fields['alternative_email'])) {
$this->fields['alternative_email'] = $default_email;
}
echo "<input type='text' size='40' name='alternative_email' value='" . $this->fields['alternative_email'] . "'>";
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td class='center' colspan='2'>";
echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit'>";
echo "<input type='hidden' name='id' value='{$ID}'>";
echo "</td></tr>";
echo "</table></div>";
Html::closeForm();
}
示例4: explode
$mlistchunk = explode('<||>', $miscitems);
$j = 0;
for ($i = 0; $i < count($mlistchunk); $i++) {
$dqr_list[$j] = explode('<|>', $mlistchunk[$i]);
$j++;
}
$supp = new Supplier();
$supp->setSID($_POST['Supplier_ID']);
$supp->setSupplierDetails();
$pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
//$pdf->AliasNbPages();
$pdf->setAutoPageBreak(TRUE, 45);
$pdf->AddPage('P', 'A4');
$pdf->SetFont('helvetica', 'B', 13);
$pdf->SetY(56);
$pdf->Cell(125, 8, $supp->getName(), 0, 0, 'L');
$pdf->SetFont('helvetica', 'B', 14);
$pdf->Cell(100, 8, "DC NO: {$dcno}", 0, 1, 'L');
$pdf->SetFont('helvetica', '', 13);
$pdf->Cell(125, 8, $supp->getAddressl1(), 0, 0, 'L');
$pdf->Cell(100, 8, "Date: {$dcdate}", 0, 1, 'L');
$pdf->Cell(125, 8, $supp->getAddressl2(), 0, 0, 'L');
$pdf->Cell(100, 8, "Your Ref: {$cref}", 0, 1, 'L');
$pdf->Cell(125, 8, "Phone No: " . $supp->getPhoneNo(), 0, 0, 'L');
$pdf->Cell(100, 8, "Date: {$crefdate}", 0, 1, 'L');
$pdf->ln();
$pdf->line(0, 87, 220, 87);
//line before mode of dispatch
$pdf->setY(86);
$pdf->MultiCell(125, 16, "Please receive the following materials and acknowledge the receipt", 0, 'L', 0, 0, '', '', true, 0, false, true, 16, 'M', true);
$pdf->Cell(100, 8, "Mode Of Dispatch: {$dmode}", 0, 1, 'L');
示例5: showForSupplier
/**
* Show webapplications associated to an item
*
* @since version 0.84
*
* @param $item Supplier object for which associated webapplications must be displayed
* @param $withtemplate (default '')
**/
static function showForSupplier(Supplier $item, $withtemplate = '')
{
global $DB, $CFG_GLPI;
$ID = $item->getField('id');
if ($item->isNewID($ID)) {
return false;
}
if (!Session::haveRight("plugin_webapplications", READ)) {
return false;
}
if (!$item->can($item->fields['id'], READ)) {
return false;
}
if (empty($withtemplate)) {
$withtemplate = 0;
}
$rand = mt_rand();
$is_recursive = $item->isRecursive();
$query = "SELECT `glpi_entities`.`id` AS entity,\n `glpi_plugin_webapplications_webapplications`.`id` AS assocID,\n `glpi_plugin_webapplications_webapplications`.`name` AS assocName,\n `glpi_plugin_webapplications_webapplications`.*\n FROM `glpi_plugin_webapplications_webapplications`\n LEFT JOIN `glpi_entities` ON (`glpi_plugin_webapplications_webapplications`.`entities_id`=`glpi_entities`.`id`)\n WHERE `glpi_plugin_webapplications_webapplications`.`suppliers_id` = '{$ID}' ";
$query .= getEntitiesRestrictRequest(" AND", "glpi_plugin_webapplications_webapplications", '', '', true);
$query .= " ORDER BY `assocName`";
$result = $DB->query($query);
$number = $DB->numrows($result);
$i = 0;
$webs = array();
if ($numrows = $DB->numrows($result)) {
while ($data = $DB->fetch_assoc($result)) {
$webs[$data['assocID']] = $data;
}
}
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>" . PluginWebapplicationsWebapplicationType::getTypeName(1) . "</th>";
echo "<th>" . __('URL') . "</th>";
echo "<th>" . __('Server') . "</th>";
echo "<th>" . __('Language') . "</th>";
echo "<th>" . __('Version') . "</th>";
echo "<th>" . __('Comments') . "</th>";
echo "</tr>";
$used = array();
if ($number) {
Session::initNavigateListItems('PluginWebapplicationsWebapplication', sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName()));
$web = new PluginWebapplicationsWebapplication();
foreach ($webs as $data) {
$webID = $data["id"];
$link = NOT_AVAILABLE;
if ($web->getFromDB($webID)) {
$link = $web->getLink();
}
Session::addToNavigateListItems('PluginWebapplicationsWebapplication', $webID);
$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>" . Dropdown::getDropdownName("glpi_plugin_webapplications_webapplicationtypes", $data["plugin_webapplications_webapplicationtypes_id"]) . "</td>";
$link = Toolbox::substr($data["address"], 0, 30) . "...";
echo "<td class='center'>" . "<a href=\"" . str_replace("&", "&", $data["address"]) . "\" target=\"_blank\">" . "<u>" . $link . "</u></a></td>";
echo "<td>" . Dropdown::getDropdownName("glpi_plugin_webapplications_webapplicationservertypes", $data["plugin_webapplications_webapplicationservertypes_id"]) . "</td>";
echo "<td>" . Dropdown::getDropdownName("glpi_plugin_webapplications_webapplicationtechnics", $data["plugin_webapplications_webapplicationtechnics_id"]) . "</td>";
echo "<td>" . $data["version"] . "</td>";
echo "<td>" . $data["comment"] . "</td>";
echo "</tr>";
$i++;
}
}
echo "</table>";
echo "</div>";
}
示例6: Supplier
}
if (isset($_POST['previewok'])) {
$previewok = $_POST['previewok'];
} else {
$previewok = '';
}
if (isset($_POST['opid'])) {
$po->setValue('potermid', $_POST['opid']);
$potermid = $_POST['opid'];
}
$popath = '/home/www/divyaeng2/popdfs/';
// $popath='/www/divyaeng2/popdfs/';
$supp = new Supplier();
$supp->setSID($_POST['Supplier_ID']);
$supp->setSupplierDetails();
$sname = $supp->getName();
$addli = $supp->getAddressl1();
$addl2 = $supp->getAddressl2();
$phoneno = $supp->getPhoneNo();
class PDF extends TCPDF
{
// Page header
function Header()
{
$sname = $GLOBALS['sname'];
$addli = $GLOBALS['addli'];
$addl2 = $GLOBALS['addl2'];
$podate = $GLOBALS['podate'];
$suppref = $GLOBALS['suppref'];
$phoneno = $GLOBALS['phoneno'];
$supprefdate = $GLOBALS['supprefdate'];
示例7: getTeamSuppliers
/**
* Add team suppliers to the notified user list
**/
function getTeamSuppliers()
{
global $DB, $CFG_GLPI;
$query = "SELECT `items_id`\n FROM `glpi_projecttaskteams`\n WHERE `glpi_projecttaskteams`.`itemtype` = 'Supplier'\n AND `glpi_projecttaskteams`.`projecttasks_id` = '" . $this->obj->fields["id"] . "'";
$supplier = new Supplier();
foreach ($DB->request($query) as $data) {
if ($supplier->getFromDB($data['items_id'])) {
$this->addToAddressesList(array("email" => $supplier->fields["email"], "name" => $supplier->getName(), "language" => $CFG_GLPI["language"], 'usertype' => NotificationTarget::ANONYMOUS_USER));
}
}
}
示例8: showForSupplier
/**
* Show contacts asociated to an enterprise
**/
static function showForSupplier(Supplier $supplier)
{
global $DB, $CFG_GLPI;
$instID = $supplier->fields['id'];
if (!$supplier->can($instID, READ)) {
return false;
}
$canedit = $supplier->can($instID, UPDATE);
$rand = mt_rand();
$query = "SELECT `glpi_contacts`.*,\n `glpi_contacts_suppliers`.`id` AS ID_ent,\n `glpi_entities`.`id` AS entity\n FROM `glpi_contacts_suppliers`, `glpi_contacts`\n LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id`=`glpi_contacts`.`entities_id`)\n WHERE `glpi_contacts_suppliers`.`contacts_id`=`glpi_contacts`.`id`\n AND `glpi_contacts_suppliers`.`suppliers_id` = '{$instID}'" . getEntitiesRestrictRequest(" AND", "glpi_contacts", '', '', true) . "\n ORDER BY `glpi_entities`.`completename`, `glpi_contacts`.`name`";
$result = $DB->query($query);
$contacts = array();
$used = array();
if ($number = $DB->numrows($result)) {
while ($data = $DB->fetch_assoc($result)) {
$contacts[$data['ID_ent']] = $data;
$used[$data['id']] = $data['id'];
}
}
if ($canedit) {
echo "<div class='firstbloc'>";
echo "<form name='contactsupplier_form{$rand}' id='contactsupplier_form{$rand}'\n method='post' action='";
echo Toolbox::getItemTypeFormURL(__CLASS__) . "'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_1'><th colspan='2'>" . __('Add a contact') . "</tr>";
echo "<tr class='tab_bg_2'><td class='center'>";
echo "<input type='hidden' name='suppliers_id' value='{$instID}'>";
Contact::dropdown(array('used' => $used, 'entity' => $supplier->fields["entities_id"], 'entity_sons' => $supplier->fields["is_recursive"]));
echo "</td><td class='center'>";
echo "<input type='submit' name='add' value=\"" . _sx('button', 'Add') . "\" class='submit'>";
echo "</td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
echo "<div class='spaced'>";
if ($canedit && $number) {
Html::openMassiveActionsForm('mass' . __CLASS__ . $rand);
$massiveactionparams = array('num_displayed' => $number, 'container' => 'mass' . __CLASS__ . $rand);
Html::showMassiveActions($massiveactionparams);
}
echo "<table class='tab_cadre_fixehov'>";
$header_begin = "<tr>";
$header_top = '';
$header_bottom = '';
$header_end = '';
if ($canedit && $number) {
$header_top .= "<th width='10'>" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand);
$header_top .= "</th>";
$header_bottom .= "<th width='10'>" . Html::getCheckAllAsCheckbox('mass' . __CLASS__ . $rand);
$header_bottom .= "</th>";
}
$header_end .= "<th>" . __('Name') . "</th>";
$header_end .= "<th>" . __('Entity') . "</th>";
$header_end .= "<th>" . __('Phone') . "</th>";
$header_end .= "<th>" . __('Phone 2') . "</th>";
$header_end .= "<th>" . __('Mobile phone') . "</th>";
$header_end .= "<th>" . __('Fax') . "</th>";
$header_end .= "<th>" . _n('Email', 'Emails', 1) . "</th>";
$header_end .= "<th>" . __('Type') . "</th>";
$header_end .= "</tr>";
echo $header_begin . $header_top . $header_end;
$used = array();
if ($number) {
Session::initNavigateListItems('Contact', sprintf(__('%1$s = %2$s'), Supplier::getTypeName(1), $supplier->getName()));
foreach ($contacts as $data) {
$ID = $data["ID_ent"];
$used[$data["id"]] = $data["id"];
Session::addToNavigateListItems('Contact', $data["id"]);
echo "<tr class='tab_bg_1" . ($data["is_deleted"] ? "_2" : "") . "'>";
if ($canedit) {
echo "<td>" . Html::getMassiveActionCheckBox(__CLASS__, $data["ID_ent"]) . "</td>";
}
echo "<td class='center'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/contact.form.php?id=" . $data["id"] . "'>" . sprintf(__('%1$s %2$s'), $data["name"], $data["firstname"]) . "</a></td>";
echo "<td class='center' width='100'>" . Dropdown::getDropdownName("glpi_entities", $data["entity"]);
echo "</td>";
echo "<td class='center' width='100'>" . $data["phone"] . "</td>";
echo "<td class='center' width='100'>" . $data["phone2"] . "</td>";
echo "<td class='center' width='100'>" . $data["mobile"] . "</td>";
echo "<td class='center' width='100'>" . $data["fax"] . "</td>";
echo "<td class='center'>";
echo "<a href='mailto:" . $data["email"] . "'>" . $data["email"] . "</a></td>";
echo "<td class='center'>" . Dropdown::getDropdownName("glpi_contacttypes", $data["contacttypes_id"]) . "</td>";
echo "</tr>";
}
echo $header_begin . $header_bottom . $header_end;
}
echo "</table>";
if ($canedit && $number) {
$massiveactionparams['ontop'] = false;
Html::showMassiveActions($massiveactionparams);
Html::closeForm();
}
echo "</div>";
}
示例9: getDatasForObject
/**
* @param $item CommonDBTM object
* @param $options array
* @param $simple (false by default)
**/
function getDatasForObject(CommonDBTM $item, array $options, $simple = false)
{
global $CFG_GLPI, $DB;
$objettype = strtolower($item->getType());
$datas["##{$objettype}.title##"] = $item->getField('name');
$datas["##{$objettype}.content##"] = $item->getField('content');
$datas["##{$objettype}.description##"] = $item->getField('content');
$datas["##{$objettype}.id##"] = sprintf("%07d", $item->getField("id"));
if ($_SESSION['glpiticket_timeline'] == 1) {
$datas["##{$objettype}.url##"] = $this->formatURL($options['additionnaloption']['usertype'], $objettype . "_" . $item->getField("id") . "_" . $item->getType() . '$1');
} else {
$datas["##{$objettype}.url##"] = $this->formatURL($options['additionnaloption']['usertype'], $objettype . "_" . $item->getField("id"));
}
$tab = '$2';
if ($_SESSION['glpiticket_timeline'] == 1) {
$tab = '$1';
}
$datas["##{$objettype}.urlapprove##"] = $this->formatURL($options['additionnaloption']['usertype'], $objettype . "_" . $item->getField("id") . "_" . $item->getType() . $tab);
$entity = new Entity();
if ($entity->getFromDB($this->getEntity())) {
$datas["##{$objettype}.entity##"] = $entity->getField('completename');
$datas["##{$objettype}.shortentity##"] = $entity->getField('name');
}
$datas["##{$objettype}.storestatus##"] = $item->getField('status');
$datas["##{$objettype}.status##"] = $item->getStatus($item->getField('status'));
$datas["##{$objettype}.urgency##"] = $item->getUrgencyName($item->getField('urgency'));
$datas["##{$objettype}.impact##"] = $item->getImpactName($item->getField('impact'));
$datas["##{$objettype}.priority##"] = $item->getPriorityName($item->getField('priority'));
$datas["##{$objettype}.time##"] = $item->getActionTime($item->getField('actiontime'));
$datas["##{$objettype}.creationdate##"] = Html::convDateTime($item->getField('date'));
$datas["##{$objettype}.closedate##"] = Html::convDateTime($item->getField('closedate'));
$datas["##{$objettype}.solvedate##"] = Html::convDateTime($item->getField('solvedate'));
$datas["##{$objettype}.duedate##"] = Html::convDateTime($item->getField('due_date'));
$datas["##{$objettype}.category##"] = '';
if ($item->getField('itilcategories_id')) {
$datas["##{$objettype}.category##"] = Dropdown::getDropdownName('glpi_itilcategories', $item->getField('itilcategories_id'));
}
$datas["##{$objettype}.authors##"] = '';
$datas['authors'] = array();
if ($item->countUsers(CommonITILActor::REQUESTER)) {
$users = array();
foreach ($item->getUsers(CommonITILActor::REQUESTER) as $tmpusr) {
$uid = $tmpusr['users_id'];
$user_tmp = new User();
if ($uid && $user_tmp->getFromDB($uid)) {
$users[] = $user_tmp->getName();
$tmp = array();
$tmp['##author.id##'] = $uid;
$tmp['##author.name##'] = $user_tmp->getName();
if ($user_tmp->getField('locations_id')) {
$tmp['##author.location##'] = Dropdown::getDropdownName('glpi_locations', $user_tmp->getField('locations_id'));
} else {
$tmp['##author.location##'] = '';
}
if ($user_tmp->getField('usertitles_id')) {
$tmp['##author.title##'] = Dropdown::getDropdownName('glpi_usertitles', $user_tmp->getField('usertitles_id'));
} else {
$tmp['##author.title##'] = '';
}
if ($user_tmp->getField('usercategories_id')) {
$tmp['##author.category##'] = Dropdown::getDropdownName('glpi_usercategories', $user_tmp->getField('usercategories_id'));
} else {
$tmp['##author.category##'] = '';
}
$tmp['##author.email##'] = $user_tmp->getDefaultEmail();
$tmp['##author.mobile##'] = $user_tmp->getField('mobile');
$tmp['##author.phone##'] = $user_tmp->getField('phone');
$tmp['##author.phone2##'] = $user_tmp->getField('phone2');
$datas['authors'][] = $tmp;
} else {
// Anonymous users only in xxx.authors, not in authors
$users[] = $tmpusr['alternative_email'];
}
}
$datas["##{$objettype}.authors##"] = implode(', ', $users);
}
$datas["##{$objettype}.openbyuser##"] = '';
if ($item->getField('users_id_recipient')) {
$user_tmp = new User();
$user_tmp->getFromDB($item->getField('users_id_recipient'));
$datas["##{$objettype}.openbyuser##"] = $user_tmp->getName();
}
$datas["##{$objettype}.lastupdater##"] = '';
if ($item->getField('users_id_lastupdater')) {
$user_tmp = new User();
$user_tmp->getFromDB($item->getField('users_id_lastupdater'));
$datas["##{$objettype}.lastupdater##"] = $user_tmp->getName();
}
$datas["##{$objettype}.assigntousers##"] = '';
if ($item->countUsers(CommonITILActor::ASSIGN)) {
$users = array();
foreach ($item->getUsers(CommonITILActor::ASSIGN) as $tmp) {
$uid = $tmp['users_id'];
$user_tmp = new User();
if ($user_tmp->getFromDB($uid)) {
//.........这里部分代码省略.........
示例10: getDatasForObject
/**
* @param $item CommonDBTM object
* @param $options array
* @param $simple (false by default)
**/
function getDatasForObject(CommonDBTM $item, array $options, $simple = false)
{
global $CFG_GLPI, $DB;
$objettype = strtolower($item->getType());
$datas["##{$objettype}.title##"] = $item->getField('name');
$datas["##{$objettype}.content##"] = $item->getField('content');
$datas["##{$objettype}.description##"] = $item->getField('content');
$datas["##{$objettype}.id##"] = sprintf("%07d", $item->getField("id"));
$datas["##{$objettype}.url##"] = $this->formatURL($options['additionnaloption']['usertype'], $objettype . "_" . $item->getField("id"));
$datas["##{$objettype}.urlapprove##"] = $this->formatURL($options['additionnaloption']['usertype'], $objettype . "_" . $item->getField("id") . "_" . $item->getType() . '$2');
$entity = new Entity();
if ($entity->getFromDB($this->getEntity())) {
$datas["##{$objettype}.entity##"] = $entity->getField('completename');
$datas["##{$objettype}.shortentity##"] = $entity->getField('name');
}
$datas["##{$objettype}.storestatus##"] = $item->getField('status');
$datas["##{$objettype}.status##"] = $item->getStatus($item->getField('status'));
$datas["##{$objettype}.urgency##"] = $item->getUrgencyName($item->getField('urgency'));
$datas["##{$objettype}.impact##"] = $item->getImpactName($item->getField('impact'));
$datas["##{$objettype}.priority##"] = $item->getPriorityName($item->getField('priority'));
$datas["##{$objettype}.time##"] = $item->getActionTime($item->getField('actiontime'));
$datas["##{$objettype}.creationdate##"] = Html::convDateTime($item->getField('date'));
$datas["##{$objettype}.closedate##"] = Html::convDateTime($item->getField('closedate'));
$datas["##{$objettype}.solvedate##"] = Html::convDateTime($item->getField('solvedate'));
$datas["##{$objettype}.duedate##"] = Html::convDateTime($item->getField('due_date'));
$datas["##{$objettype}.category##"] = '';
if ($item->getField('itilcategories_id')) {
$datas["##{$objettype}.category##"] = Dropdown::getDropdownName('glpi_itilcategories', $item->getField('itilcategories_id'));
}
$datas["##{$objettype}.authors##"] = '';
$datas['authors'] = array();
if ($item->countUsers(CommonITILActor::REQUESTER)) {
$users = array();
foreach ($item->getUsers(CommonITILActor::REQUESTER) as $tmpusr) {
$uid = $tmpusr['users_id'];
$user_tmp = new User();
if ($uid && $user_tmp->getFromDB($uid)) {
$users[] = $user_tmp->getName();
$tmp = array();
$tmp['##author.id##'] = $uid;
$tmp['##author.name##'] = $user_tmp->getName();
if ($user_tmp->getField('locations_id')) {
$tmp['##author.location##'] = Dropdown::getDropdownName('glpi_locations', $user_tmp->getField('locations_id'));
} else {
$tmp['##author.location##'] = '';
}
if ($user_tmp->getField('usertitles_id')) {
$tmp['##author.title##'] = Dropdown::getDropdownName('glpi_usertitles', $user_tmp->getField('usertitles_id'));
} else {
$tmp['##author.title##'] = '';
}
if ($user_tmp->getField('usercategories_id')) {
$tmp['##author.category##'] = Dropdown::getDropdownName('glpi_usercategories', $user_tmp->getField('usercategories_id'));
} else {
$tmp['##author.category##'] = '';
}
$tmp['##author.email##'] = $user_tmp->getDefaultEmail();
$tmp['##author.mobile##'] = $user_tmp->getField('mobile');
$tmp['##author.phone##'] = $user_tmp->getField('phone');
$tmp['##author.phone2##'] = $user_tmp->getField('phone2');
$datas['authors'][] = $tmp;
} else {
// Anonymous users only in xxx.authors, not in authors
$users[] = $tmpusr['alternative_email'];
}
}
$datas["##{$objettype}.authors##"] = implode(', ', $users);
}
$datas["##{$objettype}.openbyuser##"] = '';
if ($item->getField('users_id_recipient')) {
$user_tmp = new User();
$user_tmp->getFromDB($item->getField('users_id_recipient'));
$datas["##{$objettype}.openbyuser##"] = $user_tmp->getName();
}
$datas["##{$objettype}.lastupdater##"] = '';
if ($item->getField('users_id_lastupdater')) {
$user_tmp = new User();
$user_tmp->getFromDB($item->getField('users_id_lastupdater'));
$datas["##{$objettype}.lastupdater##"] = $user_tmp->getName();
}
$datas["##{$objettype}.assigntousers##"] = '';
if ($item->countUsers(CommonITILActor::ASSIGN)) {
$users = array();
foreach ($item->getUsers(CommonITILActor::ASSIGN) as $tmp) {
$uid = $tmp['users_id'];
$user_tmp = new User();
if ($user_tmp->getFromDB($uid)) {
$users[$uid] = $user_tmp->getName();
}
}
$datas["##{$objettype}.assigntousers##"] = implode(', ', $users);
}
$datas["##{$objettype}.assigntosupplier##"] = '';
if ($item->countSuppliers(CommonITILActor::ASSIGN)) {
$suppliers = array();
//.........这里部分代码省略.........