本文整理汇总了PHP中Transfer类的典型用法代码示例。如果您正苦于以下问题:PHP Transfer类的具体用法?PHP Transfer怎么用?PHP Transfer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Transfer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: action_changeShort
public function action_changeShort()
{
echo 'test2';
return;
$member = \MemberQuery::create()->findOneById(1);
$con = \Propel::getConnection();
if (!$con->beginTransaction()) {
throw new \Exception('Could not begin transaction');
}
try {
$transfer = \TransferQuery::create()->findOneById(1);
if (!$transfer) {
$transfer = new \Transfer();
$transfer->setMemberId($member->getId());
$transfer->save($con);
$transfer = \TransferQuery::create()->findOneById(1);
}
$transfer->setAmount($transfer->getAmount() + 2);
$transfer->save($con);
if (!$con->commit()) {
throw new \Exception('Could not commit transaction');
}
} catch (\Exception $e) {
$con->rollBack();
throw $e;
}
print_r('<pre>');
print_r($transfer->toArray());
print_r('</pre>');
}
开发者ID:nikonehauser,项目名称:pt,代码行数:30,代码来源:weight.controller.php
示例2: display
public function display()
{
// Cancel the transfer if a request is submitted.
if (isset($_POST['cancel'])) {
$transfer = new Transfer();
$transfer->cancelSessions();
unset($_POST['cancel']);
$pos = strrpos($_SERVER['HTTP_REFERER'], '/');
$pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "New-Funds-Transfer");
// Otherwise process the transfer.
} elseif (isset($_POST['submit'])) {
unset($_POST['submit']);
// To negate any back button issues.
if (!isset($_SESSION['transferDate']) || !isset($_SESSION['transferDescription']) || !isset($_SESSION['transferRemitter']) || !isset($_SESSION['transferAmount'])) {
header('Location: New-Funds-Transfer');
}
if (isset($_POST['password'])) {
$validate = new Validation();
// Validate the password.
try {
$validate->password($_POST['password']);
} catch (ValidationException $e) {
$_SESSION['error'] = $e->getError();
}
if (isset($_SESSION['error'])) {
unset($_POST['password']);
header('Location: New-Funds-Transfer');
} else {
$user = new Users();
$user->userID = $_SESSION['userID'];
$user->password = $_POST['password'];
unset($_POST['password']);
// Confirm the password is corredt.
try {
$user->confirmPassword();
} catch (ValidationException $e) {
$_SESSION['error'] = $e->getError();
}
if (isset($_SESSION['error'])) {
header('Location: New-Funds-Transfer');
} else {
// If everything is ok, process the transfer and display
// the Transfer Acknowledgement Page
$account = new Account();
$account->accountID = $_SESSION['transferAccountID'];
if ($account->processTransfer()) {
include 'view/layout/transferack.php';
} else {
// Otherwise return to the Check Transfer page.
$checkTransfer = new CheckTransfer();
$checkTransfer->init();
include 'view/layout/checktransfer.php';
}
}
}
}
}
}
开发者ID:s3444261,项目名称:assignment2,代码行数:59,代码来源:TransferackController.php
示例3: initialize
/**
* @see Application::initialize()
*/
public function initialize(Transfer $transfer)
{
$template = new Template('');
$template->baseUrl = dirname($transfer->server('PHP_SELF'));
if ($template->baseUrl != '/') {
$template->baseUrl = $template->baseUrl . '/';
}
$transfer->baseTpl = $template;
$transfer->layout = $template->derive($this->getTemplatesPath() . 'layout.phtml');
}
开发者ID:am-,项目名称:mu-webapp,代码行数:13,代码来源:MyApp.php
示例4: sendContactMail
public function sendContactMail($name, $email, $message, $transferId, $hiddenMessage, $title)
{
if ($hiddenMessage == "" && isset($title)) {
$transfer = new Transfer();
$transferInfo = $transfer->getTransferById($transferId);
$mailMessage = $this->createMailMessage($name, $email, $message, $transferInfo);
$betreff = "Nachricht von Dhamma-Reise";
$header = 'From: [email protected]' . "\r\n" . 'Reply-To: ' . $email . "\r\n" . 'Content-Type:text/plain" \\r\\n' . 'X-Mailer: PHP/' . phpversion();
$this->debug("NEW MAIL MESSAGE", "Sending mail to: " . $transferInfo['email'] . "\n" . $betreff . $mailMessage);
mail($transferInfo['email'], $betreff, $mailMessage, $header, "-f [email protected]");
}
}
开发者ID:rapude,项目名称:dhamma-reise,代码行数:12,代码来源:Mailer.class.php
示例5: instanceUrl
/**
* Get API URL for this Stripe transfer reversal.
*
* @throws \Arcanedev\Stripe\Exceptions\InvalidRequestException
*
* @return string
*/
public function instanceUrl()
{
if (is_null($id = $this['id'])) {
throw new InvalidRequestException('Could not determine which URL to request: class instance has invalid ID [null]', null);
}
return implode('/', [Transfer::classUrl(), urlencode(str_utf8($this['transfer'])), 'reversals', urlencode(str_utf8($id))]);
}
开发者ID:arcanedev,项目名称:stripe,代码行数:14,代码来源:TransferReversal.php
示例6: testAllCharge
public function testAllCharge()
{
self::authorizeFromEnv();
$transfers = Transfer::all(array('limit' => 3, 'offset' => 0));
if (count($transfers['data'])) {
$transfer = Transfer::retrieve($transfers['data'][0]->id);
$charges = $transfer->charges->all(array('limit' => 3, 'offset' => 0));
}
}
开发者ID:payjp,项目名称:payjp-php,代码行数:9,代码来源:TransferTest.php
示例7: transfers
/**
* @param array|null $params
*
* @return Collection of the Recipient's Transfers
*/
public function transfers($params = null)
{
if ($params === null) {
$params = array();
}
$params['recipient'] = $this->id;
$transfers = Transfer::all($params, $this->_opts);
return $transfers;
}
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:14,代码来源:Recipient.php
示例8: testTransferUpdateMetadataAll
public function testTransferUpdateMetadataAll()
{
$recipient = self::createTestRecipient();
self::authorizeFromEnv();
$transfer = Transfer::create(array('amount' => 100, 'currency' => 'usd', 'recipient' => $recipient->id));
$transfer->metadata = array('test' => 'foo bar');
$transfer->save();
$updatedTransfer = Transfer::retrieve($transfer->id);
$this->assertSame('foo bar', $updatedTransfer->metadata['test']);
}
开发者ID:cso4tb,项目名称:Auxum-,代码行数:10,代码来源:TransferTest.php
示例9: instanceUrl
/**
* @return string The API URL for this Stripe transfer reversal.
*/
public function instanceUrl()
{
$id = $this['id'];
$transfer = $this['transfer'];
if (!$id) {
throw new Error\InvalidRequest("Could not determine which URL to request: " . "class instance has invalid ID: {$id}", null);
}
$id = Util\Util::utf8($id);
$transfer = Util\Util::utf8($transfer);
$base = Transfer::classUrl();
$transferExtn = urlencode($transfer);
$extn = urlencode($id);
return "{$base}/{$transferExtn}/reversals/{$extn}";
}
开发者ID:jesusmarket,项目名称:jesusmarket,代码行数:17,代码来源:TransferReversal.php
示例10: showFormInventory
/**
* Print the config form for restrictions
*
* @return Nothing (display)
**/
function showFormInventory()
{
global $DB, $CFG_GLPI;
if (!self::canView()) {
return false;
}
$canedit = Config::canUpdate();
if ($canedit) {
echo "<form name='form' action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\" method='post'>";
}
echo "<div class='center' id='tabsbody'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4'>" . __('Assets') . "</th></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td width='30%'>" . __('Enable the financial and administrative information by default') . "</td>";
echo "<td width='20%'>";
Dropdown::ShowYesNo('auto_create_infocoms', $CFG_GLPI["auto_create_infocoms"]);
echo "</td><td width='20%'> " . __('Restrict monitor management') . "</td>";
echo "<td width='30%'>";
$this->dropdownGlobalManagement("monitors_management_restrict", $CFG_GLPI["monitors_management_restrict"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td>" . __('Software category deleted by the dictionary rules') . "</td><td>";
SoftwareCategory::dropdown(array('value' => $CFG_GLPI["softwarecategories_id_ondelete"], 'name' => "softwarecategories_id_ondelete"));
echo "</td><td> " . __('Restrict device management') . "</td><td>";
$this->dropdownGlobalManagement("peripherals_management_restrict", $CFG_GLPI["peripherals_management_restrict"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Beginning of fiscal year') . "</td><td>";
Html::showDateField("date_tax", array('value' => $CFG_GLPI["date_tax"], 'maybeempty' => false, 'canedit' => true, 'min' => '', 'max' => '', 'showyear' => false));
echo "</td><td> " . __('Restrict phone management') . "</td><td>";
$this->dropdownGlobalManagement("phones_management_restrict", $CFG_GLPI["phones_management_restrict"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Automatic fields (marked by *)') . "</td><td>";
$tab = array(0 => __('Global'), 1 => __('By entity'));
Dropdown::showFromArray('use_autoname_by_entity', $tab, array('value' => $CFG_GLPI["use_autoname_by_entity"]));
echo "</td><td> " . __('Restrict printer management') . "</td><td>";
$this->dropdownGlobalManagement("printers_management_restrict", $CFG_GLPI["printers_management_restrict"]);
echo "</td></tr>";
echo "</table>";
if (Session::haveRightsOr("transfer", array(CREATE, UPDATE)) && Session::isMultiEntitiesMode()) {
echo "<br><table class='tab_cadre_fixe'>";
echo "<tr><th colspan='2'>" . __('Automatic transfer of computers') . "</th></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . __('Template for the automatic transfer of computers in another entity') . "</td><td>";
Transfer::dropdown(array('value' => $CFG_GLPI["transfers_id_auto"], 'name' => "transfers_id_auto", 'emptylabel' => __('No automatic transfer')));
echo "</td></tr>";
echo "</table>";
}
echo "<br><table class='tab_cadre_fixe'>";
echo "<tr>";
echo "<th colspan='4'>" . __('Automatically update of the elements related to the computers');
echo "</th><th colspan='2'>" . __('Unit management') . "</th></tr>";
echo "<tr><th> </th>";
echo "<th>" . __('Alternate username') . "</th>";
echo "<th>" . __('User') . "</th>";
echo "<th>" . __('Group') . "</th>";
echo "<th>" . __('Location') . "</th>";
echo "<th>" . __('Status') . "</th>";
echo "</tr>";
$fields = array("contact", "user", "group", "location");
echo "<tr class='tab_bg_2'>";
echo "<td> " . __('When connecting or updating') . "</td>";
$values[0] = __('Do not copy');
$values[1] = __('Copy');
foreach ($fields as $field) {
echo "<td>";
$fieldname = "is_" . $field . "_autoupdate";
Dropdown::showFromArray($fieldname, $values, array('value' => $CFG_GLPI[$fieldname]));
echo "</td>";
}
echo "<td>";
State::dropdownBehaviour("state_autoupdate_mode", __('Copy computer status'), $CFG_GLPI["state_autoupdate_mode"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td> " . __('When disconnecting') . "</td>";
$values[0] = __('Do not delete');
$values[1] = __('Clear');
foreach ($fields as $field) {
echo "<td>";
$fieldname = "is_" . $field . "_autoclean";
Dropdown::showFromArray($fieldname, $values, array('value' => $CFG_GLPI[$fieldname]));
echo "</td>";
}
echo "<td>";
State::dropdownBehaviour("state_autoclean_mode", __('Clear status'), $CFG_GLPI["state_autoclean_mode"]);
echo "</td></tr>";
if ($canedit) {
echo "<tr class='tab_bg_2'>";
echo "<td colspan='6' class='center'>";
echo "<input type='submit' name='update' class='submit' value=\"" . _sx('button', 'Save') . "\">";
echo "</td></tr>";
}
echo "</table></div>";
Html::closeForm();
//.........这里部分代码省略.........
开发者ID:UnidadInformaticaSERVIUVI,项目名称:Administrador-de-Inventario,代码行数:101,代码来源:config.class.php
示例11: updateComputerNoTranfer
/**
* Update computer to not change entity (transfer not allowed)
*
* @test
*/
public function updateComputerNoTranfer()
{
global $DB;
$DB->connect();
$transfer = new Transfer();
$computer = new Computer();
$pfiComputerInv = new PluginFusioninventoryInventoryComputerInventory();
$pfEntity = new PluginFusioninventoryEntity();
// Manual transfer computer to entity 2
$transfer->getFromDB(1);
$item_to_transfer = array("Computer" => array(1 => 1));
$transfer->moveItems($item_to_transfer, 2, $transfer->fields);
$computer->getFromDB(1);
$this->assertEquals(2, $computer->fields['entities_id'], 'Transfer move computer');
$this->AgentEntity(1, 2, 'Transfer computer on entity 2');
// Define entity 2 not allowed to transfer
$ents_id = $pfEntity->add(array('entities_id' => 2, 'transfers_id_auto' => 0));
$this->assertEquals(2, $ents_id, 'Entity 2 defined with no transfer');
// Update computer and computer must not be transfered (keep in entoty 2)
$a_inventory = array();
$a_inventory['CONTENT']['HARDWARE'] = array('NAME' => 'pc1');
$a_inventory['CONTENT']['BIOS'] = array('SSN' => 'xxyyzz');
$pfiComputerInv->import("pc-2013-02-13", "", $a_inventory);
// Update
$this->assertEquals(1, countElementsInTable('glpi_computers'), 'Must have only 1 computer');
$computer->getFromDB(1);
$this->assertEquals(2, $computer->fields['entities_id'], 'Computer must not be transfered');
$this->AgentEntity(1, 2, 'Agent must stay with entity 2');
}
开发者ID:korial29,项目名称:fusioninventory-for-glpi,代码行数:34,代码来源:ComputerEntityTest.php
示例12: retrieveByClient
static public function retrieveByClient($status, $client_id = null)
{
//echo $status;
$types= array('all','sell','purchase','switch');
$statuses= array('all','pending','completed','cancelled');
if(!in_array($status,$statuses))
if(!in_array($status,$types))
die('Wrong status when getting transfer collection!');
$IsTypeOriented = in_array($status,$statuses) ? false: true;
if(!$client_id)
die('Should add case for all clients!');
$transactions= array();
if($IsTypeOriented)
$addition = ($status!= 'all') ? " AND types = '$status'" : "";
else
$addition = ($status!= 'all') ? " AND status = '$status'" : "";
$query = " SELECT t.id, t.created_at, t.comment, a.name aname, i.fund_name name,
i.ISIN code, t.status, t.types, t.amount, t.trade_date, t.settlement_date
FROM transfers t, custody_ac a, fund i
WHERE t.id_client = '$client_id' AND a.id = t.id_custody1 AND i.id = t.id_isin $addition ";
$qres=mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_assoc($qres))
{
$transfer = new Transfer();
$transfer->setId($row['id']);
$transfer->setStatus($row['status']);
$transfer->setType($row['types']);
$transfer->setComment($row['comment']);
$transfer->setSecurity($row['name']);
$transfer->setAmount($row['amount']);
$transfer->setIsin($row['code']);
$transfer->setTradeDate($row['trade_date']);
$transfer->setSettlementDate($row['settlement_date']);
$transfer->setAccount($row['aname']);
$transfer->setCreatedAt($row['created_at']);
$transfers[] = $transfer;
}
return $transfers;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:46,代码来源:transfercollection.class.php
示例13: doOldImport
public function doOldImport()
{
DB::delete('DELETE FROM `cache`');
// delete old data:
foreach (Auth::user()->accounts()->get() as $acc) {
$acc->delete();
}
foreach (Auth::user()->budgets()->get() as $b) {
$b->delete();
}
foreach (Auth::user()->categories()->get() as $b) {
$b->delete();
}
foreach (Auth::user()->beneficiaries()->get() as $b) {
$b->delete();
}
foreach (Icon::get() as $icon) {
$icon->delete();
}
$data = file_get_contents('http://commondatastorage.googleapis.com/nder/import.json');
$json = json_decode($data);
$map = array();
$map['accounts'] = array();
$map['icons'] = array();
// all accounts:
foreach ($json->accounts as $account) {
$newAccount = new Account();
$newAccount->name = Crypt::encrypt($account->name);
$newAccount->balance = floatval($account->balance);
$newAccount->fireflyuser_id = Auth::user()->id;
$newAccount->date = $account->date;
$newAccount->save();
$map['accounts'][$account->id] = $newAccount->id;
}
// all icons:
foreach ($json->icons as $icon) {
$newIcon = new Icon();
$newIcon->file = $icon->file;
$newIcon->save();
$map['icons'][intval($icon->id)] = $newIcon->id;
}
// all beneficiaries:
foreach ($json->beneficiaries as $ben) {
$nb = new Beneficiary();
$nb->fireflyuser_id = Auth::user()->id;
$nb->name = Crypt::encrypt($ben->name);
$nb->save();
$map['beneficiaries'][$ben->id] = $nb->id;
}
// all budgets
foreach ($json->budgets as $bd) {
$nbg = new Budget();
$nbg->fireflyuser_id = Auth::user()->id;
$nbg->name = Crypt::encrypt($bd->name);
$nbg->date = $bd->date;
$nbg->amount = floatval($bd->amount);
$nbg->save();
$map['budgets'][$bd->id] = $nbg->id;
}
// all categories:
foreach ($json->categories as $c) {
$nc = new Category();
$nc->fireflyuser_id = Auth::user()->id;
$nc->icon_id = intval($map['icons'][intval($c->icon_id)]);
$nc->name = Crypt::encrypt($c->name);
$nc->showtrend = intval($c->showtrend);
$nc->save();
$map['categories'][$c->id] = $nc->id;
}
foreach ($json->targets as $t) {
$nt = new Target();
$nt->fireflyuser_id = Auth::user()->id;
$nt->account_id = $map['accounts'][$t->account_id];
$nt->description = Crypt::encrypt($t->description);
$nt->amount = floatval($t->amount);
$nt->duedate = $t->duedate;
$nt->startdate = $t->startdate;
$nt->save();
$map['targets'][$t->id] = $nt->id;
}
foreach ($json->transactions as $t) {
$nt = new Transaction();
$nt->fireflyuser_id = Auth::user()->id;
$nt->account_id = $map['accounts'][$t->account_id];
$nt->budget_id = is_null($t->budget_id) ? NULL : intval($map['budgets'][$t->budget_id]);
$nt->category_id = is_null($t->category_id) ? NULL : $map['categories'][$t->category_id];
$nt->beneficiary_id = is_null($t->beneficiary_id) ? NULL : $map['beneficiaries'][$t->beneficiary_id];
$nt->description = Crypt::encrypt($t->description);
$nt->amount = floatval($t->amount);
$nt->date = $t->date;
$nt->onetime = intval($t->onetime);
$nt->save();
$map['transactions'][$t->id] = $nt->id;
}
foreach ($json->transfers as $t) {
$nt = new Transfer();
$nt->fireflyuser_id = Auth::user()->id;
$nt->account_from = $map['accounts'][$t->account_from];
$nt->account_to = $map['accounts'][$t->account_to];
$nt->category_id = is_null($t->category_id) ? NULL : $map['categories'][$t->category_id];
//.........这里部分代码省略.........
开发者ID:jcyh,项目名称:nder-firefly,代码行数:101,代码来源:ImportController.php
示例14: dirname
<?php
echo 'test1';
include dirname(__FILE__) . '/bootstrap.php';
$member = \MemberQuery::create()->findOneById(1);
$con = \Propel::getConnection();
if (!$con->beginTransaction()) {
throw new \Exception('Could not begin transaction');
}
try {
$transfer = \TransferQuery::create()->findOneById(1);
if (!$transfer) {
$transfer = new \Transfer();
$transfer->setMemberId($member->getId());
$transfer->save($con);
$transfer = \TransferQuery::create()->findOneById(1);
}
$transfer->setAmount($transfer->getAmount() + 2);
$transfer->save($con);
if (!$con->commit()) {
throw new \Exception('Could not commit transaction');
}
} catch (\Exception $e) {
$con->rollBack();
throw $e;
}
print_r('<pre>');
print_r($transfer->toArray());
print_r('</pre>');
echo "\n CONSISTENCY 2\n";
开发者ID:nikonehauser,项目名称:pt,代码行数:30,代码来源:consistency2.php
示例15: Transfer
GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Html::header(__('Transfer'), '', 'admin', 'rule', 'transfer');
$transfer = new Transfer();
$transfer->checkGlobal(READ);
if (isset($_POST['transfer'])) {
if (isset($_SESSION['glpitransfer_list'])) {
if (!Session::haveAccessToEntity($_POST['to_entity'])) {
Html::displayRightError();
}
$transfer->moveItems($_SESSION['glpitransfer_list'], $_POST['to_entity'], $_POST);
unset($_SESSION['glpitransfer_list']);
echo "<div class='b center'>" . __('Operation successful') . "<br>";
echo "<a href='central.php'>" . __('Back') . "</a></div>";
Html::footer();
exit;
}
} else {
if (isset($_POST['clear'])) {
开发者ID:btry,项目名称:glpi,代码行数:30,代码来源:transfer.action.php
示例16: renderContent
protected function renderContent()
{
//Get some pre value from URL
//The type of the content we want to create
$type = isset($_GET['type']) ? strtolower(trim($_GET['type'])) : '';
//If it has guid, it means this is a translated version
$guid = isset($_GET['guid']) ? strtolower(trim($_GET['guid'])) : '';
//Get the list of Content Type
$types = GxcHelpers::getAvailableContentType();
//List of language that should exclude not to translate
$lang_exclude = array();
//List of translated versions
$versions = array();
//Available Terms for this Object Type
$terms = array();
//Selected Terms
$selected_terms = array();
//Get Term Order
$term_orders = ConstantDefine::getTermOrder();
//If $type is empty then redirect to choose content type page
if ($type != '') {
//Check if the type appear in content type Definition
if (array_key_exists($type, $types)) {
// If the guid is not empty, it means we are creating a translated version of a content
// We will exclude the translated language and include the name of the translated content to $versions
if ($guid != '') {
$temp_object = Object::model()->findAll('guid=:gid', array(':gid' => $guid));
if (count($temp_object) > 0) {
foreach ($temp_object as $obj) {
$lang_exclude[] = $obj->lang;
$langs = GxcHelpers::getAvailableLanguages();
$versions[] = $obj->object_name . ' - ' . $langs[$obj->lang]['name'];
}
}
}
//Import the Content Type Class
Yii::import('common.content_type.' . $type . '.' . $types[$type]['class']);
//Init the class
$typeClassObj = new $types[$type]['class']();
$content_resources = $typeClassObj->Resources();
//We start to implement the checking Permission HERE
$param_content_check = array();
$data_content_check = array();
$param_content_check['type'] = $type;
if (GxcContentPermission::checkCreatePermission($param_content_check, $data_content_check, $typeClassObj->Permissions())) {
$param_content_check['new_content'] = true;
$content_status = GxcContentPermission::getContentStatus($param_content_check, $data_content_check, $typeClassObj->Permissions());
$model = new $types[$type]['class']();
// Uncomment the following line if AJAX validation is needed
// $this->performAjaxValidation($model);
$model->object_date = date('Y-m-d H:i:s');
$model->person = '';
$model->guid = $guid;
$get_languages = GxcHelpers::loadLanguageItems($lang_exclude);
$available_languages = array();
foreach ($get_languages as $key => $value) {
$available_languages[] = $key;
}
//Get available Taxonomy and Terms for this Object
$available_taxonomy = Taxonomy::model()->findAll(' type = :type AND lang IN (' . implode(',', $available_languages) . ') ', array(':type' => $type));
if ($available_taxonomy) {
foreach ($available_taxonomy as $t) {
$temp = array();
$temp['id'] = $t->taxonomy_id;
$temp['lang'] = $t->lang;
$temp['name'] = $t->name;
$temp['terms'] = array();
//Look for the Term Items belong to this Taxonomy
$list_terms = Term::model()->findAll(array('select' => '*', 'condition' => 'taxonomy_id=:id', 'order' => 't.parent ASC, t.order ASC', 'params' => array(':id' => $t->taxonomy_id)));
if ($list_terms) {
foreach ($list_terms as $term) {
$temp_item['id'] = $term->term_id;
$temp_item['name'] = CHtml::encode($term->name);
$temp_item['parent'] = $term->parent;
$temp['terms']['item_' . $term->term_id] = $temp_item;
}
}
$terms[$t->taxonomy_id] = $temp;
}
}
if (isset($_POST[$types[$type]['class']])) {
$model->attributes = $_POST[$types[$type]['class']];
//Convert the date time publish to timestamp
$model->object_date = strtotime($model->object_date);
$model->object_date_gmt = local_to_gmt($model->object_date);
//Check which button the User click To Send to person or group
$button = $_POST['which_button'];
$trans = new Transfer();
// Get the Terms that the User Choose
//
$post_terms = isset($_POST['terms']) ? $_POST['terms'] : array();
$selected_terms = array();
if (!empty($post_terms)) {
foreach ($post_terms as $t) {
$t = explode('_', $t);
if (!isset($selected_terms[$t[1]])) {
$selected_temp = array();
$selected_temp['id'] = $terms[$t[1]]['id'];
$selected_temp['lang'] = $terms[$t[1]]['lang'];
$selected_temp['name'] = $terms[$t[1]]['name'];
//.........这里部分代码省略.........
开发者ID:pramana08,项目名称:GXC-CMS-2,代码行数:101,代码来源:ObjectCreateWidget.php
示例17: transferComputer
/**
* Do automatic transfer if option is enable
*
* @param $line_links array : data from glpi_plugin_ocsinventoryng_ocslinks table
* @param $line_ocs array : data from ocs tables
*
* @return nothing
**/
static function transferComputer($line_links, $line_ocs)
{
global $DB, $PluginOcsinventoryngDBocs, $CFG_GLPI;
// Get all rules for the current plugin_ocsinventoryng_ocsservers_id
$rule = new RuleImportEntityCollection();
$data = array();
$data = $rule->processAllRules(array('ocsservers_id' => $line_links["plugin_ocsinventoryng_ocsservers_id"], '_source' => 'ocsinventoryng'), array(), array('ocsid' => $line_links["ocsid"]));
// If entity is changing move items to the new entities_id
if (isset($data['entities_id']) && $data['entities_id'] != $line_links['entities_id']) {
if (!isCommandLine() && !Session::haveAccessToEntity($data['entities_id'])) {
Html::displayRightError();
}
$transfer = new Transfer();
$transfer->getFromDB($CFG_GLPI['transfers_id_auto']);
$item_to_transfer = array("Computer" => array($line_links['computers_id'] => $line_links['computers_id']));
$transfer->moveItems($item_to_transfer, $data['entities_id'], $transfer->fields);
}
//If location is update by a rule
self::updateLocation($line_links, $data);
}
开发者ID:geldarr,项目名称:hack-space,代码行数:28,代码来源:ocsserver.class.php
示例18: Centre
zum Anbieter einer Fahrt aufnehmen.<?php
} else {
?>
zu einem Mitfahrer aufnehmen.<?php
}
?>
Ihre Daten werden per E-Mail übertragen und der Empfänger kann sich dann mit Ihnen in Verbindung setzen.<br />
Die mit einem Sternchen gekennzeichneten Felder sind Pflichtfelder. </p>
<div class="box">
<?php
$centre = new Centre();
$centreName = $centre->getNameById($_GET['centreId']);
$events = new Event();
$eventInfo = $events->getEventById($_GET['eventId']);
$transfer = new Transfer();
$transferInfo = $transfer->getTransferById($transferId);
if ($offers) {
?>
<form action="contact.php?eventId=<?php
echo $_GET['eventId'];
?>
¢reId=<?php
echo $_GET['centreId'];
?>
&mode=offer&transferId=<?php
echo $_GET['transferId'];
?>
&<?php
echo SID;
?>
开发者ID:rapude,项目名称:dhamma-reise,代码行数:31,代码来源:contact.php
示例19: getTransferHistory
/**
* Get the history workflow of the Object
* @param type $object
*/
public static function getTransferHistory($model)
{
$trans = Transfer::model()->with('from_user')->findAll(array('condition' => ' object_id=:obj ', 'params' => array(':obj' => $model->object_id), 'order' => 'transfer_id ASC'));
$trans_list = "<ul>";
$trans_list .= "<li>- <b>" . $model->author->display_name . "</b> " . t("cms", "created on") . " <b>" . date('m/d/Y H:i:s', $model->object_modified) . "</b></li>";
//Start to Translate all the Transition
foreach ($trans as $tr) {
if ($tr->type == ConstantDefine::TRANS_STATUS) {
$temp = "<li>- <b>" . $tr->from_user->display_name . "</b> " . t("cms", "changed status to") . " <b>" . self::convertObjectStatus($tr->after_status) . "</b> " . t("cms", "on") . " <b>" . date('m/d/Y H:i:s', $tr->time) . "</b></li>";
}
if ($tr->type == ConstantDefine::TRANS_ROLE) {
$temp = "<li>- <b>" . $tr->from_user->display_name . "</b> " . t("cms", "modified and sent to") . " <b>" . ucfirst($tr->note) . "</b> " . t("cms", "on") . " <b>" . date('m/d/Y H:i:s', $tr->time) . "</b></li>";
}
if ($tr->type == ConstantDefine::TRANS_PERSON) {
$to_user = User::model()->findbyPk($tr->to_user_id);
$name = "";
if ($to_user != null) {
$name = $to_user->display_name;
}
$temp = "<li>- <b>" . $tr->from_user->display_name . "</b> " . t("cms", "modified and sent to") . " <b>" . ucfirst($name) . "</b> " . t("cms", "on") . " <b>" . date('m/d/Y H:i:s', $tr->time) . "</b></li>";
}
$trans_list .= $temp;
}
$trans_list .= '</ul>';
return $trans_list;
}
开发者ID:pramana08,项目名称:GXC-CMS-2,代码行数:30,代码来源:Object.php
示例20: getAllotments
public function getAllotments()
{
//$applicant = $this->loadModel($id);
$allotments = $this->allotments;
// get all allotments made to this applicant
if (!empty($allotments)) {
// if allotment(s) was made
$cnt = count($allotments);
for ($i = 0; $i < $cnt; $i++) {
//check if it was transferred to anyone else
$criteria = new CDbCriteria(array('condition' => 'allotment_id=:aid', 'order' => 'transfer_date DESC', 'limit' => 1, 'params' => array(':aid' => $allotments[$i]->id)));
$transfer = Transfer::model()->find($criteria);
if ($transfer != null) {
//if transferred set $allotment date and deed_no
if ($transfer->applicant_id === $this->id) {
$allotments[$i]->date = $transfer->transfer_date;
$allotments[$i]->order_no = $transfer->deed_no;
$allotments[$i]->type = 'transfer';
} else {
unset($allotments[$i]);
}
}
}
}
//select allotments from transfers if any made only by transfer
$criteria = new CDbCriteria(array('condition' => 'applicant_id=:aid', 'order' => 'transfer_date DESC', 'limit' => 1, 'params' => array(':aid' => $this->id)));
$transfer = Transfer::model()->find($criteria);
if ($transfer != null) {
//if transferred set $allotment date and deed_no
if ($transfer->applicant_id === $this->id) {
$allotment = $transfer->allotment;
$allotment->applicant_id = $transfer->applicant_id;
|
请发表评论