本文整理汇总了PHP中DoliDB::order方法的典型用法代码示例。如果您正苦于以下问题:PHP DoliDB::order方法的具体用法?PHP DoliDB::order怎么用?PHP DoliDB::order使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoliDB
的用法示例。
在下文中一共展示了DoliDB::order方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getEMailTemplate
/**
* Return template of email
* Search into table c_email_templates
*
* @param DoliDB $db Database handler
* @param string $type_template Get message for key module
* @param string $user Use template public or limited to this user
* @param Translate $outputlangs Output lang object
* @param int $id Id template to find
* @return array array('topic'=>,'content'=>,..)
*/
private function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0)
{
$ret = array();
$sql = "SELECT label, topic, content, lang";
$sql .= " FROM " . MAIN_DB_PREFIX . 'c_email_templates';
$sql .= " WHERE type_template='" . $db->escape($type_template) . "'";
$sql .= " AND entity IN (" . getEntity("c_email_templates") . ")";
$sql .= " AND (fk_user is NULL or fk_user = 0 or fk_user = " . $user->id . ")";
if (is_object($outputlangs)) {
$sql .= " AND (lang = '" . $outputlangs->defaultlang . "' OR lang IS NULL OR lang = '')";
}
if (!empty($id)) {
$sql .= " AND rowid=" . $id;
}
$sql .= $db->order("lang,label", "ASC");
//print $sql;
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
// Get first found
if ($obj) {
$ret['label'] = $obj->label;
$ret['topic'] = $obj->topic;
$ret['content'] = $obj->content;
$ret['lang'] = $obj->lang;
} else {
$defaultmessage = '';
if ($type_template == 'facture_send') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendInvoice");
} elseif ($type_template == 'facture_relance') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendInvoiceReminder");
} elseif ($type_template == 'propal_send') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendProposal");
} elseif ($type_template == 'askpricesupplier_send') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendAskPriceSupplier");
} elseif ($type_template == 'order_send') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendOrder");
} elseif ($type_template == 'order_supplier_send') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendSupplierOrder");
} elseif ($type_template == 'invoice_supplier_send') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendSupplierInvoice");
} elseif ($type_template == 'shipping_send') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendShipping");
} elseif ($type_template == 'fichinter_send') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentSendFichInter");
} elseif ($type_template == 'thirdparty') {
$defaultmessage = $outputlangs->transnoentities("PredefinedMailContentThirdparty");
}
$ret['label'] = 'default';
$ret['topic'] = '';
$ret['content'] = $defaultmessage;
$ret['lang'] = $outputlangs->defaultlang;
}
$db->free($resql);
return $ret;
} else {
dol_print_error($db);
return -1;
}
}