JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
made css_mangler.php handle versioning (strips numerical postfixes) and made contract...
authorJason Woofenden <jason283@herkamire.com>
Thu, 5 Mar 2009 02:01:06 +0000 (21:01 -0500)
committerJason Woofenden <jason283@herkamire.com>
Thu, 5 Mar 2009 02:01:06 +0000 (21:01 -0500)
css_mangler.php
tasks.html
tasks.php
tasks2.css [deleted symlink]
template.html

index 03e55f9..40f0e8e 100644 (file)
@@ -13,7 +13,18 @@ function css_mangler() {
 
        $file = substr($file, 1);
 
 
        $file = substr($file, 1);
 
+       $file = ereg_replace('_[0-9]*[.]css', '.css', $file);
+
+       $mtime = filemtime($file);
+       if($mtime === false) {
+               header('Content-Type: text/plain');
+               print("cannot stat $file");
+               return;
+       }
+
        header('Content-Type: text/css');
        header('Content-Type: text/css');
+       header('Last-Modified: '.gmdate('D, d M Y H:i:s', $mtime) . ' GMT');
+       header('Last-Modified: '.gmdate('D, d M Y H:i:s', $mtime) . ' GMT');
 
        if(ie5or6()) {
                echo(ereg_replace("\n[^\n]*remove this line for IE 5.5 and 6[^\n]*\n", "\n", read_whole_file($file)));
 
        if(ie5or6()) {
                echo(ereg_replace("\n[^\n]*remove this line for IE 5.5 and 6[^\n]*\n", "\n", read_whole_file($file)));
index cf845df..da0188e 100644 (file)
@@ -47,7 +47,7 @@
     <table cellspacing="0" cellpadding="4" border="0" summary="">
 
 <!--~client_row start~-->
     <table cellspacing="0" cellpadding="4" border="0" summary="">
 
 <!--~client_row start~-->
-      <tr><td class="caption">Client: </td><td class="field"><select name="client_id"><!--~client_id.options~--></select></td></tr>
+      <tr><td class="caption">Client: </td><td class="field"><select name="client_id"><option value="">Choose One...</option><!--~client_id.options~--></select></td></tr>
 <!--~end~-->
 
       <tr><td class="caption">Title: </td><td class="field"><input type="text" size="40" name="title" value="~title.attr~" /></td></tr>
 <!--~end~-->
 
       <tr><td class="caption">Title: </td><td class="field"><input type="text" size="40" name="title" value="~title.attr~" /></td></tr>
index 7966987..44ff813 100644 (file)
--- a/tasks.php
+++ b/tasks.php
@@ -426,7 +426,7 @@ function tasks_edit_main() {
                        }
                }
 
                        }
                }
 
-               if("you're happy with the POSTed values") { # if you change this change the one above
+               if(!logged_in_as_contractor() || $_REQUEST['client_id']) { # if you change this change the one above
                        if($edit_id) {
                                $tables = 'title,url,description,state';
                                $values = array($title, $url, $description, $state);
                        if($edit_id) {
                                $tables = 'title,url,description,state';
                                $values = array($title, $url, $description, $state);
@@ -447,6 +447,7 @@ function tasks_edit_main() {
                                $client_id = logged_in();
                                if(logged_in_as_contractor() && $_REQUEST['client_id']) {
                                        $client_id = format_int($_REQUEST['client_id']);
                                $client_id = logged_in();
                                if(logged_in_as_contractor() && $_REQUEST['client_id']) {
                                        $client_id = format_int($_REQUEST['client_id']);
+                                       $client_name = db_get_value('people', 'name', 'where id=%i', $client_id);
                                } else {
                                        # if client entered the task, no price is set
                                        $price = 0;
                                } else {
                                        # if client entered the task, no price is set
                                        $price = 0;
@@ -457,7 +458,11 @@ function tasks_edit_main() {
                                        $ord = 0;
                                }
                                db_insert('tasks', 'client_id,title,url,description,state,paid,price,ord', $client_id, $title, $url, $description, $state, $paid, $price, $ord);
                                        $ord = 0;
                                }
                                db_insert('tasks', 'client_id,title,url,description,state,paid,price,ord', $client_id, $title, $url, $description, $state, $paid, $price, $ord);
-                               message('Task saved.');
+                               if(logged_in_as_contractor()) {
+                                       message("Task saved for $client_name.");
+                               } else {
+                                       message('Task saved.');
+                               }
                        }
                        if($GLOBALS['tasks_form_recipient'] != "fixme@example.com") {
                                $to = $GLOBALS['tasks_form_recipient'];
                        }
                        if($GLOBALS['tasks_form_recipient'] != "fixme@example.com") {
                                $to = $GLOBALS['tasks_form_recipient'];
@@ -481,6 +486,8 @@ function tasks_edit_main() {
                        if($error !== true) {
                                return './';
                        }
                        if($error !== true) {
                                return './';
                        }
+               } else {
+                       message('Error: you must select a client for the task');
                }
                # otherwise, we display the form again. tasks_get_fields() has
                # already put the posted values back into the template engine, so they will
                }
                # otherwise, we display the form again. tasks_get_fields() has
                # already put the posted values back into the template engine, so they will
diff --git a/tasks2.css b/tasks2.css
deleted file mode 120000 (symlink)
index 57d3998..0000000
+++ /dev/null
@@ -1 +0,0 @@
-tasks.css
\ No newline at end of file
index a5eef75..b475f29 100644 (file)
@@ -4,8 +4,8 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <title>JasonWoof -- Website Services</title>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
   <title>JasonWoof -- Website Services</title>
-  <link rel="stylesheet" href="style4.css" type="text/css" />
-  <link rel="stylesheet" href="tasks2.css" type="text/css" />
+  <link rel="stylesheet" href="style_4.css" type="text/css" />
+  <link rel="stylesheet" href="tasks_2.css" type="text/css" />
 </head>
 
 <body onload="document.getElementById('screen_height').style.height = (window.innerHeight ? window.innerHeight : document.documentElement.clientWidth) + 'px'">
 </head>
 
 <body onload="document.getElementById('screen_height').style.height = (window.innerHeight ? window.innerHeight : document.documentElement.clientWidth) + 'px'">