tutos-commits Mailing List for TUTOS (Page 2)
Projects / CRM / PLM / Calendar / Tasks / SCRUM / Test / Inventory
Brought to you by:
gokohnert
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(13) |
Aug
(214) |
Sep
(144) |
Oct
(22) |
Nov
(22) |
Dec
(93) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(25) |
Feb
(31) |
Mar
(92) |
Apr
(70) |
May
(103) |
Jun
(130) |
Jul
(265) |
Aug
(325) |
Sep
(233) |
Oct
(244) |
Nov
(261) |
Dec
(157) |
2003 |
Jan
(101) |
Feb
(135) |
Mar
(148) |
Apr
(164) |
May
(53) |
Jun
(116) |
Jul
(149) |
Aug
(126) |
Sep
(45) |
Oct
(109) |
Nov
(36) |
Dec
(61) |
2004 |
Jan
(131) |
Feb
(236) |
Mar
(278) |
Apr
(259) |
May
(92) |
Jun
(110) |
Jul
(150) |
Aug
(64) |
Sep
(141) |
Oct
(141) |
Nov
(146) |
Dec
(65) |
2005 |
Jan
(70) |
Feb
(77) |
Mar
(129) |
Apr
(153) |
May
(161) |
Jun
(63) |
Jul
(42) |
Aug
(16) |
Sep
(30) |
Oct
(3) |
Nov
(8) |
Dec
(40) |
2006 |
Jan
(114) |
Feb
(16) |
Mar
(12) |
Apr
(15) |
May
(4) |
Jun
(9) |
Jul
(69) |
Aug
(27) |
Sep
(12) |
Oct
(80) |
Nov
(62) |
Dec
(41) |
2007 |
Jan
(34) |
Feb
(2) |
Mar
(38) |
Apr
(82) |
May
(61) |
Jun
(37) |
Jul
(16) |
Aug
(64) |
Sep
(7) |
Oct
(52) |
Nov
(18) |
Dec
(28) |
2008 |
Jan
(168) |
Feb
(26) |
Mar
(27) |
Apr
(19) |
May
(10) |
Jun
(58) |
Jul
(58) |
Aug
(91) |
Sep
(14) |
Oct
(23) |
Nov
(56) |
Dec
(38) |
2009 |
Jan
(58) |
Feb
(90) |
Mar
(204) |
Apr
(90) |
May
(27) |
Jun
(177) |
Jul
(116) |
Aug
(53) |
Sep
(42) |
Oct
(120) |
Nov
(51) |
Dec
(58) |
2010 |
Jan
(117) |
Feb
(231) |
Mar
(163) |
Apr
(90) |
May
(40) |
Jun
(139) |
Jul
(49) |
Aug
(118) |
Sep
(25) |
Oct
(80) |
Nov
(102) |
Dec
(99) |
2011 |
Jan
(176) |
Feb
(42) |
Mar
(60) |
Apr
(52) |
May
(30) |
Jun
(29) |
Jul
(27) |
Aug
(16) |
Sep
(51) |
Oct
(70) |
Nov
(63) |
Dec
(58) |
2012 |
Jan
(28) |
Feb
(26) |
Mar
(7) |
Apr
(12) |
May
(41) |
Jun
(61) |
Jul
(59) |
Aug
(38) |
Sep
(30) |
Oct
(28) |
Nov
(14) |
Dec
(31) |
2013 |
Jan
(24) |
Feb
(54) |
Mar
(45) |
Apr
(22) |
May
(35) |
Jun
(8) |
Jul
(18) |
Aug
(38) |
Sep
(11) |
Oct
(8) |
Nov
(19) |
Dec
(20) |
2014 |
Jan
(20) |
Feb
(22) |
Mar
(4) |
Apr
(6) |
May
(13) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
(8) |
Aug
(13) |
Sep
(12) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2021 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <gok...@us...> - 2017-08-16 13:26:13
|
Revision: 1316 http://sourceforge.net/p/tutos/code/1316 Author: gokohnert Date: 2017-08-16 13:26:07 +0000 (Wed, 16 Aug 2017) Log Message: ----------- enabled php7 support Modified Paths: -------------- trunk/php/Date.pinc trunk/php/address.pinc trunk/php/address_show.php trunk/php/admin_show.php trunk/php/appointment.pinc trunk/php/auth/auth.pinc trunk/php/auth/auth_cmdline.pinc trunk/php/auth/auth_db.pinc trunk/php/auth/auth_external.pinc trunk/php/auth/auth_google.pinc trunk/php/auth/auth_http.pinc trunk/php/auth/auth_ldap.pinc trunk/php/auth/auth_pam.pinc trunk/php/auth/auth_pwauth_db.pinc trunk/php/auth/auth_remoteuser.pinc trunk/php/auth/auth_x509.pinc trunk/php/base.pinc trunk/php/bugtracking/bug.pinc trunk/php/bugtracking/bug_show.php trunk/php/checklist/checkfield.pinc trunk/php/checklist/checklist.pinc trunk/php/company.pinc trunk/php/counter/counter.pinc trunk/php/database.pinc trunk/php/db/db.pinc trunk/php/db/db_firebird.pinc trunk/php/db/db_mssql.pinc trunk/php/db/db_mysql.pinc trunk/php/db/db_mysqli.pinc trunk/php/db/db_pg.pinc trunk/php/db/db_sqlite.pinc trunk/php/db/db_sqlite3.pinc trunk/php/db.p3 trunk/php/department.pinc trunk/php/doctracker/doctracker.pinc trunk/php/drawboard/drawboard.pinc trunk/php/excel.pinc trunk/php/expense/expense.pinc trunk/php/file/file.pinc trunk/php/file/mconfig.pinc trunk/php/google_api/gapi.pinc trunk/php/group/group.pinc trunk/php/help.php trunk/php/installation/installation.pinc trunk/php/invoice/invoice.pinc trunk/php/layout/adq_layout.pinc trunk/php/layout/classic_base.pinc trunk/php/layout/classic_layout.pinc trunk/php/layout/layout_base.pinc trunk/php/layout/mobile_layout.pinc trunk/php/layout/new2_layout.pinc trunk/php/layout/new_layout.pinc trunk/php/layout/test_layout.pinc trunk/php/layout/theme_base.pinc trunk/php/ldap/ldap.pinc trunk/php/ldap/mconfig.pinc trunk/php/location.pinc trunk/php/mail.pinc trunk/php/mailbox/mailbox.pinc trunk/php/mailbox/mconfig.pinc trunk/php/module_base.pinc trunk/php/module_template/AAA.pinc trunk/php/mytutos.php trunk/php/note/note.pinc trunk/php/pdf.pinc trunk/php/pdf2.pinc trunk/php/permission.p3 trunk/php/product.pinc trunk/php/rate/rate.pinc trunk/php/reminder/reminder.pinc trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc trunk/php/report-engine/rep_directory/rep_directory.pinc trunk/php/report-engine/rep_doccheck/rep_doccheck.pinc trunk/php/report-engine/rep_envelope/rep_envelope.pinc trunk/php/report-engine/rep_freemind/rep_freemind.pinc trunk/php/report-engine/rep_ganttproject/rep_ganttproject.pinc trunk/php/report-engine/rep_group_excel/rep_group_excel.pinc trunk/php/report-engine/rep_index/rep_index.pinc trunk/php/report-engine/rep_mta/rep_mta.pinc trunk/php/report-engine/rep_prod_excel/rep_prod_excel.pinc trunk/php/report-engine/rep_prodstat/rep_prodstat.pinc trunk/php/report-engine/rep_spine/rep_spine.pinc trunk/php/report-engine/rep_subversion/rep_subversion.pinc trunk/php/report-engine/report_overview.php trunk/php/report-engine/report_show.php trunk/php/report-engine/reporter.pinc trunk/php/resource/resource.pinc trunk/php/rss/rss.pinc trunk/php/scrum/scrum.pinc trunk/php/stc/stc.pinc trunk/php/stuff/stuff.pinc trunk/php/subversion/svn.pinc trunk/php/task.pinc trunk/php/team.pinc trunk/php/team_ins.php trunk/php/testmanager/testmanager.pinc trunk/php/ticker/ticker.pinc trunk/php/timetrack/timetrack.pinc trunk/php/url/url.pinc trunk/php/user.pinc trunk/php/watchlist/watchlist.pinc trunk/php/webelements.p3 trunk/php/xml/xml_parse.pinc Modified: trunk/php/Date.pinc =================================================================== --- trunk/php/Date.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/Date.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2014 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -210,7 +210,7 @@ /* CANADA - Canada Day - July 1st, but not on a Sunday */ /* - July 2nd if July 1st is a Sunday */ if (($tutos[cal][$ii][$ij][Date] == "CA_CANADADAY") && ($month == "07") && - ($today['mday'] == canadaday($today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == canadaday($today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } @@ -248,69 +248,69 @@ } } elseif (($tutos[cal][$ii][$ij][Date] == "MARTINLUTHERKING") && ($month == "01") && - ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } elseif (($tutos[cal][$ii][$ij][Date] == "WASHINGTON") && ($month == "02") && - ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } elseif (($tutos[cal][$ii][$ij][Date] == "MEMORIALDAY") && ($month == "05") && - ($today['mday'] == nthday(-1, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(-1, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } elseif (($tutos[cal][$ii][$ij][Date] == "LABORDAY") && ($month == "09") && - ($today['mday'] == nthday(1, 1, $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(1, 1, $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } elseif (($tutos[cal][$ii][$ij][Date] == "COLUMBUSDAY") && ($month == "10") && - ($today['mday'] == nthday(2, 1, $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(2, 1, $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } /* CANADA - February Holiday - 2nd Monday in February */ elseif (($tutos[cal][$ii][$ij][Date] == "CA_FEBHOLIDAY2") && ($month == "02") && - ($today['mday'] == nthday(2, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(2, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } /* CANADA - February Holiday - 3rd Monday in February */ elseif (($tutos[cal][$ii][$ij][Date] == "CA_FEBHOLIDAY3") && ($month == "02") && - ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } /* CANADA - Victoria Day - Monday preceding May 25th */ elseif (($tutos[cal][$ii][$ij][Date] == "CA_VICTORIADAY") && ($month == "05") && - ($today['mday'] == victoriaday($today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == victoriaday($today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } /* CANADA - Civic Holiday - 1st Monday in August */ elseif (($tutos[cal][$ii][$ij][Date] == "CA_CIVICDAY") && ($month == "08") && - ($today['mday'] == nthday(1, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(1, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } /* CANADA - Discovery Day - 3nd Monday in August */ elseif (($tutos[cal][$ii][$ij][Date] == "CA_DISCOVERYDAY") && ($month == "08") && - ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } /* CANADA - Labour Day - 1st Monday in September */ elseif (($tutos[cal][$ii][$ij][Date] == "CA_LABOURDAY") && ($month == "09") && - ($today['mday'] == nthday(1, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(1, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } /* CANADA - Thanksgiving Day - 2nd Monday in October */ elseif (($tutos[cal][$ii][$ij][Date] == "CA_THANKSGIVING") && ($month == "10") && - ($today['mday'] == nthday(2, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(2, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } @@ -318,7 +318,7 @@ elseif ( $wd == "Tue" ) { /* Date calculation for Dutch 'Prinsjesdag' by Robert Brouwer */ if ($tutos[cal][$ii][$ij][Date] == "PRINSDAY" && ($month == "09") && - ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year']))) { + ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year']))) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } @@ -368,7 +368,7 @@ } } elseif (($tutos[cal][$ii][$ij][Date] == "THANKSGIVING") && ($month == "11") && - ($today['mday'] == nthday(4, $today['wday'], $today['mon'], $today['year'])) ) { + ($today['mday'] == nthday(4, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } @@ -392,12 +392,12 @@ } /* Date calculation for Dutch 'Moederdag' (Mothersday') by Robert Brouwer */ } elseif ($tutos[cal][$ii][$ij][Date] == "MOTHERDAY" && - ($month == "5") && ($today['mday'] == nthday(2, $today['wday'], $today['mon'], $today['year'])) ) { + ($month == "5") && ($today['mday'] == nthday(2, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; /* Date calculation for Dutch 'Vaderdag' (Fathersday') by Robert Brouwer */ } elseif ($tutos[cal][$ii][$ij][Date] == "FATHERDAY" && - ($month == "6") && ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { + ($month == "6") && ($today['mday'] == nthday(3, $today['wday'], $today['mon'], $today['year'])) ) { $desc .= $tutos[cal][$ii][$ij][Desc].$br; $mark += $tutos[cal][$ii][$ij][type]; } elseif ($tutos[cal][$ii][$ij][Date] == "WHITSUNDAY") { @@ -478,7 +478,7 @@ * str is whatever a database gives us * -1 = now */ - function TUTOS_Date_Time( $str = "-1" ) { + function __construct( $str = "-1" ) { global $current_user; $this->notime = 0; @@ -929,8 +929,8 @@ $r = ''; if ( !isset($_SERVER['HTTP_USER_AGENT']) - || preg_match("#Lynx#",$_SERVER['HTTP_USER_AGENT']) - || preg_match("#w3m#",$_SERVER['HTTP_USER_AGENT']) ) { + || preg_match("#Lynx#",$_SERVER['HTTP_USER_AGENT']) + || preg_match("#w3m#",$_SERVER['HTTP_USER_AGENT']) ) { // Do nothing } else { $r .= "<a href=\"JavaScript: @@ -1360,7 +1360,7 @@ * make a duraton in seoncds human readable * exact = false will only report days after 14 days */ - function duration($x,$exact = true) { + static function duration($x,$exact = true) { global $lang; $r = ''; Modified: trunk/php/address.pinc =================================================================== --- trunk/php/address.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/address.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -26,11 +26,12 @@ * URL to use for display this object */ protected $showurl = 'address_show.php'; + protected $modurl = 'address_new.php'; /** * initialize */ - function tutos_address(tutos_db $dbconn) { + function __construct(tutos_db $dbconn) { global $lang,$current_user,$tutos,$table; @@ -392,10 +393,10 @@ acl_raise($this,$this->id,$tutos[modok]); $this->modified[] = array ( 'field' => 'created' , - 'old' => $this->getType() , - 'new' => $this->id, - 'obj_id' => $this->id - ); + 'old' => $this->getType() , + 'new' => $this->id, + 'obj_id' => $this->id + ); } $q->addFV('creator',$this->creator,'OBJ'); $q->addFV('creation',$this->creation,'DATETIME'); @@ -486,17 +487,13 @@ /** * Return a URL to modify this address */ - function getModURL() { + function getModURL($arg = '') { + $url = parent::getModURL($arg); if ( isset($this->location) && count($this->location) > 0 ) { @reset($this->location); list ($j,$l) = @each ($this->location); - $url = 'address_new.php?id='. $this->id .'&loc_id='. $l->id; - } else { - $url = 'address_new.php?id='. $this->id; + $url = addUrlParameter($url,'loc_id='.$l->id); } - if (isset($_REQUEST['ss'])) { - return addUrlParameter($url,'ss='.$_REQUEST['ss']); - } return $url; } @@ -503,7 +500,7 @@ /** * Return a URL to delete this address */ - function getDelURL() { + function getDelURL($arg = '') { return 'address_del.php?id='. $this->id; } @@ -745,11 +742,11 @@ return; } return array( url => 'address_select.php', - image => $user->layout->theme->getImage(tutos_address::getHtmlIcon(),'menu'), - text => ($text == "" ? $lang['Addresses'] : $text), - info => $lang['SearchForAdr'], - category => array('search','address',useaddressbook) - ); + image => $user->layout->theme->getImage(tutos_address::getHtmlIcon(),'menu'), + text => ($text == "" ? $lang['Addresses'] : $text), + info => $lang['SearchForAdr'], + category => array('search','address',useaddressbook) + ); } /** Modified: trunk/php/address_show.php =================================================================== --- trunk/php/address_show.php 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/address_show.php 2017-08-16 13:26:07 UTC (rev 1316) @@ -128,7 +128,7 @@ // Location's Header and Direkt Links to Modify and Delete $r .= "<tr><td></td></tr>\n"; $r .= "<tr><td></td></tr>\n"; - $r .= Show_LocFields($this->user,'',$this,"ModifyDelete",9); + $r .= Show_LocFields($this->user,'',$this->obj,"ModifyDelete",9); $r .= Show_LocFields($this->user,$lang['AdrDescription'],$this->obj,"lname",1); $r .= Show_LocFields($this->user,$lang['Company'],$this->obj,"c_id",1); @@ -213,8 +213,8 @@ $this->name = $lang['AddressDetail'].": ". $this->obj->getFullName(); } if ( ($this->obj->getTypeID() != useaddressbook) - && ($this->obj->getTypeID() != usecompany) - && ($this->obj->getTypeID() != usedepartment) ) { + && ($this->obj->getTypeID() != usecompany) + && ($this->obj->getTypeID() != usedepartment) ) { $msg = addLine($msg,sprintf($lang['Err0040'],$lang['Address'])); $this->stop = true; $this->format = "html"; @@ -227,19 +227,19 @@ if ( $this->user->feature_ok(useaddressbook,PERM_NEW) ) { $x = array( url => 'address_new.php', - text => $lang['NewEntry'], - info => $lang['AdrCreateInfo'], - category => array('address','new','obj',useaddressbook) - ); + text => $lang['NewEntry'], + info => $lang['AdrCreateInfo'], + category => array('address','new','obj',useaddressbook) + ); $this->addMenu($x); } if ( !(is_numeric($this->obj) && $this->obj == -1) ) { if ( $this->obj->mod_ok() ) { $x = array( url => $this->obj->getModURL(), - text => $lang['Modify'], - info => $lang['Modify'], - category => array('address','mod','obj',useaddressbook) - ); + text => $lang['Modify'], + info => $lang['Modify'], + category => array('address','mod','obj',useaddressbook) + ); $this->addMenu($x); } } @@ -246,16 +246,16 @@ if ( $this->user->feature_ok(useaddressbook,PERM_NEW) ) { $x = array( url => 'company_new.php', - text => $lang['CompanyCreate'], - info => $lang['CompanyCreateInfo'], - category => array('company','new','module',usecompany) - ); + text => $lang['CompanyCreate'], + info => $lang['CompanyCreateInfo'], + category => array('company','new','module',usecompany) + ); $this->addMenu($x); $x = array( url => 'department_new.php', - text => $lang['DepartmentCreate'], - info => $lang['DepCreateInfo'], - category => array('department','new','module',usedepartment) - ); + text => $lang['DepartmentCreate'], + info => $lang['DepCreateInfo'], + category => array('department','new','module',usedepartment) + ); $this->addMenu($x); } @@ -262,42 +262,42 @@ if (is_object($this->obj)) { if ( $tutos[usevcard] == 1 ) { $x = array( url => $this->obj->getUrl() ."&format=vcard", - text => $lang['AdrGetVcard'], - info => $lang['AdrGetVcardI'], - category => array('address','view','obj',useaddressbook) - ); + text => $lang['AdrGetVcard'], + info => $lang['AdrGetVcardI'], + category => array('address','view','obj',useaddressbook) + ); $this->addMenu($x); } if ( $this->obj->use_ok() && $this->user->feature_ok(usetimetrack,PERM_SEE) ) { $x = array( url => 'timetrack/timetrack_overview.php?worker='.$this->obj->id, - text => $lang['TimetrackBooked'], - info => sprintf($lang['TimetrackBookedI'],$this->obj->getFullName()), - category => array('timetrack','support',usetimetrack) - ); + text => $lang['TimetrackBooked'], + info => sprintf($lang['TimetrackBookedI'],$this->obj->getFullName()), + category => array('timetrack','support',usetimetrack) + ); $this->addMenu($x); } if ( $this->obj->use_ok() && $this->user->feature_ok(usetaskmanagement,PERM_SEE) ) { $x = array( url => 'task_overview.php?id='.$this->obj->id, - text => $lang['TaskOverview'], - info => sprintf($lang['TaskOverviewInfo'],$this->obj->getFullName()), - category => array('task','support',usetaskmanagement) - ); + text => $lang['TaskOverview'], + info => sprintf($lang['TaskOverviewInfo'],$this->obj->getFullName()), + category => array('task','support',usetaskmanagement) + ); $this->addMenu($x); } if ( $this->obj->use_ok() && $this->user->feature_ok(usetaskmanagement,PERM_SEE) && $this->user->feature_ok(usecalendar,PERM_SEE) ) { $x = array( url => 'res_cal.php?id='.$this->obj->id, - text => $lang['ResCal'], - info => $lang['ResCal'], - category => array('timetrack','task','support') - ); + text => $lang['ResCal'], + info => $lang['ResCal'], + category => array('timetrack','task','support') + ); $this->addMenu($x); } if ( $this->obj->isUser() && $this->user->feature_ok(usecalendar,PERM_SEE) ) { $x = array( url => 'calendar.php?team[]='. $this->obj->id, - text => $lang['Calendar'], - info => sprintf($lang['ShowCal'], $this->obj->getFullName()), - category => array('app','support',usecalendar) - ); + text => $lang['Calendar'], + info => sprintf($lang['ShowCal'], $this->obj->getFullName()), + category => array('app','support',usecalendar) + ); $this->addMenu($x); } } Modified: trunk/php/admin_show.php =================================================================== --- trunk/php/admin_show.php 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/admin_show.php 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2001 - 2014 by Gero Kohnert + * Copyright 2001 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -176,7 +176,7 @@ $r .= $this->OverviewRowStart($line); $adr = new tutos_user($this->dbconn); $uid = $result->get($a, "id"); - $adr = $adr->read($uid, $adr, 1); + $adr = $adr->read_user($uid, $adr, 1); $r .= ' <td class="over_l">'. (is_object($adr) ? $adr->getLink():$uid) .'</td>'; $r .= ' <td class="over_r">'. makelink('user_new.php?uid='.$uid , (is_object($adr) ? $adr->login:'??') ); if ($adr->isAdmin()) { @@ -345,9 +345,9 @@ $x2 .= @gethostbyaddr($x1); $x2 .= ')'; } else if ( (ini_get('allow_url_fopen') == 1) && - ($tutos['resolve_host'] == 2) && - strstr($x1, '.') && - !strstr($x1, ' ')) { + ($tutos['resolve_host'] == 2) && + strstr($x1, '.') && + !strstr($x1, ' ')) { // see http://perishablepress.com/code-snippets/#code-snippets_php $url = 'http://api.hostip.info/get_html.php?ip='.$x1; $contents = file_get_contents($url); @@ -589,8 +589,8 @@ } } else { $x1 = preg_replace('#([1-9][0-9]*\.[0-9]*\.[0-9]*\.[0-9]*)#', - '<a href="admin_show.php?mode=logfile&filter=$1">$1</a>', - $x1); + '<a href="admin_show.php?mode=logfile&filter=$1">$1</a>', + $x1); } $r .= $x1.' '.$x2; } @@ -905,10 +905,10 @@ order_parse($this->q, $xxx, $xxx, $this, array('last_seen',2)); $x = array( URL => 'user_new.php', - TEXT => $lang['UserCreate'], - INFO => $lang['UserCreate'], - CATEGORY => array('user','new','module',useuser) - ); + TEXT => $lang['UserCreate'], + INFO => $lang['UserCreate'], + CATEGORY => array('user','new','module',useuser) + ); $this->addMenu($x); $x = tutos_user::getSelectLink($this->user); @@ -916,106 +916,106 @@ if ( $this->user->feature_ok(usehistory,PERM_SEL) ) { $x = array( url => 'history_select.php', - text => $lang['ObjHistory'], - info => $lang['ObjHistory'], - category => array('search','history',usehistory) - ); + text => $lang['ObjHistory'], + info => $lang['ObjHistory'], + category => array('search','history',usehistory) + ); $this->addMenu($x); } if ($tutos[useacl] == 1) { $x = array( URL => 'acl_overview.php', - TEXT => $lang['ACLOverview'], - INFO => $lang['ACLOverview'], - CATEGORY => array("admin") - ); + TEXT => $lang['ACLOverview'], + INFO => $lang['ACLOverview'], + CATEGORY => array("admin") + ); $this->addMenu($x); } if ($tutos[usesync] == 1) { $x = array( URL => 'admin_sync.php', - TEXT => $lang['AdminDBSync'], - INFO => $lang['AdminDBSync'], - CATEGORY => array("admin") - ); + TEXT => $lang['AdminDBSync'], + INFO => $lang['AdminDBSync'], + CATEGORY => array("admin") + ); $this->addMenu($x); } $x = array( URL => 'admin/phpinfo.php', - TEXT => '< PHP - Info >', - INFO => "PHP - Info for this TUTOS", - 'target' => 'admin', - CATEGORY => array('admin') - ); + TEXT => '< PHP - Info >', + INFO => "PHP - Info for this TUTOS", + 'target' => 'admin', + CATEGORY => array('admin') + ); $this->addMenu($x); if ( $this->user->isadmin() && function_exists("eaccelerator_info")) { $x = array( URL => 'admin/eaccelerator.php', - TEXT => '< Eaccelerator Info >', - INFO => 'Info about optimization', - 'target' => 'admin', - CATEGORY => array('admin') - ); + TEXT => '< Eaccelerator Info >', + INFO => 'Info about optimization', + 'target' => 'admin', + CATEGORY => array('admin') + ); $this->addMenu($x); } if ( $this->user->isadmin() && ($tutos['use_memcache']) ) { $x = array( URL => 'admin/memcache.php', - TEXT => '< Memcache Info >', - INFO => 'Info about optimization', - 'target' => 'admin', - CATEGORY => array('admin') - ); + TEXT => '< Memcache Info >', + INFO => 'Info about optimization', + 'target' => 'admin', + CATEGORY => array('admin') + ); $this->addMenu($x); } if ( $this->user->isadmin() && $tutos['use_apccache'] ) { $x = array( URL => 'admin/apc.php', - TEXT => '< APC Info >', - INFO => 'Info about optimization/caching', - 'target' => 'admin', - CATEGORY => array('admin') - ); + TEXT => '< APC Info >', + INFO => 'Info about optimization/caching', + 'target' => 'admin', + CATEGORY => array('admin') + ); $this->addMenu($x); } $x = array( URL => 'module_overview.php', - TEXT => $lang['AdminModules'], - INFO => $lang['AdminModulesI'], - CATEGORY => array('admin') - ); + TEXT => $lang['AdminModules'], + INFO => $lang['AdminModulesI'], + CATEGORY => array('admin') + ); $this->addMenu($x); $x = array( URL => 'admin/hooks.php', - TEXT => 'Hooks', - INFO => 'hooks defined here', - CATEGORY => array('admin') - ); + TEXT => 'Hooks', + INFO => 'hooks defined here', + CATEGORY => array('admin') + ); $this->addMenu($x); $x = array( URL => 'admin/customize_show.php', - text => $lang['AdminCustomizeLang'], - info => $lang['AdminCustomizeLangI'], - CATEGORY => array('admin') - ); + text => $lang['AdminCustomizeLang'], + info => $lang['AdminCustomizeLangI'], + CATEGORY => array('admin') + ); $this->addMenu($x); $x = array( URL => 'admin/table_custom_show.php', - TEXT => $lang['AdminCustomTable'], - INFO => $lang['AdminCustomTableI'], - CATEGORY => array('admin') - ); + TEXT => $lang['AdminCustomTable'], + INFO => $lang['AdminCustomTableI'], + CATEGORY => array('admin') + ); $this->addMenu($x); $x = array( URL => 'admin/main_config.php', - TEXT => $lang['AdminMainConfig'], - INFO => $lang['AdminMainConfigI'], - CATEGORY => array('admin','config') - ); + TEXT => $lang['AdminMainConfig'], + INFO => $lang['AdminMainConfigI'], + CATEGORY => array('admin','config') + ); $this->addMenu($x); $x = array( URL => 'admin/crontab_maker.php', - TEXT => 'Cronjob', - INFO => 'define cronjob', - CATEGORY => array('admin','config') - ); + TEXT => 'Cronjob', + INFO => 'define cronjob', + CATEGORY => array('admin','config') + ); $this->addMenu($x); } } @@ -1026,6 +1026,6 @@ $dbconn->close(); ?> <!-- -SVN Info $Id$ -$Author$ ---> \ No newline at end of file + SVN Info $Id$ + $Author$ + --> \ No newline at end of file Modified: trunk/php/appointment.pinc =================================================================== --- trunk/php/appointment.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/appointment.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2014 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -387,7 +387,7 @@ /** * */ - function appointment(tutos_db $dbconn) { + function __construct(tutos_db $dbconn) { global $table; $this->init($dbconn); @@ -469,10 +469,10 @@ $x2->setDateTimeTS($this->end->ts_def); if ( $this->t_ignore == 0 ) { if ( ( $x1->hour == $x2->hour ) - && ( $x1->min == $x2->min ) - && ( $x1->min == 0 ) - && ( $x1->hour == 0 ) - ) { + && ( $x1->min == $x2->min ) + && ( $x1->min == 0 ) + && ( $x1->hour == 0 ) + ) { $this->t_ignore = 1; } else { $this->t_ignore = 0; @@ -609,7 +609,7 @@ * lg = language array to use (for multilang mails) * return modified subject line */ - function replace_mail_tags($mail,$lg) { + function replace_mail_tags($mail,array $lg) { if (is_object($mail)) { $s = $mail->body; } else { @@ -740,7 +740,7 @@ $id = $new->id; } if ( ( is_object($this->product) && ($id != $this->product->id) ) - || (!is_object($this->product) && ($id != -1)) ) { + || (!is_object($this->product) && ($id != -1)) ) { $this->modified[] = array ( "field" => "ProductP" , "old" => (is_object($this->product) ? $this->product->id:-1) , "new" => $id ); $this->product = $new; } @@ -757,7 +757,7 @@ $id = $new->id; } if ( ( is_object($this->visitor) && ($id != $this->visitor->id) ) - || (!is_object($this->visitor) && ($id != -1)) ) { + || (!is_object($this->visitor) && ($id != -1)) ) { $this->modified[] = array ( "field" => "VisitAt" , "old" => (is_object($this->visitor) ? $this->visitor->id:-1) , "new" => $id ); $this->visitor = $new; } @@ -870,10 +870,10 @@ $this->id = $q->addFV("id",-1,"NEXTID"); $this->modified[] = array ( "field" => "created" , - "old" => $this->getType() , - "new" => $this->id, - "obj_id" => $this->id - ); + "old" => $this->getType() , + "new" => $this->id, + "obj_id" => $this->id + ); } $q->addFV("creator",$this->creator,"OBJ"); $q->addFV("creation",$this->creation,"DATETIME"); @@ -974,10 +974,10 @@ $r = $this->dbconn->Exec($q); $r->free(); $this->modified[] = array ( "field" => "AppointCommit" , - "old" => $this->participant_state[$adr_id] , - "new" => $vote, - "obj_id" => $this->id - ); + "old" => $this->participant_state[$adr_id] , + "new" => $vote, + "obj_id" => $this->id + ); $msg = addLine($msg,history_save($this)); return $msg; } @@ -1324,7 +1324,7 @@ $ical .= ";UNTIL=". $this->end->getYYYYMMDD(); } # FIX ME !! - $ical .= "\n"; + $ical .= "\n"; } $ical .= "ATTACH;FMTTYPE=text/html:". $url ."\n"; if ( $this->remember > 0 ) { @@ -1532,8 +1532,8 @@ } if ( ($tutos[applocdesc][$this->outside] == 1) - || ( ($myself == true) && ($tutos[applocdesc][$this->outside] == 2)) - ) { + || ( ($myself == true) && ($tutos[applocdesc][$this->outside] == 2)) + ) { $descr = preg_replace('#\n#m','<br />',myentities($this->descr)); if ($descr != '' ) { $r .= '<span class="left">'.urlReplace($descr,0).'</span>'; @@ -1787,15 +1787,15 @@ if (! $user->feature_ok(usecalendar,PERM_NEW) ) return ''; $x[0] = array( url => 'app_new.php', - text => $lang['NewEntry'], - info => $lang['NewAppointInfo'], - category => array('app','new','obj',usecalendar) - ); + text => $lang['NewEntry'], + info => $lang['NewAppointInfo'], + category => array('app','new','obj',usecalendar) + ); $x[1] = array( url => "app_new_r.php", - text => $lang['NewAppointR'], - info => $lang['NewAppointInfoR'], - category => array('app','new','obj',usecalendar) - ); + text => $lang['NewAppointR'], + info => $lang['NewAppointInfoR'], + category => array('app','new','obj',usecalendar) + ); if (! is_object($obj) ) return $x; @@ -1802,8 +1802,8 @@ if ( $obj->id == -1 ) return $x; if ( ($obj->getType() == "company") || - ($obj->getType() == "department") - ) { + ($obj->getType() == "department") + ) { $x[0][url] = addUrlParameter($x[0][url],"vid=".$obj->id); $x[0][category] = array('app','new','module',usecalendar); $x[0][text] = $lang['NewAppoint']; @@ -1826,11 +1826,11 @@ return; } return array( url => 'app_select.php', - image => $user->layout->theme->getImage(appointment::getHtmlIcon(),'menu'), - text => ($text == "" ? $lang['Search']: $text), - info => $lang['SearchForApp'], - category => array('search','app',usecalendar) - ); + image => $user->layout->theme->getImage(appointment::getHtmlIcon(),'menu'), + text => ($text == "" ? $lang['Search']: $text), + info => $lang['SearchForApp'], + category => array('search','app',usecalendar) + ); } /** Modified: trunk/php/auth/auth.pinc =================================================================== --- trunk/php/auth/auth.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -34,7 +34,7 @@ * * @param Object a database connection */ - function auth() { + function __construct() { $this->pwlostsupport = true; $this->pwchangesupport = true; $this->is_additional = false; // this auth is possible as additional login Modified: trunk/php/auth/auth_cmdline.pinc =================================================================== --- trunk/php/auth/auth_cmdline.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_cmdline.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2004 - 2013 by Gero Kohnert + * Copyright 2004 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -25,7 +25,7 @@ /** * init */ - function auth_cmdline() { + function __construct() { $this->uname = $this->getParameter("u"); $this->pw = $this->getParameter("p"); $this->dbnr = $this->getParameter("d"); Modified: trunk/php/auth/auth_db.pinc =================================================================== --- trunk/php/auth/auth_db.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_db.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: trunk/php/auth/auth_external.pinc =================================================================== --- trunk/php/auth/auth_external.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_external.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /* - * Copyright 2009 - 2013 by Gero Kohnert + * Copyright 2009 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -25,7 +25,7 @@ /** * init */ - function auth_external() { + function __construct() { global $tutos,$msg; // Modified: trunk/php/auth/auth_google.pinc =================================================================== --- trunk/php/auth/auth_google.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_google.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -14,13 +14,13 @@ require_once 'auth.pinc'; $table['people']['google_email'] = array('custom' => true, - type => 'VARCHAR', - size => 128, - Desc => 'google email for auth', - constraints => '', - 'lang' => 'Google Email', - 'hidden' => false, - 'required' => false); +type => 'VARCHAR', +size => 128, +Desc => 'google email for auth', +constraints => '', +'lang' => 'Google Email', +'hidden' => false, +'required' => false); /** * Authentification class @@ -33,7 +33,7 @@ /** * init */ - function auth_google() { + function __construct() { global $tutos,$msg; $this->pwlostsupport = false; Modified: trunk/php/auth/auth_http.pinc =================================================================== --- trunk/php/auth/auth_http.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_http.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -23,7 +23,7 @@ /** * init */ - function auth_http() { + function __construct() { global $tutos,$msg; // Modified: trunk/php/auth/auth_ldap.pinc =================================================================== --- trunk/php/auth/auth_ldap.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_ldap.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -29,7 +29,7 @@ /** * init */ - function auth_ldap() { + function __construct() { global $tutos,$msg; // // Globally diable PWLOST SUPPORT @@ -162,7 +162,7 @@ /* OK there is one user so lets check */ $ds = ldap_connect($tutos[ldapauthserver]["host"], - $tutos[ldapauthserver]["port"]); + $tutos[ldapauthserver]["port"]); if( ! $ds ) { ReadLang($lang); @@ -244,8 +244,8 @@ $res = ldap_bind($ds); } else { $res = ldap_bind($ds, - $tutos[ldapauthserver]["binddn"], - $tutos[ldapauthserver]["passwd"]); + $tutos[ldapauthserver]["binddn"], + $tutos[ldapauthserver]["passwd"]); } if( ! $res ) { @@ -267,8 +267,8 @@ } $sr = ldap_search($ds, - $tutos[ldapauthserver]["basedn"], - $filter) ; + $tutos[ldapauthserver]["basedn"], + $filter) ; if( ! $sr ) { $errno = ldap_errno($ds); Modified: trunk/php/auth/auth_pam.pinc =================================================================== --- trunk/php/auth/auth_pam.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_pam.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -24,7 +24,7 @@ /** * init */ - function auth_pam() { + function __construct() { global $tutos,$msg; // // Globally diable PWLOST SUPPORT Modified: trunk/php/auth/auth_pwauth_db.pinc =================================================================== --- trunk/php/auth/auth_pwauth_db.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_pwauth_db.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2009 - 2013 by Gero Kohnert + * Copyright 2009 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Modified: trunk/php/auth/auth_remoteuser.pinc =================================================================== --- trunk/php/auth/auth_remoteuser.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_remoteuser.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -24,7 +24,7 @@ /** * init */ - function auth_remoteuser() { + function __construct() { global $tutos,$msg; // // Globally diable PWLOST SUPPORT Modified: trunk/php/auth/auth_x509.pinc =================================================================== --- trunk/php/auth/auth_x509.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/auth/auth_x509.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -24,7 +24,7 @@ /** * init */ - function auth_x509() { + function __construct() { global $tutos; // // Globally diable PWLOST SUPPORT Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/base.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -59,7 +59,7 @@ * * @param Object a database connection */ - function tutos_base(tutos_db $dbconn) { + function __construct($dbconn) { $this->init($dbconn); } @@ -826,8 +826,8 @@ } $this->modified[] = array ( "field" => $histfield , - "old" => (is_object($this->$fld) ? $this->$fld->id:null) , - "new" => (is_object($value) ? $value->id:null) ); + "old" => (is_object($this->$fld) ? $this->$fld->id:null) , + "new" => (is_object($value) ? $value->id:null) ); $this->$fld = $value; return true; } @@ -1033,9 +1033,9 @@ return null; } return array( url => 'tree.php?id='.$this->id, - text => ($text == '' ? 'Treebrowser': $text), - category => array('view','tree') - ); + text => ($text == '' ? 'Treebrowser': $text), + category => array('view','tree') + ); } /** @@ -1351,8 +1351,8 @@ } if (is_object($mail) - && $mail->contenttype == 'text/html' - && preg_match('#@LOGO@#',$s)) { + && $mail->contenttype == 'text/html' + && preg_match('#@LOGO@#',$s)) { if (preg_match('#^http#',$tutos['logo'])) { $p = $tutos['logo']; } else { @@ -1807,7 +1807,7 @@ $r = ''; if (isset($tutos['presave-hooks'][$this->getType()]) && - is_array($tutos['presave-hooks'][$this->getType()])) { + is_array($tutos['presave-hooks'][$this->getType()])) { foreach($tutos['presave-hooks'][$this->getType()] as $f) { if (function_exists($f)) { $r .= $f($this); @@ -1826,7 +1826,7 @@ $r = ''; if (isset($tutos['postsave-hooks'][$this->getType()]) && - is_array($tutos['postsave-hooks'][$this->getType()])) { + is_array($tutos['postsave-hooks'][$this->getType()])) { foreach($tutos['postsave-hooks'][$this->getType()] as $f) { if (function_exists($f)) { if ( !isset($tutos['in_ps']) || ($tutos['in_ps'] != $f)) { @@ -1849,7 +1849,7 @@ $r = ''; if (isset($tutos['postdel-hooks'][$this->getType()]) && - is_array($tutos['postdel-hooks'][$this->getType()])) { + is_array($tutos['postdel-hooks'][$this->getType()])) { foreach($tutos['postdel-hooks'][$this->getType()] as $f) { if (function_exists($f)) { if ( !isset($tutos['in_pd']) || ($tutos['in_pd'] != $f)) { @@ -1872,7 +1872,7 @@ $r = ''; if (isset($tutos['check-hooks'][$this->getType()]) && - is_array($tutos['check-hooks'][$this->getType()])) { + is_array($tutos['check-hooks'][$this->getType()])) { foreach($tutos['check-hooks'][$this->getType()] as $f) { if (function_exists($f)) { if ( !isset($tutos['in_ch']) || ($tutos['in_ch'] != $f)) { @@ -1895,7 +1895,7 @@ $r = ''; if (isset($tutos['after_read-hooks'][$this->getType()]) && - is_array($tutos['after_read-hooks'][$this->getType()])) { + is_array($tutos['after_read-hooks'][$this->getType()])) { foreach($tutos['after_read-hooks'][$this->getType()] as $f) { if (function_exists($f)) { if ( !isset($tutos['in_ar']) || ($tutos['in_ar'] != $f)) { @@ -1918,7 +1918,7 @@ $r = ''; if (isset($tutos['postinit-hooks'][$this->getType()]) && - is_array($tutos['postinit-hooks'][$this->getType()])) { + is_array($tutos['postinit-hooks'][$this->getType()])) { foreach($tutos['postinit-hooks'][$this->getType()] as $f) { if (function_exists($f)) { if ( !isset($tutos['in_pi']) || ($tutos['in_pi'] != $f)) { Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2017-08-12 16:50:33 UTC (rev 1315) +++ trunk/php/bugtracking/bug.pinc 2017-08-16 13:26:07 UTC (rev 1316) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -30,7 +30,7 @@ type => 'bool', 'default' => '0', 'help' => 'BugConfigHelpUseRevision' - ); +); $tutos['cfg']['bug_need_revision'] = array( 'section' => 'bugtracking', type => 'stc', @@ -38,19 +38,19 @@ 'stcdef' => 'BugStates', 'default' => '0', 'help' => 'BugConfigHelpNeedRevision' - ); +); $tutos['cfg']['bug_delete'] = array( 'section' => 'bugtracking', type => 'bool', 'default' => '0', 'help' => 'BugConfigHelpDelete' - ); +); $tutos['cfg']['bug_free_target'] = array( 'section' => 'bugtracking', type => 'bool', 'default' => '0', 'help' => 'BugConfigHelpFreeTarget' - ); +); $tutos['cfg']['bugnew_prod_mail'] = array( 'section' => 'bugtracking', type => 'sel', @@ -57,7 +57,7 @@ 'function'=> 'get_prod_roles', 'multi' => 1, 'help' => 'BugConfigHelpProdNewMail' - ); +); $tutos['cfg']['bugmod_prod_mail'] = array( 'section' => 'bugtracking', type => 'sel', @@ -64,13 +64,13 @@ 'function'=> 'get_prod_roles', 'multi' => 1, 'help' => 'BugConfigHelpProdModMail' - ); +); $tutos['cfg']['bug_no_mail'] = array( 'section' => 'bugtracking', type => 'bool', 'default' => '0', 'help' => 'BugConfigHelpNoMail' - ); +); /** * get roles for selection in bugnew_prod_mail and bugmod_prod_mail @@ -157,7 +157,7 @@ */ class Bugdata extends tutos_base { - function bugdata(tutos_db $dbconn) { + function __construct(tutos_db $dbconn) { global $tutos,$current_user,$table; $this->init($dbconn); @@ -319,38 +319,41 @@ */ static public $revision = '$Rev$'; - static public $c_state = array(BUG_STATE_OPEN => "red", - BUG_STATE_WORK => "blue", - BUG_STATE_SOLVED => "green", - BUG_STATE_CLOSED => "gray" - ); + static public $c_state = array( + BUG_STATE_OPEN => "red", + BUG_STATE_WORK => "blue", + BUG_STATE_SOLVED => "green", + BUG_STATE_CLOSED => "gray" + ); - static public $c_class = array(BUG_CLASS_LIGHT => "blue", - BUG_CLASS_HEAVY => "#F05050", - BUG_CLASS_DANGER => "red", - BUG_CLASS_HINT => "green", - BUG_CLASS_5 => "#50F050", - BUG_CLASS_6 => "#5050F0", - BUG_CLASS_7 => "#804040", - BUG_CLASS_8 => "#408040", - BUG_CLASS_9 => "#404080" - ); + static public $c_class = array( + BUG_CLASS_LIGHT => "blue", + BUG_CLASS_HEAVY => "#F05050", + BUG_CLASS_DANGER => "red", + BUG_CLASS_HINT => "green", + BUG_CLASS_5 => "#50F050", + BUG_CLASS_6 => "#5050F0", + BUG_CLASS_7 => "#804040", + BUG_CLASS_8 => "#408040", + BUG_CLASS_9 => "#404080" + ); /** * features we can modify per parent */ - static protected $parent_feature = array('bug_use_revision', - 'bug_need_revision', - 'bug_delete', - 'bug_free_target', - 'bugnew_prod_mail', - 'bugmod_prod_mail', - 'bug_no_mail' - ); + static protected $parent_feature = array( + 'bug_use_revision', + 'bug_need_revision', + 'bug_delete', + 'bug_free_target', + 'bugnew_prod_mail', + 'bugmod_prod_mail', + 'bug_no_mail' + ); /** * */ - function bug(tutos_db $dbconn) { + function __construct(tutos_db $dbconn) { global $tutos,$current_user,$table,$lang; $this->init($dbconn); @@ -360,7 +363,7 @@ $this->class = BUG_CLASS_LIGHT; foreach($lang['BugClasses'] as $i => $j) { if (isset($tutos['deprecated']['BugClasses']) - && !in_array($i,$tutos['deprecated']['BugClasses']) ) { + && !in_array($i,$tutos['deprecated']['BugClasses']) ) { $this->class = $i; break; } @@ -774,7 +777,7 @@ return 0; } if ( (is_object($this->parent) && $this->parent->tutos['bug_delete'] == 0) - || (!is_object($this->parent) && $tutos['bug_delete'] == 0) ) { + || (!is_object($this->parent) && $tutos['bug_delete'] == 0) ) { return 0; } return acl_del_ok($this); @@ -1157,7 +1160,7 @@ * lg = language array to use (for multilang mails) * return modified subject line */ - function replace_mail_tags($mail,$lg) { + function replace_mail_tags($mail,array $lg) { if (is_object($mail)) { $s = $mail->body; } else { @@ -1364,16 +1367,16 @@ // Prepare the history $this->parent->modified[] = array ( "field" => "BugCreate" , - "old" => "" , - "new" => $this->id, - "obj_id" => $this->parent->id - ); + "old" => "" , + "new" => $this->id, + "obj_id" => $this->parent->id + ); $callref = true; $this->modified[] = array ( "field" => "created" , - "old" => $this->getType() , - "new" => $this->id, - "obj_id" => $this->id - ); + "old" => $this->getType() , + "new" => $this->id, + "obj_id" => $this->id + ); } $q->addFV('revision',$this->newrev,"STRING",$table['bug3']['revision'][size]); $q->addFV('creator',$this->creator,"OBJ"); @@ -1427,10 +1430,10 @@ $bd->creator = $current_user; $bd->save(); $this->modified[] = array ( "field" => "BugAdditional" , - "old" => -1 , - "new" => $bd->id, - "obj_id" => $this->id - ); + "old" => -1 , + "new" => $bd->id, + "obj_id" => $this->id + ); // add the new bugdesc to the list $this->bughist[] = &$bd; } @@ -1600,7 +1603,7 @@ $x[0][REMINDER_BUG_SOLVE_AT] = array('plandate',$lang['DateTimeTill']); // possible Offsets $x[1] = array_unique($x[1] + array(-86400*7*1,-86400*2,-86400*1,-3600*2,-3600*1,0, - 3600*1,3600*2,86400*1,86400*2,86400*7*1)); + 3600*1,3600*2,86400*1,86400*2,86400*7*1)); return $x; } @@ -1834,23 +1837,23 @@ ... [truncated message content] |
From: <gok...@us...> - 2017-08-12 16:50:36
|
Revision: 1315 http://sourceforge.net/p/tutos/code/1315 Author: gokohnert Date: 2017-08-12 16:50:33 +0000 (Sat, 12 Aug 2017) Log Message: ----------- updates Modified Paths: -------------- trunk/php/bugtracking/bug.pinc trunk/php/expense/expense.pinc trunk/php/stc/en.p3 Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2017-08-05 13:16:51 UTC (rev 1314) +++ trunk/php/bugtracking/bug.pinc 2017-08-12 16:50:33 UTC (rev 1315) @@ -1196,10 +1196,13 @@ $baseUrl = getBaseUrl(true); - if (strpos($baseUrl, "bugtracking") === false) { + $dbaseUrl = dirname($baseUrl); + if (strpos($baseUrl, "/bugtracking/") !== false) { + $url = $dbaseUrl."/". $this->getUrl(); + } else if (strpos($baseUrl, "/expense/") !== false) { + $url = $dbaseUrl."/". $this->getUrl(); + } else { $url = $baseUrl . $this->getURL(); - } else { - $url = dirname($baseUrl)."/". $this->getUrl(); } $mail->body = preg_replace('/@TO@/',$to->getFullName(),$mail->body); @@ -1831,23 +1834,23 @@ $q = 'SELECT * from '. $obj->dbconn->prefix.$table['bugtracking'][name] .' where '; if($obj->getTypeId() == usebugtracking) { - $q .= 'followup_id = '. $obj->id; - } else { - $q .= 'product_id = '. $obj->id; - } + $q .= 'followup_id = '. $obj->id; + } else { + $q .= 'product_id = '. $obj->id; + } $r = $obj->dbconn->Exec($q); $n = $r->numrows(); $a = 0; while ($a < $n) { - $b = new bug($obj->dbconn); - $b->read_result($r,$a); - // $b->readTimetrackSum(); - // $obj->tsum['Bugs'] += $b->timetracksum; - $obj->list[usebugtracking][1][$b->id] = &$b; - $a++; - unset($b); - } + $b = new bug($obj->dbconn); + $b->read_result($r,$a); + // $b->readTimetrackSum(); + // $obj->tsum['Bugs'] += $b->timetracksum; + $obj->list[usebugtracking][1][$b->id] = &$b; + $a++; + unset($b); + } $obj->readTimetrackSum($obj->list[usebugtracking][1],'Bugs'); @@ -1862,46 +1865,46 @@ $n = $r->numrows(); $a = 0; while ($a < $n) { - $b = new bug($obj->dbconn); - $b->read_result($r,$a); - //$b->readTimetrackSum(); - //$obj->tsum['Bugs'] += $b->timetracksum; - $obj->list[usebugtracking][2][$b->id] = &$b; - $a++; - unset($b); - } + $b = new bug($obj->dbconn); + $b->read_result($r,$a); + //$b->readTimetrackSum(); + //$obj->tsum['Bugs'] += $b->timetracksum; + $obj->list[usebugtracking][2][$b->id] = &$b; + $a++; + unset($b); + } $r->free(); return; } - /** - * Return Info about connected bugs to a object including timetrack - */ - function summary(tutos_base $obj) { + /** + * Return Info about connected bugs to a object including timetrack + */ + function summary(tutos_base $obj) { global $lang; if (! is_object($obj) ) return; if(!isset($obj->list[usebugtracking][1])) { - bug::obj_read($obj); - } + bug::obj_read($obj); + } $ret = ''; $b = array(); foreach ($obj->list[usebugtracking][1] as $i => $bug) { - if (!isset($b[$bug->state])) { - $b[$bug->state] = 0; - $t[$bug->state] = 0; - $s[$bug->state] = ''; - } - $b[$bug->state]++; - // TODO $t[$bug->state] += $bug->timetracksum; - if ($bug->see_ok()) { - $s[$bug->state] = $bug->short; - } - } + if (!isset($b[$bug->state])) { + $b[$bug->state] = 0; + $t[$bug->state] = 0; + $s[$bug->state] = ''; + } + $b[$bug->state]++; + // TODO $t[$bug->state] += $bug->timetracksum; + if ($bug->see_ok()) { + $s[$bug->state] = $bug->short; + } + } $bug = new bug($obj->dbconn); @@ -1909,30 +1912,30 @@ $url = addUrlParameter($url,"pid=". $obj->id); foreach($b as $i => $f) { - if ( $f > 0 ) { - $vurl = addUrlParameter($url,'state[]='. $i); - $ret .= "<tr>\n"; - $ret .= '<td nowrap="nowrap" align="left">'. makelink($vurl,$bug->getStateColorBlock($i).$bug->getState($i) ) ."</td>\n"; - $ret .= '<td nowrap="nowrap" align="right"> '. $b[$i] ." </td>\n"; - // TODO $ret .= '<td nowrap="nowrap" align="right"> '. hour_format($t[$i]) .' '. $lang['hours'] ."</td>\n"; - if ( ($f == 1) && ($s[$i] != '') ) { - $ret .= "<td nowrap=\"nowrap\" align=\"left\"> (". $s[$i].") </td>\n"; - } else { - $ret .= "<td nowrap=\"nowrap\" align=\"left\"> </td>\n"; - } - $ret .= "</tr>\n"; - } - } + if ( $f > 0 ) { + $vurl = addUrlParameter($url,'state[]='. $i); + $ret .= "<tr>\n"; + $ret .= '<td nowrap="nowrap" align="left">'. makelink($vurl,$bug->getStateColorBlock($i).$bug->getState($i) ) ."</td>\n"; + $ret .= '<td nowrap="nowrap" align="right"> '. $b[$i] ." </td>\n"; + // TODO $ret .= '<td nowrap="nowrap" align="right"> '. hour_format($t[$i]) .' '. $lang['hours'] ."</td>\n"; + if ( ($f == 1) && ($s[$i] != '') ) { + $ret .= "<td nowrap=\"nowrap\" align=\"left\"> (". $s[$i].") </td>\n"; + } else { + $ret .= "<td nowrap=\"nowrap\" align=\"left\"> </td>\n"; + } + $ret .= "</tr>\n"; + } + } if ($ret == "") { - return $ret; - } + return $ret; + } return '<table border="0" cellpadding="0" cellspacing="0">'. $ret ."</table>\n"; } - /** - * a object that may hold bugs is deleted - */ - static function obj_delete(tutos_user $user,tutos_base $obj) { + /** + * a object that may hold bugs is deleted + */ + static function obj_delete(tutos_user $user,tutos_base $obj) { $msg = ''; // do not run for followups @@ -1941,25 +1944,25 @@ bug::obj_read($obj); if ( isset($obj->list[usebugtracking][1]) && (count($obj->list[usebugtracking][1]) > 0) ) { - foreach ($obj->list[usebugtracking][1] as $f ) { - if ($f->del_ok()) { - $msg = addLine($msg,$f->delete()); - } - } - } + foreach ($obj->list[usebugtracking][1] as $f ) { + if ($f->del_ok()) { + $msg = addLine($msg,$f->delete()); + } + } + } if ( isset($obj->list[usebugtracking][2]) && (count($obj->list[usebugtracking][2]) > 0) ) { - foreach ($obj->list[usebugtracking][2] as $f ) { - $f->setTarget(); - $msg = addLine($msg,$f->save()); - } - } + foreach ($obj->list[usebugtracking][2] as $f ) { + $f->setTarget(); + $msg = addLine($msg,$f->save()); + } + } return $msg; } - /** - * show a list of bugs attached to the given object - */ - static function infolist (tutos_user $user,tutos_base $obj,$cols,$format = "html") { + /** + * show a list of bugs attached to the given object + */ + static function infolist (tutos_user $user,tutos_base $obj,$cols,$format = "html") { global $lang,$tutos; $r = ''; @@ -1969,67 +1972,67 @@ $closed = preg_split('#,#',$tutos['bug_closed_states']); bug::obj_read($obj); if ( count($obj->list[usebugtracking][1]) > 0 ) { - $r .= $user->layout->ContentRowStart(); - if($obj->getTypeId() == usebugtracking) { - $r .= $user->layout->showfield($lang['BugFollowBy']); - } else { - $r .= $user->layout->show_info_field($lang['Bugs'],$obj,get_class()); - } - $d = ''; - $pre = ''; - if($obj->getTypeId() == usebugtracking) { - foreach ($obj->list[usebugtracking][1] as $i => $bug) { - if (in_array($bug->state,$closed)) { - $d .= $pre.'<span class="missing">'.$bug->getStateColorBlock().$bug->getLink().'</span>'; - } else { - $d .= $pre.$bug->getStateColorBlock().$bug->getLink(); - } - $pre = '<br />'; - $link = 'bugtracking/bug_overview.php?show=all&fid='.$obj->id; - } - } else { - $d .= bug::summary($obj); - $link = 'bugtracking/bug_overview.php?show=all&pid='.$obj->id; - } - $d .= $pre.$user->layout->theme->getImage(folder,'list') .' '. makelink($link,$lang['BugsOverview'] ); - $r .= $user->layout->showdata($d,$cols-1); - $r .= $user->layout->ContentRowEnd(); - } + $r .= $user->layout->ContentRowStart(); + if($obj->getTypeId() == usebugtracking) { + $r .= $user->layout->showfield($lang['BugFollowBy']); + } else { + $r .= $user->layout->show_info_field($lang['Bugs'],$obj,get_class()); + } + $d = ''; + $pre = ''; + if($obj->getTypeId() == usebugtracking) { + foreach ($obj->list[usebugtracking][1] as $i => $bug) { + if (in_array($bug->state,$closed)) { + $d .= $pre.'<span class="missing">'.$bug->getStateColorBlock().$bug->getLink().'</span>'; + } else { + $d .= $pre.$bug->getStateColorBlock().$bug->getLink(); + } + $pre = '<br />'; + $link = 'bugtracking/bug_overview.php?show=all&fid='.$obj->id; + } + } else { + $d .= bug::summary($obj); + $link = 'bugtracking/bug_overview.php?show=all&pid='.$obj->id; + } + $d .= $pre.$user->layout->theme->getImage(folder,'list') .' '. makelink($link,$lang['BugsOverview'] ); + $r .= $user->layout->showdata($d,$cols-1); + $r .= $user->layout->ContentRowEnd(); + } if ( count($obj->list[usebugtracking][2]) > 0 ) { - $r .= $user->layout->ContentRowStart(); - $r .= $user->layout->showfield($lang['Bug'].': '.$lang['BugTarget']); - $d = ''; - $pre = ''; - $x = 0; - $linktitle = $lang['BugsOverview']; - foreach ($obj->list[usebugtracking][2] as $i => $bug) { - if (in_array($bug->state,$closed)) { - $d .= $pre.'<span class="missing">'.$bug->getStateColorBlock().$bug->getLink().'</span>'; - } else { - $d .= $pre.$bug->getStateColorBlock().$bug->getLink(); - } - $pre = '<br />'; - $x++; - if ($format == "html" && $x > $tutos['maxshort']) { - $linktitle = sprintf($lang['AllEntries'], count($obj->list[usebugtracking][2])); - break; - } - } - $link = 'bugtracking/bug_overview.php?show=all&tid='.$obj->id; - $d .= $pre.$user->layout->theme->getImage(folder,'list') ." ". makelink($link,$linktitle); + $r .= $user->layout->ContentRowStart(); + $r .= $user->layout->showfield($lang['Bug'].': '.$lang['BugTarget']); + $d = ''; + $pre = ''; + $x = 0; + $linktitle = $lang['BugsOverview']; + foreach ($obj->list[usebugtracking][2] as $i => $bug) { + if (in_array($bug->state,$closed)) { + $d .= $pre.'<span class="missing">'.$bug->getStateColorBlock().$bug->getLink().'</span>'; + } else { + $d .= $pre.$bug->getStateColorBlock().$bug->getLink(); + } + $pre = '<br />'; + $x++; + if ($format == "html" && $x > $tutos['maxshort']) { + $linktitle = sprintf($lang['AllEntries'], count($obj->list[usebugtracking][2])); + break; + } + } + $link = 'bugtracking/bug_overview.php?show=all&tid='.$obj->id; + $d .= $pre.$user->layout->theme->getImage(folder,'list') ." ". makelink($link,$linktitle); - $r .= $user->layout->showdata($d,$cols-1); - $r .= $user->layout->ContentRowEnd(); - } + $r .= $user->layout->showdata($d,$cols-1); + $r .= $user->layout->ContentRowEnd(); + } return $r; } - /** - * create a link where a bug for the given object could be added - */ - static function getaddlink (tutos_user $user,tutos_base $obj,$text = "") { + /** + * create a link where a bug for the given object could be added + */ + static function getaddlink (tutos_user $user,tutos_base $obj,$text = "") { global $lang; if (! is_object($obj) ) return ""; if ( $obj->id == -1 ) return ""; @@ -2039,25 +2042,25 @@ if ($obj->getType() == 'stc') return ''; $x = array( url => 'bugtracking/bug_new.php?pid='. $obj->id, - confirm => false, - text => ($text == '' ? $lang['BugCreate']:$text), - info => sprintf($lang['BugCreateInfo'], $obj->getFullName()), - category => array(bug::getType(),'new','module',usebugtracking) + confirm => false, + text => ($text == '' ? $lang['BugCreate']:$text), + info => sprintf($lang['BugCreateInfo'], $obj->getFullName()), + category => array(bug::getType(),'new','module',usebugtracking) ); return $x; } - /** - * method called from check service - * Check for OPEN bugs to remember - */ - static function checkservice (tutos_user $user) { + /** + * method called from check service + * Check for OPEN bugs to remember + */ + static function checkservice (tutos_user $user) { global $tutos,$lang,$table; $msg = ''; if ( $tutos['bug_remember'] == 0 ) { - return $msg; - } + return $msg; + } $now = new TUTOS_Date_Time(); $q = 'SELECT * FROM '. $user->dbconn->prefix .$table['bugtracking'][name]; @@ -2065,17 +2068,17 @@ $x = preg_split('#,#',$tutos['bug_warn_states']); if (count($x) > 0) { - $q .= $qpre . ' state in '; - $xpre = '('; - foreach ($x as $i) { - $q .= $xpre.$i; - $xpre = ','; - } - $q .= ')'; + $q .= $qpre . ' state in '; + $xpre = '('; + foreach ($x as $i) { + $q .= $xpre.$i; + $xpre = ','; + } + $q .= ')'; - } else { - return; - } + } else { + return; + } $r = $user->dbconn->Exec($q); @@ -2082,154 +2085,154 @@ $n = $r->numrows(); $a = 0; while ($a < $n) { - $b = new bug($user->dbconn); - $b->read_result($r,$a); - $a++; + $b = new bug($user->dbconn); + $b->read_result($r,$a); + $a++; - // get last mod date - $b->read_last_mod(); + // get last mod date + $b->read_last_mod(); - if (!isset($b->lastmod[0])) { - // create a lastmod that represents the creation - $l['date'] = $b->creation; - $l['old'] = -1; - $l['new'] = $b->state; - } else { - $l['date'] = $b->creation; - $l['old'] = -1; - $l['new'] = $b->lastmod[count($b->lastmod)-1]['old']; - } - $l = array($l); - $b->lastmod = array_merge($b->lastmod,$l); + if (!isset($b->lastmod[0])) { + // create a lastmod that represents the creation + $l['date'] = $b->creation; + $l['old'] = -1; + $l['new'] = $b->state; + } else { + $l['date'] = $b->creation; + $l['old'] = -1; + $l['new'] = $b->lastmod[count($b->lastmod)-1]['old']; + } + $l = array($l); + $b->lastmod = array_merge($b->lastmod,$l); - // seconds since last state change or creation minus remebertime - $diff = $now->getTimeStamp() - ($tutos['bug_remember'] * 60) - $b->lastmod[0]['date']->getTimestamp(); - if ( $diff < 0 ) { - // A nearly fresh bug in that state - continue; - } + // seconds since last state change or creation minus remebertime + $diff = $now->getTimeStamp() - ($tutos['bug_remember'] * 60) - $b->lastmod[0]['date']->getTimestamp(); + if ( $diff < 0 ) { + // A nearly fresh bug in that state + continue; + } - $diff_total = hour_format( ($now->getTimeStamp() - $b->lastmod[0]['date']->getTimestamp()) / 3600 ); // in hours + $diff_total = hour_format( ($now->getTimeStamp() - $b->lastmod[0]['date']->getTimestamp()) / 3600 ); // in hours - // get the date of latest reminder - $q1 = 'SELECT * FROM '. $user->dbconn->prefix .$table['bug2'][name].' WHERE id = '. $b->id; - $r1 = $user->dbconn->Exec($q1); - $n1 = $r1->numrows(); - $a1 = 0; - while ( ($a1 < $n1) && ($diff > 0) ) { - $d1 = $r1->getDateTime($a1, "r_time"); - // seconds since last reminder - $diff = min($diff,$now->getTimeStamp() - ($tutos['bug_remember'] * 60)- $d1->getTimestamp() ); - $a1++; - } + // get the date of latest reminder + $q1 = 'SELECT * FROM '. $user->dbconn->prefix .$table['bug2'][name].' WHERE id = '. $b->id; + $r1 = $user->dbconn->Exec($q1); + $n1 = $r1->numrows(); + $a1 = 0; + while ( ($a1 < $n1) && ($diff > 0) ) { + $d1 = $r1->getDateTime($a1, "r_time"); + // seconds since last reminder + $diff = min($diff,$now->getTimeStamp() - ($tutos['bug_remember'] * 60)- $d1->getTimestamp() ); + $a1++; + } - $r1->free(); - if ( $diff >0 ) { - // delete reminders before last state change - $q2 = 'DELETE FROM '. $user->dbconn->prefix .$table['bug2'][name]; - $q2 .= ' WHERE id ='.$b->id; - $q2 .= ' AND r_time <'.$user->dbconn->DateTime($b->lastmod[0]['date']); - $r2 = $user->dbconn->Exec($q2); - $r2->free(); + $r1->free(); + if ( $diff >0 ) { + // delete reminders before last state change + $q2 = 'DELETE FROM '. $user->dbconn->prefix .$table['bug2'][name]; + $q2 .= ' WHERE id ='.$b->id; + $q2 .= ' AND r_time <'.$user->dbconn->DateTime($b->lastmod[0]['date']); + $r2 = $user->dbconn->Exec($q2); + $r2->free(); - // still or again need to remember - $q2 = 'INSERT INTO '. $user->dbconn->prefix .$table['bug2'][name].' (id,r_time) VALUES('. $b->id .','. $user->dbconn->DateTime($now) .')'; - $r2 = $user->dbconn->Exec($q2); - $r2->free(); + // still or again need to remember + $q2 = 'INSERT INTO '. $user->dbconn->prefix .$table['bug2'][name].' (id,r_time) VALUES('. $b->id .','. $user->dbconn->DateTime($now) .')'; + $r2 = $user->dbconn->Exec($q2); + $r2->free(); - $bugmailtxt = 'bug_remember.proto'; - $m = new mail($user); - $m->setFrom($b->creator); - $m->addHeader("X-PRIORITY","1"); - $m->addHeader("priority","urgent"); - $ml = array(); - if ($b->parent->getType() == "product") { - $b->parent->readRoles(); - } - if (is_object($b->solver)) - $ml[$b->solver->id] = $b->solver; - else if (is_numeric($b->solver)) { - // expand list - if ($b->parent->getType() == "product") { - if (isset($b->parent->role[-(10+$b->solver)])) - foreach ($b->parent->role[-(10+$b->solver)] as $f) { - $ml[$f->id] = $f; - unset($f); - } - } - } - $ml[$b->creator->id] = $b->creator; - // find the projectmanager - if ($b->parent->getType() == "product") { - if (is_array($b->parent->role[PROD_ROLE_MANAGER])) { - foreach ($b->parent->role[PROD_ROLE_MANAGER] as $i => $f) { - $ml[$f->id] = &$f; - unset($f); - } - } - } - $b->ml = $ml; - $to = ''; - $topre = ''; - foreach($ml as $i => $f) { - $m->resetBodies(); - $m->resetTo(); - $m->addTo($f); - $body = ''; - $mformat = 'text/plain'; - $m->setSubject($b->replace_mail_tags($lang['EmailStillOpen'],$lang)); - if ( ! findMailTemplate($bugmailtxt,$f,$body,'/php/bugtracking/templates',$mformat) ) { - $msg = addLine($msg,sprintf($lang['Err0037'],$m->subject,$body)); - continue; - } - $m->setSubject($f->lg['EmailStillOpen']); - $m->setContentCharset($f->lg['content_encoding']); - $m->setContentType($mformat); - $m->setContentDesc($f->lg['BugsDetail']); - $m->body = $body; - $m->body = preg_replace('/@TIME@/',$diff_total,$m->body); - $m->replace_mail_tags($b,$f->lg); - $b->make_mail_body($ml[$i],$m); + $bugmailtxt = 'bug_remember.proto'; + $m = new mail($user); + $m->setFrom($b->creator); + $m->addHeader("X-PRIORITY","1"); + $m->addHeader("priority","urgent"); + $ml = array(); + if ($b->parent->getType() == "product") { + $b->parent->readRoles(); + } + if (is_object($b->solver)) + $ml[$b->solver->id] = $b->solver; + else if (is_numeric($b->solver)) { + // expand list + if ($b->parent->getType() == "product") { + if (isset($b->parent->role[-(10+$b->solver)])) + foreach ($b->parent->role[-(10+$b->solver)] as $f) { + $ml[$f->id] = $f; + unset($f); + } + } + } + $ml[$b->creator->id] = $b->creator; + // find the projectmanager + if ($b->parent->getType() == "product") { + if (is_array($b->parent->role[PROD_ROLE_MANAGER])) { + foreach ($b->parent->role[PROD_ROLE_MANAGER] as $i => $f) { + $ml[$f->id] = &$f; + unset($f); + } + } + } + $b->ml = $ml; + $to = ''; + $topre = ''; + foreach($ml as $i => $f) { + $m->resetBodies(); + $m->resetTo(); + $m->addTo($f); + $body = ''; + $mformat = 'text/plain'; + $m->setSubject($b->replace_mail_tags($lang['EmailStillOpen'],$lang)); + if ( ! findMailTemplate($bugmailtxt,$f,$body,'/php/bugtracking/templates',$mformat) ) { + $msg = addLine($msg,sprintf($lang['Err0037'],$m->subject,$body)); + continue; + } + $m->setSubject($f->lg['EmailStillOpen']); + $m->setContentCharset($f->lg['content_encoding']); + $m->setContentType($mformat); + $m->setContentDesc($f->lg['BugsDetail']); + $m->body = $body; + $m->body = preg_replace('/@TIME@/',$diff_total,$m->body); + $m->replace_mail_tags($b,$f->lg); + $b->make_mail_body($ml[$i],$m); - $m->send(); - $to .= $topre.$f->getFullName(); - $topre = ', '; - } + $m->send(); + $to .= $topre.$f->getFullName(); + $topre = ', '; + } - // add a line to the bug history - $bd = new bugdata($user->dbconn); - $bd->bugid = $b->id; - $bd->description = sprintf($lang['MailSendTo'],$to)."\n\"".$b->replace_mail_tags($lang['EmailStillOpen'],$lang).'"'; - $bd->creator = -1; - $bd->save(); - } - } + // add a line to the bug history + $bd = new bugdata($user->dbconn); + $bd->bugid = $b->id; + $bd->description = sprintf($lang['MailSendTo'],$to)."\n\"".$b->replace_mail_tags($lang['EmailStillOpen'],$lang).'"'; + $bd->creator = -1; + $bd->save(); + } + } $r->free(); return $msg; } - /** - * create a link to a select page - */ - static function getSelectLink (tutos_user $user,$text = "") { + /** + * create a link to a select page + */ + static function getSelectLink (tutos_user $user,$text = "") { global $lang,$tutos; if ( ! $user->feature_ok(usebugtracking,PERM_SEL) ) { - return; - } + return; + } return array( url => 'bugtracking/bug_select.php', - image => $user->layout->theme->getImage(bug::getHtmlIcon(),'menu'), - text => ($text == "" ? $lang['Bugs'] : $text), - info => $lang['BugsSearch'], - category => array('search',bug::getType(),usebugtracking) + image => $user->layout->theme->getImage(bug::getHtmlIcon(),'menu'), + text => ($text == "" ? $lang['Bugs'] : $text), + info => $lang['BugsSearch'], + category => array('search',bug::getType(),usebugtracking) ); } - /** - * create a link for an overview filtered by $obj - */ - function getOverviewLinkObj (tutos_user $user,tutos_base $obj,$text = "") { + /** + * create a link for an overview filtered by $obj + */ + function getOverviewLinkObj (tutos_user $user,tutos_base $obj,$text = "") { global $lang; if (! is_object($obj) ) return ''; @@ -2239,35 +2242,35 @@ if (! $obj->see_ok() ) return ''; return array( url => 'bugtracking/bug_overview.php?pid='.$obj->id, - confirm => false, - text => ($text == '' ? $lang['BugsOverview']:$text), - info => $lang['BugsOverview'], - category => array('overview','module',usebugtracking) + confirm => false, + text => ($text == '' ? $lang['BugsOverview']:$text), + info => $lang['BugsOverview'], + category => array('overview','module',usebugtracking) ); } - /** - * show the mytutos info about bugs - */ - static function mytutos (tutos_user $user) { + /** + * show the mytutos info about bugs + */ + static function mytutos (tutos_user $user) { global $tutos,$lang,$current_user; if ( ! $current_user->feature_ok(usebugtracking,PERM_SEE) ) { - return ''; - } + return ''; + } if ( ! $current_user->feature_ok(usebugtracking,PERM_MYTUTOS) ) { - return ''; - } + return ''; + } $q = 'SELECT * from '. $user->dbconn->prefix .'bugs where (creator = '. $user->id .' or solver = '. $user->id .')'; $x = preg_split('#,#',$tutos['bug_closed_states']); foreach ($x as $i) { - if (!empty($i)) { - $q .= ' and state <> '.$i; - } - } + if (!empty($i)) { + $q .= ' and state <> '.$i; + } + } $q .= ' order by creation DESC'; $res = $user->dbconn->Exec($q); $n = $res->numrows(); @@ -2274,18 +2277,18 @@ $a = 0; if ($n == 0) { - $res->free(); - return ''; - } + $res->free(); + return ''; + } $r = info_table_start(); $r .= " <tr>\n"; $m = bug::getSelectLink($current_user); if ($m) { - $ml = menulink($m[url],$m[text],$m[info]); - } else { - $ml = $lang['Bugs']; - } + $ml = menulink($m[url],$m[text],$m[info]); + } else { + $ml = $lang['Bugs']; + } $r .= ' <th colspan="4">'. $current_user->layout->theme->getImage(bug::getHtmlIcon(),'list') .' '. $ml ."</th>\n"; $r .= " </tr>\n"; $r .= " <tr>\n"; @@ -2295,28 +2298,28 @@ $r .= ' <th>'. $lang['BugState'] ."</th>\n"; $r .= " </tr>\n"; while ( ($a < $n) and ($a < 2* $tutos['maxshort']) ) { - $f = new bug($user->dbconn); - $f->read_result($res,$a); - if ( $f->see_ok() ) { - $r .= " <tr>\n"; - $r .= ' <td>' .$f->getStateColorBlock().$f->getLink() ."</td>\n"; - $r .= ' <td>' . ($f->parent->id > 0 ? $f->parent->getLink():$lang['HistoryDeleted']) ."</td>\n"; - $r .= ' <td>' . $f->getClass() ."</td>\n"; - $r .= ' <td>' . $f->getState() ."</td>\n"; - $r .= " </tr>\n"; - } - $a++; - unset($f); - } + $f = new bug($user->dbconn); + $f->read_result($res,$a); + if ( $f->see_ok() ) { + $r .= " <tr>\n"; + $r .= ' <td>' .$f->getStateColorBlock().$f->getLink() ."</td>\n"; + $r .= ' <td>' . ($f->parent->id > 0 ? $f->parent->getLink():$lang['HistoryDeleted']) ."</td>\n"; + $r .= ' <td>' . $f->getClass() ."</td>\n"; + $r .= ' <td>' . $f->getState() ."</td>\n"; + $r .= " </tr>\n"; + } + $a++; + unset($f); + } $r .= info_table_end(); $res->free(); return $r; } - /** - * get regular expression to find bug names - */ - function get_bug_regex() { + /** + * get regular expression to find bug names + */ + function get_bug_regex() { global $tutos; //%Y-%m-&X-&Y $reg = $tutos['bug_autoname']; @@ -2332,17 +2335,17 @@ return '(\s|^|"|\')('.$reg.')("|\'|:|\s|$)'; } - /** - * get a list of per object config fields - */ - static function getObjConfig(tutos_base $obj) { + /** + * get a list of per object config fields + */ + static function getObjConfig(tutos_base $obj) { return self::$parent_feature; } - /** - * get the help index - */ - static function getHelpIndex () { + /** + * get the help index + */ + static function getHelpIndex () { global $lang; $r = ''; @@ -2353,5 +2356,5 @@ $r .= "</ul>\n"; return $r; } -} -?> \ No newline at end of file + } + ?> \ No newline at end of file Modified: trunk/php/expense/expense.pinc =================================================================== --- trunk/php/expense/expense.pinc 2017-08-05 13:16:51 UTC (rev 1314) +++ trunk/php/expense/expense.pinc 2017-08-12 16:50:33 UTC (rev 1315) @@ -27,7 +27,7 @@ function expense_make_bug(tutos_base $obj) { global $tutos,$lang; - if (! in_array($obj->id,$tutos['expense_make_bug'])) return ' not in list '; + if (! in_array($obj->id,$tutos['expense_make_bug']) && (! in_array(-1,$tutos['expense_make_bug']) ) ) return ' not in list '; $msg = ''; // create a new bug Modified: trunk/php/stc/en.p3 =================================================================== --- trunk/php/stc/en.p3 2017-08-05 13:16:51 UTC (rev 1314) +++ trunk/php/stc/en.p3 2017-08-12 16:50:33 UTC (rev 1315) @@ -32,8 +32,8 @@ $lang['STCDetail'] = 'State Transition Control Element'; $lang['STCOverview'] = 'State Transition Control Overview'; -$lang['STCnotexistant'] = 'not existant'; -$lang['STCadd_ne'] = 'add a "non existant" state'; +$lang['STCnotexistant'] = 'non existent'; +$lang['STCadd_ne'] = 'add a "non existent" state'; $lang['STCNoTransInfo'] = 'If no transtion is defined all<br />state changes are allowed'; $lang['stc'] = 'STC'; $lang['stcstate'] = 'STC State'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-08-05 13:16:54
|
Revision: 1314 http://sourceforge.net/p/tutos/code/1314 Author: gokohnert Date: 2017-08-05 13:16:51 +0000 (Sat, 05 Aug 2017) Log Message: ----------- more permission handling of attached bugs Modified Paths: -------------- trunk/php/expense/de.p3 trunk/php/expense/en.p3 trunk/php/expense/expense.pinc trunk/php/expense/expense_new.php trunk/php/expense/expense_overview.php trunk/php/expense/expense_show.php trunk/php/expense/fr.p3 trunk/php/expense/hu.p3 trunk/php/expense/mtable.pinc trunk/php/expense/tw.p3 trunk/php/expense/zh.p3 Modified: trunk/php/expense/de.p3 =================================================================== --- trunk/php/expense/de.p3 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/de.p3 2017-08-05 13:16:51 UTC (rev 1314) @@ -98,6 +98,8 @@ $lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; $lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; +$lang['ExpenseReady'] = 'Ausgabe bereit zur Genehmigung'; + $lang['perm'][useexpenses] = 'Spesennutzung'; $lang['expense'] = &$lang['Expense']; Modified: trunk/php/expense/en.p3 =================================================================== --- trunk/php/expense/en.p3 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/en.p3 2017-08-05 13:16:51 UTC (rev 1314) @@ -98,6 +98,8 @@ $lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; $lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; +$lang['ExpenseReady'] = 'Expense ready for approval'; + $lang['perm'][useexpenses] = 'use expenses'; $lang['expense'] = &$lang['Expense']; Modified: trunk/php/expense/expense.pinc =================================================================== --- trunk/php/expense/expense.pinc 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/expense.pinc 2017-08-05 13:16:51 UTC (rev 1314) @@ -25,7 +25,7 @@ * called as postsave hook for the expense */ function expense_make_bug(tutos_base $obj) { - global $tutos; + global $tutos,$lang; if (! in_array($obj->id,$tutos['expense_make_bug'])) return ' not in list '; @@ -32,16 +32,18 @@ $msg = ''; // create a new bug $solver = getObject($obj->dbconn,$tutos['expense_bug_solver']); + $obj->read_adr_reference(); $b = new bug($obj->dbconn); $b->setParent($obj); - $b->setShort('Expense needs allow'); + $b->setShort($lang['ExpenseReady'].' : '.$obj->ccentre); $b->setName('auto'); $b->setClass(BUG_CLASS_LIGHT); $b->setState($tutos['expense_bug_initial_state']); + $b->setReporter($obj->adr_ref); $b->setSolver($solver); $b->bughist[0] = new bugdata($obj->dbconn); - $b->bughist[0]->description = myentities(wordwrap($obj->description,80)); + $b->bughist[0]->description = myentities(wordwrap($obj->ccentre.' '.$obj->description,80)); $b->acl_raise($obj->adr_id,$tutos[useok]); $msg = addLine($msg,$b->save()); @@ -48,8 +50,15 @@ // also set to watchlist $w = new watchlist($obj->dbconn); - $msg = addLine($msg,$w->add($b->id,$obj->id,'inform about states')); + // $msg = addLine($msg,$w->add($b->id,$obj->id,'inform about states')); + // limit permission to write for requester + $obj->acl_lower($obj->adr_id,$tutos[useok]); + $obj->acl_lower($obj->getObjectGroupId(2),$tutos[useok]); + acl_drop_level($obj,$tutos[modok]); + // raise permission to write for solver + $obj->acl_raise($solver->id,$tutos[modok]); + $msg = addLine($msg,$obj->acl_save()); return $msg; } @@ -860,7 +869,7 @@ // adopt the permissions from the referenced object $this->copy_acl($this->ref,true); $this->acl_default(); - $this->acl_raise($this->getObjectGroupId(2),$tutos[useok]); + $this->acl_raise($this->getObjectGroupId(2),$tutos[modok]); $this->acl_raise($this->getObjectGroupId(3),$tutos[seeok]); // Prepare the history Modified: trunk/php/expense/expense_new.php =================================================================== --- trunk/php/expense/expense_new.php 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/expense_new.php 2017-08-05 13:16:51 UTC (rev 1314) @@ -92,15 +92,12 @@ $r .= $this->showData($d,$this->width-1); $r .= $this->EditRowEnd(); - $r .= $this->EditRowStart(); - $r .= $this->showfieldc($lang['ExpenseName'],1,"name"); - $r .= ' <td colspan="5"><input class="required_fld" id="name" size="80" maxlength="'. $table['expense']['name'][size] .'" name="name" value="'. myentities($this->obj->name) ."\" /></td>\n"; - $r .= $this->EditRowEnd(); + $r .= $this->editfield_data_row($this->obj,$table['expense']['name'],$this->width-1,1); if (!isset($this->hide['category']) || !$this->hide['category'] ) { $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseCategory'],0,"category"); - $r .= " <td colspan=\"5\">\n"; + $r .= " <td colspan=\"".($this->width-1)."\">\n"; $r .= $this->obj->askCategory(); $r .= " </td>\n"; $r .= $this->EditRowEnd(); @@ -108,16 +105,10 @@ $this->addhidden("category",-1); } - $r .= $this->EditRowStart(); - $r .= $this->showfieldc($lang['ExpenseReason'],0,"reason"); - $r .= ' <td colspan="5"><input id="reason" size="80" maxlength="'. $table['expense']['reason'][size] .'" name="reason" value="'. myentities($this->obj->reason) ."\" /></td>\n"; - $r .= $this->EditRowEnd(); + $r .= $this->editfield_data_row($this->obj,$table['expense']['reason'],$this->width-1,1); if (!isset($this->hide['people']) || !$this->hide['people'] ) { - $r .= $this->EditRowStart(); - $r .= $this->showfieldc($lang['ExpensePeople'],0,"people"); - $r .= $this->showData('<textarea id="people" rows="1" cols="60" name="people">'. $this->obj->people .'</textarea>',$this->width-1); - $r .= $this->EditRowEnd(); + $r .= $this->editfield_data_row($this->obj,$table['expense']['people'],$this->width-1,1); } $r .= $this->EditRowStart(); @@ -169,21 +160,20 @@ $this->addhidden("mop",-1); } if (!isset($this->hide['city']) || !$this->hide['city'] ) { - $r .= $this->EditRowStart(); - $r .= $this->showfieldc($lang['City'],0,"city"); - $r .= $this->showData('<input id="city" size="80" maxlength="'. $table['expense']['city'][size] .'" name="city" value="'. myentities($this->obj->city) .'">',$this->width-1); - $r .= $this->EditRowEnd(); + $r .= $this->editfield_data_row($this->obj,$table['expense']['city'],$this->width-1,1); } if (!isset($this->hide['country']) || !$this->hide['country'] ) { - $r .= $this->EditRowStart(); - $r .= $this->showfieldc($lang['Country'],0,"country"); - $r .= $this->showData(SelectCntryCde("country", $this->obj->country),$this->width-1); - $r .= $this->EditRowEnd(); + if ( !isset($table['expense']['country']['hide']) || ($table['expense']['country']['hide'] == false) ) { + $r .= $this->EditRowStart(); + $r .= $this->showfieldc($lang['Country'],0,"country"); + $r .= $this->showData(SelectCntryCde("country", $this->obj->country),$this->width-1); + $r .= $this->EditRowEnd(); + } } $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseCCentre'],0,"ccentre"); - $r .= "<td colspan=\"5\">\n"; + $r .= "<td colspan=\"".($this->width-1)."\">\n"; if (!isset($this->fixate['ccentre']) || !$this->fixate['ccentre'] ) { $r .= '<input id="ccentre" size="80" maxlength="'. $table['expense']['ccentre'][size] .'" name="ccentre" value="'. myentities($this->obj->ccentre) ."\" />\n"; } else { @@ -193,10 +183,9 @@ $r .= " </td>\n"; $r .= $this->EditRowEnd(); - $r .= $this->EditRowStart(); - $r .= $this->showfield($lang['ExpenseDescription'],0,"description"); - $r .= $this->showData('<textarea id="description" rows="10" cols="60" name="description">'. $this->obj->description .'</textarea>',$this->width-1); - $r .= $this->EditRowEnd(); + if (!isset($this->hide['description']) || !$this->hide['description'] ) { + $r .= $this->editfield_data_row($this->obj,$table['expense']['description'],$this->width-1,1); + } // Edit additional custom fields $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,$this->width); @@ -294,6 +283,10 @@ $this->obj->read_adr_reference(); $this->obj->read_relations(); + // CostCentre defaults to linked object name + if ( ($this->obj->ccentre == '') && is_object($this->obj->ref)) { + $this->obj->ccentre = $this->obj->ref->getFullName(); + } if ( is_object($this->obj->ref) && !$this->obj->ref->use_ok() ) { $msg = addLine($msg,sprintf($lang['Err0001'],$lang[$this->obj->ref->getType()],$this->obj->ref->getFullName())); Modified: trunk/php/expense/expense_overview.php =================================================================== --- trunk/php/expense/expense_overview.php 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/expense_overview.php 2017-08-05 13:16:51 UTC (rev 1314) @@ -497,7 +497,7 @@ // Name overview_arg($this,'name',OVERVIEW_ARG_STRING,'expense',array('name'),'ExpenseName','e.'); - if($_REQUEST['ext'] == 1) { + if (isset($_REQUEST['ext']) && ($_REQUEST['ext'] == 1) ) { // State overview_arg($this,'state',OVERVIEW_ARG_INT,'expense',array('state'),array('ExpenseState','ExpenseStates'),'e.'); Modified: trunk/php/expense/expense_show.php =================================================================== --- trunk/php/expense/expense_show.php 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/expense_show.php 2017-08-05 13:16:51 UTC (rev 1314) @@ -109,11 +109,12 @@ $r .= $this->showfield_data_row($this->obj,$table['expense']['mop'],$this->width -1,1); $r .= $this->showfield_data_row($this->obj,$table['expense']['city'],$this->width -1,1); - $r .= $this->ContentRowStart(); - $r .= $this->showfield($lang['Country']); - $r .= $this->showdata(myentities($lang['countrycde'][$this->obj->country] ." (". $this->obj->country .")"),$this->width -1); - $r .= $this->ContentRowEnd(); - + if ( !isset($table['expense']['country']['hide']) || ($table['expense']['country']['hide'] == false) ) { + $r .= $this->ContentRowStart(); + $r .= $this->showfield($lang['Country']); + $r .= $this->showdata(myentities($lang['countrycde'][$this->obj->country] ." (". $this->obj->country .")"),$this->width -1); + $r .= $this->ContentRowEnd(); + } $r .= $this->showfield_data_row($this->obj,$table['expense']['ccentre'],$this->width -1,1); $r .= $this->showfield_data_row($this->obj,$table['expense']['description'],$this->width -1,1); Modified: trunk/php/expense/fr.p3 =================================================================== --- trunk/php/expense/fr.p3 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/fr.p3 2017-08-05 13:16:51 UTC (rev 1314) @@ -98,6 +98,8 @@ $lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; $lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; +$lang['ExpenseReady'] = 'Expense ready for approval'; + $lang['perm'][useexpenses] = "utilise les dépenses"; $lang['expense'] = &$lang['Dépense']; Modified: trunk/php/expense/hu.p3 =================================================================== --- trunk/php/expense/hu.p3 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/hu.p3 2017-08-05 13:16:51 UTC (rev 1314) @@ -98,6 +98,8 @@ $lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; $lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; +$lang['ExpenseReady'] = 'Expense ready for approval'; + $lang['perm'][useexpenses] = "kiadások használata"; $lang['expense'] = &$lang['Expense']; Modified: trunk/php/expense/mtable.pinc =================================================================== --- trunk/php/expense/mtable.pinc 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/mtable.pinc 2017-08-05 13:16:51 UTC (rev 1314) @@ -18,7 +18,12 @@ $table['expense']['id'] = array(type => 'ID_TYPE', constraints => 'PK', Desc => 'Object ID'); $table['expense']['link_id'] = array(type => 'ID_TYPE', constraints => 'NN', Desc => 'id of linked object'); $table['expense']['adr_id'] = array(type => 'ID_TYPE', constraints => 'NN', Desc => 'id of linked address'); -$table['expense']['name'] = array(type => 'VARCHAR', size => 50, constraints => 'NN', Desc => 'short name of expenses'); +$table['expense']['name'] = array(type => 'VARCHAR', size => 50, constraints => 'NN', + Desc => 'short name of expenses', + 'required' => true, + 'field' => 'name', + 'lang' => 'ExpenseName', + ); $table['expense']['state'] = array(type => 'ID_TYPE', constraints => 'NN', Desc => 'state of expense'); $table['expense']['description'] = array(type => 'TX_TYPE', constraints => '', Desc => 'long description of expenses', Modified: trunk/php/expense/tw.p3 =================================================================== --- trunk/php/expense/tw.p3 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/tw.p3 2017-08-05 13:16:51 UTC (rev 1314) @@ -98,6 +98,8 @@ $lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; $lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; +$lang['ExpenseReady'] = 'Expense ready for approval'; + $lang['perm'][useexpenses] = "使用開支"; $lang['expense'] = &$lang['Expense']; ?> Modified: trunk/php/expense/zh.p3 =================================================================== --- trunk/php/expense/zh.p3 2017-08-05 11:41:21 UTC (rev 1313) +++ trunk/php/expense/zh.p3 2017-08-05 13:16:51 UTC (rev 1314) @@ -98,6 +98,8 @@ $lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; $lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; +$lang['ExpenseReady'] = 'Expense ready for approval'; + $lang['perm'][useexpenses] = "使用开支"; $lang['expense'] = &$lang['Expense']; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-08-05 11:41:24
|
Revision: 1313 http://sourceforge.net/p/tutos/code/1313 Author: gokohnert Date: 2017-08-05 11:41:21 +0000 (Sat, 05 Aug 2017) Log Message: ----------- lower acl method Modified Paths: -------------- trunk/php/base.pinc Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2017-08-05 11:40:45 UTC (rev 1312) +++ trunk/php/base.pinc 2017-08-05 11:41:21 UTC (rev 1313) @@ -597,6 +597,13 @@ } /** + * lower permissions + */ + function acl_lower($id, $perm) { + return acl_lower($this,$id,$perm); + } + + /** * raise a feature bit */ Function acl_raise_bit($adr_id,$feature,$value) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-08-05 11:40:48
|
Revision: 1312 http://sourceforge.net/p/tutos/code/1312 Author: gokohnert Date: 2017-08-05 11:40:45 +0000 (Sat, 05 Aug 2017) Log Message: ----------- read custom.pinc for modules after loading Modified Paths: -------------- trunk/php/module_base.pinc Modified: trunk/php/module_base.pinc =================================================================== --- trunk/php/module_base.pinc 2017-08-05 11:40:04 UTC (rev 1311) +++ trunk/php/module_base.pinc 2017-08-05 11:40:45 UTC (rev 1312) @@ -98,6 +98,12 @@ $lang[$tutos[modules][$key]['perm']] = $key; } + + // load custom stuff if available + if (file_exists(dirname($tutos['base'] .'/'. $tutos[modules][$key][file]) .'/custom.pinc') ) { + @include dirname($tutos['base'] .'/'. $tutos[modules][$key][file]) .'/custom.pinc'; + } + return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-08-05 11:40:06
|
Revision: 1311 http://sourceforge.net/p/tutos/code/1311 Author: gokohnert Date: 2017-08-05 11:40:04 +0000 (Sat, 05 Aug 2017) Log Message: ----------- new drop acl function Modified Paths: -------------- trunk/php/acl.pinc Modified: trunk/php/acl.pinc =================================================================== --- trunk/php/acl.pinc 2017-07-31 14:49:07 UTC (rev 1310) +++ trunk/php/acl.pinc 2017-08-05 11:40:04 UTC (rev 1311) @@ -486,6 +486,18 @@ } /** + * drop all permission with given level + */ +Function acl_drop_level(tutos_base $obj,$level) { + foreach($obj->acl[0] as $i => $f) { + if ( ($f >= 0) && ($f == $level) ) { + $obj->acl[0][$i] = 0; + $obj->acl_write = true; + } + } +} + +/** * lower the permissions to given level if above */ Function acl_lower(tutos_base $obj,$adr_id,$level) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-07-31 14:49:09
|
Revision: 1310 http://sourceforge.net/p/tutos/code/1310 Author: gokohnert Date: 2017-07-31 14:49:07 +0000 (Mon, 31 Jul 2017) Log Message: ----------- new feature to couple a expense state to bug state for tracking. use expense config to enable this (auto_track) Modified Paths: -------------- trunk/html/nuke.css Modified: trunk/html/nuke.css =================================================================== --- trunk/html/nuke.css 2017-07-31 14:35:54 UTC (rev 1309) +++ trunk/html/nuke.css 2017-07-31 14:49:07 UTC (rev 1310) @@ -113,7 +113,7 @@ color: black; white-space: normal; min-width: 10em; - max-width: 14em; + max-width: 16em; } .pagetitle { @@ -578,4 +578,4 @@ background: #ffff72; outline: 0; } -/* EOF */ \ No newline at end of file +/* EOF */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-07-31 14:35:56
|
Revision: 1309 http://sourceforge.net/p/tutos/code/1309 Author: gokohnert Date: 2017-07-31 14:35:54 +0000 (Mon, 31 Jul 2017) Log Message: ----------- new feature to couple a expense state to bug state for tracking. use expense config to enable this (auto_track) Modified Paths: -------------- trunk/php/base.pinc trunk/php/db/table_custom_example.pinc trunk/php/expense/de.p3 trunk/php/expense/en.p3 trunk/php/expense/expense.pinc trunk/php/expense/expense_config.php trunk/php/expense/expense_ins.php trunk/php/expense/expense_overview.php trunk/php/expense/fr.p3 trunk/php/expense/hu.p3 trunk/php/expense/mconfig.pinc trunk/php/expense/tw.p3 trunk/php/expense/zh.p3 trunk/php/watchlist/watchlist.pinc Modified: trunk/php/base.pinc =================================================================== --- trunk/php/base.pinc 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/base.pinc 2017-07-31 14:35:54 UTC (rev 1309) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2002 - 2013 by Gero Kohnert + * Copyright 2002 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -2077,5 +2077,14 @@ function cache_store($id,$value,$ttl = -1) { return $this->cache_store_static($this->dbconn->db->systemid.$id,$value,$ttl); } + + /** + * trigger object + * use for inter object communication + * returns a text message + */ + function trigger(tutos_base $obj,$message) { + return ''; + } } ?> \ No newline at end of file Modified: trunk/php/db/table_custom_example.pinc =================================================================== --- trunk/php/db/table_custom_example.pinc 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/db/table_custom_example.pinc 2017-07-31 14:35:54 UTC (rev 1309) @@ -443,4 +443,18 @@ $table['appointment1']['description'][size] = 101; $table['appointment1']['visitor']['searchable'] = true; +$table['location']['iban'] = array('custom' => true, + type => "VARCHAR", + size => 200, + constraints => "", + Desc => "IBAN", + 'lang' => "IBAN", + 'handler' => "url", + 'overview' => false, # show in overview + 'sortable' => false, # show in overview as sortable + 'hideempty' => true, + 'required' => false + ); +$table['location']['acc_info1']['hideempty'] = true; + ?> \ No newline at end of file Modified: trunk/php/expense/de.p3 =================================================================== --- trunk/php/expense/de.p3 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/de.p3 2017-07-31 14:35:54 UTC (rev 1309) @@ -88,6 +88,16 @@ $lang['ExpenseStates'][6] = 'in Vorbereitung'; $lang['ExpenseStates'][0] = 'undefiniert'; +$lang['ExpenseConfigHelpStateSTC'] = 'STC state support for expense states'; +$lang['ExpenseConfigHelpTrack'] = 'use a tracker object to support the allow/deny proess'; +$lang['ExpenseConfigHelpInitTrackStates'] = 'States that automatically trigger a tracker object'; +$lang['ExpenseConfigHelpAutoAllowState'] = 'State to enter automatically for allow'; +$lang['ExpenseConfigHelpBugAllowStates'] = 'bug states that trigger a automatic allow'; +$lang['ExpenseConfigHelpAutoDenyState'] = 'State to enter automatically for deny'; +$lang['ExpenseConfigHelpBugDenyStates'] = 'bug states that trigger a automatic deny'; +$lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; +$lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; + $lang['perm'][useexpenses] = 'Spesennutzung'; $lang['expense'] = &$lang['Expense']; Modified: trunk/php/expense/en.p3 =================================================================== --- trunk/php/expense/en.p3 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/en.p3 2017-07-31 14:35:54 UTC (rev 1309) @@ -88,6 +88,16 @@ $lang['ExpenseStates'][6] = 'prepare'; $lang['ExpenseStates'][0] = 'undefined'; +$lang['ExpenseConfigHelpStateSTC'] = 'STC state support for expense states'; +$lang['ExpenseConfigHelpTrack'] = 'use a tracker object to support the allow/deny proess'; +$lang['ExpenseConfigHelpInitTrackStates'] = 'States that automatically trigger a tracker object'; +$lang['ExpenseConfigHelpAutoAllowState'] = 'State to enter automatically for allow'; +$lang['ExpenseConfigHelpBugAllowStates'] = 'bug states that trigger a automatic allow'; +$lang['ExpenseConfigHelpAutoDenyState'] = 'State to enter automatically for deny'; +$lang['ExpenseConfigHelpBugDenyStates'] = 'bug states that trigger a automatic deny'; +$lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; +$lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; + $lang['perm'][useexpenses] = 'use expenses'; $lang['expense'] = &$lang['Expense']; Modified: trunk/php/expense/expense.pinc =================================================================== --- trunk/php/expense/expense.pinc 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/expense.pinc 2017-07-31 14:35:54 UTC (rev 1309) @@ -16,9 +16,43 @@ define ('EXPENSE_STATE_DONE',3); define ('EXPENSE_STATE_PAYED',4); define ('EXPENSE_STATE_REJECT',5); +define ('EXPENSE_STATE_PREPARE',6); define ('EXPENSE_STATE_UNDEF',0); // old expenses befire using states +/** + * make a bug when state changes to a trigger state + * called as postsave hook for the expense + */ +function expense_make_bug(tutos_base $obj) { + global $tutos; + + if (! in_array($obj->id,$tutos['expense_make_bug'])) return ' not in list '; + + $msg = ''; + // create a new bug + $solver = getObject($obj->dbconn,$tutos['expense_bug_solver']); + + $b = new bug($obj->dbconn); + $b->setParent($obj); + $b->setShort('Expense needs allow'); + $b->setName('auto'); + $b->setClass(BUG_CLASS_LIGHT); + $b->setState($tutos['expense_bug_initial_state']); + $b->setSolver($solver); + $b->bughist[0] = new bugdata($obj->dbconn); + $b->bughist[0]->description = myentities(wordwrap($obj->description,80)); + + $b->acl_raise($obj->adr_id,$tutos[useok]); + $msg = addLine($msg,$b->save()); + + // also set to watchlist + $w = new watchlist($obj->dbconn); + $msg = addLine($msg,$w->add($b->id,$obj->id,'inform about states')); + + return $msg; +} + /* --------------------------------------------------------------------------- * List all expenses * cols > 0 make sperate rows with cols columns for each expense @@ -600,7 +634,20 @@ * set the state */ function setState($value) { - return $this->setIntField("state",$value,"ExpenseState"); + global $tutos; + + + $changed = $this->setIntField("state",$value,"ExpenseState"); + if ($tutos['expense_auto_track'] == 1) { + $x = preg_split('#,#',$tutos['expense_init_track_states']); + if ($changed && in_array($value,$x)) { + // when saving trigger a bug if state is in list of trigger states + // use postsave hook + $tutos['expense_make_bug'][] = $this->id; + $tutos['postsave-hooks']['expense'][] = 'expense_make_bug'; + } + } + return $changed; } /** @@ -1066,6 +1113,40 @@ return $x; } + /** + * expense was triggered + * assigned bug might have been changed + * + */ + function trigger(tutos_base $obj,$message) { + global $tutos; + + $msg = ''; + if ($message != 'change') return ''; + if ($tutos['expense_auto_track'] != 1) return ''; + if ($obj->getType() != 'bugtracking') return ''; + + foreach ($obj->modified as $i => $f) { + if ($f['field'] == 'BugState') { + $allow = preg_split('#,#',$tutos['expense_bug_allow_states']); + $deny = preg_split('#,#',$tutos['expense_bug_deny_states']); + if (in_array($f['new'],$allow)) { + $msg = addLine($msg,$this->getLink(). ' allow '); + $this->setState($tutos['expense_auto_allow_state']); + $msg = addLine($msg,$this->save()); + } else if (in_array($f['new'],$deny)) { + $msg = addLine($msg,$this->getLink(). ' deny '); + $this->setState($tutos['expense_auto_deny_state']); + $msg = addLine($msg,$this->save()); + } + } + } + if ($msg != '') { + $msg = addLine('Expense:'. $this->getFullName(). ' was triggered by:'. $obj.' with '. $message,$msg); + } + return $msg; + } + /* --------------------------------------------------------------------------- * The following methods are abstract factory functions for groups * which handle the membership list of an object Modified: trunk/php/expense/expense_config.php =================================================================== --- trunk/php/expense/expense_config.php 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/expense_config.php 2017-07-31 14:35:54 UTC (rev 1309) @@ -56,44 +56,126 @@ $r .= '<td colspan="2" class="pre">'.myentities($lang['ExpenseConfigHelpStateSTC']).'</td>'; $r .= $this->OverviewRowEnd($line++); - - // states that are like closed - $r .= $this->OverviewRowStart($line); - $r .= $this->showfield('expense_closed_states'); $stc = getObject($this->user->dbconn,$tutos['expense_state_stc']); if (!is_object($stc)) { $stc = new stc(null); $stc->initByArray('ExpenseStates',null); } - $x = preg_split('#,#',$tutos['expense_closed_states']); - $r .= '<td><select multiple="multiple" name="closed_states[]">'."\n"; - foreach ($stc->states as $f) { - $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; - if (in_array($f->stc_state,$x)) { - $r .= ' selected="selected"'; + + if ($tutos[usebugtracking] == 1) { + $bstc = getObject($this->user->dbconn,$tutos['bug_state_stc']); + if (!is_object($bstc)) { + $bstc = new stc(null); + $bstc->initByArray('BugStates',null); } - $r .= '>'. myentities($f->getFullName()) ."</option>\n"; - } - $r .= '</select></td>'; - $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpClosedStates'].'</td>'; - $r .= $this->OverviewRowEnd($line++); + // track the allow/deny by a bug object + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_auto_track'); + $r .= '<td><input type="checkbox" name="auto_track"'.($tutos['expense_auto_track'] == 1 ? ' checked="checked"':'').' value="1" /></td>'; + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpTrack'].'</td>'; + $r .= $this->OverviewRowEnd($line++); - // state to set on auto finish - $r .= $this->OverviewRowStart($line); - $r .= $this->showfield('expense_finish_state'); - $r .= '<td><select name="finish_state">'."\n"; - foreach ($stc->states as $f) { - $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; - if ($f->stc_state == $tutos['expense_finish_state']) { - $r .= ' selected="selected"'; + // states to initialize tracking + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_init_track_states'); + $r .= '<td><select multiple="multiple" name="init_track_states[]">'; + $x = preg_split('#,#',$tutos['expense_init_track_states']); + foreach ($stc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if (in_array($f->stc_state,$x)) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; } - $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpInitTrackStates'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + // auto allow state + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_auto_allow_state'); + $r .= '<td><select name="auto_allow_state">'; + foreach ($stc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if ($f->stc_state == $tutos['expense_auto_allow_state']) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpAutoAllowState'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + // bug states for changeing automtically to allow + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_bug_allow_states'); + $r .= '<td><select multiple="multiple" name="bug_allow_states[]">'; + $x = preg_split('#,#',$tutos['expense_bug_allow_states']); + foreach ($bstc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if (in_array($f->stc_state,$x)) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpBugAllowStates'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + // auto allow state + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_auto_deny_state'); + $r .= '<td><select name="auto_deny_state">'; + foreach ($stc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if ($f->stc_state == $tutos['expense_auto_deny_state']) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpAutoDenyState'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + // bug states for changeing automatically to deny + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_bug_deny_states'); + $r .= '<td><select multiple="multiple" name="bug_deny_states[]">'; + $x = preg_split('#,#',$tutos['expense_bug_deny_states']); + foreach ($bstc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if (in_array($f->stc_state,$x)) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpBugDenyStates'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + // inital bug state + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_bug_inital_state'); + $r .= '<td><select name="bug_initial_state">'; + foreach ($bstc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if ($f->stc_state == $tutos['expense_bug_initial_state']) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpBugInitialState'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + // bug solver + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_bug_solver'); + $r .= '<td>'; + $r .= select_from_array_or_input($this->solver,"bug_solver",$this->solver,1,'at'); + $r .= '</td>'; + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpBugSolver'].'</td>'; + $r .= $this->OverviewRowEnd($line++); } - $r .= '</select></td>'; - $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpFinishState'].'</td>'; - $r .= $this->OverviewRowEnd($line++); - $r .= $this->submit_reset_row(0,1,1,1,1,0); $r .= $this->DataTableEnd(); @@ -108,7 +190,7 @@ * */ function prepare() { - global $lang,$msg,$info,$tutos; + global $lang,$msg,$info,$tutos, $current_user; $this->name = $lang['ExpenseConfig']; $this->css_class = 'configbox'; @@ -115,8 +197,14 @@ // default if (!isset($tutos['expense_state_stc'])) $tutos['expense_state_stc'] = -1; - if (!isset($tutos['expense_closed_states'])) $tutos['expense_closed_states'] = BUG_STATE_SOLVED.','.BUG_STATE_CLOSED; - if (!isset($tutos['expense_finish_state'])) $tutos['bug_finish_state'] = BUG_STATE_CLOSED; + if (!isset($tutos['expense_auto_track'])) $tutos['expense_auto_track'] = 0; + if (!isset($tutos['expense_init_track_states'])) $tutos['expense_init:track_state'] = EXPENSE_STATE_REQUEST; + if (!isset($tutos['expense_auto_allow_state'])) $tutos['expense_auto_allow_state'] = EXPENSE_STATE_APPROVED; + if (!isset($tutos['expense_auto_deny_state'])) $tutos['expense_auto_deny_state'] = EXPENSE_STATE_REJECT; + if (!isset($tutos['expense_bug_allow_states'])) $tutos['expense_bug_allow_states'] = ''; + if (!isset($tutos['expense_bug_deny_states'])) $tutos['expense_bug_deny_states'] = ''; + if (!isset($tutos['expense_bug_inital_state'])) $tutos['expense_bug_inital_state'] = BUG_STATE_OPEN; + if (!isset($tutos['expense_bug_solver'])) $tutos['expense_bug_solver'] = $current_user->id; if ( ! $this->user->isAdmin() ) { $msg = addLine($msg,$this->error("Only admins are allowed to see this")); @@ -123,6 +211,9 @@ $this->stop = true; return; } + + $this->solver = getObject($this->dbconn,$tutos['expense_bug_solver']); + if (isset($_REQUEST['save']) && ($_REQUEST['save'] == 1) ) { // STC @@ -129,7 +220,49 @@ $tutos['expense_state_stc'] = $_REQUEST['state_stc']; write_config_value($this->dbconn,'expense_state_stc','expense'); + $tutos['expense_auto_track'] = ( isset($_REQUEST['auto_track']) ? $_REQUEST['auto_track']:0 ); + write_config_value($this->dbconn,'expense_auto_track','expense'); + // INIT STATES + if (isset($_REQUEST['init_track_states']) && is_array($_REQUEST['init_track_states'])) { + $tutos['expense_init_track_states'] = implode(',',$_REQUEST['init_track_states']); + } else { + $tutos['expense_init_track_states'] = ''; + } + write_config_value($this->dbconn,'expense_init_track_states','expense'); + + // Bug Allow States + if (isset($_REQUEST['bug_allow_states']) && is_array($_REQUEST['bug_allow_states'])) { + $tutos['expense_bug_allow_states'] = implode(',',$_REQUEST['bug_allow_states']); + } else { + $tutos['expense_bug_allow_states'] = ''; + } + write_config_value($this->dbconn,'expense_bug_allow_states','expense'); + + // Bug Deny States + if (isset($_REQUEST['bug_deny_states']) && is_array($_REQUEST['bug_deny_states'])) { + $tutos['expense_bug_deny_states'] = implode(',',$_REQUEST['bug_deny_states']); + } else { + $tutos['expense_bug_deny_states'] = ''; + } + write_config_value($this->dbconn,'expense_bug_deny_states','expense'); + + $tutos['expense_auto_allow_state'] = $_REQUEST['auto_allow_state']; + write_config_value($this->dbconn,'expense_auto_allow_state','expense'); + + $tutos['expense_auto_deny_state'] = $_REQUEST['auto_deny_state']; + write_config_value($this->dbconn,'expense_auto_deny_state','expense'); + + $tutos['expense_bug_initial_state'] = $_REQUEST['bug_initial_state']; + write_config_value($this->dbconn,'expense_bug_initial_state','expense'); + + // Solver + $tutos['expense_bug_solver'] = $_REQUEST['bug_solverid']; + if (!is_numeric($tutos['expense_bug_solver']) || $tutos['expense_bug_solver'] == '' ) { + $tutos['expense_bug_solver'] = $current_user->id; + } + write_config_value($this->dbconn,'expense_bug_solver','expense'); + $info = addLine($info,' saving done '); } } Modified: trunk/php/expense/expense_ins.php =================================================================== --- trunk/php/expense/expense_ins.php 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/expense_ins.php 2017-07-31 14:35:54 UTC (rev 1309) @@ -71,7 +71,7 @@ $gotourl = addBadField($gotourl,'state',true); } else { $u->setState($_POST['state']); - $gotourl= addUrlParameter($gotourl,"state=". $state,true); + $gotourl= addUrlParameter($gotourl,"state=". $_POST['state'],true); } if ( isset($_POST['category']) ) { Modified: trunk/php/expense/expense_overview.php =================================================================== --- trunk/php/expense/expense_overview.php 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/expense_overview.php 2017-07-31 14:35:54 UTC (rev 1309) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2014 by Gero Kohnert and ECOsoft.net + * Copyright 1999 - 2017 by Gero Kohnert and ECOsoft.net * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -141,7 +141,7 @@ $this->preflds++; } if ($this->head['state']) { - $r .= $this->orderHeader('',$lang['ExpenseState'],$this->link2); + $r .= $this->orderHeader('state',$lang['ExpenseState'],$this->link2); $this->flds++; $this->preflds++; } Modified: trunk/php/expense/fr.p3 =================================================================== --- trunk/php/expense/fr.p3 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/fr.p3 2017-07-31 14:35:54 UTC (rev 1309) @@ -11,11 +11,13 @@ # Expenses $lang['Expense'] = "Dépense"; $lang['Expenses'] = "Dépenses"; +$lang['ExpenseConfig'] = 'Configure Expensemanagement'; $lang['ExpenseCreate'] = "Créer une dépense"; $lang['ExpenseCreateInfo'] = "Créér une dépense pour %s"; $lang['ExpenseDelete'] = "Annuler cette dépense"; $lang['ExpenseDescription'] = "Description"; $lang['ExpenseName'] = "Titre"; +$lang['ExpenseState'] = 'State'; $lang['ExpenseDetail'] = "Montrer les dépenses"; $lang['ExpenseOverview'] = "Vue d'ensemble des dépenses"; $lang['ExpenseCreation'] = "Enregistrer une dépense"; @@ -77,6 +79,25 @@ $lang['ExpenseMOPs'][5] = "Diners"; $lang['ExpenseMOPs'][6] = "Autre méthode de paiement"; +$lang['ExpenseStates'] = array(); +$lang['ExpenseStates'][1] = 'Request'; +$lang['ExpenseStates'][2] = 'Approved'; +$lang['ExpenseStates'][3] = 'Done'; +$lang['ExpenseStates'][4] = 'Payed'; +$lang['ExpenseStates'][5] = 'Rejected'; +$lang['ExpenseStates'][6] = 'prepare'; +$lang['ExpenseStates'][0] = 'undefined'; + +$lang['ExpenseConfigHelpStateSTC'] = 'STC state support for expense states'; +$lang['ExpenseConfigHelpTrack'] = 'use a tracker object to support the allow/deny proess'; +$lang['ExpenseConfigHelpInitTrackStates'] = 'States that automatically trigger a tracker object'; +$lang['ExpenseConfigHelpAutoAllowState'] = 'State to enter automatically for allow'; +$lang['ExpenseConfigHelpBugAllowStates'] = 'bug states that trigger a automatic allow'; +$lang['ExpenseConfigHelpAutoDenyState'] = 'State to enter automatically for deny'; +$lang['ExpenseConfigHelpBugDenyStates'] = 'bug states that trigger a automatic deny'; +$lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; +$lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; + $lang['perm'][useexpenses] = "utilise les dépenses"; $lang['expense'] = &$lang['Dépense']; Modified: trunk/php/expense/hu.p3 =================================================================== --- trunk/php/expense/hu.p3 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/hu.p3 2017-07-31 14:35:54 UTC (rev 1309) @@ -11,11 +11,13 @@ # Expenses $lang['Expense'] = "Kiadás"; $lang['Expenses'] = "Kiadások"; +$lang['ExpenseConfig'] = 'Configure Expensemanagement'; $lang['ExpenseCreate'] = "Kiadás létrehozása"; $lang['ExpenseCreateInfo'] = "Új kiadás létrehozása %s számára"; $lang['ExpenseDelete'] = "Kiadás törlése"; $lang['ExpenseDescription'] = "Leírás"; $lang['ExpenseName'] = "Cím"; +$lang['ExpenseState'] = 'State'; $lang['ExpenseDetail'] = "Kiadások kijelzése"; $lang['ExpenseOverview'] = "Kiadások áttekintése"; $lang['ExpenseCreation'] = "Kiadások létrehozása"; @@ -77,6 +79,25 @@ $lang['ExpenseMOPs'][5] = "Diners"; $lang['ExpenseMOPs'][6] = "más fizetési mód"; +$lang['ExpenseStates'] = array(); +$lang['ExpenseStates'][1] = 'Request'; +$lang['ExpenseStates'][2] = 'Approved'; +$lang['ExpenseStates'][3] = 'Done'; +$lang['ExpenseStates'][4] = 'Payed'; +$lang['ExpenseStates'][5] = 'Rejected'; +$lang['ExpenseStates'][6] = 'prepare'; +$lang['ExpenseStates'][0] = 'undefined'; + +$lang['ExpenseConfigHelpStateSTC'] = 'STC state support for expense states'; +$lang['ExpenseConfigHelpTrack'] = 'use a tracker object to support the allow/deny proess'; +$lang['ExpenseConfigHelpInitTrackStates'] = 'States that automatically trigger a tracker object'; +$lang['ExpenseConfigHelpAutoAllowState'] = 'State to enter automatically for allow'; +$lang['ExpenseConfigHelpBugAllowStates'] = 'bug states that trigger a automatic allow'; +$lang['ExpenseConfigHelpAutoDenyState'] = 'State to enter automatically for deny'; +$lang['ExpenseConfigHelpBugDenyStates'] = 'bug states that trigger a automatic deny'; +$lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; +$lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; + $lang['perm'][useexpenses] = "kiadások használata"; $lang['expense'] = &$lang['Expense']; Modified: trunk/php/expense/mconfig.pinc =================================================================== --- trunk/php/expense/mconfig.pinc 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/mconfig.pinc 2017-07-31 14:35:54 UTC (rev 1309) @@ -40,6 +40,7 @@ // // Files (like invoices etc) could be added // +$tutos[modulesinc]['bugtracking'][] = "expense"; $tutos[modulesinc]['file'][] = "expense"; $tutos['docowners'][] = 'expense'; Modified: trunk/php/expense/tw.p3 =================================================================== --- trunk/php/expense/tw.p3 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/tw.p3 2017-07-31 14:35:54 UTC (rev 1309) @@ -11,11 +11,13 @@ # Expenses $lang['Expense'] = "開支"; $lang['Expenses'] = "開支"; +$lang['ExpenseConfig'] = 'Configure Expensemanagement'; $lang['ExpenseCreate'] = "建立開支"; $lang['ExpenseCreateInfo'] = "建立 %s 的新開支"; $lang['ExpenseDelete'] = "刪除開支"; $lang['ExpenseDescription'] = "內容"; $lang['ExpenseName'] = "開支名稱"; +$lang['ExpenseState'] = 'State'; $lang['ExpenseDetail'] = "開支顯示"; $lang['ExpenseOverview'] = "開支概況"; $lang['ExpenseCreation'] = "開支建立"; @@ -77,6 +79,25 @@ $lang['ExpenseMOPs'][5] = "大來卡"; $lang['ExpenseMOPs'][6] = "其他付款方法"; +$lang['ExpenseStates'] = array(); +$lang['ExpenseStates'][1] = 'Request'; +$lang['ExpenseStates'][2] = 'Approved'; +$lang['ExpenseStates'][3] = 'Done'; +$lang['ExpenseStates'][4] = 'Payed'; +$lang['ExpenseStates'][5] = 'Rejected'; +$lang['ExpenseStates'][6] = 'prepare'; +$lang['ExpenseStates'][0] = 'undefined'; + +$lang['ExpenseConfigHelpStateSTC'] = 'STC state support for expense states'; +$lang['ExpenseConfigHelpTrack'] = 'use a tracker object to support the allow/deny proess'; +$lang['ExpenseConfigHelpInitTrackStates'] = 'States that automatically trigger a tracker object'; +$lang['ExpenseConfigHelpAutoAllowState'] = 'State to enter automatically for allow'; +$lang['ExpenseConfigHelpBugAllowStates'] = 'bug states that trigger a automatic allow'; +$lang['ExpenseConfigHelpAutoDenyState'] = 'State to enter automatically for deny'; +$lang['ExpenseConfigHelpBugDenyStates'] = 'bug states that trigger a automatic deny'; +$lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; +$lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; + $lang['perm'][useexpenses] = "使用開支"; $lang['expense'] = &$lang['Expense']; ?> Modified: trunk/php/expense/zh.p3 =================================================================== --- trunk/php/expense/zh.p3 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/expense/zh.p3 2017-07-31 14:35:54 UTC (rev 1309) @@ -11,11 +11,13 @@ # Expenses $lang['Expense'] = "开支"; $lang['Expenses'] = "开支"; +$lang['ExpenseConfig'] = 'Configure Expensemanagement'; $lang['ExpenseCreate'] = "建立开支"; $lang['ExpenseCreateInfo'] = "建立 %s 的新开支"; $lang['ExpenseDelete'] = "删除开支"; $lang['ExpenseDescription'] = "內容"; $lang['ExpenseName'] = "开支名称"; +$lang['ExpenseState'] = 'State'; $lang['ExpenseDetail'] = "开支显示"; $lang['ExpenseOverview'] = "开支概況"; $lang['ExpenseCreation'] = "开支建立"; @@ -77,6 +79,25 @@ $lang['ExpenseMOPs'][5] = "大来卡"; $lang['ExpenseMOPs'][6] ="其他付款方法"; +$lang['ExpenseStates'] = array(); +$lang['ExpenseStates'][1] = 'Request'; +$lang['ExpenseStates'][2] = 'Approved'; +$lang['ExpenseStates'][3] = 'Done'; +$lang['ExpenseStates'][4] = 'Payed'; +$lang['ExpenseStates'][5] = 'Rejected'; +$lang['ExpenseStates'][6] = 'prepare'; +$lang['ExpenseStates'][0] = 'undefined'; + +$lang['ExpenseConfigHelpStateSTC'] = 'STC state support for expense states'; +$lang['ExpenseConfigHelpTrack'] = 'use a tracker object to support the allow/deny proess'; +$lang['ExpenseConfigHelpInitTrackStates'] = 'States that automatically trigger a tracker object'; +$lang['ExpenseConfigHelpAutoAllowState'] = 'State to enter automatically for allow'; +$lang['ExpenseConfigHelpBugAllowStates'] = 'bug states that trigger a automatic allow'; +$lang['ExpenseConfigHelpAutoDenyState'] = 'State to enter automatically for deny'; +$lang['ExpenseConfigHelpBugDenyStates'] = 'bug states that trigger a automatic deny'; +$lang['ExpenseConfigHelpBugInitialState'] = 'intial state for newly created tracker object'; +$lang['ExpenseConfigHelpBugSolver'] = 'Solver Adress or Team'; + $lang['perm'][useexpenses] = "使用开支"; $lang['expense'] = &$lang['Expense']; ?> Modified: trunk/php/watchlist/watchlist.pinc =================================================================== --- trunk/php/watchlist/watchlist.pinc 2017-07-28 13:53:13 UTC (rev 1308) +++ trunk/php/watchlist/watchlist.pinc 2017-07-31 14:35:54 UTC (rev 1309) @@ -228,10 +228,13 @@ $n = $r->numrows(); $a = 0; while ($a < $n) { - $adr = new tutos_address($obj->dbconn); - $adr = $adr->read($r->get($a, "adr_id"),$adr); + $adr = getObject($obj->dbconn,$r->get($a, "adr_id")); + if ( is_object($adr) ) { + # $adr = new tutos_address($obj->dbconn); + # $adr = $adr->read($r->get($a, "adr_id"),$adr); - $obj->list[usewatchlist][$adr->id] = &$adr; + $obj->list[usewatchlist][$adr->id] = &$adr; + } $a++; unset($adr); } @@ -337,14 +340,19 @@ $url = getBaseUrl(true) .$tutos['base'] .'/php/'. $obj->getUrl();; foreach ($obj->list[usewatchlist] as $i => $f) { - $f->read_locs_data(true); - $body = ''; - $mformat = 'text/plain'; - $msg .= check_template('watch.proto', $f,$body,$mformat); + if ($f->getType() == 'address') { + $f->read_locs_data(true); + $body = ''; + $mformat = 'text/plain'; + $msg .= check_template('watch.proto', $f,$body,$mformat); - $blist = array(); - $msg = addLine($msg,send_mail($f, $user, $f->lg['EmailChanged'], $body,$mformat, $url, $obj,$blist)); - + $blist = array(); + $msg = addLine($msg,send_mail($f, $user, $f->lg['EmailChanged'], $body,$mformat, $url, $obj,$blist)); + } else { + // non human watcher + $msg = addLine($msg,$f->trigger($obj,'change')); + $msg = addLine($msg,'Informed:'.$f->getLink()); + } watchlist::update($obj, $f); } return $msg; @@ -369,12 +377,18 @@ $url = getBaseURL(true) . $obj->getUrl(); foreach ($obj->list[usewatchlist] as $i => $f) { - $body = ''; - $mformat = 'text/plain'; - $msg .= check_template('watch_del.proto', $f,$body,$mformat); + if ($f->getType() == 'address') { + $body = ''; + $mformat = 'text/plain'; + $msg .= check_template('watch_del.proto', $f,$body,$mformat); - $blist = array(); - $msg = addLine($msg,send_mail($f, $user,$f->lg['EmailDeleted'], $body, $mformat, $url, $obj, $blist)); + $blist = array(); + $msg = addLine($msg,send_mail($f, $user,$f->lg['EmailDeleted'], $body, $mformat, $url, $obj, $blist)); + } else { + // non human watcher + $msg = addLine($msg,$f->trigger($obj,'delete')); + $msg = addLine($msg,'Informed:'.$f->getLink()); + } } $q = 'DELETE from '. $obj->dbconn->prefix .'watchlist where obj_id = '. $obj->id; $obj->dbconn->Exec($q); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-07-28 13:53:16
|
Revision: 1308 http://sourceforge.net/p/tutos/code/1308 Author: gokohnert Date: 2017-07-28 13:53:13 +0000 (Fri, 28 Jul 2017) Log Message: ----------- added state field Added Paths: ----------- trunk/php/expense/expense_config.php Added: trunk/php/expense/expense_config.php =================================================================== --- trunk/php/expense/expense_config.php (rev 0) +++ trunk/php/expense/expense_config.php 2017-07-28 13:53:13 UTC (rev 1308) @@ -0,0 +1,145 @@ +<?php +/** + * Copyright 2009 - 2017 by Gero Kohnert + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; version 2 of the License. + * + * SVN Info $Id: bug_config.php 1016 2013-03-13 11:59:14Z gokohnert $ + * $Author: gokohnert $ + */ +$tutos['files'][__FILE__] = '$Rev: 1016 $'; + +$tutos['base'] = "../.."; +ini_set("include_path",".."); + +require_once 'webelements.p3'; +require_once 'permission.p3'; + +check_user(); +loadmodules('expense','config'); +loadmodule('expense'); +loadlayout(); + +/** + * display a admin page + */ +class Expense_config extends layout { + /** + * + */ + function info() { + global $lang,$table,$tutos; + + $r = ''; + $r .= "<form id=\"expenseconfig\" name=\"expenseconfig\" action=\"expense_config.php\" method=\"post\">\n"; + $r .= $this->DataTableStart(); + $line = 0; + $r .= $this->OverviewHeadLineStart(); + $r .= '<th colspan="4">'.$this->name.'</th>'; + $r .= $this->OverviewHeadLineEnd(); + + + // STC + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_state_stc'); + $r .= '<td><select name="state_stc">'."\n"; + $r .= ' <option value="-1"'.($tutos['expense_state_stc'] == -1 ? ' selected="selected"':'').'>'.$lang['no'].'</option>'."\n"; + stc::getListByLangArray($this,'ExpenseStates'); + foreach($this->stcs as $j) { + $r .= ' <option value="'.$j->id.'"'.($tutos['expense_state_stc'] == $j->id ? ' selected="selected"':'').'>'.$j->getLink().'</option>'."\n"; + } + $r .= '</select>'; + $r .= '<br />'.makelink('stc/stc_new.php?lgarr=ExpenseStates&mod=expense','Create a new STC'); + $r .= '</td>'; + $r .= '<td colspan="2" class="pre">'.myentities($lang['ExpenseConfigHelpStateSTC']).'</td>'; + $r .= $this->OverviewRowEnd($line++); + + + // states that are like closed + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_closed_states'); + $stc = getObject($this->user->dbconn,$tutos['expense_state_stc']); + if (!is_object($stc)) { + $stc = new stc(null); + $stc->initByArray('ExpenseStates',null); + } + $x = preg_split('#,#',$tutos['expense_closed_states']); + $r .= '<td><select multiple="multiple" name="closed_states[]">'."\n"; + foreach ($stc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if (in_array($f->stc_state,$x)) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpClosedStates'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + // state to set on auto finish + $r .= $this->OverviewRowStart($line); + $r .= $this->showfield('expense_finish_state'); + $r .= '<td><select name="finish_state">'."\n"; + foreach ($stc->states as $f) { + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if ($f->stc_state == $tutos['expense_finish_state']) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + $r .= '</select></td>'; + $r .= '<td colspan="2" class="pre">'.$lang['ExpenseConfigHelpFinishState'].'</td>'; + $r .= $this->OverviewRowEnd($line++); + + + $r .= $this->submit_reset_row(0,1,1,1,1,0); + + $r .= $this->DataTableEnd(); + $this->addHidden("save", 1); + $r .= hiddenFormElements(); + $r .= $this->getHidden(); + $r .= "</form>\n"; + return $r; + } + + /** + * + */ + function prepare() { + global $lang,$msg,$info,$tutos; + + $this->name = $lang['ExpenseConfig']; + $this->css_class = 'configbox'; + + // default + if (!isset($tutos['expense_state_stc'])) $tutos['expense_state_stc'] = -1; + if (!isset($tutos['expense_closed_states'])) $tutos['expense_closed_states'] = BUG_STATE_SOLVED.','.BUG_STATE_CLOSED; + if (!isset($tutos['expense_finish_state'])) $tutos['bug_finish_state'] = BUG_STATE_CLOSED; + + if ( ! $this->user->isAdmin() ) { + $msg = addLine($msg,$this->error("Only admins are allowed to see this")); + $this->stop = true; + return; + } + if (isset($_REQUEST['save']) && ($_REQUEST['save'] == 1) ) { + + // STC + $tutos['expense_state_stc'] = $_REQUEST['state_stc']; + write_config_value($this->dbconn,'expense_state_stc','expense'); + + + $info = addLine($info,' saving done '); + } + } +} + +$l = new Expense_config($current_user); +$l->display(); +$dbconn->close(); +?> +<!-- +SVN Info $Id: bug_config.php 1016 2013-03-13 11:59:14Z gokohnert $ +$Author: gokohnert $ +--> \ No newline at end of file Property changes on: trunk/php/expense/expense_config.php ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/x-php \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-07-28 13:49:01
|
Revision: 1307 http://sourceforge.net/p/tutos/code/1307 Author: gokohnert Date: 2017-07-28 13:48:59 +0000 (Fri, 28 Jul 2017) Log Message: ----------- added state field Modified Paths: -------------- trunk/php/expense/de.p3 trunk/php/expense/en.p3 trunk/php/expense/expense.pinc trunk/php/expense/expense_ins.php trunk/php/expense/expense_new.php trunk/php/expense/expense_overview.php trunk/php/expense/expense_select.php trunk/php/expense/expense_show.php trunk/php/expense/mconfig.pinc trunk/php/expense/mtable.pinc Modified: trunk/php/expense/de.p3 =================================================================== --- trunk/php/expense/de.p3 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/de.p3 2017-07-28 13:48:59 UTC (rev 1307) @@ -1,21 +1,23 @@ <?php -# $Id$ -# -# ========================= NOTE ======================== -# Please put site specific extensions and changes -# to TUTOS language files in a file called 'de_custom.p3' -# or 'lang_custom.p3' (for all languages) -# using the same format like here -# ======================================================= +// $Id$ +// +// ========================= NOTE ======================== +// Please put site specific extensions and changes +// to TUTOS language files in a file called 'de_custom.p3' +// or 'lang_custom.p3' (for all languages) +// using the same format like here +// ======================================================= -# Expenses +// Expenses $lang['Expense'] = 'Spesen'; $lang['Expenses'] = 'Spesen'; +$lang['ExpenseConfig'] = 'Spesenmanagement konfigurieren'; $lang['ExpenseCreate'] = 'Spesen buchen'; $lang['ExpenseCreateInfo'] = 'Neuen Spesen zu %s anlegen'; $lang['ExpenseDelete'] = 'Spesen löschen'; $lang['ExpenseDescription'] = 'Beschreibung'; $lang['ExpenseName'] = 'Bezeichnung'; +$lang['ExpenseState'] = 'Status'; $lang['ExpenseDetail'] = 'Spesen anzeigen'; $lang['ExpenseOverview'] = 'Spesenübersicht'; $lang['ExpenseCreation'] = 'Spesen buchen'; @@ -77,6 +79,15 @@ $lang['ExpenseMOPs'][5] = 'Diners'; $lang['ExpenseMOPs'][6] = 'Sonstige Zahlungsarten'; +$lang['ExpenseStates'] = array(); +$lang['ExpenseStates'][1] = 'angefordert'; +$lang['ExpenseStates'][2] = 'genehmigt'; +$lang['ExpenseStates'][3] = 'erledigt'; +$lang['ExpenseStates'][4] = 'bezahlt'; +$lang['ExpenseStates'][5] = 'verweigert'; +$lang['ExpenseStates'][6] = 'in Vorbereitung'; +$lang['ExpenseStates'][0] = 'undefiniert'; + $lang['perm'][useexpenses] = 'Spesennutzung'; $lang['expense'] = &$lang['Expense']; Modified: trunk/php/expense/en.p3 =================================================================== --- trunk/php/expense/en.p3 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/en.p3 2017-07-28 13:48:59 UTC (rev 1307) @@ -1,21 +1,23 @@ <?php -# $Id$ -# -# ========================= NOTE ======================== -# Please put site specific extensions and changes -# to TUTOS language files in a file called 'en_custom.p3' -# or 'lang_custom.p3' (for all languages) -# using the same format like here -# ======================================================= +// $Id$ +// +// ========================= NOTE ======================== +// Please put site specific extensions and changes +// to TUTOS language files in a file called 'en_custom.p3' +// or 'lang_custom.p3' (for all languages) +// using the same format like here +// ======================================================= -# Expenses +// Expenses $lang['Expense'] = 'Expenses'; $lang['Expenses'] = 'Expenses'; +$lang['ExpenseConfig'] = 'Configure Expensemanagement'; $lang['ExpenseCreate'] = 'Create expenses'; $lang['ExpenseCreateInfo'] = 'Create new expenses for %s'; $lang['ExpenseDelete'] = 'Delete this expenses'; $lang['ExpenseDescription'] = 'Description'; $lang['ExpenseName'] = 'Title'; +$lang['ExpenseState'] = 'State'; $lang['ExpenseDetail'] = 'Expenses Display'; $lang['ExpenseOverview'] = 'Expenses Overview'; $lang['ExpenseCreation'] = 'Expenses Creation'; @@ -77,6 +79,15 @@ $lang['ExpenseMOPs'][5] = 'Diners'; $lang['ExpenseMOPs'][6] = 'Other method of payments'; +$lang['ExpenseStates'] = array(); +$lang['ExpenseStates'][1] = 'Request'; +$lang['ExpenseStates'][2] = 'Approved'; +$lang['ExpenseStates'][3] = 'Done'; +$lang['ExpenseStates'][4] = 'Payed'; +$lang['ExpenseStates'][5] = 'Rejected'; +$lang['ExpenseStates'][6] = 'prepare'; +$lang['ExpenseStates'][0] = 'undefined'; + $lang['perm'][useexpenses] = 'use expenses'; $lang['expense'] = &$lang['Expense']; Modified: trunk/php/expense/expense.pinc =================================================================== --- trunk/php/expense/expense.pinc 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/expense.pinc 2017-07-28 13:48:59 UTC (rev 1307) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert and ECOsoft.net + * Copyright 1999 - 2017 by Gero Kohnert and ECOsoft.net * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -11,6 +11,14 @@ */ $tutos['files'][__FILE__] = '$Rev$'; +define ('EXPENSE_STATE_REQUEST',1); +define ('EXPENSE_STATE_APPROVED',2); +define ('EXPENSE_STATE_DONE',3); +define ('EXPENSE_STATE_PAYED',4); +define ('EXPENSE_STATE_REJECT',5); + +define ('EXPENSE_STATE_UNDEF',0); // old expenses befire using states + /* --------------------------------------------------------------------------- * List all expenses * cols > 0 make sperate rows with cols columns for each expense @@ -58,6 +66,33 @@ } /** + * ask a expense state + */ +function ExpenseAskState ($default) { + global $lang,$tutos,$current_user; + + $stc = getObject($current_user->dbconn,$tutos['expense_state_stc']); + if (!is_object($stc)) { + $stc = new stc(null); + $stc->initByArray('ExpenseStates',Expense::$c_state); + } + + $r = '<select id="state" name="state[]" multiple="multiple">'."\n"; + foreach ($stc->states as $f) { + if($f->stc_state == STC_NOT_EXISTANT) continue; + $r .= ' <option value="'. $f->stc_state .'" style="background:'.$f->color.'"'; + if ( $f->stc_state == $default ) { + $r .= ' selected="selected"'; + } + $r .= '>'. myentities($f->getFullName()) ."</option>\n"; + } + + $r .= "</select>\n"; + + return $r; +} + +/** * ask a expense category */ function ExpenseAskCategory ($default,$any) { @@ -126,6 +161,14 @@ */ static public $revision = '$Rev$'; + static public $c_state = array(EXPENSE_STATE_REQUEST => "aqua", + EXPENSE_STATE_PREPARE => "beige", + EXPENSE_STATE_APPROVED => "orange", + EXPENSE_STATE_DONE => "yellow", + EXPENSE_STATE_PAYED => "green", + EXPENSE_STATE_REJECT => "red", + EXPENSE_STATE_UNDEF => "white" + ); /** * constructor */ @@ -135,6 +178,7 @@ $this->init($dbconn); $this->name = ''; + $this->state = -1; $this->description = ''; $this->link_id = null; $this->adr_id = null; @@ -172,6 +216,7 @@ $this->sup_id = $r->get($pos, 'supplier'); $this->adr_id = $r->get($pos, 'adr_id'); $this->name = $r->get($pos, 'name'); + $this->state = $r->get($pos, 'state'); $this->description = $r->get($pos, 'description'); $this->quantity = $r->get($pos, 'quantity'); $this->gamount = $r->get($pos, 'gamount'); @@ -194,6 +239,9 @@ if ($this->quantity == null) { $this->quantity = 1.0; } + if ($this->state == null) { + $this->state = EXPENSE_STATE_UNDEF; + } parent::read_result($r,$pos); return; } @@ -318,6 +366,28 @@ return $lang['HistoryDeleted']; } + /** + * create a select list with possible states + */ + function askState () { + global $tutos,$lang; + + $r = ''; + $stc = getObject($this->dbconn,$tutos['expense_state_stc']); + if (!is_object($stc)) { + $stc = new stc(null); + $stc->initByArray('ExpenseStates',self::$c_state); + /* if ($this->state == EXPENSE_STATE_UNDEF) { */ + /* $r .= $lang['ExpenseAutoState'] .' '; */ + /* $r .= $this->getState().'<input id="stc_state" type="hidden" name="state" value="'. $this->state ."\" />\n"; */ + /* return $r; */ + /* } */ + } + $stc->stateowner = $this; + $r .= $stc->getStateSelection($this->state,'state'); + return $r; + } + function askCategory () { $r = ExpenseAskCategory($this->category,0); return $r; @@ -450,6 +520,30 @@ } /** + * get current state of this expense (default) as HTML + */ + function getState ($s = "") { + global $tutos,$lang; + + $r = ''; + if ( empty($s) ) { + $s = $this->state; + } + + $stc = getObject($this->dbconn,$tutos['expense_state_stc']); + if (!is_object($stc)) { + $stc = new stc(null); + $stc->initByArray('ExpenseStates',self::$c_state); + if ($s == -1) { + $this->state = EXPENSE_STATE_UNDEF; + $s = $this->state; + } + } + $r .= $stc->getState($s); + return $r; + } + + /** * Return a link to this expense */ function getLink($text = '',$arg = '') { @@ -503,6 +597,13 @@ } /** + * set the state + */ + function setState($value) { + return $this->setIntField("state",$value,"ExpenseState"); + } + + /** * set the expense category */ function setCategory($value) { @@ -680,6 +781,7 @@ $q = new Query($this->dbconn); $q->setTable($this->tablename); $q->addFV('name',$this->name,'STRING',$table['expense']['name'][size]); + $q->addFV('state',$this->state,'INT'); $q->addFV('category',$this->category,'INT'); $q->addFV('reason',$this->reason,'STRING',$table['expense']['reason'][size]); $q->addFV('city',$this->city,'STRING',$table['expense']['city'][size]); @@ -855,6 +957,9 @@ case 'ExpenseEndTime': $x = resolve_history_datetime($f,$this->dbconn,false); break; + case 'ExpenseState': + $x = resolve_history_lgarr ($f,'ExpenseStates'); + break; default: return null; } @@ -881,7 +986,25 @@ static function getHtmlIcon () { return 'coins'; } + /** + * get a array with virtual groups used in STC for state changes + */ + function getStateObjectGroups(array &$x,Stc_transition $stc) { + global $lang,$tutos; + + $x[$stc->getTypeId()][2] = $lang[$stc->getType()].':'.$lang['Expense'].' - '.$lang['ExpenseAddress']; + $x[$stc->getTypeId()][3] = $lang[$stc->getType()].':'.$lang['Expense'].' - '.$lang['ExpenseSupplier']; + + $x[$stc->getTypeId()][8] = $lang[$stc->getType()].':'.$lang['Expense'].' '.$lang['ExpenseReference'].' '.$lang['ProdRoles']; + foreach ($lang['ProdRole'] as $role => $f) { + if ( $tutos[rolecheck][$role] != "p") { + $x[$stc->getTypeId()][10+$role] = $lang[$stc->getType()].':'.$lang['Expense'].' '.$lang['ExpenseReference'].' '.$lang['Product'].' - '.$f; + } + } + } + + /** * get a array with virtual groups */ function getObjectGroups() { @@ -891,6 +1014,13 @@ $x[$this->getTypeId()][2] = $lang[$this->getType()].':'.$lang['ExpenseAddress']; $x[$this->getTypeId()][3] = $lang[$this->getType()].':'.$lang['ExpenseSupplier']; + $x[$this->getTypeId()][8] = $lang[$this->getType()].':'.$lang['ExpenseReference'].' '.$lang['ProdRoles']; + foreach ($lang['ProdRole'] as $role => $f) { + if ( $tutos[rolecheck][$role] != "p") { + $x[$this->getTypeId()][10+$role] = $lang[$this->getType()].':'.$lang['ExpenseReference'].' '.$lang['Product'].' - '.$f; + } + } + return $x; } @@ -918,6 +1048,21 @@ $x[$this->sup_id] = $this->supplier; } + // reference project roles + if (is_object($this->ref) && ($this->ref->getTypeId() == useprojects) ) { + $this->ref->readroles(); + // All Parent Project Roles + if ($id2 == 8) { + $x = $this->ref->getObjectGroupList(8); + } + foreach ($lang['ProdRole'] as $role => $f) { + if ( $tutos[rolecheck][$role] == "p") continue; + if ($role+10 == $id2) { + $x = $this->ref->getObjectGroupList($role+128); + } + } + } + return $x; } Modified: trunk/php/expense/expense_ins.php =================================================================== --- trunk/php/expense/expense_ins.php 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/expense_ins.php 2017-07-28 13:48:59 UTC (rev 1307) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert and ECOsoft.net + * Copyright 1999 - 2017 by Gero Kohnert and ECOsoft.net * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -47,7 +47,7 @@ $bad = true; } if ( !checkfloat($_POST['quantity'],true) ) { - $gotourl = addBadField($gotourl,'quaantity',true); + $gotourl = addBadField($gotourl,'quantity',true); $bad = true; } @@ -65,6 +65,15 @@ $u->setName(trim($_POST['name'])); $gotourl= addUrlParameter($gotourl,"name=". UrlEncode($u->name),true); } + +if ( empty($_POST['state']) || !isset($_POST['state']) ) { + $msg = addLine($msg,sprintf($lang['Err0009'],$lang['ExpenseState'])); + $gotourl = addBadField($gotourl,'state',true); +} else { + $u->setState($_POST['state']); + $gotourl= addUrlParameter($gotourl,"state=". $state,true); +} + if ( isset($_POST['category']) ) { $u->setCategory($_POST['category']); $gotourl= addUrlParameter($gotourl,"category=". UrlEncode($u->category),true); Modified: trunk/php/expense/expense_new.php =================================================================== --- trunk/php/expense/expense_new.php 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/expense_new.php 2017-07-28 13:48:59 UTC (rev 1307) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2014 by Gero Kohnert and ECOsoft.net + * Copyright 1999 - 2017 by Gero Kohnert and ECOsoft.net * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -46,7 +46,7 @@ $this->addhidden('Xid',$this->obj->id); } - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseReference'],1,"link_id"); $r .= " <td colspan=\"5\">\n"; if ($this->obj->id == -1) { @@ -63,65 +63,70 @@ $this->addhidden("link_id",$this->obj->link_id); } $r .= " </td>\n"; - $r .= "</tr>\n"; + $r .= $this->EditRowEnd(); - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); + $r .= $this->showfieldc($lang['ExpenseState'],1,"state"); + $r .= $this->showData($this->obj->askState(),$this->width-1); + $r .= $this->EditRowEnd(); + + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseSupplier'],1,"sid"); - $r .= " <td colspan=\"5\">\n"; if (!isset($this->fixate['sid']) || !$this->fixate['sid'] ) { - $r .= select_from_array_or_input($this->obj,'s',$this->obj->supplier,0,'cd'); + $d = select_from_array_or_input($this->obj,'s',$this->obj->supplier,0,'cd'); } else { - $r .= $this->obj->supplier->getLink(); + $d = $this->obj->supplier->getLink(); $this->addhidden("sid",$this->obj->supplier->id); } - $r .= " </td>\n"; - $r .= "</tr>\n"; + $r .= $this->showData($d,$this->width-1); + $r .= $this->EditRowEnd(); - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseAddress'],1,"aid"); - $r .= " <td colspan=\"5\">\n"; if (!isset($this->fixate['aid']) || !$this->fixate['aid'] ) { - $r .= select_from_array_or_input($this->obj,'a',$this->obj->adr_ref,0,'a'); + $d = select_from_array_or_input($this->obj,'a',$this->obj->adr_ref,0,'a'); } else { - $r .= $this->obj->adr_ref->getLink(); + $d = $this->obj->adr_ref->getLink(); $this->addhidden("aid",$this->obj->adr_ref->id); } - $r .= " </td>\n"; - $r .= "</tr>\n"; + $r .= $this->showData($d,$this->width-1); + $r .= $this->EditRowEnd(); - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseName'],1,"name"); $r .= ' <td colspan="5"><input class="required_fld" id="name" size="80" maxlength="'. $table['expense']['name'][size] .'" name="name" value="'. myentities($this->obj->name) ."\" /></td>\n"; - $r .= "</tr>\n"; + $r .= $this->EditRowEnd(); if (!isset($this->hide['category']) || !$this->hide['category'] ) { - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseCategory'],0,"category"); $r .= " <td colspan=\"5\">\n"; $r .= $this->obj->askCategory(); $r .= " </td>\n"; - $r .= "</tr>\n"; + $r .= $this->EditRowEnd(); } else { $this->addhidden("category",-1); } - $r .= "<tr>\n"; + + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseReason'],0,"reason"); $r .= ' <td colspan="5"><input id="reason" size="80" maxlength="'. $table['expense']['reason'][size] .'" name="reason" value="'. myentities($this->obj->reason) ."\" /></td>\n"; - $r .= "</tr>\n"; + $r .= $this->EditRowEnd(); if (!isset($this->hide['people']) || !$this->hide['people'] ) { - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpensePeople'],0,"people"); - $r .= ' <td colspan="5"><textarea id="people" rows="1" cols="60" name="people">'. $this->obj->people ."</textarea></td>\n"; - $r .= "</tr>\n"; + $r .= $this->showData('<textarea id="people" rows="1" cols="60" name="people">'. $this->obj->people .'</textarea>',$this->width-1); + $r .= $this->EditRowEnd(); } - $r .= "<tr>\n"; + + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseQuantity'],0,"quantity"); $check = ""check_all_float(this,'".$lang['DecPoint']."');\""; - $r .= ' <td colspan="5"><input id="quantity" size="10" maxlength="10" name="quantity" '.$check.' value="'. my_number_format($this->obj->quantity,2) ."\" />\n"; - $r .= "</tr>\n"; + $r .= $this->showData('<input id="quantity" size="10" maxlength="10" name="quantity" '.$check.' value="'. my_number_format($this->obj->quantity,2) .'" />',$this->width-1); + $r .= $this->EditRowEnd(); - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseGAmount'],1,"gamount"); $check = ""check_all_float(this,'".$lang['DecPoint']."');\""; $r .= ' <td colspan="2"><input id="gamount" size="10" maxlength="10" name="gamount" '. $check.' value="'. my_number_format($this->obj->gamount,2) ."\" />\n"; @@ -131,16 +136,16 @@ $r .= " <td colspan=\"2\">\n"; $r .= TAX_select("itax",$this->obj->itax); $r .= " </td>\n"; - $r .= "</tr>\n"; + $r .= $this->EditRowEnd(); - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseDeduction'],0,"deduction"); $check = ""check_all_float(this,'".$lang['DecPoint']."');\""; $r .= ' <td colspan="5"><input id="deduction" size="10" maxlength="10" name="deduction" '.$check.' value="'. my_number_format($this->obj->deduction,2) ."\" />\n"; $r .= " </td>\n"; - $r .= "</tr>\n"; + $r .= $this->EditRowEnd(); - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseStartTime'],1,"t_start"); $r .= " <td colspan=\"2\">\n"; $r .= $this->obj->t_start->EnterDateTime("t_start"); @@ -153,33 +158,30 @@ } else { $r .= " <td colspan=\"3\"> </td>\n"; } - $r .= "</tr>\n"; + $r .= $this->EditRowEnd(); if (!isset($this->hide['mop']) || !$this->hide['mop'] ) { - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseMOP'],0,"mop"); - $r .= " <td colspan=\"5\">\n"; - $r .= $this->obj->askMOP(); - $r .= " </td>\n"; - $r .= "</tr>\n"; + $r .= $this->showData($this->obj->askMOP(),$this->width-1); + $r .= $this->EditRowEnd(); } else { $this->addhidden("mop",-1); } if (!isset($this->hide['city']) || !$this->hide['city'] ) { - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['City'],0,"city"); - $r .= ' <td colspan="5"><input id="city" size="80" maxlength="'. $table['expense']['city'][size] .'" name="city" value="'. myentities($this->obj->city) ."\" /></td>\n"; - $r .= "</tr>\n"; + $r .= $this->showData('<input id="city" size="80" maxlength="'. $table['expense']['city'][size] .'" name="city" value="'. myentities($this->obj->city) .'">',$this->width-1); + $r .= $this->EditRowEnd(); } if (!isset($this->hide['country']) || !$this->hide['country'] ) { - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['Country'],0,"country"); - $r .= "<td colspan=\"5\">\n"; - $r .= SelectCntryCde("country", $this->obj->country); - $r .= " </td>\n"; - $r .= "</tr>\n"; + $r .= $this->showData(SelectCntryCde("country", $this->obj->country),$this->width-1); + $r .= $this->EditRowEnd(); } - $r .= "<tr>\n"; + + $r .= $this->EditRowStart(); $r .= $this->showfieldc($lang['ExpenseCCentre'],0,"ccentre"); $r .= "<td colspan=\"5\">\n"; if (!isset($this->fixate['ccentre']) || !$this->fixate['ccentre'] ) { @@ -189,12 +191,12 @@ $this->addhidden("ccentre",$this->obj->ccentre); } $r .= " </td>\n"; - $r .= "</tr>\n"; + $r .= $this->EditRowEnd(); - $r .= "<tr>\n"; + $r .= $this->EditRowStart(); $r .= $this->showfield($lang['ExpenseDescription'],0,"description"); - $r .= ' <td colspan="5"><textarea id="description" rows="10" cols="60" name="description">'. $this->obj->description ."</textarea></td>\n"; - $r .= "</tr>\n"; + $r .= $this->showData('<textarea id="description" rows="10" cols="60" name="description">'. $this->obj->description .'</textarea>',$this->width-1); + $r .= $this->EditRowEnd(); // Edit additional custom fields $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,$this->width); @@ -326,4 +328,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/expense/expense_overview.php =================================================================== --- trunk/php/expense/expense_overview.php 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/expense_overview.php 2017-07-28 13:48:59 UTC (rev 1307) @@ -140,6 +140,11 @@ $this->flds++; $this->preflds++; } + if ($this->head['state']) { + $r .= $this->orderHeader('',$lang['ExpenseState'],$this->link2); + $this->flds++; + $this->preflds++; + } if ($this->head['supplier']) { $r .= $this->orderHeader('',$lang['ExpenseSupplier'],$this->link2); $this->flds++; @@ -202,6 +207,11 @@ $r .= $this->OverviewRowBlock($b->getRefLink($x),'over_l'); } + if ($this->head['state']) { + $x = ''; + $r .= $this->OverviewRowBlock($b->getState(),'over_l'); + } + if ($this->head['supplier']) { $x = ''; if (is_object($b->supplier)) { @@ -283,6 +293,11 @@ $r .= ' <option value="-1" selected="selected">'. $lang['ActionNil'] ."</option>\n"; $r .= ' <option value="-2">'. $lang['Delete'] ."</option>\n"; $r .= ' <option value="-4">'. $lang['AclModify'] ."</option>\n"; + foreach ($this->stc->states as $f) { + if ($f->stc_state == STC_NOT_EXISTANT) continue; + $r .= " <option value=\"S". $f->stc_state .'" style="background:'.$f->color.';">'. sprintf($lang['SetTo'],$lang['ExpenseState'],$f->getFullName()) ."</option>\n"; + } + $r .= get_custom_massupdate_options($this,'expense'); if (class_exists('watchlist')) { $r .= watchlist::action_options(); } @@ -299,8 +314,14 @@ * action via massupdate */ Function action() { - global $lang,$msg,$info; + global $lang,$msg,$info,$tutos; + $this->stc = getObject($this->user->dbconn,$tutos['expense_state_stc']); + if (!is_object($this->stc)) { + $this->stc = new stc(null); + $this->stc->initByArray('ExpenseStates',Expense::$c_state); + } + if ( $_GET['action'] == -2 ) { $this->dbconn->Begin("WORK"); foreach ($_GET['mark'] as $key => $val) { @@ -325,6 +346,52 @@ $this->redirect = "../". acl_action(); return; } + if ( preg_match("#^([S])(.*)#",$_GET['action'],$a) ) { + // Setting State + $this->dropSubSession(); + + $this->dbconn->Begin("WORK"); + foreach ($_GET['mark'] as $val) { + $b = new expense($this->dbconn); + $b = $b->read($val,$b); + if ( $b->id != $val ) { + continue; + } + if ( $b->mod_ok() ) { + $this->stc->stateowner = $b; + if ( $a[1] == "S" ) { + if ($a[2] == $b->state) continue; // keep + if (!$this->stc->check_trans($b->state,$a[2])) { + $msg = addLine($msg,$b->getLink() .': '. sprintf($lang['Err0024'],$lang[$b->getType()]).' ('.$lang['ExpenseState'].')'); + continue; + } + $state = $b->state; + if ($b->setState($a[2])) { + $info = addLine($info,$b->getLink() .' '. $lang['ExpenseState'] .': '.$lang['ExpenseStates'][$state].' → '. $lang['ExpenseStates'][$a[2]]); + } + } else { + $msg = addLine($msg,"A:".$_GET['action'] ." M: '". $val[1] ."' V:". $val[2]); + } + $msg = addLine($msg,$b->save()); + } else { + $msg = addLine($msg,$b->getLink() .': '. sprintf($lang['Err0024'],$lang[$b->getType()])); + } + unset ($b); + } + $this->dbconn->Commit("WORK"); + return; + } + + foreach ($_GET['mark'] as $key => $val) { + $obj = new expense($this->dbconn); + $obj = $obj->read($val,$obj); + if ( $obj->id != $val ) { + continue; + } + if (set_custom_massupdate_object($this,'expense',$obj,$_REQUEST['action'])) { + $msg = addLine($msg,$obj->save()); + } + } if (class_exists('watchlist')) { watchlist::parse_action($this->user); } @@ -334,7 +401,7 @@ * prepare */ Function prepare() { - global $msg,$lang,$table; + global $msg,$lang,$table,$tutos; $this->layout_id = useexpenses; $this->name = $lang['ExpensesOverview']; @@ -345,9 +412,16 @@ $this->stop = true; } + $this->stc = getObject($this->user->dbconn,$tutos['expense_state_stc']); + if (!is_object($this->stc)) { + $this->stc = new stc(null); + $this->stc->initByArray('ExpenseStates',Expense::$c_state); + } + $this->link1 = 'expense/expense_overview.php'; $this->filter = array(); + $this->head['state'] = true; $this->head['link_id'] = true; $this->head['custom'] = true; $this->head['mods'] = true; @@ -368,6 +442,9 @@ if (isset($this->hide['mods']) && $this->hide['mods'] ) { $this->head['mods'] = false; } + if (isset($this->hide['state']) && $this->hide['state'] ) { + $this->head['state'] = false; + } $this->link1 = addHiddenFields($this->link1); if (isset($_GET['ext'])) { @@ -384,19 +461,13 @@ $name = $_GET['name']; } + $this->header = ''; + $this->hpre = ''; + $j = "SELECT DISTINCT e.* FROM ". $this->dbconn->prefix .$table['expense'][name].' e '; // select + join $q = ""; $pre = " WHERE "; - if ( ($name != "*") && ($name != "") ) { - $q .= " " . $pre ."(". $this->dbconn->Like("e.name",$name) ." OR ". $this->dbconn->Like("e.name",$name) .")"; - $pre = " AND "; - $this->link1 = addUrlParameter($this->link1,"name=".UrlEncode($name)); - $this->filter['name'] = $name; - } else { - $this->filter['name'] = ""; - } - if ( isset($_GET['id']) ) { if (false == is_numeric($_GET['id'])) { $msg = addLine($msg,sprintf($lang['Err0012'],"id",$_GET['id'])); @@ -412,6 +483,8 @@ $q .= " ". $pre ." e.currency = '".$_GET['currency']."'"; $pre = " AND "; $this->link1 = addUrlParameter($this->link1,"currency=". $_GET['currency']); + $this->header .= $this->hpre.$lang['Currency'] .' = ' .myentities($_GET['currency']); + $this->hpre = '<br />'; } // References to display @@ -421,31 +494,38 @@ $this->q = $j.$q; $this->qpre = $pre; - // Start Date for search - overview_arg($this,'f',OVERVIEW_ARG_D_FROM,'expense',array('creation','t_start'),'created','e.'); - // End Date for search - overview_arg($this,'t',OVERVIEW_ARG_D_TO,'expense',array('creation','t_start'),'created','e.'); + // Name + overview_arg($this,'name',OVERVIEW_ARG_STRING,'expense',array('name'),'ExpenseName','e.'); - // reference - overview_arg($this,'link_fn',OVERVIEW_ARG_FN,'expense',array('link_id'),'ExpenseReference','e.',get_parent_classes('expense')); - overview_arg($this,'link_id',OVERVIEW_ARG_OBJID,'expense',array('link_id'),'ExpenseReference','e.'); + if($_REQUEST['ext'] == 1) { + // State + overview_arg($this,'state',OVERVIEW_ARG_INT,'expense',array('state'),array('ExpenseState','ExpenseStates'),'e.'); - // supplier - overview_arg($this,'supfn',OVERVIEW_ARG_FN,'expense',array('supplier'),'ExpenseSupplier','e.','cd'); - overview_arg($this,'supid',OVERVIEW_ARG_OBJID,'expense',array('supplier'),'ExpenseSupplier','e.'); + // Start Date for search + overview_arg($this,'f',OVERVIEW_ARG_D_FROM,'expense',array('creation','t_start'),'created','e.'); + // End Date for search + overview_arg($this,'t',OVERVIEW_ARG_D_TO,'expense',array('creation','t_start'),'created','e.'); - // adr - overview_arg($this,'adrfn',OVERVIEW_ARG_FN,'expense',array('adr_id'),'ExpenseAddress','e.','at'); - overview_arg($this,'adrid',OVERVIEW_ARG_OBJID,'expense',array('adr_id'),'ExpenseAddress','e.'); + // reference + overview_arg($this,'link_fn',OVERVIEW_ARG_FN,'expense',array('link_id'),'ExpenseReference','e.',get_parent_classes('expense')); + overview_arg($this,'link_id',OVERVIEW_ARG_OBJID,'expense',array('link_id'),'ExpenseReference','e.'); - // creator - overview_arg($this,'crfn',OVERVIEW_ARG_FN,'expense',array('creator'),'ExpenseCreator','e.','a'); - overview_arg($this,'crid',OVERVIEW_ARG_OBJID,'expense',array('creator'),'ExpenseCreator','e.'); + // supplier + overview_arg($this,'supfn',OVERVIEW_ARG_FN,'expense',array('supplier'),'ExpenseSupplier','e.','cd'); + overview_arg($this,'supid',OVERVIEW_ARG_OBJID,'expense',array('supplier'),'ExpenseSupplier','e.'); - // category - overview_arg($this,'cat',OVERVIEW_ARG_INT,'expense',array('category'),array('ExpenseCategory','ExpenseCategories'),'e.'); + // adr + overview_arg($this,'adrfn',OVERVIEW_ARG_FN,'expense',array('adr_id'),'ExpenseAddress','e.','at'); + overview_arg($this,'adrid',OVERVIEW_ARG_OBJID,'expense',array('adr_id'),'ExpenseAddress','e.'); + // creator + overview_arg($this,'crfn',OVERVIEW_ARG_FN,'expense',array('creator'),'ExpenseCreator','e.','a'); + overview_arg($this,'crid',OVERVIEW_ARG_OBJID,'expense',array('creator'),'ExpenseCreator','e.'); + // category + overview_arg($this,'cat',OVERVIEW_ARG_INT,'expense',array('category'),array('ExpenseCategory','ExpenseCategories'),'e.'); + } + // custom selectors // get customized non textual search fields $custom = get_custom_sql_select($this,'expense','e',$this->link1); @@ -460,7 +540,6 @@ $this->q = preg_replace('# where#i',','.$s.' WHERE',$this->q); } // $msg = addLine($this->q,$msg); - check_dbacl($this->dbconn,$this->q, $this->user->id); // sorting @@ -510,4 +589,4 @@ $l = new Expense_overview($current_user); $l->display(); $dbconn->Close(); -?> +?> \ No newline at end of file Modified: trunk/php/expense/expense_select.php =================================================================== --- trunk/php/expense/expense_select.php 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/expense_select.php 2017-07-28 13:48:59 UTC (rev 1307) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert and ECOsoft.net + * Copyright 1999 - 2017 by Gero Kohnert and ECOsoft.net * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -58,6 +58,11 @@ $r .= $this->ContentRowEnd(); $r .= $this->ContentRowStart('ext'); + $r .= $this->showfieldc($lang['ExpenseState'],0,'state'); + $r .= $this->showdata(ExpenseAskState($this->state),2); + $r .= $this->ContentRowEnd(); + + $r .= $this->ContentRowStart('ext'); $r .= $this->showfieldc($lang['ExpenseSupplier'],0,'sup'); $r .= $this->showdata(select_from_array_or_input($this,"sup",null,1,'cd'),2); $r .= $this->ContentRowEnd(); @@ -165,16 +170,11 @@ $this->ext = $_GET['ext']; } - # $lang['ExpenseReferences'][1] = &$lang['Company']; - # $lang['ExpenseReferences'][2] = &$lang['Department']; - # $lang['ExpenseReferences'][3] = &$lang['Address']; - # $lang['ExpenseReferences'][4] = &$lang['Bug']; - $lang['ExpenseReferences'][5] = &$lang['ProductP']; - # $lang['ExpenseReferences'][6] = &$lang['Team']; - $lang['ExpenseReferences'][7] = &$lang['Task']; - # $lang['ExpenseReferences'][8] = &$lang['Installation']; - $lang['ExpenseReferences'][8] = 'Installation'; - # $lang['ExpenseReferences'][9] = &$lang['Checklist']; + if ( isset($_SESSION['expense_state']) ) { + $this->state = $_SESSION['expense_state']; + } else { + $this->state = EXPENSE_STATE_UNDEF; + } } } @@ -185,4 +185,4 @@ <!-- SVN Info $Id$ $Author$ ---> +--> \ No newline at end of file Modified: trunk/php/expense/expense_show.php =================================================================== --- trunk/php/expense/expense_show.php 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/expense_show.php 2017-07-28 13:48:59 UTC (rev 1307) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert and ECOsoft.net + * Copyright 1999 - 2017 by Gero Kohnert and ECOsoft.net * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -54,6 +54,11 @@ $r .= $this->ContentRowEnd(); $r .= $this->ContentRowStart(); + $r .= $this->showfield($lang['ExpenseState']); + $r .= $this->showdata($this->obj->getState(),$this->width -1); + $r .= $this->ContentRowEnd(); + + $r .= $this->ContentRowStart(); $r .= $this->showfield($lang['ExpenseReference']); $r .= $this->showdata($this->obj->getRefLink(),$this->width -1); $r .= $this->ContentRowEnd(); Modified: trunk/php/expense/mconfig.pinc =================================================================== --- trunk/php/expense/mconfig.pinc 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/mconfig.pinc 2017-07-28 13:48:59 UTC (rev 1307) @@ -1,6 +1,6 @@ <?php /* - * Copyright 1999 - 2013 by Gero Kohnert and ECOsoft.net + * Copyright 1999 - 2017 by Gero Kohnert and ECOsoft.net * * Module specific configuration * @@ -9,10 +9,10 @@ */ $tutos['files'][__FILE__] = '$Rev$'; -# -# Every module must have an individual ID ( < 0 > -100 ). -# this is module 90 -# +// +// Every module must have an individual ID ( < 0 > -100 ). +// this is module 90 +// define('useexpenses',-90); $tutos[modules]['expense'] = array( name => "expense", @@ -19,23 +19,27 @@ Desc => "expenses", file => "php/expense/expense.pinc", 'overview' => "expense/expense_overview.php", + 'configurl' => "expense/expense_config.php", 'perm' => useexpenses ); -# -# globally enable this module -# +// +// globally enable this module +// $tutos[useexpenses] = 1; -# -# List of objects/modules where we do something with this module -# and need to include this module -# +$tutos['expense_state_stc'] = -1; + +// +// List of objects/modules where we do something with this module +// and need to include this module +// $tutos[modulesinc]['expense'][] = "product"; $tutos[modulesinc]['expense'][] = "task"; $tutos[modulesinc]['expense'][] = "installation"; $tutos[modulesinc]['expense'][] = "scheme"; -# -# Files (like invoices etc) could be added -# +$tutos[modulesinc]['expense'][] = 'stc'; +// +// Files (like invoices etc) could be added +// $tutos[modulesinc]['file'][] = "expense"; $tutos['docowners'][] = 'expense'; Modified: trunk/php/expense/mtable.pinc =================================================================== --- trunk/php/expense/mtable.pinc 2017-07-08 15:54:00 UTC (rev 1306) +++ trunk/php/expense/mtable.pinc 2017-07-28 13:48:59 UTC (rev 1307) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2011 by Gero Kohnert and ECOsoft.net + * Copyright 1999 - 2017 by Gero Kohnert and ECOsoft.net * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -19,6 +19,7 @@ $table['expense']['link_id'] = array(type => 'ID_TYPE', constraints => 'NN', Desc => 'id of linked object'); $table['expense']['adr_id'] = array(type => 'ID_TYPE', constraints => 'NN', Desc => 'id of linked address'); $table['expense']['name'] = array(type => 'VARCHAR', size => 50, constraints => 'NN', Desc => 'short name of expenses'); +$table['expense']['state'] = array(type => 'ID_TYPE', constraints => 'NN', Desc => 'state of expense'); $table['expense']['description'] = array(type => 'TX_TYPE', constraints => '', Desc => 'long description of expenses', 'hideempty' => true, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-07-08 15:54:04
|
Revision: 1306 http://sourceforge.net/p/tutos/code/1306 Author: gokohnert Date: 2017-07-08 15:54:00 +0000 (Sat, 08 Jul 2017) Log Message: ----------- url handling handler Modified Paths: -------------- trunk/php/address_tools.p3 trunk/php/company_show.php trunk/php/handler.pinc trunk/php/location.pinc Modified: trunk/php/address_tools.p3 =================================================================== --- trunk/php/address_tools.p3 2017-07-08 12:09:31 UTC (rev 1305) +++ trunk/php/address_tools.p3 2017-07-08 15:54:00 UTC (rev 1306) @@ -19,9 +19,14 @@ Function Show_LocFields($user,$title,tutos_base $a,$name,$typ) { global $tutos,$lang,$current_user,$table; - if ( !isset($table['location'][$name]['hideempty']) ) { - $table['location'][$name]['hideempty'] = false; + // name might be _fld_name so short it + $fldname = $name; + if (strpos($name,'_fld_') === 0 ) { + $fldname = substr($name,5); } + if ( !isset($table['location'][$fldname]['hideempty']) ) { + $table['location'][$fldname]['hideempty'] = false; + } $used = false; $r = ''; $line = ''; @@ -40,36 +45,11 @@ foreach($a->location as $j => $l) { $r .= ' <td colspan="'. $s .'" class="over_l line'. (($line % 2) +1) ."\">\n"; $line++; - if ( $name == "email_1" ) { - $r .= handle('email',$l->$name,myentities($l->$name)); - if ($l->$name != '') { - $used = true; - } - } elseif ( $name == "email_2" ) { - $r .= handle('email',$l->$name,myentities($l->$name)); - if ($l->$name != '') { - $used = true; - } - } elseif ( $name == "phone_1" ) { - $r .= handle('phone',$l->$name,myentities($l->$name)); - if ($l->$name != '') { - $used = true; - } - } elseif ( $name == "phone_2" ) { - $r .= handle('phone',$l->$name,myentities($l->$name)); - if ($l->$name != '') { - $used = true; - } - } elseif ( $name == "zip" ) { + if ( $name == "zip" ) { $r .= handle('geodata',$l,myentities($l->$name)); if ($l->$name != '') { $used = true; } - } elseif ( $name == "fax_1" ) { - $r .= handle('fax',$l->$name,myentities($l->$name)); - if ($l->$name != '') { - $used = true; - } } elseif ( $name == "c_id" ) { if (is_object($l->company) && $l->company->id > 0) { $r .= $l->company->getLink(); @@ -105,7 +85,11 @@ mywindow.location.href = '". $url ."'; mywindow.focus();\" "self.status='". myentities($l->lname,1) ."' ;return true\" title=\"". myentities($l->lname) ."\">"; $r .= myentities($l->$name) ."</a>"; } else { - $r .= myentities($l->$name); + if ( isset($table['location'][$fldname]['handler']) ) { + $r .= handle($table['location'][$fldname]['handler'],$l->$name,myentities($l->$name)); + } else { + $r .= myentities($l->$name); + } if ($l->$name != '') { $used = true; } @@ -119,15 +103,15 @@ } } elseif ( $typ == 9 ) { $used = true; - if ( count($a->obj->location) <= 1 ) { + if ( count($a->location) <= 1 ) { $s = 2; } else { $s = 1; } - if ( count($a->obj->location) > 0 ) { - foreach($a->obj->location as $j => $l) { + if ( count($a->location) > 0 ) { + foreach($a->location as $j => $l) { if ( $name == "ModifyDelete" ) { - $r .= $current_user->layout->showGuiIcons('<th colspan="'.$s.'" align="right">'. myentities($l->lname) .' '. $lang['Address'] .'  ','</th>',$l,$a->obj,array('mod','del'),false); + $r .= $current_user->layout->showGuiIcons('<th colspan="'.$s.'" align="right">'. myentities($l->lname) .' '. $lang['Address'] .'  ','</th>',$l,$a,array('mod','del'),false); } } } @@ -163,7 +147,7 @@ $r .= "</tr>\n"; // sent only if hideempty false or fideempty true and content ist there - if (! $used && $table['location'][$name]['hideempty'] ) { + if (! $used && $table['location'][$fldname]['hideempty'] ) { return ''; } return $r; Modified: trunk/php/company_show.php =================================================================== --- trunk/php/company_show.php 2017-07-08 12:09:31 UTC (rev 1305) +++ trunk/php/company_show.php 2017-07-08 15:54:00 UTC (rev 1306) @@ -75,7 +75,7 @@ // Location's Header and Direkt Links to Modify and Delete // $r .= "<tr><td colspan=\"".$cols."\"></td></tr>\n"; // $r .= "<tr><td colspan=\"".$cols."\"></td></tr>\n"; - $r .= Show_LocFields($this->user,'',$this,"ModifyDelete",9); + $r .= Show_LocFields($this->user,'',$this->obj,"ModifyDelete",9); $r .= Show_LocFields($this->user,$lang['AdrDescription'],$this->obj,"lname",1); Modified: trunk/php/handler.pinc =================================================================== --- trunk/php/handler.pinc 2017-07-08 12:09:31 UTC (rev 1305) +++ trunk/php/handler.pinc 2017-07-08 15:54:00 UTC (rev 1306) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2002 - 2013 by Gero Kohnert + * Copyright 2002 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,7 +16,6 @@ */ Function handle($type,$obj,$arg) { global $tutos,$msg,$info; - $r = ''; $cnt = 0; if (!isset($tutos[handler][$type]) || (count($tutos[handler][$type]) == 0) ) { @@ -89,4 +88,24 @@ } } +/** + * show the content as url (used for fields that contain web urls) + */ +class url_handler extends tutos_handler +{ + /** + * run the handler + */ + function handle($obj,$arg,$cnt) { + return '<a href="'.$arg.'">'.$arg.'</a>'; + } + + /** + * check if all is ok + */ + function check($obj,$arg) { + return true; + } +} +$tutos[handler]['url']['url_handler'] = 'handler.pinc'; ?> \ No newline at end of file Modified: trunk/php/location.pinc =================================================================== --- trunk/php/location.pinc 2017-07-08 12:09:31 UTC (rev 1305) +++ trunk/php/location.pinc 2017-07-08 15:54:00 UTC (rev 1306) @@ -733,7 +733,7 @@ $r .= "</tr>\n"; // Edit additional custom fields - $r .= edit_custom_fields($layout,$this->gettype(),$this->obj,5); + $r .= edit_custom_fields($layout,$this->gettype(),$this,5); return $r; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-07-08 12:09:33
|
Revision: 1305 http://sourceforge.net/p/tutos/code/1305 Author: gokohnert Date: 2017-07-08 12:09:31 +0000 (Sat, 08 Jul 2017) Log Message: ----------- use hideempty in locations Modified Paths: -------------- trunk/php/address_show.php trunk/php/address_tools.p3 trunk/php/db/table.pinc Modified: trunk/php/address_show.php =================================================================== --- trunk/php/address_show.php 2017-07-08 11:22:48 UTC (rev 1304) +++ trunk/php/address_show.php 2017-07-08 12:09:31 UTC (rev 1305) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -50,8 +50,8 @@ $r .= " ". myentities($this->obj->getFullName()) ."\n"; $r .= " ". myentities($this->obj->location[$this->lid]->street1) ."\n"; $r .= " ". myentities($this->obj->location[$this->lid]->street2) ."\n"; - #ToDo: localize this - $adrformat = "%s - %s %s"; + // ToDo: localize this + $adrformat = "%s - %s %s"; $r .= " ". sprintf($adrformat,$this->obj->location[$this->lid]->country , $this->obj->location[$this->lid]->zip , $this->obj->location[$this->lid]->city )."\n"; $r .= " ". $lang['countrycde'][$this->obj->location[$this->lid]->country] ."\n"; $r .= "\n\n\n"; @@ -145,6 +145,13 @@ $r .= Show_LocFields($this->user,$lang['ZIP'],$this->obj,"zip",1); $r .= Show_LocFields($this->user,$lang['State'],$this->obj,"state",1); $r .= Show_LocFields($this->user,$lang['Country'],$this->obj,"country",1); + // add custom location fields + foreach($table['location'] as $i => $x) { + if (!is_array($x)) continue; + if (!isset($x['custom'])) continue; + if (!$x['custom']) continue; + $r .= Show_LocFields($this->user,$x['lang'],$this->obj,'_fld_'.$i,1); + } $r .= team::infolist($this->user,$this->obj,$cols,$this->format); $r .= product::infolist($this->user,$this->obj,$cols,$this->format); Modified: trunk/php/address_tools.p3 =================================================================== --- trunk/php/address_tools.p3 2017-07-08 11:22:48 UTC (rev 1304) +++ trunk/php/address_tools.p3 2017-07-08 12:09:31 UTC (rev 1305) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2014 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -14,11 +14,15 @@ $tutos['files'][__FILE__] = '$Rev$'; /** --------------------------------------------------------------------------- - * + * show one location field vertically for all locations */ -Function Show_LocFields($user,$title,&$a,$name,$typ) { - global $tutos,$lang,$current_user; +Function Show_LocFields($user,$title,tutos_base $a,$name,$typ) { + global $tutos,$lang,$current_user,$table; + if ( !isset($table['location'][$name]['hideempty']) ) { + $table['location'][$name]['hideempty'] = false; + } + $used = false; $r = ''; $line = ''; $r .= "<tr>\n"; @@ -38,31 +42,60 @@ $line++; if ( $name == "email_1" ) { $r .= handle('email',$l->$name,myentities($l->$name)); + if ($l->$name != '') { + $used = true; + } } elseif ( $name == "email_2" ) { $r .= handle('email',$l->$name,myentities($l->$name)); + if ($l->$name != '') { + $used = true; + } } elseif ( $name == "phone_1" ) { $r .= handle('phone',$l->$name,myentities($l->$name)); + if ($l->$name != '') { + $used = true; + } } elseif ( $name == "phone_2" ) { $r .= handle('phone',$l->$name,myentities($l->$name)); + if ($l->$name != '') { + $used = true; + } } elseif ( $name == "zip" ) { $r .= handle('geodata',$l,myentities($l->$name)); + if ($l->$name != '') { + $used = true; + } } elseif ( $name == "fax_1" ) { $r .= handle('fax',$l->$name,myentities($l->$name)); + if ($l->$name != '') { + $used = true; + } } elseif ( $name == "c_id" ) { - if (is_object($l->company) && $l->company->id > 0) + if (is_object($l->company) && $l->company->id > 0) { $r .= $l->company->getLink(); + $used = true; + } } elseif ( $name == "d_id" ) { - if (is_object($l->department) && $l->department->id > 0) + if (is_object($l->department) && $l->department->id > 0) { $r .= $l->department->getLink($l->department->name); + $used = true; + } } elseif ( $name == "country" ) { if ( isset($lang['countrycde'][$l->$name]) ) { $r .= handle('country',$l,$lang['countrycde'][$l->$name] ." (". $l->$name .")"); } else { $r .= $l->$name; + if ($l->$name != '') { + $used = true; + } } } elseif ( $name == "city" ) { $r .= handle('city',$l,myentities($l->$name)); + if ($l->$name != '') { + $used = true; + } } elseif ( $name == "lname" ) { + $used = true; // always show lname $url = "address_show.php"; $url = addUrlParameter($url,"lid=". $l->id); $url = addUrlParameter($url,"format=popup",false); @@ -73,6 +106,9 @@ $r .= myentities($l->$name) ."</a>"; } else { $r .= myentities($l->$name); + if ($l->$name != '') { + $used = true; + } } $r .= "\n</td>\n"; $set++; @@ -82,6 +118,7 @@ $r .= ' <td colspan="'. $s ."\"> </td>\n"; } } elseif ( $typ == 9 ) { + $used = true; if ( count($a->obj->location) <= 1 ) { $s = 2; } else { @@ -121,8 +158,14 @@ } else { $r .= ' <td colspan="'. $s .'"> '. myentities($a->$name) ." </td>\n"; } + $used = true; } $r .= "</tr>\n"; + + // sent only if hideempty false or fideempty true and content ist there + if (! $used && $table['location'][$name]['hideempty'] ) { + return ''; + } return $r; } /** Modified: trunk/php/db/table.pinc =================================================================== --- trunk/php/db/table.pinc 2017-07-08 11:22:48 UTC (rev 1304) +++ trunk/php/db/table.pinc 2017-07-08 12:09:31 UTC (rev 1305) @@ -222,56 +222,75 @@ 'field' => 'phone_1', 'handler' => 'phone', 'lang' => 'Phone', + 'hideempty' => true, ), 'phone_2' => array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'phone number', 'field' => 'phone_2', 'handler' => 'phone', 'lang' => 'MobilePhone', + 'hideempty' => true, ), 'fax_1' => array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'fax number', 'field' => 'fax_1', 'handler' => 'fax', 'lang' => 'AdrFax', + 'hideempty' => true, ), 'email_1' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'email address', 'field' => 'email_1', 'handler' => 'email', 'lang' => 'AdrEmail', + 'hideempty' => true, ), 'email_2' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'email address', 'field' => 'email_2', 'handler' => 'email', 'lang' => 'AdrEmail', + 'hideempty' => true, ), 'street1' => array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'street address', 'field' => 'street1', 'lang' => 'Street', + 'hideempty' => true, ), 'street2' => array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'street address', 'field' => 'street2', 'lang' => 'Street', + 'hideempty' => true, ), 'city' => array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'city', 'field' => 'city', 'lang' => 'City', + 'hideempty' => true, ), 'zip' => array(type => 'VARCHAR', size => 10, constraints => '', Desc => 'zip code', 'field' => 'zip', 'lang' => 'ZIP', + 'hideempty' => true, ), 'state' => array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'state in country', 'field' => 'state', 'lang' => 'State', + 'hideempty' => true, ), 'country' => array(type => 'VARCHAR', size => 3, constraints => '', Desc => 'ISO Country code', 'field' => 'country', 'lang' => 'County', + 'hideempty' => true, ), 'coords' => array(type => 'VARCHAR', size => 30, constraints => '', Desc => 'Coordinates (not yet used)'), - 'acc_info1' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'bank account info line 1'), - 'acc_info2' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'bank account info line 2'), - 'acc_nr' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'bank account info nr'), - 'customer_id' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'customer id'), + 'acc_info1' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'bank account info line 1', + 'hideempty' => true, + ), + 'acc_info2' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'bank account info line 2', + 'hideempty' => true, + ), + 'acc_nr' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'bank account info nr', + 'hideempty' => true, + ), + 'customer_id' => array(type => 'VARCHAR', size => 60, constraints => '', Desc => 'customer id', + 'hideempty' => true, + ), 'creator' => array(type => 'ID_TYPE', constraints => '', Desc => 'creator ID'), 'creation' => array(type => 'TS_TYPE', constraints => '', Desc => 'creation date') ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-07-08 11:22:51
|
Revision: 1304 http://sourceforge.net/p/tutos/code/1304 Author: gokohnert Date: 2017-07-08 11:22:48 +0000 (Sat, 08 Jul 2017) Log Message: ----------- use custom location fields Modified Paths: -------------- trunk/php/department_show.php Modified: trunk/php/department_show.php =================================================================== --- trunk/php/department_show.php 2017-07-08 11:05:09 UTC (rev 1303) +++ trunk/php/department_show.php 2017-07-08 11:22:48 UTC (rev 1304) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2014 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -77,6 +77,13 @@ $r .= Show_LocFields($this->user,$lang['acc_info2'],$this->obj,"acc_info2",1); $r .= Show_LocFields($this->user,$lang['acc_nr'],$this->obj,"acc_nr",1); $r .= Show_LocFields($this->user,$lang['AdrCustumerID'],$this->obj,"customer_id",1); + // add custom location fields + foreach($table['location'] as $i => $x) { + if (!is_array($x)) continue; + if (!isset($x['custom'])) continue; + if (!$x['custom']) continue; + $r .= Show_LocFields($this->user,$x['lang'],$this->obj,'_fld_'.$i,1); + } } $ra = $this->dbconn->Exec($this->q); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-07-08 11:05:10
|
Revision: 1303 http://sourceforge.net/p/tutos/code/1303 Author: gokohnert Date: 2017-07-08 11:05:09 +0000 (Sat, 08 Jul 2017) Log Message: ----------- use custom location fields Modified Paths: -------------- trunk/php/company_new.php trunk/php/company_show.php trunk/php/location.pinc Modified: trunk/php/company_new.php =================================================================== --- trunk/php/company_new.php 2017-06-30 14:14:13 UTC (rev 1302) +++ trunk/php/company_new.php 2017-07-08 11:05:09 UTC (rev 1303) @@ -58,7 +58,6 @@ $r .= $this->editfield_data_row($this->obj,$table['company']['credit_limit'],$this->width-1,1); $r .= $this->editfield_data_row($this->obj,$table['company']['employees'],$this->width-1,1); $r .= $this->editfield_data_row($this->obj,$table['company']['revenue'],$this->width-1,1); - #$r .= $this->showfield_data_row($this->obj,$table['company']['revenue'],$cols-1,1); // Edit additional custom fields $r .= edit_custom_fields($this,$this->obj->gettype(),$this->obj,$this->width); Modified: trunk/php/company_show.php =================================================================== --- trunk/php/company_show.php 2017-06-30 14:14:13 UTC (rev 1302) +++ trunk/php/company_show.php 2017-07-08 11:05:09 UTC (rev 1303) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2014 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -92,6 +92,13 @@ $r .= Show_LocFields($this->user,$lang['acc_info2'],$this->obj,"acc_info2",1); $r .= Show_LocFields($this->user,$lang['acc_nr'],$this->obj,"acc_nr",1); $r .= Show_LocFields($this->user,$lang['AdrCustumerID'],$this->obj,"customer_id",1); + // add custom location fields + foreach($table['location'] as $i => $x) { + if (!is_array($x)) continue; + if (!isset($x['custom'])) continue; + if (!$x['custom']) continue; + $r .= Show_LocFields($this->user,$x['lang'],$this->obj,'_fld_'.$i,1); + } } // No departments Modified: trunk/php/location.pinc =================================================================== --- trunk/php/location.pinc 2017-06-30 14:14:13 UTC (rev 1302) +++ trunk/php/location.pinc 2017-07-08 11:05:09 UTC (rev 1303) @@ -1,6 +1,6 @@ <?php /** - * Copyright 1999 - 2013 by Gero Kohnert + * Copyright 1999 - 2017 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -78,7 +78,6 @@ return; } - $obj->location = array(); $obj->locall = array(); @@ -590,6 +589,8 @@ } } } + // Parse additional custom fields + $msg = addLine($msg,parse_custom_fields($this->gettype(),$this)); if ( isset($_POST['cploc']) && ($_POST['cploc'] == 1) ) { // Copy the location data from the companies location if possible @@ -730,6 +731,10 @@ $r .= $layout->showfieldc($lang['AdrCustumerID'],0,"customer_id"); $r .= ' <td colspan="4"><input size="50" maxlength="'. $table['location']['customer_id'][size] .'" id="customer_id" name="customer_id" value="'. myentities($this->customer_id) ."\" /></td>\n"; $r .= "</tr>\n"; + + // Edit additional custom fields + $r .= edit_custom_fields($layout,$this->gettype(),$this->obj,5); + return $r; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-06-30 14:14:16
|
Revision: 1302 http://sourceforge.net/p/tutos/code/1302 Author: gokohnert Date: 2017-06-30 14:14:13 +0000 (Fri, 30 Jun 2017) Log Message: ----------- fix Modified Paths: -------------- trunk/php/url/url.pinc Modified: trunk/php/url/url.pinc =================================================================== --- trunk/php/url/url.pinc 2017-06-30 14:08:46 UTC (rev 1301) +++ trunk/php/url/url.pinc 2017-06-30 14:14:13 UTC (rev 1302) @@ -589,7 +589,7 @@ /** * add a preset link */ - function getAddLinkPreset(tutos_user $user,layout $obj,$text = "") { + static function getAddLinkPreset(tutos_user $user,layout $obj,$text = "") { global $lang; if (! is_object($obj) ) return ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-06-30 14:08:49
|
Revision: 1301 http://sourceforge.net/p/tutos/code/1301 Author: gokohnert Date: 2017-06-30 14:08:46 +0000 (Fri, 30 Jun 2017) Log Message: ----------- fix Modified Paths: -------------- trunk/php/watchlist/watchlist.pinc Modified: trunk/php/watchlist/watchlist.pinc =================================================================== --- trunk/php/watchlist/watchlist.pinc 2017-06-30 09:00:16 UTC (rev 1300) +++ trunk/php/watchlist/watchlist.pinc 2017-06-30 14:08:46 UTC (rev 1301) @@ -150,7 +150,7 @@ /** * parse the massupdate actions */ - function action_options () { + static function action_options () { global $lang; $r = ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2017-06-30 09:00:17
|
Revision: 1300 http://sourceforge.net/p/tutos/code/1300 Author: gokohnert Date: 2017-06-30 09:00:16 +0000 (Fri, 30 Jun 2017) Log Message: ----------- fix Modified Paths: -------------- trunk/php/address_tools.p3 Modified: trunk/php/address_tools.p3 =================================================================== --- trunk/php/address_tools.p3 2016-11-05 17:46:13 UTC (rev 1299) +++ trunk/php/address_tools.p3 2017-06-30 09:00:16 UTC (rev 1300) @@ -68,8 +68,8 @@ $url = addUrlParameter($url,"format=popup",false); $url = addSessionKey($url,false); $r .= "<a href=\"JavaScript: - mywindow = window.open('". myentities($l->$name) ."', 'help', 'width=300,height=300,top=200,left=200,scrollbars=1'); - mywindow.location.href = '". $url ."'; mywindow.focus();\" "self.status='". myentities($l->$name,1) ."' ;return true\" title=\"". myentities($l->$name) ."\">"; + mywindow = window.open('". myentities($l->lname) ."', 'help', 'width=300,height=300,top=200,left=200,scrollbars=1'); + mywindow.location.href = '". $url ."'; mywindow.focus();\" "self.status='". myentities($l->lname,1) ."' ;return true\" title=\"". myentities($l->lname) ."\">"; $r .= myentities($l->$name) ."</a>"; } else { $r .= myentities($l->$name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2016-11-05 17:46:16
|
Revision: 1299 http://sourceforge.net/p/tutos/code/1299 Author: gokohnert Date: 2016-11-05 17:46:13 +0000 (Sat, 05 Nov 2016) Log Message: ----------- fixes Modified Paths: -------------- trunk/php/Date.pinc trunk/php/address_tools.p3 trunk/php/stc/stc.pinc Modified: trunk/php/Date.pinc =================================================================== --- trunk/php/Date.pinc 2016-10-06 14:31:46 UTC (rev 1298) +++ trunk/php/Date.pinc 2016-11-05 17:46:13 UTC (rev 1299) @@ -1094,7 +1094,7 @@ /** * get the used Date Format as YYMMDD or similar */ - function getDateFormat() { + static function getDateFormat() { global $lang; $r = $lang['DateFormatStr']; $r = preg_replace('#%d#','dd',$r); Modified: trunk/php/address_tools.p3 =================================================================== --- trunk/php/address_tools.p3 2016-10-06 14:31:46 UTC (rev 1298) +++ trunk/php/address_tools.p3 2016-11-05 17:46:13 UTC (rev 1299) @@ -68,7 +68,7 @@ $url = addUrlParameter($url,"format=popup",false); $url = addSessionKey($url,false); $r .= "<a href=\"JavaScript: - mywindow = window.open('". myentities($l->name) ."', 'help', 'width=300,height=300,top=200,left=200,scrollbars=1'); + mywindow = window.open('". myentities($l->$name) ."', 'help', 'width=300,height=300,top=200,left=200,scrollbars=1'); mywindow.location.href = '". $url ."'; mywindow.focus();\" "self.status='". myentities($l->$name,1) ."' ;return true\" title=\"". myentities($l->$name) ."\">"; $r .= myentities($l->$name) ."</a>"; } else { Modified: trunk/php/stc/stc.pinc =================================================================== --- trunk/php/stc/stc.pinc 2016-10-06 14:31:46 UTC (rev 1298) +++ trunk/php/stc/stc.pinc 2016-11-05 17:46:13 UTC (rev 1299) @@ -829,13 +829,13 @@ /** * create a array with all stcs valid for a given lang_array */ - function getListByLangArray($obj,$la) { + static function getListByLangArray($obj,$la) { global $table; $tablename = $obj->dbconn->prefix .$table['stc'][name]; $tablename2 = $obj->dbconn->prefix .$table['stc_states'][name]; $q = 'SELECT distinct a.* FROM '. $tablename .' a,'.$tablename2 .' b WHERE b.lang_array = \''. $la .'\' AND a.id = b.stc_id'; - $r = $this->dbconn->Exec($q); + $r = $obj->dbconn->Exec($q); $obj->stcs = array(); $n = $r->numrows(); @@ -883,4 +883,4 @@ return $r; } } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2016-10-06 14:31:47
|
Revision: 1298 http://sourceforge.net/p/tutos/code/1298 Author: gokohnert Date: 2016-10-06 14:31:46 +0000 (Thu, 06 Oct 2016) Log Message: ----------- https instead of http Modified Paths: -------------- trunk/html/motd_default.html Modified: trunk/html/motd_default.html =================================================================== --- trunk/html/motd_default.html 2016-09-23 14:48:47 UTC (rev 1297) +++ trunk/html/motd_default.html 2016-10-06 14:31:46 UTC (rev 1298) @@ -17,4 +17,4 @@ See <a href="http://wiki.tutos.org" target="doku">TUTOS wiki</a> for uptodate documentation. -<a href=" |
From: <gok...@us...> - 2016-09-23 14:48:49
|
Revision: 1297 http://sourceforge.net/p/tutos/code/1297 Author: gokohnert Date: 2016-09-23 14:48:47 +0000 (Fri, 23 Sep 2016) Log Message: ----------- better fixing of Advisory ID: SYSS-2016-070 Modified Paths: -------------- trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc Modified: trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc =================================================================== --- trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc 2016-08-13 16:02:13 UTC (rev 1296) +++ trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc 2016-09-23 14:48:47 UTC (rev 1297) @@ -1,6 +1,6 @@ <?php /** - * Copyright 2005 - 2011 by Gero Kohnert + * Copyright 2005 - 2016 by Gero Kohnert * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,7 +16,7 @@ class rep_bug_state_duration extends rep_base { function rep_bug_state_duration($dbconn,$report) { - global $tutos; + global $tutos,$lang; loadmodule('bugtracking'); @@ -33,9 +33,11 @@ # echo $this->from->getYYYYMMDD(). $this->from->notime; $this->bugclass = array(); - if (isset($_GET['bugclass'])) { - if (is_array($_GET['bugclass'])) { - $this->bugclass = $_GET['bugclass']; + if (isset($_GET['bugclass']) && is_array($_GET['bugclass'])) { + foreach ($_GET['bugclass'] as $j) { + if (is_numeric(trim($j)) && isset($lang['BugClasses'][trim($j)])) { + $this->bugclass[] = trim($j); + } } } @@ -109,20 +111,16 @@ $r .= 'FILTERED '. $lang['BugClass'].': '; $pre_r = ''; foreach ($this->bugclass as $j) { - if (is_numeric($j)) { - $r .= $pre_r. $lang['BugClasses'][$j]; - $pre_r = " or "; - } + $r .= $pre_r. $lang['BugClasses'][$j]; + $pre_r = " or "; } $r .= "<br />"; $q .= $pre . "class in ("; $pre2 = ""; foreach ($this->bugclass as $j) { - if (is_numeric($j)) { - $q.= $pre2.$j; - $pre2 = ","; - } + $q.= $pre2.$j; + $pre2 = ","; } $q.= ")"; $pre = " AND "; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2016-08-13 16:02:15
|
Revision: 1296 http://sourceforge.net/p/tutos/code/1296 Author: gokohnert Date: 2016-08-13 16:02:13 +0000 (Sat, 13 Aug 2016) Log Message: ----------- new version Modified Paths: -------------- trunk/php/config_default.pinc Modified: trunk/php/config_default.pinc =================================================================== --- trunk/php/config_default.pinc 2016-08-13 14:13:31 UTC (rev 1295) +++ trunk/php/config_default.pinc 2016-08-13 16:02:13 UTC (rev 1296) @@ -743,7 +743,7 @@ // // The TUTOS Version number // -$tutos[version] = '1.11.20160104'; +$tutos[version] = '1.12.20160813'; // ### Local Variables: *** ### mode:iso-accents *** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2016-08-13 14:13:33
|
Revision: 1295 http://sourceforge.net/p/tutos/code/1295 Author: gokohnert Date: 2016-08-13 14:13:31 +0000 (Sat, 13 Aug 2016) Log Message: ----------- new release Modified Paths: -------------- trunk/Makefile trunk/homepage/download.html trunk/homepage/index.html Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2016-08-13 14:13:03 UTC (rev 1294) +++ trunk/Makefile 2016-08-13 14:13:31 UTC (rev 1295) @@ -16,7 +16,7 @@ # # Primary Version -VERSION = 1.11 +VERSION = 1.12 # # The full Version is VERSION.DATE # @@ -772,6 +772,12 @@ @$(CHMOD) 777 tutos_private/repository @$(CHMOD) 777 tutos_private/session # +# SVN +# make branch and tag +branch: + svn copy . ../branches/${VERSION} -m "start branch ${VERSION} " + svn copy . ../tags/RELEASE-${FULLVERSION} -m "tag release ${FULLVERSION}" +# # PHP Release # # php.list: ${PHP} ${LANGFILES} ${OTHER} ${HELP} updateconfig Modified: trunk/homepage/download.html =================================================================== --- trunk/homepage/download.html 2016-08-13 14:13:03 UTC (rev 1294) +++ trunk/homepage/download.html 2016-08-13 14:13:31 UTC (rev 1295) @@ -12,7 +12,7 @@ <p /> A <b>better overview</b> over released version is available at <a href="https://sourceforge.net/projects/tutos/files/ |
From: <gok...@us...> - 2016-08-13 14:13:06
|
Revision: 1294 http://sourceforge.net/p/tutos/code/1294 Author: gokohnert Date: 2016-08-13 14:13:03 +0000 (Sat, 13 Aug 2016) Log Message: ----------- fix Modified Paths: -------------- trunk/php/bugtracking/bug.pinc Modified: trunk/php/bugtracking/bug.pinc =================================================================== --- trunk/php/bugtracking/bug.pinc 2016-08-13 14:12:47 UTC (rev 1293) +++ trunk/php/bugtracking/bug.pinc 2016-08-13 14:13:03 UTC (rev 1294) @@ -601,7 +601,7 @@ } else if ($i->cid != -1) { $r .= ' <i>'. $lang['HistoryDeleted'] ."</i>\n"; } - if ($this->parent->tutos['bug_use_revision'] == 1) { + if (isset($this->parent->tutos) && $this->parent->tutos['bug_use_revision'] == 1) { $r .= '  <span align="right"><b>- '.$i->revision ." -</b></span>"; } $r .= '<br />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2016-08-13 14:12:49
|
Revision: 1293 http://sourceforge.net/p/tutos/code/1293 Author: gokohnert Date: 2016-08-13 14:12:47 +0000 (Sat, 13 Aug 2016) Log Message: ----------- more example Modified Paths: -------------- trunk/php/db/table_custom_example.pinc Modified: trunk/php/db/table_custom_example.pinc =================================================================== --- trunk/php/db/table_custom_example.pinc 2016-07-08 14:20:10 UTC (rev 1292) +++ trunk/php/db/table_custom_example.pinc 2016-08-13 14:12:47 UTC (rev 1293) @@ -368,6 +368,15 @@ $lang['INDID_'][124] = "do not use 2"; $tutos['deprecated']['INDID_'] = array(123,124); +/** + * set a default vi postinit hook + */ +function group_set_default(group $obj) { + if ($obj->_fld_salesgroup == '') + $obj->_fld_salesgroup = 19; +} +$tutos['postinit-hooks']['group'][] = 'group_set_default'; + // // Example in module_template // This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gok...@us...> - 2016-07-08 14:20:12
|
Revision: 1292 http://sourceforge.net/p/tutos/code/1292 Author: gokohnert Date: 2016-07-08 14:20:10 +0000 (Fri, 08 Jul 2016) Log Message: ----------- check against SQL Injection SYSS-2016-070 Credits: This security vulnerability was found by Christoph Ritter of the SySS GmbH. E-Mail: chr...@sy... Public Key: https://www.syss.de/fileadmin/dokumente/PGPKeys/Christoph_Ritter.asc Key Fingerprint: 9FB0 1B9B 2F72 3DD5 3AF3 62D8 0545 8E66 6D35 EAE8 Modified Paths: -------------- trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc Modified: trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc =================================================================== --- trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc 2016-07-08 14:18:44 UTC (rev 1291) +++ trunk/php/report-engine/rep_bug_state_duration/rep_bug_state_duration.pinc 2016-07-08 14:20:10 UTC (rev 1292) @@ -34,7 +34,9 @@ $this->bugclass = array(); if (isset($_GET['bugclass'])) { - $this->bugclass = $_GET['bugclass']; + if (is_array($_GET['bugclass'])) { + $this->bugclass = $_GET['bugclass']; + } } $this->stc = getObject($this->dbconn,$tutos['bug_state_stc']); @@ -83,14 +85,12 @@ } $x = new TUTOS_Date_Time(); - # calc the last state only if not CLOSED - # if (($lastState != BUG_STATE_CLOSED) && ($lastState != BUG_STATE_SOLVED)) { - if ($lastState != BUG_STATE_CLOSED) { - $stat[$lastState] += ($x->ts - $lastChange); - } - $lastChange = $x->ts; + if ($lastState != BUG_STATE_CLOSED) { + $stat[$lastState] += ($x->ts - $lastChange); + } + $lastChange = $x->ts; - return $r; + return $r; } function show(layout $ly) { @@ -109,16 +109,20 @@ $r .= 'FILTERED '. $lang['BugClass'].': '; $pre_r = ''; foreach ($this->bugclass as $j) { - $r .= $pre_r. $lang['BugClasses'][$j]; - $pre_r = " or "; + if (is_numeric($j)) { + $r .= $pre_r. $lang['BugClasses'][$j]; + $pre_r = " or "; + } } $r .= "<br />"; $q .= $pre . "class in ("; $pre2 = ""; foreach ($this->bugclass as $j) { - $q.= $pre2.$j; - $pre2 = ","; + if (is_numeric($j)) { + $q.= $pre2.$j; + $pre2 = ","; + } } $q.= ")"; $pre = " AND "; @@ -240,4 +244,4 @@ } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |