/**
  * @param $id
  * @return \Delivery\Entity\User
  */
 public function findUser($id)
 {
     if ($this->cache->has($id)) {
         $entity = $this->cache->get($id);
     } else {
         $entity = $this->repository->find($id);
     }
     return $entity;
 }
Example #2
0
File: ACL.php Project: h3rb/page
 public static function set($haystack, $needle, $delim = ',')
 {
     if (has($haystack, $needle)) {
         return $haystack;
     }
     return $haystack . $delim . $needle;
 }
Example #3
0
 public function run()
 {
     writeln("<comment>Run/new mysql container {$this->container}</comment>");
     $env = Env::getDotEnv();
     $db = getenv('DB_NAME');
     if (empty($db)) {
         $db = getenv('DB_DATABASE');
         // Laravel support
     }
     $password = getenv('DB_PASSWORD');
     $user = getenv('DB_USER');
     if (empty($user)) {
         $user = getenv('DB_USERNAME');
         // Laravel support
     }
     $version = has('mysql.version') ? get('mysql.version') : '5.6';
     $command = "docker run --name {$this->container} ";
     $command .= "-e MYSQL_ROOT_PASSWORD={$password} ";
     $command .= "-e MYSQL_DATABASE={$db} ";
     if ($user != 'root') {
         $command .= "-e MYSQL_USER={$user} ";
         $command .= "-e MYSQL_PASSWORD={$password} ";
     }
     $command .= "-p 3306:3306 -d mysql:{$version}";
     Helpers::doLocal($command);
     Helpers::waitForPort('Waiting for mysql to start', $this->ip, 3306);
 }
Example #4
0
 public function __construct($container_name)
 {
     $this->dir = Helpers::getPackageDir();
     $this->webdir = Helpers::getProjectDir();
     $this->image = has('docker.image') ? get('docker.image') : 'laravel';
     $this->container = $container_name;
     $this->ip = Helpers::getMachineIp();
 }
Example #5
0
/**
 * @author Sérgio Rafael Siqueira <*****@*****.**>
 *
 * @param array $xss
 *
 * @return array
 */
function sort(array $xss)
{
    $xss = array_values($xss);
    if (!has(1, $xss)) {
        return $xss;
    }
    $pivot = head($xss);
    $xs = tail($xss);
    $left = array_filter($xs, function ($x) use($pivot) {
        return $x < $pivot;
    });
    $right = array_filter($xs, function ($x) use($pivot) {
        return $x > $pivot;
    });
    return array_merge(sort($left), [$pivot], sort($right));
}
Example #6
0
 public static function getMachineIp()
 {
     $result = '';
     if (has('docker.machine.ip')) {
         $result = get('docker.machine.ip');
         return $result;
     } else {
         $docker_name = env('server.host');
         writeln("Getting environment data from {$docker_name}");
         $output = runLocally("docker-machine env {$docker_name}");
         if (preg_match('#DOCKER_HOST\\=\\"tcp:\\/\\/(.*):#i', $output, $matches)) {
             $result = $matches[1];
         }
         set('docker.machine.ip', $result);
         return $result;
     }
 }
Example #7
0
<?php

function has($string, $anotherString)
{
    return strpos($string, $anotherString) !== false;
}
foreach (file($argv[1]) as $line) {
    $theJSON = trim($line);
    if ($theJSON != "") {
        $sum = 0;
        list($stuff, $items) = explode("[", $theJSON);
        foreach (explode("{", $items) as $item) {
            if (has($item, "id") && has($item, "label")) {
                list($stuff, $id_with_comma) = explode(" ", $item);
                list($id) = explode(",", $id_with_comma);
                $sum += $id;
            }
        }
        echo "{$sum}\n";
    }
}
Example #8
0
    run('echo "<?php return require \'' . $file . '.php\';" > server.php');
    run('echo "<?php return require \'env-' . $file . '.php\';" > env.php');
    cd('{{release_path}}');
    $adminCoreCommands = has('adminCoreCommands') ? get('adminCoreCommands') : true;
    if ($adminCoreCommands) {
        // run all basic luya commands
        run('./vendor/bin/luya migrate --interactive=0');
    }
    $commands = has('beforeCommands') ? get('beforeCommands') : [];
    foreach ($commands as $cmd) {
        run($cmd);
    }
    if ($adminCoreCommands) {
        run('./vendor/bin/luya import');
        run('./vendor/bin/luya health');
    }
    $commands = has('afterCommands') ? get('afterCommands') : [];
    foreach ($commands as $cmd) {
        run($cmd);
    }
});
task('luya:command_exporter', function () {
    run('cd {{release_path}} && ./vendor/bin/luya exporter/export');
});
set('shared_dirs', ['public_html/storage']);
task('luya', array('deploy:prepare', 'deploy:release', 'deploy:update_code', 'deploy:vendors', 'deploy:luya', 'deploy:symlink', 'deploy:shared', 'cleanup'))->desc('LUYA project deployment');
task('cleanup:deployfile', function () {
    run('rm -f {{release_path}}/deploy.php');
    run('rm -f {{release_path}}/README.md');
});
after('cleanup', 'cleanup:deployfile');
Example #9
0
include "header.php";
$ua = str_replace(array("/", "+", "_", "\n", "\t", "."), " ", strtolower($_SERVER['HTTP_USER_AGENT']));
function has($t)
{
    global $ua;
    return !(strpos($ua, $t) === false);
}
//not complete list but 99% of systems share where ie10 is not available
//IE 09 is available for vista and up
//IE 10 is only available for win7 and win8 || has("windows nt 6.0")
//IE 11 is only available for win7 and win8 || has("windows nt 6.0")
// 5->2000/xp/2003 6.0->vista, 6.1->win7, 6.2->win8, 6.3->win 8.1
$no_ie = has("os x") || has("linux");
$no_ie_system = has("windows nt 4") || has("windows nt 5") || has("windows nt 6 0") || has("os x") || has("linux");
$no_sa = !has("os x");
$no_sa_system = has("os x 10 4") || has("os x 10 5") || has("os x 10 6") || has("os x 10 7");
#echo $no_sa;
#
//$u_sa="http://www.apple.com/safari/";
$sa_map = array("en" => "", "sv" => "se", "ja" => "jp", "sl" => "si", "uk" => "ua", "rm" => "de", "da" => "dk", "ca" => "es");
$sal = "https://itunes.apple.com/%s/app/os-x-yosemite/id915041082?mt=12";
//if (in_array($ll, array("de","es","pl","pt","fr","nl")))
//    $sal="http://clkuk.tradedoubler.com/click?p=23761&a=2364610&url=https%%3A%%2F%%2Fitunes.apple.com%%2F%s%%2Fapp%%2Fos-x-mavericks%%2Fid675248567%%3Fmt%%3D12%%26uo%%3D4%%26partnerId%%3D2003";
$u_sa = sprintf($sal, $ll);
if (isset($sa_map[$ll])) {
    $u_sa = sprintf($sal, $sa_map[$ll]);
}
$u_ff = "http://www.mozilla.com/firefox/";
$u_op = "http://www.opera.com/browser/";
#$u_ch=sprintf("http://www.google.com/chrome?hl=%s",$ll);
$u_ch = "https://www.google.com/chrome/browser/desktop/";
Example #10
0
function show_comments()
{
    global $taskID;
    global $TPL;
    global $task;
    if ($_REQUEST["commentSummary"]) {
        $_REQUEST["showTaskHeader"] = true;
        $_REQUEST["clients"] = true;
        $TPL["commentsR"] = comment::get_list_summary($_REQUEST);
        $TPL["extra_page_links"] = '<a href="' . $TPL["url_alloc_task"] . 'taskID=' . $TPL["task_taskID"] . '&sbs_link=comments">Full</a>';
    } else {
        $TPL["commentsR"] = comment::util_get_comments("task", $taskID);
        $TPL["extra_page_links"] = '<a href="' . $TPL["url_alloc_task"] . 'taskID=' . $TPL["task_taskID"];
        $TPL["extra_page_links"] .= '&sbs_link=comments&commentSummary=true&maxCommentLength=50000000">Summary</a>';
    }
    $TPL["commentsR"] and $TPL["class_new_comment"] = "hidden";
    $TPL["allParties"] = $task->get_all_parties($task->get_value("projectID")) or $TPL["allParties"] = array();
    $TPL["entity"] = "task";
    $TPL["entityID"] = $task->get_id();
    if (has("project")) {
        $project = $task->get_foreign_object("project");
        $TPL["clientID"] = $project->get_value("clientID");
    }
    $commentTemplate = new commentTemplate();
    $ops = $commentTemplate->get_assoc_array("commentTemplateID", "commentTemplateName", "", array("commentTemplateType" => "task"));
    $TPL["commentTemplateOptions"] = "<option value=\"\">Comment Templates</option>" . page::select_options($ops);
    include_template("../comment/templates/commentM.tpl");
}
 * file that was distributed with this source code.
 */
require dirname(__FILE__) . '/../../bootstrap/unit.php';
require 'util/xfLuceneZendManager.class.php';
$t = new lime_test(3, new lime_output_color());
function has()
{
    $files = get_included_files();
    foreach ($files as $file) {
        if (false !== strpos($file, '/Zend/Search/Lucene.php')) {
            return true;
        }
    }
    return false;
}
function inpath()
{
    $paths = explode(PATH_SEPARATOR, get_include_path());
    $count = 0;
    foreach ($paths as $path) {
        if (false !== strpos($path, '/lib/vendor')) {
            $count++;
        }
    }
    return $count;
}
xfLuceneZendManager::load();
$t->ok(has(), '::load() loads Zend_Search_Lucene');
$t->is(inpath(), 1, '::load() configures the include path');
xfLuceneZendManager::load();
$t->is(inpath(), 1, '::load() configures the include path only once');
Example #12
0
 /**
  * Get all time sheet item comments in a faked mbox format
  * @param integer $taskID which task the time sheet item comments relate to
  * @return string of mbox format emails
  */
 public function get_timeSheetItem_comments($taskID)
 {
     $people =& get_cached_table("person");
     has("time") and $rows = timeSheetItem::get_timeSheetItemComments($taskID);
     foreach ((array) $rows as $row) {
         $d = $row["timeSheetItemCreatedTime"] or $d = $row["date"];
         $timestamp = format_date("U", $d);
         $name = $people[$row["personID"]]["name"];
         $str .= $br . "From allocPSA " . date('D M  j G:i:s Y', $timestamp);
         $str .= "\nFrom: " . $name;
         $str .= "\nDate: " . date("D, d M Y H:i:s O", $timestamp);
         $str .= "\n\n" . $name . " " . $row["duration"] . " " . $row["comment"];
         $br = "\n\n";
     }
     return $str;
 }
Example #13
0
 public static function get_list($_FORM = array())
 {
     global $TPL;
     $current_user =& singleton("current_user");
     list($filter, $filter2) = person::get_list_filter($_FORM);
     $debug = $_FORM["debug"];
     $debug and print "<pre>_FORM: " . print_r($_FORM, 1) . "</pre>";
     $debug and print "<pre>filter: " . print_r($filter, 1) . "</pre>";
     $_FORM["return"] or $_FORM["return"] = "html";
     // Get averages for hours worked over the past fortnight and year
     if ($current_user->have_perm(PERM_PERSON_READ_MANAGEMENT) && $_FORM["showHours"]) {
         $t = new timeSheetItem();
         list($ts_hrs_col_1, $ts_dollars_col_1) = $t->get_averages(date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 14, date("Y"))));
         list($ts_hrs_col_2, $ts_dollars_col_2) = $t->get_fortnightly_average();
     } else {
         unset($_FORM["showHours"]);
     }
     // A header row
     $summary .= person::get_list_tr_header($_FORM);
     if (is_array($filter) && count($filter)) {
         $filter = " WHERE " . implode(" AND ", $filter);
     }
     if (is_array($filter2) && count($filter2)) {
         unset($filter["skill"]);
         $filter .= " AND " . implode(" OR ", $filter2);
     }
     $q = "SELECT person.*\n            FROM person\n       LEFT JOIN proficiency ON person.personID = proficiency.personID\n           " . $filter . "\n        GROUP BY username\n        ORDER BY firstName,surname,username";
     $debug and print "Query: " . $q;
     $db = new db_alloc();
     $db->query($q);
     while ($row = $db->next_record()) {
         $p = new person();
         if (!$p->read_db_record($db)) {
             continue;
         }
         $row = $p->perm_cleanup($row);
         // this is not the right way to do this - alla
         $print = true;
         $_FORM["showHours"] and $row["hoursSum"] = $ts_hrs_col_1[$row["personID"]];
         $_FORM["showHours"] and $row["hoursAvg"] = $ts_hrs_col_2[$row["personID"]];
         $row["name"] = $p->get_name();
         $row["name_link"] = $p->get_link($_FORM);
         $row["personActive_label"] = $p->get_value("personActive") == 1 ? "Y" : "";
         if ($_FORM["showSkills"]) {
             $senior_skills = $p->get_skills('Senior');
             $advanced_skills = $p->get_skills('Advanced');
             $intermediate_skills = $p->get_skills('Intermediate');
             $junior_skills = $p->get_skills('Junior');
             $novice_skills = $p->get_skills('Novice');
             $skills = array();
             $senior_skills and $skills[] = "<img src=\"../images/skill_senior.png\" alt=\"Senior=\"> " . page::htmlentities($senior_skills);
             $advanced_skills and $skills[] = "<img src=\"../images/skill_advanced.png\" alt=\"Advanced=\"> " . page::htmlentities($advanced_skills);
             $intermediate_skills and $skills[] = "<img src=\"../images/skill_intermediate.png\" alt=\"Intermediate=\"> " . page::htmlentities($intermediate_skills);
             $junior_skills and $skills[] = "<img src=\"../images/skill_junior.png\" alt=\"Junior=\"> " . page::htmlentities($junior_skills);
             $novice_skills and $skills[] = "<img src=\"../images/skill_novice.png\" alt=\"Novice\"> " . page::htmlentities($novice_skills);
             $row["skills_list"] = implode("<br>", $skills);
         }
         if ($_FORM["showLinks"]) {
             $row["navLinks"] = '<a href="' . $TPL["url_alloc_taskList"] . 'personID=' . $row["personID"] . '&taskView=byProject&applyFilter=1';
             $row["navLinks"] .= '&dontSave=1&taskStatus=open&projectType=Current">Tasks</a>&nbsp;&nbsp;';
             has("project") and $row["navLinks"] .= '<a href="' . $TPL["url_alloc_personGraph"] . 'personID=' . $row["personID"] . '">Graph</a>&nbsp;&nbsp;';
             $row["navLinks"] .= '<a href="' . $TPL["url_alloc_taskCalendar"] . 'personID=' . $row["personID"] . '">Calendar</a>&nbsp;&nbsp;';
             $dateFrom = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 28, date("Y")));
             $dateTo = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y")));
             $row["navLinks"] .= '<a href="' . $TPL["url_alloc_timeSheetGraph"] . 'personID=' . $row["personID"] . '&dateFrom=' . $dateFrom . '&dateTo=' . $dateTo . '&applyFilter=1&dontSave=1">Hours</a>';
         }
         $summary .= person::get_list_tr($row, $_FORM);
         $rows[$row["personID"]] = $row;
     }
     $rows or $rows = array();
     if ($print && $_FORM["return"] == "array") {
         return $rows;
     } else {
         if ($print && $_FORM["return"] == "html") {
             return "<table class=\"list sortable\">" . $summary . "</table>";
         } else {
             if (!$print && $_FORM["return"] == "html") {
                 return "<table style=\"width:100%\"><tr><td colspan=\"10\" style=\"text-align:center\"><b>No People Found</b></td></tr></table>";
             }
         }
     }
 }
Example #14
0
    $replaced2 = (int) $matches[1];
    writeln("{$replaced2} replacements...");
    $output = runLocally("wp search-replace https://{$domain} http://{$local}", 999);
    preg_match('/Made (\\d+) replacements/', $output, $matches);
    $replaced3 = (int) $matches[1];
    writeln("{$replaced3} replacements...");
    $totalReplaced = $replaced1 + $replaced2 + $replaced3;
    writeln("Total of {$totalReplaced} replacements");
});
task('pull:files', function () {
    writeln('Getting uploads, long duration first time! (approx. 60s)');
    $user = run('echo $USER');
    runLocally("rsync --exclude .cache -re ssh {$user}@{{server.host}}:{{deploy_path}}/shared/web/app/uploads web/app", 999);
});
task('pull:elastic', function () {
    if (has('elastic') && get('elastic')) {
        writeln('Setup elasticsearch and elasticpress');
        runLocally('wp elasticpress index --setup', 999);
    }
});
task('pull:cleanup', function () {
    writeln('Remove all tranisents');
    runLocally('wp transient delete-all');
    writeln('Permalinks rewrite/flush');
    runLocally('wp rewrite flush');
    writeln('Activate query monitor');
    runLocally('wp plugin activate query-monitor');
    if (file_exists('web/app/uploads/.cache/')) {
        runLocally('chmod -R 777 web/app/uploads/.cache');
        writeln('Empty Bladerunner cache');
        array_map('unlink', glob("web/app/uploads/.cache/*.*"));
Example #15
0
 function get_list_summary_filter($filter = array())
 {
     // This takes care of projectID singular and plural
     has("project") and $projectIDs = project::get_projectID_sql($filter, "task");
     $projectIDs and $sql1["projectIDs"] = $projectIDs;
     $projectIDs and $sql2["projectIDs"] = $projectIDs;
     $filter['taskID'] and $sql1[] = prepare("(task.taskID = %d)", $filter["taskID"]);
     $filter['taskID'] and $sql2[] = prepare("(task.taskID = %d)", $filter["taskID"]);
     $filter['taskID'] and $sql3[] = prepare("(tsiHint.taskID = %d)", $filter["taskID"]);
     $filter["fromDate"] and $sql1[] = prepare("(date(commentCreatedTime) >= '%s')", $filter["fromDate"]);
     $filter["fromDate"] and $sql2[] = prepare("(dateTimeSheetItem >= '%s')", $filter["fromDate"]);
     $filter["fromDate"] and $sql3[] = prepare("(tsiHint.date >= '%s')", $filter["fromDate"]);
     $filter["toDate"] and $sql1[] = prepare("(date(commentCreatedTime) < '%s')", $filter["toDate"]);
     $filter["toDate"] and $sql2[] = prepare("(dateTimeSheetItem < '%s')", $filter["toDate"]);
     $filter["toDate"] and $sql3[] = prepare("(tsiHint.date < '%s')", $filter["toDate"]);
     $filter["personID"] and $sql1["personID"] = prepare("(comment.commentCreatedUser IN (%s))", $filter["personID"]);
     $filter["personID"] and $sql2[] = prepare("(timeSheetItem.personID IN (%s))", $filter["personID"]);
     $filter["personID"] and $sql3[] = prepare("(tsiHint.personID IN (%s))", $filter["personID"]);
     $filter["clients"] or $sql1[] = "(commentCreatedUser IS NOT NULL)";
     $filter["clients"] && $filter["personID"] and $sql1["personID"] = prepare("(comment.commentCreatedUser IN (%s) OR comment.commentCreatedUser IS NULL)", $filter["personID"]);
     $filter["taskStatus"] and $sql1[] = task::get_taskStatus_sql($filter["taskStatus"]);
     $filter["taskStatus"] and $sql2[] = task::get_taskStatus_sql($filter["taskStatus"]);
     return array($sql1, $sql2, $sql3);
 }
Example #16
0
 $parser = new css_parser();
 $css_doc = $parser->parse($data);
 if (has('u')) {
     //css_cleaner
     if (!has('p')) {
         err('Please, indicate the project source path. Multiple paths can be concatenated using ' . PATH_SEPARATOR);
         exit(1);
     }
     $cleaner = new css_cleaner();
     $cleaner->verbose = true;
     $cleaner->project_files = explode(PATH_SEPARATOR, $opts['p']);
     $cleaner->method = get('m', 'safe') == 'safe' ? css_cleaner::METHOD_SAFE : css_cleaner::METHOD_BEST_CLEAN;
     if (has('e')) {
         $cleaner->extensions = get('e');
     }
     if (has('r')) {
         $cleaner->report_path = get('r');
     }
     $cleaner->clean($css_doc);
 }
 //Optimize
 $optimizer = new css_optimizer();
 $optimizer->compress = get('c', true);
 $optimizer->optimize = get('o', true);
 $optimizer->prefixes = get('v', 'webkit,msie,firefox');
 $optimizer->process($css_doc);
 //Generate output
 $out = $css_doc->render($optimizer->compress);
 //Save output
 if (!($fout = array_shift($argv))) {
     echo $out;
Example #17
0
 public static function get_category_options($category = "")
 {
     has("task") and $category_options["search_tasks"] = "Search Tasks";
     has("project") and $category_options["search_projects"] = "Search Projects";
     has("time") and $category_options["search_time"] = "Search Time Sheets";
     has("client") and $category_options["search_clients"] = "Search Clients";
     has("comment") and $category_options["search_comment"] = "Search Comments";
     has("wiki") and $category_options["search_wiki"] = "Search Wiki";
     has("item") and $category_options["search_items"] = "Search Items";
     has("finance") and $category_options["search_expenseForm"] = "Search Expense Forms";
     return page::select_options($category_options, $category);
 }
Example #18
0
 /**
  * @param mixed $offset
  *
  * @return bool
  */
 public function offsetExists($offset)
 {
     return has($offset, $this->xs);
 }
Example #19
0
/**
 * Checks if an attribute/value of an object/array passes the given predicate.
 * ```php
 * $foo = ['name' => 'foo', 'age' => 11];
 * $isAdult = satisfies(gt(__(), 18), 'age');
 * satisfies(startsWith('f'), 'name', $foo); // true
 * satisfies(startsWith('g'), 'name', $foo); // false
 * satisfies(startsWith('g'), 'friends', $foo); // false
 * $isAdult($foo); // false
 * ```
 *
 * @signature (a -> Boolean) -> k -> {k : a} -> Boolean
 * @param  callable $predicate
 * @param  string|int $key
 * @param  mixed $object
 * @return bool
 */
function satisfies()
{
    $satisfies = function ($predicate, $key, $object) {
        return has($key, $object) && $predicate(get($key, $object));
    };
    return apply(curry($satisfies), func_get_args());
}
Example #20
0
} else {
    if ($_POST["delete"]) {
        $person->delete();
        alloc_redirect($TPL["url_alloc_personList"]);
    }
}
#$person = new person();
#$person->set_id($personID);
#$person->select();
$person->set_values("person_");
if ($person->get_id()) {
    $q = prepare("SELECT tfPerson.tfID AS value, tf.tfName AS label \n                  FROM tf, tfPerson \n  \t\t\t\t       WHERE tf.tfID = tfPerson.tfID \n                   AND tfPerson.personID = %d \n                   AND (tf.tfActive = 1 OR tf.tfID = %d)", $person->get_id(), $person->get_value("preferred_tfID"));
    $TPL["preferred_tfID_options"] = page::select_options($q, $person->get_value("preferred_tfID"));
    $tf = new tf();
    $tf->set_id($person->get_value("preferred_tfID"));
    $tf->select();
}
$TPL["absence_url"] = $TPL["url_alloc_absence"] . "personID=" . $personID;
$TPL["personActive"] = !$person->get_id() || $person->get_value("personActive") ? " checked" : "";
if (has("time")) {
    $timeUnit = new timeUnit();
    $rate_type_array = $timeUnit->get_assoc_array("timeUnitID", "timeUnitLabelB");
}
$TPL["timeSheetRateUnit_select"] = page::select_options($rate_type_array, $person->get_value("defaultTimeSheetRateUnitID"));
$TPL["timeSheetRateUnit_label"] = $rate_type_array[$person->get_value("defaultTimeSheetRateUnitID")];
if ($personID) {
    $TPL["main_alloc_title"] = "Person Details: " . $person->get_value("username") . " - " . APPLICATION_NAME;
} else {
    $TPL["main_alloc_title"] = "New Person - " . APPLICATION_NAME;
}
include_template("templates/personM.tpl");
Example #21
0
		<img src='img/right.png' id='iconcollapse' onclick='$("#toggleicons").addClass("offset")' title='Collapse' />
		</div>
		<form id='search' <?php 
show('search');
?>
action="" onsubmit='return false'>
			<input id="inputbox" style='width:206px' value='<?php 
echo $q;
?>
' onFocus="show('list'); $('#search').css('z-index', 10);" onBlur="delayHide('list', 1000);">
				<img id="clear" src='http://www.picol.org/images/icons/files/png/16/search_16.png' onclick="document.getElementById('inputbox').value=''; updateFunc();" alt="Clear search" title="Clear search" />
			</input>
			<ul style='display:none' id="list"></ul>
		</form>
<?php 
if (has('bookmarks')) {
    ?>
		<div id="bookmarks" style='display:none'>
			<?php 
    include 'resources/opendaybookmarks.php';
    ?>
		</div>
<?php 
}
?>
		<div id="search-small" <?php 
show('search');
?>
><img src='img/search.png' onclick="window.location='m'" alt="Search" title="Search" /></div>
		<div id="credits"><?php 
$include = true;
Example #22
0
    header("Location: update-browser.html");
    exit;
}
include "header.php";
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
function has($t)
{
    global $ua;
    return !(strpos($ua, $t) === false);
}
//not complete list but 99% of systems share where ie10 is not available
//IE 09 is available for vista and up
//IE 10 is only available for win7 and win8 || has("windows nt 6.0")
// 5->2000/xp/2003 6.0->vista
$no_ie = has("windows nt 4") || has("windows nt 5") || has("windows nt 6.0") || has("mac os") || has("linux");
$no_sa = !has("mac os");
$sa_map = array("en" => "", "sv" => "se", "ja" => "jp", "sl" => "si", "uk" => "ua", "rm" => "de", "da" => "dk", "ca" => "es");
$u_sa = sprintf("https://itunes.apple.com/%s/app/os-x-mavericks/id675248567?mt=12&uo=4", $ll);
if (isset($sa_map[$ll])) {
    $u_sa = sprintf("https://itunes.apple.com/%s/app/os-x-mavericks/id675248567?mt=12&uo=4", $sa_map[$ll]);
}
$u_ff = "http://www.mozilla.com/firefox/";
$u_op = "http://www.opera.com/browser/";
$u_ch = sprintf("http://www.google.com/chrome?hl=%s", $ll);
$u_ie = sprintf("http://windows.microsoft.com/%s/internet-explorer/downloads/ie", str_replace("_", "-", $detected_lang));
T_textdomain('update-legacy');
?>


	<div class="right">
			<h2><?php 
Example #23
0
    include("update2.php");
    exit;
}
*/
require_once "lib/init.php";
require_once "lib/lang.php";
include "header.php";
$ua = strtolower($_SERVER['HTTP_USER_AGENT']);
function has($t)
{
    global $ua;
    return !(strpos($ua, $t) === false);
}
//not complete list but 99% of systems share where ie9 is not available
$no_ie = has("windows nt 4") || has("windows nt 5") || has("mac os") || has("linux");
$no_sa = has("linux");
$u_sa = sprintf("http://www.apple.com/%s/safari/", $ll);
$u_ff = "http://www.mozilla.com/firefox/";
$u_op = "http://www.opera.com/browser/";
$u_ch = sprintf("http://www.google.com/chrome?hl=%s", $ll);
$u_ie = sprintf("http://windows.microsoft.com/%s/internet-explorer/downloads/ie", str_replace("_", "-", $detected_lang));
?>


	<div class="right">
			<h2><?php 
echo T_('Free webbrowsers');
?>
</h2>
			<p><?php 
echo T_('These browsers are the newest versions of the most used free web browsers.');
Example #24
0
$display = array("", "username", ", ", "emailAddress");
$person = new person();
$people =& get_cached_table("person");
foreach ($people as $p) {
    $peeps[$p["personID"]] = $p["name"];
}
// get the default time sheet manager/admin options
$TPL["defaultTimeSheetManagerListText"] = get_person_list(config::get_config_item("defaultTimeSheetManagerList"));
$TPL["defaultTimeSheetAdminListText"] = get_person_list(config::get_config_item("defaultTimeSheetAdminList"));
$days = array("Sun" => "Sun", "Mon" => "Mon", "Tue" => "Tue", "Wed" => "Wed", "Thu" => "Thu", "Fri" => "Fri", "Sat" => "Sat");
$TPL["calendarFirstDayOptions"] = page::select_options($days, config::get_config_item("calendarFirstDay"));
$TPL["timeSheetPrintOptions"] = page::select_options($TPL["timeSheetPrintOptions"], $TPL["timeSheetPrint"]);
$commentTemplate = new commentTemplate();
$ops = $commentTemplate->get_assoc_array("commentTemplateID", "commentTemplateName");
$TPL["rssStatusFilterOptions"] = page::select_options(task::get_task_statii_array(true), config::get_config_item("rssStatusFilter"));
if (has("timeUnit")) {
    $timeUnit = new timeUnit();
    $rate_type_array = $timeUnit->get_assoc_array("timeUnitID", "timeUnitLabelB");
}
$TPL["timesheetRate_options"] = page::select_options($rate_type_array, config::get_config_item("defaultTimeSheetUnit"));
$TPL["main_alloc_title"] = "Setup - " . APPLICATION_NAME;
include_template("templates/configM.tpl");
function get_person_list($personID_array)
{
    global $peeps;
    $people = array();
    foreach ($personID_array as $personID) {
        $people[] = $peeps[$personID];
    }
    if (count($people) > 0) {
        return implode(", ", $people);
Example #25
0
 function load_task_filter($_FORM)
 {
     $current_user =& singleton("current_user");
     $db = new db_alloc();
     // Load up the forms action url
     $rtn["url_form_action"] = $_FORM["url_form_action"];
     $rtn["hide_field_options"] = $_FORM["hide_field_options"];
     //time Load up the filter bits
     has("project") and $rtn["projectOptions"] = project::get_list_dropdown($_FORM["projectType"], $_FORM["projectID"]);
     $_FORM["projectType"] and $rtn["projectType_checked"][$_FORM["projectType"]] = " checked";
     $ops = array("0" => "Nobody");
     $rtn["personOptions"] = page::select_options($ops + person::get_username_list($_FORM["personID"]), $_FORM["personID"]);
     $rtn["managerPersonOptions"] = page::select_options($ops + person::get_username_list($_FORM["managerID"]), $_FORM["managerID"]);
     $rtn["creatorPersonOptions"] = page::select_options(person::get_username_list($_FORM["creatorID"]), $_FORM["creatorID"]);
     $rtn["all_tags"] = task::get_tags(true);
     $rtn["tags"] = $_FORM["tags"];
     $taskType = new meta("taskType");
     $taskType_array = $taskType->get_assoc_array("taskTypeID", "taskTypeID");
     $rtn["taskTypeOptions"] = page::select_options($taskType_array, $_FORM["taskTypeID"]);
     $_FORM["taskView"] and $rtn["taskView_checked_" . $_FORM["taskView"]] = " checked";
     $taskStatii = task::get_task_statii_array();
     $rtn["taskStatusOptions"] = page::select_options($taskStatii, $_FORM["taskStatus"]);
     $_FORM["showDescription"] and $rtn["showDescription_checked"] = " checked";
     $_FORM["showDates"] and $rtn["showDates_checked"] = " checked";
     $_FORM["showCreator"] and $rtn["showCreator_checked"] = " checked";
     $_FORM["showAssigned"] and $rtn["showAssigned_checked"] = " checked";
     $_FORM["showTimes"] and $rtn["showTimes_checked"] = " checked";
     $_FORM["showPercent"] and $rtn["showPercent_checked"] = " checked";
     $_FORM["showPriority"] and $rtn["showPriority_checked"] = " checked";
     $_FORM["showTaskID"] and $rtn["showTaskID_checked"] = " checked";
     $_FORM["showManager"] and $rtn["showManager_checked"] = " checked";
     $_FORM["showProject"] and $rtn["showProject_checked"] = " checked";
     $_FORM["showTags"] and $rtn["showTags_checked"] = " checked";
     $_FORM["showParentID"] and $rtn["showParentID_checked"] = " checked";
     $arrow = " --&gt;";
     $taskDateOps = array("" => "", "new" => "New Tasks", "due_today" => "Due Today", "overdue" => "Overdue", "d_created" => "Date Created" . $arrow, "d_assigned" => "Date Assigned" . $arrow, "d_targetStart" => "Estimated Start" . $arrow, "d_targetCompletion" => "Estimated Completion" . $arrow, "d_actualStart" => "Date Started" . $arrow, "d_actualCompletion" => "Date Completed" . $arrow);
     $rtn["taskDateOptions"] = page::select_options($taskDateOps, $_FORM["taskDate"], 45, false);
     if (!in_array($_FORM["taskDate"], array("new", "due_today", "overdue"))) {
         $rtn["dateOne"] = $_FORM["dateOne"];
         $rtn["dateTwo"] = $_FORM["dateTwo"];
     }
     $task_num_ops = array("" => "All results", 1 => "1 result", 2 => "2 results", 3 => "3 results", 4 => "4 results", 5 => "5 results", 10 => "10 results", 15 => "15 results", 20 => "20 results", 30 => "30 results", 40 => "40 results", 50 => "50 results", 100 => "100 results", 150 => "150 results", 200 => "200 results", 300 => "300 results", 400 => "400 results", 500 => "500 results", 1000 => "1000 results", 2000 => "2000 results", 3000 => "3000 results", 4000 => "4000 results", 5000 => "5000 results", 10000 => "10000 results");
     $rtn["limitOptions"] = page::select_options($task_num_ops, $_FORM["limit"]);
     // unset vars that aren't necessary
     foreach ((array) $_FORM as $k => $v) {
         if (!$v) {
             unset($_FORM[$k]);
         }
     }
     // Get
     $rtn["FORM"] = "FORM=" . urlencode(serialize($_FORM));
     return $rtn;
 }