Example #1
0
}
$TPL["paymentMethodOptions"] = $expenseForm->get_value("paymentMethod");
$TPL["reimbursementRequiredOption"] = $rr_label;
$scr_label = "No";
if ($expenseForm->get_value("seekClientReimbursement")) {
    $scr_sel = " checked";
    $scr_label = "Yes";
}
$TPL["seekClientReimbursementLabel"] = $scr_label;
$seekClientReimbursementOption = "<input type=\"checkbox\" value=\"1\" name=\"seekClientReimbursement\"" . $scr_sel . ">";
$scr_hidden = "<input type=\"hidden\" name=\"seekClientReimbursement\" value=\"" . $expenseForm->get_value("seekClientReimbursement") . "\">";
$TPL["seekClientReimbursementOption"] = $scr_label . $scr_hidden;
$c = new client();
$c->set_id($expenseForm->get_value("clientID"));
$c->select();
$clientName = page::htmlentities($c->get_name());
$clientName and $TPL["printer_clientID"] = $clientName;
$TPL["field_expenseFormComment"] = $expenseForm->get_value("expenseFormComment", DST_HTML_DISPLAY);
if (is_object($expenseForm) && $expenseForm->get_id() && check_optional_allow_edit()) {
    $TPL["expenseFormButtons"] .= '
  <button type="submit" name="cancel" value="1" class="delete_button">Delete<i class="icon-trash"></i></button>
  <button type="submit" name="save" value="1" class="save_button">Save<i class="icon-ok-sign"></i></button>
  <button type="submit" name="finalise" value="1" class="save_button">To Admin<i class="icon-arrow-right"></i></button>
  ';
    $TPL["paymentMethodOptions"] = "<select name=\"paymentMethod\">" . $paymentOptions . "</select>";
    $TPL["reimbursementRequiredOption"] = $reimbursementRequiredRadios;
    $TPL["seekClientReimbursementOption"] = $seekClientReimbursementOption;
    $options["clientStatus"] = "Current";
    $ops = client::get_list($options);
    $ops = array_kv($ops, "clientID", "clientName");
    $TPL["field_clientID"] = "<select name=\"clientID\"><option value=\"\">" . page::select_options($ops, $expenseForm->get_value("clientID")) . "</select>";
Example #2
0
}
$TPL["clientCategoryOptions"] = page::select_options($cc, $client->get_value("clientCategory"));
$client->get_value("clientCategory") and $TPL["client_clientCategoryLabel"] = $cc[$client->get_value("clientCategory")];
// client contacts
if ($_POST["clientContact_save"] || $_POST["clientContact_delete"]) {
    $clientContact = new clientContact();
    $clientContact->read_globals();
    if ($_POST["clientContact_save"]) {
        #$clientContact->set_value('clientID', $_POST["clientID"]);
        $clientContact->save();
    }
    if ($_POST["clientContact_delete"]) {
        $clientContact->delete();
    }
}
if (!$clientID) {
    $TPL["message_help"][] = "Create a new Client by inputting the Client Name and other details and clicking the Create New Client button.";
    $TPL["main_alloc_title"] = "New Client - " . APPLICATION_NAME;
    $TPL["clientSelfLink"] = "New Client";
} else {
    $TPL["main_alloc_title"] = "Client " . $client->get_id() . ": " . $client->get_name() . " - " . APPLICATION_NAME;
    $TPL["clientSelfLink"] = sprintf("<a href=\"%s\">%d %s</a>", $client->get_url(), $client->get_id(), $client->get_name(array("return" => "html")));
}
if ($current_user->have_role("admin")) {
    $TPL["invoice_links"] .= "<a href=\"" . $TPL["url_alloc_invoice"] . "clientID=" . $clientID . "\">New Invoice</a>";
}
$projectListOps = array("showProjectType" => true, "clientID" => $client->get_id());
$TPL["projectListRows"] = project::get_list($projectListOps);
$TPL["client_clientPostalAddress"] = $client->format_address("postal");
$TPL["client_clientStreetAddress"] = $client->format_address("street");
include_template("templates/clientM.tpl");
Example #3
0
 function update_search_index_doc(&$index)
 {
     $p =& get_cached_table("person");
     $projectModifiedUser = $this->get_value("projectModifiedUser");
     $projectModifiedUser_field = $projectModifiedUser . " " . $p[$projectModifiedUser]["username"] . " " . $p[$projectModifiedUser]["name"];
     $projectName = $this->get_name();
     $projectShortName = $this->get_name(array("showShortProjectLink" => true));
     $projectShortName && $projectShortName != $projectName and $projectName .= " " . $projectShortName;
     if ($this->get_value("clientID")) {
         $c = new client();
         $c->set_id($this->get_value("clientID"));
         $c->select();
         $clientName = $c->get_name();
     }
     $doc = new Zend_Search_Lucene_Document();
     $doc->addField(Zend_Search_Lucene_Field::Keyword('id', $this->get_id()));
     $doc->addField(Zend_Search_Lucene_Field::Text('name', $projectName, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('desc', $this->get_value("projectComments"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('cid', $this->get_value("clientID"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('client', $clientName, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('modifier', $projectModifiedUser_field, "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('type', $this->get_value("projectType"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateTargetStart', str_replace("-", "", $this->get_value("dateTargetStart")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateTargetCompletion', str_replace("-", "", $this->get_value("dateTargetCompletion")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateStart', str_replace("-", "", $this->get_value("dateActualStart")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('dateCompletion', str_replace("-", "", $this->get_value("dateActualCompletion")), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('status', $this->get_value("projectStatus"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('priority', $this->get_value("projectPriority"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('tf', $this->get_value("cost_centre_tfID"), "utf-8"));
     $doc->addField(Zend_Search_Lucene_Field::Text('billed', $this->get_value("customerBilledDollars"), "utf-8"));
     $index->addDocument($doc);
 }