pages/playground.inc.php

Go to the documentation of this file.
00001 <?php if(!function_exists('startedIndexPhp')) { header("location:../index.php"); exit();}
00002 # streber - a php5 based project management system  (c) 2005-2007  / www.streber-pm.org
00003 # Distributed under the terms and conditions of the GPL as stated in lang/license.html
00004 
00013 require_once(confGet('DIR_STREBER') . 'db/class_task.inc.php');
00014 require_once(confGet('DIR_STREBER') . 'db/class_project.inc.php');
00015 require_once(confGet('DIR_STREBER') . 'render/render_list.inc.php');
00016 require_once(confGet('DIR_STREBER') . 'lists/list_tasks.inc.php');
00017 
00018 
00019 
00020 
00021 #header('WWW-Authenticate: Basic realm="blabl"');
00022 
00023 #echo "username='" . $username ."'<br>";
00024 #echo "password='" . $password ."'<br>";
00025 
00026 /*if (!isset($_SERVER['PHP_AUTH_USER'])) {
00027    header('WWW-Authenticate: Basic realm="My Realm"');
00028    header('HTTP/1.0 401 Unauthorized');
00029    echo 'Text to send if user hits Cancel button';
00030    exit();
00031 } else {
00032    echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
00033    echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
00034 }
00035 */
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00043 /*
00044 
00045 some questions
00046 
00047 on documentation-tasks:
00048 =======================
00049 1. Is is ok to hide Details-Box and Attach Files box, if tasks is a documentation
00050    page, and replace it with documentation hierarachy and prev/next navigation?
00051    -> do a mockup for this.
00052 
00053 2. not sure with "Docu" or "Documentation"
00054 
00055 
00056 
00057 history
00058 =======
00059 - deleted comments should be visible in page history (tricky but important)
00060 - It might be help to "see" the item version of a certain date, eg. to check what comments were refering too.
00061 
00062 
00063 
00064 Task labels and Categories
00065 ==========================
00066 We have:
00067 
00068   CATEGORIES        FLAGS                LABELS
00069   Task              is_folder            Bug
00070   Milestone         deleted              Feature
00071   Version           completed            Idea
00072   Documentation                          Discussion
00073   Event
00074 
00075 If might be a good idea to completely split taskView() into several functions to avoid cascaded if-constructs:
00076 - taskViewAsMilestone
00077 - taskViewAsTask
00078 - taskViewAsVersion
00079 - taskViewAsDocumentation
00080 - taskViewAsEvent
00081 
00082 We should go through the complete code and replace all depencies from Task->label to Task.category
00083 
00084 
00085 Refactor
00086 =========
00087 
00088 Version/Releases
00089 ----------------
00090 Not sure, if "Version" is not a good name. Better might be "Release" but der are probably more projects with internal versions than Projects with "real releases". Either way: "Versions" and "Released Milestones" should not be used synonymously, as it is done in rev171.
00091 
00092 
00093 Project Rights
00094 =======
00095 Currently the rights of team members are only defined by two things:
00096 
00097 1. Their project profile which is been resolved into rights of regarting to items of different pub_levels:
00098   - read
00099   - write
00100   - delete
00101   - create items with pub-level
00102   - reduce pub_level
00103 2. Some global user settings:
00104   - RIGHT_VIEW_ALL (admin view, see items and team members even if not assigned to project)
00105   - RIGHT_EDIT_PROJECTS (edit team, change rights, etc)
00106 
00107 This does not cover all possible situations:
00108 
00109 1. We sometimes need to finetune the rights to access items:
00110  - Anonymous guests should not be able to edit items of other guests.
00111 2. We might reduce the certain rights like:
00112    - Viewing efforts of other team members.
00113    - Uploading Files.
00114    - Seeing other team members
00115 3. We might provide give special rights like:
00116    - Approve / Close / Confirm / Delete items
00117 */
00118 
00119 
00123 function playground() {
00124     global $PH;
00125     global $auth;
00126     if(
00127         !isset($_SERVER['REMOTE_USER']) 
00128         && 
00129         !isset($_SERVER['REDIRECT_REDIRECT_REMOTE_USER']) 
00130         && 
00131         !isset($_SERVER['PHP_AUTH_USER']) 
00132         &&
00133         !get('HTTP_AUTHORIZATION')
00134     ){
00135        header('WWW-Authenticate: Basic realm="blabl"');
00136        header('HTTP/1.0 401 Unauthorized');
00137        echo 'Sorry. You need to authenticate';
00138     print("<pre>");
00139     print_r($_SERVER);
00140     print("</pre>");
00141        exit();
00142 
00143     }
00144     else {
00145         $username='';
00146         $password= '';
00147         if(isset($_SERVER['PHP_AUTH_USER'])) {
00148             $username=asCleanString($_SERVER['PHP_AUTH_USER']);        
00149             if(isset($_SERVER['PHP_AUTH_PW'])) {
00150                 $password=asCleanString($_SERVER['PHP_AUTH_PW']);        
00151             }
00152         }
00153     
00158         else  {
00159             $ha='';
00160             if(isset($_SERVER['REDIRECT_REDIRECT_REMOTE_USER'])) {
00161                 $ha= $_SERVER['REDIRECT_REDIRECT_REMOTE_USER'];                
00162             }
00163             else if(isset($_SERVER['REMOTE_USER'])) {
00164                 $ha= $_SERVER['REMOTE_USER'];                
00165             }
00166             
00167             $tmp= base64_decode( substr($ha,6));
00168             list($username, $password) = explode(':', $tmp);
00169         }
00170         print("<br>username='" . $username . "'");       
00171         print("<br>password='" . $password . "'");
00172 
00173     print("<pre>");
00174     print_r($_SERVER);
00175     print("</pre>");
00176 
00177 
00178     }
00179     
00180 
00181 
00182 
00183 
00184 
00185     ### create from handle ###
00186     $PH->defineFromHandle(array());
00187 
00188     ### set up page ####
00189     {
00190         $page= new Page();
00191         $page->cur_tab='home';
00192         $page->options=array(
00193             new NaviOption(array(
00194                 'target_id'=>'home',
00195                 'name'=>__('Today')
00196             )),
00197             #new NaviOption(array(
00198             #    'target_id'     =>'personViewEfforts',
00199             #    'target_params' =>array('person' =>  $auth->cur_user->id),
00200             #    'name'=>__('Personal Efforts'),
00201             #
00202             #)),
00203 
00204         );
00205 
00206         $page->title=__("Today"); # $auth->cur_user->name;
00207         $page->type=__("At Home");
00208         $page->title_minor=renderTitleDate(time());
00209         echo(new PageHeader);
00210     }
00211     echo (new PageContentOpen_Columns);
00212     measure_stop('init2');
00213 
00214     echo "Column-Right";
00215 
00216     echo(new PageContentNextCol);
00217 
00218     ### some tabs ###
00219     {
00220         ?>
00221         <div id="pm3">
00222 
00223         <style type="text/css">
00224 
00225         .form_tabgroup {
00226          display:table;
00227         }
00228         .form_tabgroup UL {
00229          margin:0;
00230          padding:0;
00231          list-style:none;
00232         }
00233         .form_tabgroup LI.form_tab A {
00234          color:#777;
00235          border:0;
00236          display:block;
00237          padding:.3em .6em;
00238         }
00239         .form_tabgroup LI.form_tab {
00240          background-color:#eee;
00241          float:left;
00242          margin-right:.3em;
00243         }
00244         .form_tabgroup LI.Active {
00245          background-color:#ddd;
00246         }
00247         .form_tabgroup LI.Active A {
00248          color:#000;
00249         }
00250         .form_tabgroup DIV {
00251          padding:.5em .7em;
00252          background-color:#ddd;
00253          clear:both;
00254         }
00255         </style>
00256 
00257           <div class="form_tabgroup">
00258             <ul>
00259               <li class="form_tab" id="tab1"><a href="#">One</a></li>
00260               <li class="form_tab" id="tab2"><a href="#">Two</a></li>
00261               <li class="form_tab" id="tab3"><a href="#">Three</a></li>
00262             </ul>
00263             <div id="tab1-body">I'm the one's tab content.</div>
00264             <div id="tab2-body">I'm the two's tab content<br />and a 2nd line.</div>
00265             <div id="tab3-body">Guess who am I -- says the three's tab content.</div>
00266           </div>
00267           <div class="form_tabgroup">
00268             <ul>
00269               <li class="form_tab" id="tab1a"><a href="#">One</a></li>
00270               <li class="form_tab" id="tab2a"><a href="#">Two</a></li>
00271               <li class="form_tab" id="tab3a"><a href="#">Three</a></li>
00272             </ul>
00273             <div id="tab1a-body">I'm the one's tab content.</div>
00274             <div id="tab2a-body">I'm the two's tab content<br />and a 2nd line.</div>
00275             <div id="tab3a-body">Guess who am I -- says the three's tab content.</div>
00276           </div>
00277         </div>
00278 
00279 
00280     <?php
00281     }
00282 
00283     echo (new PageContentClose);
00284     echo (new PageHtmlEnd);
00285 
00286 }
00287 
00288 ?>

Generated on Sun Mar 4 17:19:31 2007 for streber by  doxygen 1.5.1-p1