From: <tim...@us...> - 2012-07-16 17:49:28
|
Revision: 5510 http://web-erp.svn.sourceforge.net/web-erp/?rev=5510&view=rev Author: tim_schofield Date: 2012-07-16 17:49:22 +0000 (Mon, 16 Jul 2012) Log Message: ----------- Allow for full URL to be specified for the wiki, as suggested by Kalmer Piiskop Modified Paths: -------------- trunk/SystemParameters.php trunk/includes/MiscFunctions.php Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2012-07-16 03:32:07 UTC (rev 5509) +++ trunk/SystemParameters.php 2012-07-16 17:49:22 UTC (rev 5510) @@ -338,7 +338,7 @@ <th>' . _('Value') . '</th> <th>' . _('Notes') . '</th> </tr>'; - + echo '<tr><th colspan="3">' . _('General Settings') . '</th></tr>'; echo $TableHeader; @@ -389,7 +389,7 @@ // Check Credit Limits echo '<tr style="outline: 1px solid"><td>' . _('Check Credit Limits') . ':</td> <td><select name="X_CheckCreditLimits"> - <option '.($_SESSION['CheckCreditLimits']==0?'selected="selected" ':'').'value="0">'._('Do not check').'</option> + <option '.($_SESSION['CheckCreditLimits']==0?'selected="selected" ':'').'value="0">'._('Do not check').'</option> <option '.($_SESSION['CheckCreditLimits']==1?'selected="selected" ':'').'value="1">'._('Warn on breach').'</option> <option '.($_SESSION['CheckCreditLimits']==2?'selected="selected" ':'').'value="2">'._('Prohibit Sales').'</option> </select></td> @@ -473,8 +473,8 @@ //Blind packing note echo '<tr style="outline: 1px solid"><td>' . _('Show company details on packing slips') . ':</td> <td><select name="X_DefaultBlindPackNote"> - <option '.($_SESSION['DefaultBlindPackNote']=='1'?'selected="selected" ':'').'value="1">'._('Show Company Details').'</option> - <option '.($_SESSION['DefaultBlindPackNote']=='2'?'selected="selected" ':'').'value="2">'._('Hide Company Details').'</option> + <option '.($_SESSION['DefaultBlindPackNote']=='1'?'selected="selected" ':'').'value="1">'._('Show Company Details').'</option> + <option '.($_SESSION['DefaultBlindPackNote']=='2'?'selected="selected" ':'').'value="2">'._('Hide Company Details').'</option> </select></td> <td>' . _('Customer branches can be set by default not to print packing slips with the company logo and address. This is useful for companies that ship to customers customers and to show the source of the shipment would be inappropriate. There is an option on the setup of customer branches to ship blind, this setting is the default applied to all new customer branches') . '</td> </tr>'; @@ -482,9 +482,9 @@ // Working days on a week echo '<tr style="outline: 1px solid"><td>' . _('Working Days on a Week') . ':</td> <td><select name="X_WorkingDaysWeek"> - <option '.($_SESSION['WorkingDaysWeek']=='7'?'selected="selected" ':'').'value="7">7 '._('working days').'</option> - <option '.($_SESSION['WorkingDaysWeek']=='6'?'selected="selected" ':'').'value="6">6 '._('working days').'</option> - <option '.($_SESSION['WorkingDaysWeek']=='5'?'selected="selected" ':'').'value="5">5 '._('working days').'</option> + <option '.($_SESSION['WorkingDaysWeek']=='7'?'selected="selected" ':'').'value="7">7 '._('working days').'</option> + <option '.($_SESSION['WorkingDaysWeek']=='6'?'selected="selected" ':'').'value="6">6 '._('working days').'</option> + <option '.($_SESSION['WorkingDaysWeek']=='5'?'selected="selected" ':'').'value="5">5 '._('working days').'</option> </select></td> <td>' . _('Number of working days on a week') . '</td> </tr>'; @@ -859,7 +859,7 @@ echo '<tr style="outline: 1px solid"><td>' . _('Wiki Path') . ':</td> <td><input type="text" name="X_WikiPath" size="40" maxlength="40" value="' . $_SESSION['WikiPath'] . '" /></td> - <td>' . _('The path to the wiki installation to form the basis of wiki URLs - this should be the directory on the web-server where the wiki is installed. The wiki must be installed on the same web-server as webERP') .'</td></tr>'; + <td>' . _('The path to the wiki installation to form the basis of wiki URLs - or the full URL of the wiki.') .'</td></tr>'; echo '<tr style="outline: 1px solid"><td>' . _('Geocode Customers and Suppliers') . ':</td> <td><select name="X_geocode_integration">'; Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2012-07-16 03:32:07 UTC (rev 5509) +++ trunk/includes/MiscFunctions.php 2012-07-16 17:49:22 UTC (rev 5510) @@ -117,7 +117,7 @@ OR mb_strstr($CheckVariable,'&') OR mb_strstr($CheckVariable,"\\") OR mb_strstr($CheckVariable,'"') - OR mb_strstr($CheckVariable,'>') + OR mb_strstr($CheckVariable,'>') OR mb_strstr($CheckVariable,'<')){ return true; @@ -230,13 +230,17 @@ function wikiLink($type, $id) { - + if (strstr($_SESSION['WikiPath'], 'http:')) { + $WikiPath=$_SESSION['WikiPath']; + } else { + $WikiPath='../' . $_SESSION['WikiPath'] . '/'; + } if ($_SESSION['WikiApp']==_('WackoWiki')){ - echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/' . $type . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</a><br />'; + echo '<a target="_blank" href="' . $WikiPath . $type . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</a><br />'; } elseif ($_SESSION['WikiApp']==_('MediaWiki')){ - echo '<a target="_blank" href="../' . $_SESSION['WikiPath'] . '/index.php/' . $type . '/' . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</a><br />'; + echo '<a target="_blank" href="' . $WikiPath . $_SESSION['WikiPath'] . '/index.php/' . $type . '/' . $id . '">' . _('Wiki ' . $type . ' Knowlege Base') . '</a><br />'; } elseif ($_SESSION['WikiApp']==_('DokuWiki')){ - echo ' ../' . $_SESSION['WikiPath'] . '/doku.php?id=' . $type . ':' . $id . ' ' . _('Wiki ' . $type . ' Knowlege Base') . ' <br />'; + echo $WikiPath . $_SESSION['WikiPath'] . '/doku.php?id=' . $type . ':' . $id . ' ' . _('Wiki ' . $type . ' Knowlege Base') . ' <br />'; } }//wikiLink @@ -342,7 +346,7 @@ /*It is possible if the user entered the $DecimalPoint as a thousands separator and the $DecimalPoint is a comma that the result of this could contain several periods "." so need to ditch all but the last "." */ if (mb_substr_count($SQLFormatNumber,'.')>1){ return str_replace('.','',mb_substr($SQLFormatNumber,0,mb_strrpos($SQLFormatNumber,'.'))) . mb_substr($SQLFormatNumber,mb_strrpos($SQLFormatNumber,'.')); - + echo '<br /> Number of periods: ' . $NumberOfPeriods . ' $SQLFormatNumber = ' . $SQLFormatNumber; } else { @@ -351,7 +355,7 @@ } -function indian_number_format($Number,$DecimalPlaces){ +function indian_number_format($Number,$DecimalPlaces){ $IntegerNumber = intval($Number); $DecimalValue = $Number - $IntegerNumber; if ($DecimalPlaces !='Variable'){ @@ -372,20 +376,20 @@ $DecimalValue =''; } } - if(strlen($IntegerNumber)>3){ - $LastThreeNumbers = substr($IntegerNumber, strlen($IntegerNumber)-3, strlen($IntegerNumber)); - $RestUnits = substr($IntegerNumber, 0, strlen($IntegerNumber)-3); // extracts the last three digits - $RestUnits = (strlen($RestUnits)%2 == 1)?'0'.$RestUnits:$RestUnits; // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping. + if(strlen($IntegerNumber)>3){ + $LastThreeNumbers = substr($IntegerNumber, strlen($IntegerNumber)-3, strlen($IntegerNumber)); + $RestUnits = substr($IntegerNumber, 0, strlen($IntegerNumber)-3); // extracts the last three digits + $RestUnits = (strlen($RestUnits)%2 == 1)?'0'.$RestUnits:$RestUnits; // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping. $FirstPart =''; - $ExplodedUnits = str_split($RestUnits, 2); - for($i=0; $i<sizeof($ExplodedUnits); $i++){ - $FirstPart .= intval($ExplodedUnits[$i]).','; // creates each of the 2's group and adds a comma to the end - } - - return $FirstPart.$LastThreeNumbers.$DecimalValue; - } else { + $ExplodedUnits = str_split($RestUnits, 2); + for($i=0; $i<sizeof($ExplodedUnits); $i++){ + $FirstPart .= intval($ExplodedUnits[$i]).','; // creates each of the 2's group and adds a comma to the end + } + + return $FirstPart.$LastThreeNumbers.$DecimalValue; + } else { return $IntegerNumber. $DecimalValue; - } -} + } +} ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |