Ejemplo n.º 1
0
    $queryresult = $db->query($querystatement);
    return $queryresult;
}
$phpbms->cssIncludes[] = "pages/files.css";
$phpbms->jsIncludes[] = "modules/base/javascript/file.js";
//Form Elements
//==============================================================
$theform = new phpbmsForm();
$theform->enctype = "multipart/form-data";
if (isset($therecord["id"])) {
    $theinput = new inputField("name", $therecord["name"], NULL, true, NULL, 64, 128);
    $theinput->setAttribute("class", "important");
    $theform->addField($theinput);
}
$theinput = new inputField("type", $therecord["type"], "file type", false, null, 25);
$theinput->setAttribute("readonly", "readonly");
$theinput->setAttribute("class", "uneditable");
$theform->addField($theinput);
$theinput = new inputRolesList($db, "roleid", $therecord["roleid"], "access (role)");
$theform->addField($theinput);
if (isset($_GET["tabledefid"]) && !isset($therecord["id"])) {
    $theinput = new inputSmartSearch($db, "fileid", "Pick File", "", "exisiting file", false, 40);
    $theform->addField($theinput);
}
//end if
$thetable->getCustomFieldInfo();
$theform->prepCustomFields($db, $thetable->customFieldsQueryResult, $therecord);
$theform->jsMerge();
//==============================================================
//End Form Elements
include "header.php";
Ejemplo n.º 2
0
$therecord = $thetable->processAddEditPage();
if (isset($therecord["phpbmsStatus"])) {
    $statusmessage = $therecord["phpbmsStatus"];
}
$pageTitle = "Scheduler";
$currentpath = getcwd();
$phpbms->cssIncludes[] = "pages/scheduler.css";
$phpbms->jsIncludes[] = "modules/base/javascript/scheduler.js";
//Form Elements
//==============================================================
$theform = new phpbmsForm();
$theform->id = $theform->name;
$theinput = new inputCheckbox("inactive", $therecord["inactive"]);
$theform->addField($theinput);
$theinput = new inputField("name", $therecord["name"], NULL, true, NULL, 32, 64);
$theinput->setAttribute("class", "important");
$theform->addField($theinput);
if (moduleExists("mod:b2d42220-443b-fe74-dbdb-ed2c0968c38c", $phpbms->modules)) {
    $list = array("file" => "job", "push record" => "pushrecord");
    $theinput = new inputBasicList("scripttype", $therecord["scripttype"], $list, "script type");
    $theform->addField($theinput);
    $theinput = new inputSmartSearch($db, "pushrecordid", "Pick Push Record For Cron", $therecord["pushrecordid"]);
    $theform->addField($theinput);
}
//end if
$theinput = new inputField("job", $therecord["job"], "script", false, NULL, 32, 128, false);
$theform->addField($theinput);
$theinput = new inputDatePicker("startdate", $therecord["startdate"], "start date", true, 11, 15, false);
$theform->addField($theinput);
$theinput = new inputTimePicker("starttime", $therecord["starttime"], "start time", true, 11, 15, false);
$theform->addField($theinput);
Ejemplo n.º 3
0
 function getFields($therecord)
 {
     global $db;
     $theinput = new inputField("shipping_markup", $therecord["shipping_markup"], "shipping markup", false, "real", 4, 4);
     $fields[] = $theinput;
     $theinput = new inputField("shipping_postalcode", $therecord["shipping_postalcode"], "shipping origination zip/postal code", false, NULL, 32, 128);
     $fields[] = $theinput;
     $theinput = new inputDataTableList($db, "default_payment", $therecord["default_payment"], "paymentmethods", "uuid", "name", "inactive=0 AND (`type` != 'receivable' OR `type` IS NULL)", "priority,name", true, "default payment method", true, "");
     $fields[] = $theinput;
     $theinput = new inputDataTableList($db, "default_shipping", $therecord["default_shipping"], "shippingmethods", "uuid", "name", "inactive=0", "priority,name", true, "default shipping method", true, "");
     $fields[] = $theinput;
     $theinput = new inputDataTableList($db, "default_discount", $therecord["default_discount"], "discounts", "uuid", "name", "inactive=0", "name", true, "default discount", true, "");
     $fields[] = $theinput;
     $theinput = new inputDataTableList($db, "default_taxarea", $therecord["default_taxarea"], "tax", "uuid", "name", "inactive=0", "name", true, "default tax area", true, "");
     $fields[] = $theinput;
     $theinput = new inputBasicList("default_clienttype", $therecord["default_clienttype"], array("prospect" => "prospect", "client" => "client"), "default type");
     $fields[] = $theinput;
     $theinput = new inputCheckbox("default_hascredit", $therecord["default_hascredit"], "has credit by default");
     $fields[] = $theinput;
     $theinput = new inputCurrency("default_creditlimit", $therecord["default_creditlimit"], "default credit limit");
     $fields[] = $theinput;
     $theinput = new inputField("term1_days", $therecord["term1_days"], "term 1 length", false, "integer", 4, 4);
     $theinput->setAttribute("class", "important");
     $fields[] = $theinput;
     $theinput = new inputField("term1_percentage", $therecord["term1_percentage"], "term 1 percentage", false, "real", 4, 4);
     $fields[] = $theinput;
     $theinput = new inputField("term2_days", $therecord["term2_days"], "term 2 length", false, "integer", 4, 4);
     $theinput->setAttribute("class", "important");
     $fields[] = $theinput;
     $theinput = new inputField("term2_percentage", $therecord["term2_percentage"], "term 2 percentage", false, "real", 4, 4);
     $fields[] = $theinput;
     $theinput = new inputField("term3_days", $therecord["term3_days"], "term 3 length", false, "integer", 4, 4);
     $theinput->setAttribute("class", "important");
     $fields[] = $theinput;
     $theinput = new inputField("term3_percentage", $therecord["term3_percentage"], "term 3 percentage", false, "real", 4, 4);
     $fields[] = $theinput;
     $theinput = new inputCheckbox("prospects_on_orders", $therecord["prospects_on_orders"], "allow prospects on sales orders");
     $fields[] = $theinput;
     $theinput = new inputCheckbox("encrypt_payment_fields", $therecord["encrypt_payment_fields"], "encrypt/obfuscate payment information");
     $fields[] = $theinput;
     $theinput = new inputField("encryption_key_path", $therecord["encryption_key_path"], "absolute server path to a file containing the encryption key", false, NULL, 64);
     $fields[] = $theinput;
     $theinput = new inputCheckbox("show_payment_instructions", $therecord["show_payment_instructions"], "show payment instrucions");
     $fields[] = $theinput;
     return $fields;
 }
Ejemplo n.º 4
0
 function prepCustomFields($db, $queryresult, $therecord)
 {
     while ($fieldInfo = $db->fetchArray($queryresult)) {
         $id = $fieldInfo["field"];
         $name = $fieldInfo["name"];
         $required = (bool) $fieldInfo["required"];
         $format = $fieldInfo["format"] ? $fieldInfo["format"] : null;
         $size = "40";
         $value = isset($therecord[$id]) ? $therecord[$id] : "";
         //need to handle roleid
         $disabled = !hasRights($fieldInfo["roleid"]);
         //different custom fields (based on number) have different types
         switch (substr($id, 6)) {
             case 1:
             case 2:
                 if ($value === "") {
                     $value = 0;
                 }
                 if ($format == "currency") {
                     $theinput = new inputCurrency($id, $value, $name, $required);
                 } else {
                     $theinput = new inputField($id, $value, $name, $required, $format, 8, 128);
                 }
                 $generator = true;
                 if ($disabled) {
                     $theinput->setAttribute("readonly", "readonly");
                     $theinput->setAttribute("class", "uneditable");
                     $generator = false;
                 }
                 //endif
                 break;
             case 3:
             case 4:
                 if ($disabled) {
                     $theinput = new inputField($id, $value, $name, $required, null, 10, 15);
                     $theinput->setAttribute("readonly", "readonly");
                     $theinput->setAttribute("class", "uneditable");
                     $generator = false;
                 } else {
                     if ($format == "date") {
                         $theinput = new inputDatePicker($id, $value, $name, $required);
                     } else {
                         $value = explode(" ", $value);
                         $value = count($value) > 1 ? $value[1] : "";
                         $theinput = new inputTimePicker($id, $value, $name, $required);
                     }
                     //endif
                     $generator = true;
                 }
                 //endif
                 break;
             case 5:
             case 6:
                 if ($format == "list" && !$disabled) {
                     $theinput = new inputChoiceList($db, $id, $value, $id . "-" . $fieldInfo["tabledefid"], $name);
                     $generator = false;
                 } else {
                     $theinput = new inputField($id, $value, $name, $required, $format, 40, 254);
                     $generator = true;
                 }
                 //endif
                 if ($disabled) {
                     $theinput->setAttribute("readonly", "readonly");
                     $theinput->setAttribute("class", "uneditable");
                     $generator = false;
                 }
                 //endif
                 break;
             case 7:
             case 8:
                 $generator = false;
                 $theinput = new inputCheckbox($id, $value, $name, $disabled);
                 break;
         }
         //endswitch
         //need to handle creation of onload js for generator, but only if type
         // not = checkbox or list.
         if ($generator && $fieldInfo["generator"]) {
             $this->onload[] = "var " . $id . "Button = getObjectFromID('" . $id . "Button'); connect(" . $id . "Button, 'onclick', function(){var " . $id . " = getObjectFromID('" . $id . "');" . $id . ".value = " . $fieldInfo["generator"] . "})";
         }
         $this->addField($theinput);
     }
     //endwile
     //rewind the queryresult pointer (if not false)
     if ($queryresult) {
         $db->seek($queryresult, 0);
     }
 }
Ejemplo n.º 5
0
 function getFields($therecord)
 {
     global $db;
     $theinput = new inputField("mailchimp_apikey", $therecord["mailchimp_apikey"], "mailchimp apikey", false, NULL, 48);
     $fields[] = $theinput;
     $theinput = new inputCheckbox("mailchimp_secure", $therecord["mailchimp_secure"], "use ssl connection");
     $fields[] = $theinput;
     $theinput = new inputField("mailchimp_list_id", $therecord["mailchimp_list_id"], "list id");
     $fields[] = $theinput;
     $theinput = new inputField("mailchimp_last_sync_date", $therecord["mailchimp_last_sync_date"], "last sync date");
     $theinput->setAttribute("class", "uneditable");
     $theinput->setAttribute("readonly", "readonly");
     $fields[] = $theinput;
     return $fields;
 }
Ejemplo n.º 6
0
$theinput->setAttribute("title", "Enter the email address to send site mail from. Will also be used as part of your contact details.");
$theform->addField($theinput);
$theinput = new inputField("sendmail", $_SESSION["userinfo"]["sendmail"], "sendmail path", false, null, 32, 255);
$theinput->setAttribute("title", "Enter the path to the sendmail program directory on the host server. Defaults to: '/usr/sbin/sendmail -bs'");
$theform->addField($theinput);
$theinput = new inputField("smtphost", $_SESSION["userinfo"]["smtphost"], "SMTP host", false, null, 32, 255);
$theinput->setAttribute("title", "Enter the name of the SMTP host. Defaults to: 'localhost'");
$theform->addField($theinput);
$theinput = new inputField("smtpport", $_SESSION["userinfo"]["smtpport"], "SMTP port", false, "integer", 10, 10);
$theinput->setAttribute("title", "Enter the port number of your SMTP server. Use 25 for most unsecure servers and 465 for most secure servers. Defaults to: 25");
$theform->addField($theinput);
$theinput = new inputField("smtpuser", $_SESSION["userinfo"]["smtpuser"], "SMTP username", false, NULL, 32, 255);
$theinput->setAttribute("title", "Enter the username for access to the SMTP host.");
$theform->addField($theinput);
$theinput = new inputField("smtppass", $_SESSION["userinfo"]["smtppass"], "SMTP password", false, "password", 32, 255);
$theinput->setAttribute("title", "Enter the password for the SMTP host.");
$theform->addField($theinput);
$theform->jsMerge();
//==============================================================
//End Form Elements
include "header.php";
?>
<div class="bodyline">
    <form action="<?php 
echo htmlentities($_SERVER["PHP_SELF"]);
?>
" method="post" name="record" id="record" onsubmit="return false">
    <input type="hidden" id="command" name="command" value=""/>

    <h1><span><?php 
echo $pageTitle;