Skip to content

Commit

Permalink
Tidy.
Browse files Browse the repository at this point in the history
  • Loading branch information
juppe committed Dec 31, 2015
1 parent caa8a5a commit f1e5268
Show file tree
Hide file tree
Showing 47 changed files with 468 additions and 427 deletions.
5 changes: 3 additions & 2 deletions inc/cookie_functions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ if (!function_exists("handle_cookie")) {
/**
* Handlaa cookien settauksen ja unsettauksen
*
* @param string $nimi Cookien ja inputin nimi
* @param string $formin_submitti Submitattavan formin submit-nappulan nimi
* @param string $nimi Cookien ja inputin nimi
* @param string $formin_submitti Submitattavan formin submit-nappulan nimi
*/


function handle_cookie($nimi, $formin_submitti) {
if (isset($_POST[$formin_submitti]) && !isset($_POST[$nimi])) {
setcookie($nimi, "", time() - 3600);
Expand Down
4 changes: 3 additions & 1 deletion inc/functions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -32058,10 +32058,12 @@ if (!function_exists("hae_tuoteperhe")) {
}

if (!function_exists('generoi_hinnastot')) {


/**
* Generoi annetulle tuottelle hinnaston valuutoille, joilta l�ytyy hinnastokurssi
*
* @param int $tuote_tunnus Tuotteen tunnus
* @param int $tuote_tunnus Tuotteen tunnus
*
* @return bool Luotiinko tai p�ivitettink� hinnasto
*/
Expand Down
15 changes: 8 additions & 7 deletions inc/pankkiyhteys_functions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ function sepa_lataa_kaikki_uudet_tiedostot($params) {
* Generoi private keyn ja certificate signing requestin. Osa signing requestin tiedoista haetaan
* yhtiorowista. Palauttaa arrayn, jossa private_key ja csr.
*
* @param array $params
* @param array $params
*
* @return array
*/
Expand Down Expand Up @@ -1030,11 +1030,11 @@ function generoi_private_key_ja_csr($params = array()) {
$subject = "/" . implode("/", $csr_info);
$passphrase = openssl_random_pseudo_bytes(100);
$command = escapeshellcmd("openssl req " .
"-newkey rsa:{$key_bits} " .
"-passout stdin " .
"-keyout {$key_path} " .
"-out {$csr_path} " .
"-subj '{$subject}'");
"-newkey rsa:{$key_bits} " .
"-passout stdin " .
"-keyout {$key_path} " .
"-out {$csr_path} " .
"-subj '{$subject}'");

mkdir($csr_dir);

Expand Down Expand Up @@ -1177,10 +1177,11 @@ function parameter($param) {
return empty($param) ? '' : $param;
}


/**
* Palauttaa tilin saldon. Toimii toistaiseksi ainoastaan OP:n kanssa
*
* @param array $params
* @param array $params
*
* @return array|bool Saldo ja valuutta tai false, jos jokin meni vikaan
*/
Expand Down
6 changes: 3 additions & 3 deletions inc/pankkiyhteys_tilioteviite.inc
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ if ($tee == "valitse") {
echo "<br><br>";

$saldo = hae_tilin_saldo(array(
"pankkiyhteys_tunnus" => $pankkiyhteys_tunnus,
"pankkiyhteys_salasana" => $salasana
));
"pankkiyhteys_tunnus" => $pankkiyhteys_tunnus,
"pankkiyhteys_salasana" => $salasana
));

if ($saldo) {
echo "<table>";
Expand Down
2 changes: 1 addition & 1 deletion inc/yhtion_parametritrivi.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3644,7 +3644,7 @@ if ($fieldname == "myyntiera_pyoristys" ) {

$sela = $selb = "";

$sel = array($trow[$i] => 'selected') + array('','K','S');
$sel = array($trow[$i] => 'selected') + array('', 'K', 'S');

$ulos = "<td><select name='{$nimi}' ".js_alasvetoMaxWidth($nimi, 400).">
<option value = ' '>".t("Myyntirivin määrää ei pyöristetä seuraavaan täyteen myyntierään")."</option>
Expand Down
8 changes: 4 additions & 4 deletions korjaa_alv-tilioinnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

// otetaan includepath aina rootista
ini_set("include_path", ini_get("include_path").PATH_SEPARATOR.dirname(__FILE__).PATH_SEPARATOR."/usr/share/pear");
#error_reporting(E_ALL);
#ini_set("display_errors", 1);
//error_reporting(E_ALL);
//ini_set("display_errors", 1);

// otetaan tietokanta connect
require "inc/connect.inc";
require "inc/functions.inc";

// Pupeasennuksen root
$pupe_root_polku = dirname(__FILE__);
#$pupe_root_polku = "/Users/satu/Dropbox/Sites/pupesoft/";
//$pupe_root_polku = "/Users/satu/Dropbox/Sites/pupesoft/";

if (!isset($argv[1]) or !isset($argv[2]) or !isset($argv[3])) {
echo utf8_encode("VIRHE: pakollisia parametreja puuttu!")."\n";
Expand Down Expand Up @@ -115,7 +115,7 @@

$kulu_chk_row['summa'] -= $alvin_ero;
list($_tunnus, ) = explode(',', $new_alv_chk_row['tunnukset']);
echo utf8_encode("$laskurow[laskunro], $laskurow[tapvm], $laskurow[tunnus], $laskurow[nimi], $laskurow[yhtio_toimipaikka], $old_alv_chk_row[summa], $new_alv_chk_row[summa], $_tunnus, ero: $alvin_ero")."\n";
echo utf8_encode("$laskurow[laskunro], $laskurow[tapvm], $laskurow[tunnus], $laskurow[nimi], $laskurow[yhtio_toimipaikka], $old_alv_chk_row[summa], $new_alv_chk_row[summa], $_tunnus, ero: $alvin_ero")."\n";
$kpl += $kpl;

kopioitiliointi($kulu_chk_row['tunnus'], $kukamuuttaa);
Expand Down
18 changes: 9 additions & 9 deletions lue_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ function lue_data_echo($string, $now = false) {
elseif ($table_mysql == 'tili' and $otsikko == 'OLETUS_ALV' and ($taulunrivit[$taulu][$eriviindex][$r] == "" or $taulunrivit[$taulu][$eriviindex][$r] == "NULL")) {
$query .= ", $otsikko = NULL ";
}
elseif ($table_mysql == 'maksuehto' and in_array($otsikko, array('ABS_PVM','KASSA_ABSPVM')) and (empty($taulunrivit[$taulu][$eriviindex][$r]) or in_array($taulunrivit[$taulu][$eriviindex][$r], array('0000-00-00','NULL')))) {
elseif ($table_mysql == 'maksuehto' and in_array($otsikko, array('ABS_PVM', 'KASSA_ABSPVM')) and (empty($taulunrivit[$taulu][$eriviindex][$r]) or in_array($taulunrivit[$taulu][$eriviindex][$r], array('0000-00-00', 'NULL')))) {
$query .= ", $otsikko = NULL ";
}
elseif ($table_mysql == 'tuote' and $otsikko == 'MYYNTIHINTA' and $myyntihinnan_paivitys == 1) {
Expand Down Expand Up @@ -1982,7 +1982,7 @@ function lue_data_echo($string, $now = false) {
elseif ($table_mysql == 'tili' and $otsikko == 'OLETUS_ALV' and ($taulunrivit[$taulu][$eriviindex][$r] == "" or $taulunrivit[$taulu][$eriviindex][$r] == "NULL")) {
$query .= ", $otsikko = NULL ";
}
elseif ($table_mysql == 'maksuehto' and in_array($otsikko, array('ABS_PVM','KASSA_ABSPVM')) and (empty($taulunrivit[$taulu][$eriviindex][$r]) or in_array($taulunrivit[$taulu][$eriviindex][$r], array('0000-00-00','NULL')))) {
elseif ($table_mysql == 'maksuehto' and in_array($otsikko, array('ABS_PVM', 'KASSA_ABSPVM')) and (empty($taulunrivit[$taulu][$eriviindex][$r]) or in_array($taulunrivit[$taulu][$eriviindex][$r], array('0000-00-00', 'NULL')))) {
$query .= ", $otsikko = NULL ";
}
elseif ($eilisataeikamuuteta == "") {
Expand Down Expand Up @@ -2340,13 +2340,13 @@ function lue_data_echo($string, $now = false) {

// Synkronoidaan
if (stripos($yhtiorow["synkronoi"], $table_mysql) !== FALSE) {
if ($taulunrivit[$taulu][$eriviindex][$postoiminto] == 'LISAA') {
$syncrow = array();
}
else {
$syncrow = mysql_fetch_array($syncres);
$tunnus = $syncrow["tunnus"];
}
if ($taulunrivit[$taulu][$eriviindex][$postoiminto] == 'LISAA') {
$syncrow = array();
}
else {
$syncrow = mysql_fetch_array($syncres);
$tunnus = $syncrow["tunnus"];
}

synkronoi($kukarow["yhtio"], $table_mysql, $tunnus, $syncrow, "");
}
Expand Down
12 changes: 6 additions & 6 deletions monistalasku.php
Original file line number Diff line number Diff line change
Expand Up @@ -1759,12 +1759,12 @@
$toim == 'TILAUS' or
$toim == 'OSTOTILAUS' or
$toim == 'ENNAKKOTILAUS') or
($toim == '' and
$kumpi == 'REKLAMA' and
isset($kaytetaanhyvityshintoja[$lasku]) and
$kaytetaanhyvityshintoja[$lasku] != '' and
count($palautus) > 0) or
$sailyta_rivikommentit[$lasku] == "on") {
($toim == '' and
$kumpi == 'REKLAMA' and
isset($kaytetaanhyvityshintoja[$lasku]) and
$kaytetaanhyvityshintoja[$lasku] != '' and
count($palautus) > 0) or
$sailyta_rivikommentit[$lasku] == "on") {
$rvalues .= ", '{$rivirow['kommentti']}'";
}
else {
Expand Down
2 changes: 1 addition & 1 deletion myyntires/karhu.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@

echo "<tr><th>".t("Sähköposti")."</th>";
echo "<td>";
# Annetaan käyttäjän valita asiakkaan takaa löytyvä sähköpostiosoite jos on useita
// Annetaan käyttäjän valita asiakkaan takaa löytyvä sähköpostiosoite jos on useita
echo "<select name='karhu_email'>";
$email_vaihtoehdot = '';
if (!empty($asiakastiedot['talhal_email'])) {
Expand Down
2 changes: 1 addition & 1 deletion myyntires/myyntilaskuhaku.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function kuka_kayttaja($keta_haetaan) {
</select></td>
</tr>";

$sel = array_fill_keys(array($tee), " selected") + array_fill_keys(array('S', 'VS', 'N', 'V', 'L', 'A', 'LN','M'), '');
$sel = array_fill_keys(array($tee), " selected") + array_fill_keys(array('S', 'VS', 'N', 'V', 'L', 'A', 'LN', 'M'), '');

echo "<tr>";
echo "<th>".t("Hakulaji")."</th>";
Expand Down
2 changes: 1 addition & 1 deletion pdflib/phppdflib.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ function jfif_embed($data) {
* this is really a JFIF stream
*/
if (!in_array(substr($data, 0, 4), array("\xff\xd8\xff\xe0", "\xff\xd8\xff\xe1")) ||
!in_array(strtoupper(substr($data, 6, 4)), array("JFIF", "EXIF"))
!in_array(strtoupper(substr($data, 6, 4)), array("JFIF", "EXIF"))
) {
// This is not in JFIF or EXIF format
$this->_push_std_error(6008);
Expand Down
18 changes: 10 additions & 8 deletions rajapinnat/edi_presta.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ class EdiPresta {
/**
* Creates file in EDI-format from sales order
*
* @param array $sales_order
* @param string $filepath_base
* @param array $sales_order
* @param string $filepath_base
* @return string
* @throws Exception
*/


public static function create($sales_order, $filepath_base) {
if (empty($sales_order)) {
throw new Exception('Myyntitilauksen edi-sanoman luominen epäonnistui');
Expand Down Expand Up @@ -79,8 +81,8 @@ public static function create($sales_order, $filepath_base) {

//Jos tilauksella on rahtikulu niin lisätään tilaukselle rahtikulurivi
$rahtirivi = array(
'row_number' => $row_number,
'sales_order_id' => $sales_order['external_system_id'],
'row_number' => $row_number,
'sales_order_id' => $sales_order['external_system_id'],
);
if ($sales_order['rahti_veroton'] != 0) {
self::add_row($rahtirivi, $edi_msg);
Expand All @@ -98,8 +100,8 @@ public static function create($sales_order, $filepath_base) {

/**
*
* @param array $tilausrivi
* @param string $edi_msg
* @param array $tilausrivi
* @param string $edi_msg
*/
private static function add_row($tilausrivi, &$edi_msg) {
$kpl = $tilausrivi['tilkpl'];
Expand Down Expand Up @@ -128,8 +130,8 @@ private static function add_row($tilausrivi, &$edi_msg) {

/**
*
* @param string $edi_msg
* @param string $filepath
* @param string $edi_msg
* @param string $filepath
* @return string
* @throws Exception
*/
Expand Down
12 changes: 7 additions & 5 deletions rajapinnat/logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ public function __destruct() {

/**
*
* @param string $message
* @param string $message
* @param Exception $exception
*/


public function log($message, $exception = null) {
if (!is_null($exception)) {
$message = $this->exception_message($exception, $message);
Expand All @@ -41,15 +43,15 @@ public function log($message, $exception = null) {

/**
*
* @param string $date_format
* @param string $date_format
*/
public function set_date_format($date_format) {
$this->date_format = $date_format;
}

/**
*
* @param string $message
* @param string $message
* @throws RuntimeException
*/
private function write($message) {
Expand All @@ -64,7 +66,7 @@ private function write($message) {
* Returns message with exception message
*
* @param Exception $exception
* @param string $message
* @param string $message
* @return string
*/
private function exception_message($exception, $message = '') {
Expand All @@ -74,7 +76,7 @@ private function exception_message($exception, $message = '') {
/**
* Timestamps log lines
*
* @param string $message
* @param string $message
* @return string
*/
private function format_message($message) {
Expand Down
Loading

0 comments on commit f1e5268

Please sign in to comment.