瀏覽代碼

Merge branch 'master' of bn.git:plabudda/se

Piotr Labudda 8 年之前
父節點
當前提交
d8fe0e73c5

+ 18 - 1
SE/schema/default_db_xml_cache.public/build_recurse_ant.xsl

@@ -80,6 +80,8 @@
     <xsl:param name="get_wfs" required="yes"/>
     <xsl:param name="debug_xsl_out_filename" required="yes" />  
     <xsl:param name="debug" select="1"/>
+    <xsl:param name="recurse_ant_basedir.recurse_cache" />
+    <xsl:param name="build_recurse_ant_cache_control.xsl" />
     <xsl:param name="typeNameRoot" required="yes"/><!-- to cache purpose - to allow child elements cache created to be named from this typeNameRoot -->
     <xsl:param name="input_obj_fid_forced"/><!-- to force by build_root.xml (loop) -->
     <!--<xsl:variable name="temp_current">
@@ -525,6 +527,9 @@
                                 <xsl:with-param name="loop_path_recurs_xpath" select="$loop_path_recurs_xpath"/>
                                 <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
                                 <xsl:with-param name="feature_pos" select="$feature_pos"/>
+                                <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
+                                <!-- debug only below CACHE -->
+                                    <xsl:with-param name="typeName_dita" select="$typeName_dita"/>
                                 <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
                                 <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
                             </xsl:apply-templates>
@@ -1019,6 +1024,9 @@
         <xsl:param name="loop_path_recurs_xpath" required="yes"/>
         <xsl:param name="feature_pos_parent" required="yes"/>
         <xsl:param name="feature_pos" required="yes"/>
+        <xsl:param name="input_obj_fid" />
+        <xsl:param name="typeName_dita"/> <!-- debug cache only  -->
+        <xsl:param name="xpath_value_dita"/>
         <!-- dajemy wpis o walidacji danego feature pod katem xpath_query -->
         <xsl:if test="$debug &gt; 1"><echo>#684 dajemy wpis o walidacji danego feature pod katem xpath_query dla $featureID_name_dita=<xsl:value-of select="$featureID_name_dita"/> </echo></xsl:if>
         <!--<sleep>
@@ -1169,6 +1177,11 @@
                 <param name="ant-launcher.jar" expression="{$ant-launcher.jar}"/>
                 <param name="process_locks" expression="{$process_locks}"/>
                 <param name="uuid" expression="{$uuid}"/>
+                <param name="xml_id" expression="{@xml_id}"/>
+                <param name="typeNameRoot" expression="{$typeNameRoot}"/>
+                <param name="recurse_ant_basedir.recurse_cache" expression="{$recurse_ant_basedir.recurse_cache}"/>
+                <param name="feature_pos_parent" expression="{$feature_pos_parent}"/>
+                <param name="feature_pos" expression="{$feature_pos}"/>
                 <classpath location="/opt/local/share/java/saxon9he.jar"/>
             </xsl:element>
             <!-- delete tempfiles -->
@@ -1505,7 +1518,7 @@
             <xsl:with-param name="feature_pos_parent" select="$feature_pos_parent"/>
             <xsl:with-param name="feature_pos" select="$feature_pos"/>
             <xsl:with-param name="input_obj_fid" select="$input_obj_fid"/>
-            <xsl:with-param name="typeName_dita" select="$typeName_dita"/> <!-- debug cache only  -->
+                <xsl:with-param name="typeName_dita" select="$typeName_dita"/> <!-- debug cache only  -->
             <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
             <!--<xsl:with-param name="loop_path_recurs" select="$loop_path_recurs"/>-->
         </xsl:apply-templates>
@@ -1746,6 +1759,9 @@
                                             </param>
                                             <param name="process_locks" expression="{$process_locks}"/>
                                             <param name="get_wfs" expression="{$get_wfs}"/>
+                                            <param name="recurse_ant_basedir.recurse_cache" expression="{$recurse_ant_basedir.recurse_cache}"/>
+                                            <param name="build_recurse_ant_cache_control.xsl" expression="{$build_recurse_ant_cache_control.xsl}"/>
+                                            <param name="typeNameRoot" expression="{$typeNameRoot}"/>
                                     </xslt>
                             </xsl:element>
                         <!-- zapisujemy wynik naszego biezacego przetwarzania dita element nizej do kolejnego przejechania z ant wyniku dla podstawienia danych  -->
@@ -1991,6 +2007,7 @@
         <xsl:param name="input_obj_with_xpath" required="yes"/>
         <xsl:param name="feature_pos"  required="yes"/>
         <xsl:param name="feature_pos_parent"  required="yes"/>
+        <xsl:param name="input_obj_fid" required="no"/>
         <xsl:for-each select=".">
             <xsl:choose>
                 <!--<xsl:when test="node()='topic'">asdad</xsl:when>-->

+ 1 - 1
SE/schema/default_db_xml_cache.public/build_recurse_ant_merge_dita_from_temp.xsl

@@ -864,6 +864,6 @@
         </xsl:choose>
     </xsl:template>
     
-    <xsl:template match="@xml_id|@xpath_token_filter|@xpath_token|@format"/>
+    <xsl:template match="@xml_id|@xpath_token_filter|@xpath_token|@format|@fid"/>
         
 </xsl:stylesheet>

+ 2 - 2
SE/schema/default_db_xml_cache.public/builds_to_ant.xsl

@@ -148,11 +148,11 @@
                                         <arg value="-buildfile"/>
                                         <arg value="{$temp}/{$loop_xpath}/{.}/build.xml"/>
                                     </java>
-                                    <loadfile  property="builds_to_ant_cache_fid_ant{$loop_path_recurs}{$loop_xpath_real}{$xml_id}.{$feature_pos_parent}.{position()}" srcfile="{$temp}/{$loop_xpath}/{position()}.fid_parent.txt"/>
+                                    <!--<loadfile  property="builds_to_ant_cache_fid_ant{$loop_path_recurs}{$loop_xpath_real}{$xml_id}.{$feature_pos_parent}.{position()}" srcfile="{$temp}/{$loop_xpath}/{position()}.fid_parent.txt"/>-->
                                     
                                     <!-- THIS SHOULD BE THE SAME AS IN build_recurse_ant.xsl/builds_to_ant.xsl (to be template) line 1000 name CACHE_COPY_TASK - EOF -->
                                     
-                                    <echo> #146 builds_to_ant detected fid *.fid_parent.txt <xsl:value-of select="concat('${builds_to_ant_cache_fid_ant',$loop_path_recurs,$loop_xpath_real,$xml_id,'.',$feature_pos_parent,'.', position(),'}')"/></echo>
+                                    <!--<echo> #146 builds_to_ant detected fid *.fid_parent.txt <xsl:value-of select="concat('${builds_to_ant_cache_fid_ant',$loop_path_recurs,$loop_xpath_real,$xml_id,'.',$feature_pos_parent,'.', position(),'}')"/></echo>-->
                                    
                                    <!-- <mkdir>
                                         <xsl:attribute name="dir" select="concat($recurse_ant_basedir.recurse_cache,'/',system_cache__appinfo:escape_object_prefix_to_string($typeNameRoot),'.','${builds_to_ant_cache_fid_ant',$loop_path_recurs,$loop_xpath_real,$xml_id,'.',$feature_pos_parent,'.', position(),'}')"/>

+ 53 - 0
SE/se-lib/Route/Install.php

@@ -272,6 +272,7 @@ jQuery(document).ready(function () {
 		}
 
 		{
+/*
 			$phpFiles = array();
 			$skipPhpFiles = array();
 			$skipPhpFiles[] = 'bash_sync_perms.php';
@@ -297,6 +298,7 @@ jQuery(document).ready(function () {
 			$skipPhpFiles[] = 'se-lib/Route/UrlAction/WmsGenerate.php';
 			$skipPhpFiles[] = 'se-lib/Route/UrlAction/BiAuditGenerate.php';
 			$skipPhpFiles[] = 'superedit-DB_PROCEDURES_CREATE.php';
+			$skipPhpFiles[] = 'se-lib/Theme.php';
 			//$skipPhpFiles[] = '';
 
 			$skipPhpFiles[] = 'se-lib/DataSourceException.php';
@@ -324,9 +326,41 @@ jQuery(document).ready(function () {
 
 			DBG::_(true, true, 'phpFiles', $phpFiles, __CLASS__, __FUNCTION__, __LINE__);
 			if (empty($phpFiles)) throw new Exception("No php files to encode");
+*/
+
+			$domainEncodePhpFiles = [
+				'ant.php',
+				'api.php',
+				'budynki.php',
+				'index-ajax.php',
+				'index.php',
+				'procesy5.php',
+				'session-expire.php',
+				'test-sync.php',
+				'wfs-data.php',
+				'wfs-qgis.php',
+				'wfs.php',
+                        ];
+			$freeEncodePhpFiles = [];
+
+			$cmd = "cd {$installPath}/SE && find . -name '*.php' ";
+			$out = ''; $ret = '';
+			exec($cmd, $out, $ret);
+			echo'<pre>cmd: '. $cmd . ': (return:'.$ret.')'."\n";print_r($out);echo'</pre>';
+			if (0 !== $ret) throw new Exception("Error at find php files");
+			if (empty($out)) throw new Exception("No php files found");
+			foreach ($out as $phpFilePath) {
+				$phpFilePath = ('./' == substr($phpFilePath, 0, 2))? substr($phpFilePath, 2) : $phpFilePath;
+				if (in_array($phpFilePath, $domainEncodePhpFiles)) continue;
+				$freeEncodePhpFiles[] = $phpFilePath;
+			}
+
+			DBG::_(true, true, 'freeEncodePhpFiles', $freeEncodePhpFiles, __CLASS__, __FUNCTION__, __LINE__);
+			if (empty($freeEncodePhpFiles)) throw new Exception("No php files to encode");
 		}
 
 		{
+/*
 			$cmd = "cd {$installPath}/SE && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder {$phpVersionsForSgencoder} -b- ";
 			foreach ($appLicenceInfo->domains as $domain) {
 				$cmd .= " --domain {$domain} ";
@@ -338,6 +372,25 @@ jQuery(document).ready(function () {
 			echo'<pre>cmd: '. $cmd . ': (return:'.$ret.')'."\n";print_r($out);echo'</pre>';
 			if (0 !== $ret) throw new Exception("Error at encode files");
 			if (empty($out)) throw new Exception("No output for encode files command");
+*/
+
+			$cmdTempl = "cd {$installPath}/SE && /Applications/SourceGuardian.app/Contents/MacOS/sgencoder {$phpVersionsForSgencoder} -b- ";
+			$cmdDomainEncodeDomainsTempl = " --domain " . implode(" --domain ", array_merge($appLicenceInfo->domains, ['localhost']));
+			$cmdDomainEncodeFilesTempl = " " . implode(" ", $domainEncodePhpFiles);
+			$cmdFreeEncodeFilesTempl = " " . implode(" ", $freeEncodePhpFiles);
+
+			$cmds = [
+				$cmdTempl . $cmdDomainEncodeDomainsTempl . $cmdDomainEncodeFilesTempl,
+				$cmdTempl . $cmdFreeEncodeFilesTempl,
+			];
+
+			foreach ($cmds as $cmd) {
+				$out = ''; $ret = '';
+				exec($cmd, $out, $ret);
+				echo'<pre>cmd: '. $cmd . ': (return:'.$ret.')'."\n";print_r($out);echo'</pre>';
+				if (0 !== $ret) throw new Exception("Error at encode files");
+				if (empty($out)) throw new Exception("No output for encode files command");
+			}
 		}
 	}
 

+ 10 - 0
SE/se-lib/Route/UrlAction/BiAuditGenerate.php

@@ -521,6 +521,12 @@ where `REMOTE_PRIMARY_KEY` = '{$this->SOURCE['ID']}'";
 					SE_Layout::alert('success', "Pomyślnie zaimportowano " . count($personId) . " pracownik" . ((count($personId) == 1) ? "a" : "ów"));
 					$this->importKrsToPracownicyForm();
 					return;
+				case "addKrsCompanyToKontrachenci":
+					$krsId = V::get('krsId', 0, $_POST, int);
+					if (!$krsId) throw new Exception("Błąd formularza");
+					$query = "insert into BI_audit_ENERGA_RUM_KONTRAHENCI (uwagi, Pelna_nazwa_kontrahenta, REGON, NIP, KRS) select 'import z KRS', nazwa, regon, nip, krs from BI_audit_KRS where ID = ".$krsId." ";
+					DB::getPDO()->query($query);	
+					return;
 			}
 
 			if ($krsId) {
@@ -581,6 +587,7 @@ where `REMOTE_PRIMARY_KEY` = '{$this->SOURCE['ID']}'";
               <td>KRS</td>
               <td>NIP</td>
               <td>Regon</td>
+              <td>(Akcja)</td>
 <?php
 		if (count($result) > 1) {
 ?>
@@ -611,6 +618,9 @@ where `REMOTE_PRIMARY_KEY` = '{$this->SOURCE['ID']}'";
               <td><?=$row['krs']?></td>
               <td><?=$row['nip']?></td>
               <td><?=$row['regon']?></td>
+              <td>
+	              <button type="submit" class="btn btn-primary" name="subaction" value="addKrsCompanyToKontrachenci">Dodaj firme do kontrachentow.</button>
+			  </td>
 <?php
 		if (count($result) > 1) {
 ?>

+ 1 - 0
SE/superedit-INSTALL_SES_PROCESY_A.php

@@ -2483,6 +2483,7 @@ function MAKE_PKG_COMPONENT($h,$installer_dir_tar,$installer_url,$installer_tmp,
 				$skipPhpFiles[] = 'UI.php';
 				$skipPhpFiles[] = 'Request.php';
 				$skipPhpFiles[] = 'BiAuditGenerate.php';
+				$skipPhpFiles[] = 'Theme.php';
 				$skipPhpFiles[] = 'bash_Route_Users_Task_syncUser.php';
 				$skipPhpFiles[] = 'bash_Route_Users_Task_syncGroup.php';
 				$skipPhpFiles[] = 'bash_force_classified_table_by_GroupID.php';