本文整理汇总了PHP中Task::free方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::free方法的具体用法?PHP Task::free怎么用?PHP Task::free使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::free方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XMLExport
//.........这里部分代码省略.........
$xml .= " <priority><![CDATA[" . $contact_note->priority . "]]></priority>\n";
$xml .= " <send_email><![CDATA[" . $contact_note->send_email . "]]></send_email>\n";
$xml .= " <hours_work><![CDATA[" . $contact_note->hours_work . "]]></hours_work>\n";
$xml .= " <note_visibility><![CDATA[" . $contact_note->note_visibility . "]]></note_visibility>\n";
$xml .= " </contact_note>\n";
}
if (!$this->appendToFile($xml)) {
return false;
}
$xml = ' ';
if ($i == '1') {
$do_task = new Task();
$do_task->getTaskWithoutProject();
while ($do_task->next()) {
$xml .= " <contact_task>\n";
$xml .= " <idtask><![CDATA[" . $do_task->getData("idtask") . "]]></idtask>\n";
$xml .= " <task_description><![CDATA[" . $do_task->getData("task_description") . "]]></task_description>\n";
$xml .= " <due_date><![CDATA[" . $do_task->getData("due_date") . "]]></due_date>\n";
$xml .= " <category><![CDATA[" . $do_task->getData("category") . "]]></category>\n";
$xml .= " <iduser><![CDATA[" . $do_task->getData("iduser") . "]]></iduser>\n";
$xml .= " <due_date_dateformat><![CDATA[" . $do_task->getData("due_date_dateformat") . "]]></due_date_dateformat>\n";
$xml .= " <status><![CDATA[" . $do_task->getData("status") . "]]></status>\n";
$xml .= " <date_completed><![CDATA[" . $do_task->getData("date_completed") . "]]></date_completed>\n";
$xml .= " <idcontact><![CDATA[" . $do_task->getData("idcontact") . "]]></idcontact>\n";
$xml .= " <from_note><![CDATA[" . $do_task->getData("from_note") . "]]></from_note>\n";
$xml .= " <is_sp_date_set><![CDATA[" . $do_task->getData("is_sp_date_set") . "]]></is_sp_date_set>\n";
$xml .= " <task_category><![CDATA[" . $do_task->getData("task_category") . "]]></task_category>\n";
$xml .= " </contact_task>\n";
if (!$this->appendToFile($xml)) {
return false;
}
$xml = ' ';
}
$do_task->free();
}
$do_task = new Task();
$do_task->getContactTaskWithoutProject($do_contact->getData("idcontact"));
while ($do_task->next()) {
$xml .= " <contact_task>\n";
$xml .= " <idtask><![CDATA[" . $do_task->getData("idtask") . "]]></idtask>\n";
$xml .= " <task_description><![CDATA[" . $do_task->getData("task_description") . "]]></task_description>\n";
$xml .= " <due_date><![CDATA[" . $do_task->getData("due_date") . "]]></due_date>\n";
$xml .= " <category><![CDATA[" . $do_task->getData("category") . "]]></category>\n";
$xml .= " <iduser><![CDATA[" . $do_task->getData("iduser") . "]]></iduser>\n";
$xml .= " <due_date_dateformat><![CDATA[" . $do_task->getData("due_date_dateformat") . "]]></due_date_dateformat>\n";
$xml .= " <status><![CDATA[" . $do_task->getData("status") . "]]></status>\n";
$xml .= " <date_completed><![CDATA[" . $do_task->getData("date_completed") . "]]></date_completed>\n";
$xml .= " <idcontact><![CDATA[" . $do_task->getData("idcontact") . "]]></idcontact>\n";
$xml .= " <from_note><![CDATA[" . $do_task->getData("from_note") . "]]></from_note>\n";
$xml .= " <is_sp_date_set><![CDATA[" . $do_task->getData("is_sp_date_set") . "]]></is_sp_date_set>\n";
$xml .= " <task_category><![CDATA[" . $do_task->getData("task_category") . "]]></task_category>\n";
$xml .= " </contact_task>\n";
}
$do_task->free();
if (!$this->appendToFile($xml)) {
return false;
}
$xml = ' ';
/**
* For all the contact tasks which are associated with Project.
*/
$do_task = new Task();
//$do_task->getContactTasksAssociatedWithProject($do_contact->getData("idcontact"));
$do_task->getContactTasksAssociatedWithProject($do_contact->getData("idcontact"));
while ($do_task->next()) {
$do_project = new Project();
示例2: exportUserAccountandDelete
//.........这里部分代码省略.........
$xml .= " <contact_note>\n";
$xml .= " <idcontact_note><![CDATA[" . $contact_note->idcontact_note . "]]></idcontact_note>\n";
$xml .= " <idcontact><![CDATA[" . $contact_note->idcontact . "]]></idcontact>\n";
$xml .= " <note><![CDATA[" . $contact_note->note . "]]></note>\n";
$xml .= " <date_added><![CDATA[" . $contact_note->date_added . "]]></date_added>\n";
$xml .= " <document><![CDATA[" . $contact_note->document . "]]></document>\n";
$xml .= " <idcompany><![CDATA[" . $contact_note->idcompany . "]]></idcompany>\n";
$xml .= " <iduser><![CDATA[" . $contact_note->iduser . "]]></iduser>\n";
$xml .= " <priority><![CDATA[" . $contact_note->priority . "]]></priority>\n";
$xml .= " <send_email><![CDATA[" . $contact_note->send_email . "]]></send_email>\n";
$xml .= " <hours_work><![CDATA[" . $contact_note->hours_work . "]]></hours_work>\n";
$xml .= " <note_visibility><![CDATA[" . $contact_note->note_visibility . "]]></note_visibility>\n";
$xml .= " </contact_note>\n";
}
if ($i == '1') {
$do_task = new Task();
$do_task->getContactTaskWithoutProjectAndWithUser($iduser);
while ($do_task->next()) {
$xml .= " <contact_task>\n";
$xml .= " <idtask><![CDATA[" . $do_task->getData("idtask") . "]]></idtask>\n";
$xml .= " <task_description><![CDATA[" . $do_task->getData("task_description") . "]]></task_description>\n";
$xml .= " <due_date><![CDATA[" . $do_task->getData("due_date") . "]]></due_date>\n";
$xml .= " <category><![CDATA[" . $do_task->getData("category") . "]]></category>\n";
$xml .= " <iduser><![CDATA[" . $do_task->getData("iduser") . "]]></iduser>\n";
$xml .= " <due_date_dateformat><![CDATA[" . $do_task->getData("due_date_dateformat") . "]]></due_date_dateformat>\n";
$xml .= " <status><![CDATA[" . $do_task->getData("status") . "]]></status>\n";
$xml .= " <date_completed><![CDATA[" . $do_task->getData("date_completed") . "]]></date_completed>\n";
$xml .= " <idcontact><![CDATA[" . $do_task->getData("idcontact") . "]]></idcontact>\n";
$xml .= " <from_note><![CDATA[" . $do_task->getData("from_note") . "]]></from_note>\n";
$xml .= " <is_sp_date_set><![CDATA[" . $do_task->getData("is_sp_date_set") . "]]></is_sp_date_set>\n";
$xml .= " <task_category><![CDATA[" . $do_task->getData("task_category") . "]]></task_category>\n";
$xml .= " </contact_task>\n";
}
$do_task->free();
}
$do_task = new Task();
$do_task->getContactTaskWithoutProjectAndWithContact($do_contact->getData("idcontact"));
while ($do_task->next()) {
$xml .= " <contact_task>\n";
$xml .= " <idtask><![CDATA[" . $do_task->getData("idtask") . "]]></idtask>\n";
$xml .= " <task_description><![CDATA[" . $do_task->getData("task_description") . "]]></task_description>\n";
$xml .= " <due_date><![CDATA[" . $do_task->getData("due_date") . "]]></due_date>\n";
$xml .= " <category><![CDATA[" . $do_task->getData("category") . "]]></category>\n";
$xml .= " <iduser><![CDATA[" . $do_task->getData("iduser") . "]]></iduser>\n";
$xml .= " <due_date_dateformat><![CDATA[" . $do_task->getData("due_date_dateformat") . "]]></due_date_dateformat>\n";
$xml .= " <status><![CDATA[" . $do_task->getData("status") . "]]></status>\n";
$xml .= " <date_completed><![CDATA[" . $do_task->getData("date_completed") . "]]></date_completed>\n";
$xml .= " <idcontact><![CDATA[" . $do_task->getData("idcontact") . "]]></idcontact>\n";
$xml .= " <from_note><![CDATA[" . $do_task->getData("from_note") . "]]></from_note>\n";
$xml .= " <is_sp_date_set><![CDATA[" . $do_task->getData("is_sp_date_set") . "]]></is_sp_date_set>\n";
$xml .= " <task_category><![CDATA[" . $do_task->getData("task_category") . "]]></task_category>\n";
$xml .= " </contact_task>\n";
}
$do_task->free();
/**
* For all the contact tasks which are associated with Project.
*/
$do_task = new Task();
//$do_task->getContactTasksAssociatedWithProject($do_contact->getData("idcontact"));
$do_task->getContactTasksAssociatedWithProjectWithContact($do_contact->getData("idcontact"));
while ($do_task->next()) {
$do_project = new Project();
$do_project->getId($do_task->idproject);
$xml .= " <contact_task_with_project>\n";
$xml .= " <idproject><![CDATA[" . $do_project->idproject . "]]></idproject>\n";
$xml .= " <iduser><![CDATA[" . $do_project->iduser . "]]></iduser>\n";
示例3: eventImportAccount
function eventImportAccount(EventControler $evtcl)
{
$msg = "";
$uploaded_file = $_FILES['fields']['name']['import_account'];
$target_path = 'files/' . $uploaded_file;
if (!move_uploaded_file($_FILES['fields']['tmp_name']['import_account'], $target_path)) {
$msg = "There was an error uploading the file, please try again!";
} else {
chmod($target_path, 0755);
if (file_exists($target_path)) {
//$xml = simplexml_load_file($_SERVER['DOCUMENT_ROOT']."/".$target_path);
$str_xml = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $target_path);
$str_xml = preg_replace('/[^(\\x20-\\x7F)]*/', '', $str_xml);
$xml = simplexml_load_string($str_xml);
echo '<pre>';
print_r($xml);
echo '</pre>';
die;
if ($xml !== FALSE) {
$c_cnt = count($xml->contact);
if ($c_cnt) {
for ($i = 0; $i < $c_cnt; $i++) {
$do_contact = new Contact();
$contact = $xml->contact[$i];
$do_contact->firstname = $contact->firstname;
$do_contact->lastname = $contact->lastname;
$do_contact->position = $contact->position;
$do_contact->company = $contact->company;
$do_contact->idcompany = $contact->idcompany;
$do_contact->iduser = $_SESSION['do_User']->iduser;
$do_contact->picture = $contact->picture;
$do_contact->summary = $contact->summary;
$do_contact->birthday = $contact->birthday;
$do_contact->portal_code = $contact->portal_code;
$do_contact->fb_userid = $contact->fb_userid;
$do_contact->tw_user_id = $contact->tw_user_id;
$do_contact->email_optout = $contact->email_optout;
$do_contact->add();
$lastInsertedContId = $do_contact->getPrimaryKeyValue();
/**
*Contact Address
*/
$ca_cnt = count($contact->contact_address);
if ($ca_cnt) {
for ($ca_cnt_i = 0; $ca_cnt_i < $ca_cnt; $ca_cnt_i++) {
$do_contact_address = new ContactAddress();
$contact_address = $contact->contact_address[$ca_cnt_i];
$do_contact_address->city = $contact_address->city;
$do_contact_address->country = $contact_address->country;
$do_contact_address->state = $contact_address->state;
$do_contact_address->street = $contact_address->street;
$do_contact_address->zipcode = $contact_address->zipcode;
$do_contact_address->idcontact = $lastInsertedContId;
$do_contact_address->address = $contact_address->address;
$do_contact_address->address_type = $contact_address->address_type;
$do_contact_address->add();
$do_contact_address->free();
}
}
/**
*Contact Email
*/
$ce_cnt = count($contact->contact_email);
if ($ce_cnt) {
for ($ce_cnt_i = 0; $ce_cnt_i < $ce_cnt; $ce_cnt_i++) {
$do_contact_email = new ContactEmail();
$contact_email = $contact->contact_email[$ce_cnt_i];
$do_contact_email->idcontact = $lastInsertedContId;
$do_contact_email->email_address = $contact_email->email_address;
$do_contact_email->email_type = $contact_email->email_type;
$do_contact_email->email_isdefault = $contact_email->email_isdefault;
$do_contact_email->add();
$do_contact_email->free();
}
}
/**
*Contact Phone
*/
$cp_cnt = count($contact->contact_phone);
if ($cp_cnt) {
for ($cp_cnt_i = 0; $cp_cnt_i < $cp_cnt; $cp_cnt_i++) {
$do_contact_phone = new ContactPhone();
$contact_phone = $contact->contact_phone[$cp_cnt_i];
$do_contact_phone->phone_number = $contact_phone->phone_number;
$do_contact_phone->phone_type = $contact_phone->phone_type;
$do_contact_phone->idcontact = $lastInsertedContId;
$do_contact_phone->add();
$do_contact_phone->free();
}
}
/**
*Contact Note
*/
$cn_cnt = count($contact->contact_note);
if ($cn_cnt) {
for ($cn_cnt_i = 0; $cn_cnt_i < $cn_cnt; $cn_cnt_i++) {
$do_contact_note = new ContactNotes();
$contact_note = $contact->contact_note[$cn_cnt_i];
$do_contact_note->idcontact = $lastInsertedContId;
$do_contact_note->note = $contact_note->note;
//.........这里部分代码省略.........
示例4: elseif
} elseif ($date_diff > 15) {
$return_string = 'Later';
}
$due_date = $return_string;
$is_sp_date_set = "Yes";
$do_task = new Task();
$do_task->addNew();
$do_task->category = $category;
$do_task->due_date = $due_date;
$do_task->due_date_dateformat = $formated_date;
$do_task->iduser = $iduser;
$do_task->is_sp_date_set = $is_sp_date_set;
$do_task->status = 'open';
$do_task->task_description = $parse_content;
$do_task->add();
$do_task->free();
}
}
/**
* If the dropbox code is set to add the project note
* Check if the sender is associated with the project task and if yes add the discussion for that project task
* If the user is not associated with the project task then check if the project is a public project and if yes
* add the discussion by specifying the drop_box_sender
*/
if ($addprojectnote === true) {
$parse_content = ereg_replace("^\\>", "", $final_message_content);
$do_project_task = new ProjectTask();
$do_project_task->getTaskDetailByDropBoxCode($drop_box_code_proj_task);
//echo $do_project_task->idproject_task; echo $do_project_task->idproject;die();
//$do_task = new Task();
//$do_task->getId($drop_box_code_proj_task);
示例5: reopenTask
static function reopenTask($taskid)
{
$task = new Task();
$qry = 'UPDATE task ' . 'SET status=0 ' . 'WHERE id=' . $taskid;
$result = $task->query($qry);
if (!$result) {
common_log_db_error($user, 'UPDATE TASK', __FILE__);
}
$task->free();
}