[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4479 - in phpcompta/trunk: html html/admin/sql/patch in
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4479 - in phpcompta/trunk: html html/admin/sql/patch include include/template |
Date: |
Sun, 27 Nov 2011 03:20:13 +0100 (CET) |
Author: danydb
Date: 2011-11-27 03:20:11 +0100 (Sun, 27 Nov 2011)
New Revision: 4479
Modified:
phpcompta/trunk/html/admin/sql/patch/upgrade97.sql
phpcompta/trunk/html/ajax_misc.php
phpcompta/trunk/html/do.php
phpcompta/trunk/html/style.css
phpcompta/trunk/include/ac_common.php
phpcompta/trunk/include/class_acc_ledger.php
phpcompta/trunk/include/class_database.php
phpcompta/trunk/include/class_extension.php
phpcompta/trunk/include/class_pre_op_ach.php
phpcompta/trunk/include/class_pre_op_advanced.php
phpcompta/trunk/include/class_pre_op_ven.php
phpcompta/trunk/include/class_pre_operation.php
phpcompta/trunk/include/menu.inc.php
phpcompta/trunk/include/search.inc.php
phpcompta/trunk/include/template/param_jrn.php
Log:
fix small cosmetic bugs
Modified: phpcompta/trunk/html/admin/sql/patch/upgrade97.sql
===================================================================
--- phpcompta/trunk/html/admin/sql/patch/upgrade97.sql 2011-11-26 14:59:15 UTC
(rev 4478)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade97.sql 2011-11-27 02:20:11 UTC
(rev 4479)
@@ -69,7 +69,7 @@
end;
$BODY$
LANGUAGE plpgsql;
-
+
DROP FUNCTION comptaproc.account_insert(integer, text);
CREATE OR REPLACE FUNCTION comptaproc.account_insert(p_f_id integer, p_account
text)
@@ -170,7 +170,7 @@
begin
if length(trim(p_account)) != 0 then
- -- 2 accounts in card separated by comma
+ -- 2 accounts in card separated by comma
if position (',' in p_account) = 0 then
select count(*) into nCount from tmp_pcmn where
pcm_val=p_account;
if nCount = 0 then
@@ -193,13 +193,13 @@
raise exception 'Too many comas, invalid account';
end if;
-- check that both account are in PCMN
-
+
end if;
else
-- account is null
update fiche_detail set ad_value=null where f_id=p_f_id and
ad_id=5 ;
end if;
-
+
update fiche_detail set ad_value=p_account where f_id=p_f_id and
ad_id=5 ;
return 0;
@@ -230,7 +230,7 @@
end;
$BODY$
LANGUAGE plpgsql;
-
+
COMMENT ON FUNCTION comptaproc.format_account(account_type) IS 'format the
accounting :
- upper case
- remove space and special char.
@@ -256,7 +256,7 @@
r_record tmp_pcmn%ROWTYPE;
begin
r_record := NEW;
-if length(trim(r_record.pcm_type))=0 or r_record.pcm_type is NULL then
+if length(trim(r_record.pcm_type))=0 or r_record.pcm_type is NULL then
r_record.pcm_type:=find_pcm_type(NEW.pcm_val);
return r_record;
end if;
@@ -729,8 +729,6 @@
ALTER TABLE ONLY profile_menu ADD CONSTRAINT profile_menu_p_id_fkey FOREIGN
KEY (p_id) REFERENCES profile(p_id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY profile_menu ADD CONSTRAINT profile_menu_type_fkey FOREIGN
KEY (p_type_display) REFERENCES profile_menu_type(pm_type);
ALTER TABLE ONLY profile_user ADD CONSTRAINT profile_user_p_id_fkey FOREIGN
KEY (p_id) REFERENCES profile(p_id) ON UPDATE CASCADE ON DELETE CASCADE;
-insert into
menu_ref(me_code,me_menu,me_file,me_description,me_type,me_parameter) select
ex_code,ex_name,ex_file,ex_desC,'PL','plugin_code='||ex_code from extension;
-insert into profile_menu (me_code,me_code_dep,p_id,p_type_display) select
me_code,'EXTENSION',1,'S' from menu_ref where me_type='PL';
create type menu_tree as (code text,description text);
create or replace function comptaproc.get_profile_menu(login text)
@@ -741,16 +739,16 @@
a menu_tree;
e menu_tree;
begin
-for a in select me_code,me_description from v_all_menu where user_name=login
+for a in select me_code,me_description from v_all_menu where user_name=login
and me_code_dep is null and me_type <> 'PR' and me_type <>'SP'
loop
return next a;
-
+
for e in select * from get_menu_tree(a.code,login)
- loop
+ loop
return next e;
end loop;
-
+
end loop;
return;
end;
@@ -769,7 +767,7 @@
x v_all_menu%ROWTYPE;
begin
for x in select * from v_all_menu where me_code_dep=p_code::text and
user_name=login::text
- loop
+ loop
if x.me_code_dep is not null then
i.code := x.me_code_dep||'/'||x.me_code;
else
@@ -777,9 +775,9 @@
end if;
i.description := x.me_description;
-
+
return next i;
-
+
for e in select * from get_menu_tree(x.me_code,login)
loop
e.code:=x.me_code_dep||'/'||e.code;
@@ -791,7 +789,7 @@
end;
$BODY$
LANGUAGE plpgsql;
-
+
alter table mod_payment add jrn_def_id bigint;
update mod_payment set jrn_def_id=2 where mp_type='VEN';
update mod_payment set jrn_def_id=3 where mp_type='ACH';
@@ -934,7 +932,7 @@
p_tva_sided);
return;
end;
- $function$
+ $function$
LANGUAGE plpgsql;
DROP FUNCTION comptaproc.insert_quant_sold(text, numeric, character varying,
numeric, numeric, numeric, integer, character varying);
@@ -956,8 +954,14 @@
(p_internal,p_jid,fid_good,p_quant,p_price,p_vat,p_vat_code,fid_client,'Y',p_tva_sided);
return;
end;
- $function$
+ $function$
LANGUAGE plpgsql;
+
+insert into
menu_ref(me_code,me_menu,me_file,me_description,me_type,me_parameter) select
ex_code,ex_name,ex_file,ex_desC,'PL','plugin_code='||ex_code from extension;
+
+insert into profile_menu (me_code,me_code_dep,p_id,p_type_display) select
me_code,'EXT',1,'S' from menu_ref where me_type='PL';
+update jrn set
jr_internal=substring(jr_internal,1,1)||lpad(upper(to_hex(jr_id+1)),6,'0');
+
update version set val=98;
commit;
\ No newline at end of file
Modified: phpcompta/trunk/html/ajax_misc.php
===================================================================
--- phpcompta/trunk/html/ajax_misc.php 2011-11-26 14:59:15 UTC (rev 4478)
+++ phpcompta/trunk/html/ajax_misc.php 2011-11-27 02:20:11 UTC (rev 4479)
@@ -526,13 +526,12 @@
break;
case 'up_pay_method':
require_once 'ajax_update_payment.php';
- break;
- case 'openancsearch':
- case 'resultancsearch':
- require_once('ajax_anc_search.php');
- break;
- case 'autoanc':
- require_once('ajax_auto_anc_card.php');
- break;
-
+ break;
+ case 'openancsearch':
+ case 'resultancsearch':
+ require_once('ajax_anc_search.php');
+ break;
+ case 'autoanc':
+ require_once('ajax_auto_anc_card.php');
+ break;
}
\ No newline at end of file
Modified: phpcompta/trunk/html/do.php
===================================================================
--- phpcompta/trunk/html/do.php 2011-11-26 14:59:15 UTC (rev 4478)
+++ phpcompta/trunk/html/do.php 2011-11-27 02:20:11 UTC (rev 4479)
@@ -137,17 +137,6 @@
show_menu($all, $i);
}
}
-/*elseif (isset($_REQUEST['plugin_code']))
-{
- $default = find_default_module();
- $_GET['ac']=$default;
- $_POST['ac']=$default;
- $_REQUEST['ac']=$default;
- show_module('EXTENSION');
- $all[0] = $default;
- show_menu($all, 0);
- require_once 'extension_choice.inc.php';
-}*/
else
{
$default = find_default_module();
Modified: phpcompta/trunk/html/style.css
===================================================================
--- phpcompta/trunk/html/style.css 2011-11-26 14:59:15 UTC (rev 4478)
+++ phpcompta/trunk/html/style.css 2011-11-27 02:20:11 UTC (rev 4479)
@@ -125,6 +125,7 @@
div.u_tool {
float:left;
width: 100%;
+ padding-bottom: 25px;
}
div.u_tool div.name {
float:left;
@@ -838,7 +839,7 @@
div.topmenu {
float:left;
width:100%;
-
+ margin-top:2px;
}
h2.dossier {
Modified: phpcompta/trunk/include/ac_common.php
===================================================================
--- phpcompta/trunk/include/ac_common.php 2011-11-26 14:59:15 UTC (rev
4478)
+++ phpcompta/trunk/include/ac_common.php 2011-11-27 02:20:11 UTC (rev
4479)
@@ -65,7 +65,10 @@
{
return '<h2 ' . $p_class . '>' . htmlspecialchars($p_string) . '</h2>';
}
-
+function h1($p_string, $p_class)
+{
+ return '<h1 ' . $p_class . '>' . htmlspecialchars($p_string) . '</h1>';
+}
/* !\brief surround the string with td
* \param $p_string string to surround by TD
* \param $p_extra extra info (class, style, javascript...)
@@ -762,7 +765,7 @@
}
if ($file[0]['me_file'] != '')
{
- if ($file[0]['me_parameter'] !== "")
+ if ($file[0]['me_parameter'] != "")
{
// if there are paramter put them in superglobal
$array=compute_variable($file[0]['me_parameter']);
@@ -775,17 +778,12 @@
require_once $file[0]['me_file'];
else
require 'extension_get.inc.php';
- exit();
}
if ( $file[0]['me_javascript'] != '')
{
create_script($file[0]['me_javascript']);
}
}
- else
- {
-
- }
}
/**
* Find the default module or the first one
Modified: phpcompta/trunk/include/class_acc_ledger.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger.php 2011-11-26 14:59:15 UTC
(rev 4478)
+++ phpcompta/trunk/include/class_acc_ledger.php 2011-11-27 02:20:11 UTC
(rev 4479)
@@ -2912,7 +2912,7 @@
$op->od_direct='t';
if ($op->count() != 0 )
{
- echo HtmlInput::submit('use_opd','Utilisez une
op.prédéfinie');
+ echo HtmlInput::submit('use_opd','Utilisez une opération
prédéfinie');
echo $op->show_button();
}
echo '</form>';
Modified: phpcompta/trunk/include/class_database.php
===================================================================
--- phpcompta/trunk/include/class_database.php 2011-11-26 14:59:15 UTC (rev
4478)
+++ phpcompta/trunk/include/class_database.php 2011-11-27 02:20:11 UTC (rev
4479)
@@ -364,9 +364,19 @@
$add=($from_setup==0)?'admin/':'';
for ( $i = 4;$i <= $MaxVersion;$i++)
{
- $to=$i+1;
- if ( $this->get_version() <= $i )
- {
+ $to = $i + 1;
+
+ if ($this->get_version() <= $i)
+ {
+ if ($this->get_version() == 97)
+ {
+ if
($this->exist_schema("amortissement"))
+ {
+ $this->exec_sql('ALTER TABLE
amortissement.amortissement_histo
+ ADD CONSTRAINT
internal_fk FOREIGN KEY (jr_internal) REFERENCES jrn (jr_internal)
+ ON UPDATE CASCADE ON
DELETE SET NULL');
+ }
+ }
echo "<li>Patching ".$p_name.
" from the version ".$this->get_version()." to $to ";
@@ -452,7 +462,7 @@
$country=$this->get_value ("select pr_value from parameter
where pr_id='MY_COUNTRY'");
$this->execute_script($add."sql/patch/upgrade61.".$country.".sql");
}
-
+
if ( ! DEBUG ) ob_end_clean();
}
}
Modified: phpcompta/trunk/include/class_extension.php
===================================================================
--- phpcompta/trunk/include/class_extension.php 2011-11-26 14:59:15 UTC (rev
4478)
+++ phpcompta/trunk/include/class_extension.php 2011-11-27 02:20:11 UTC (rev
4479)
@@ -113,7 +113,7 @@
* insert into default profile
*/
$this->cn->exec_sql("insert into
profile_menu(me_code,me_code_dep,p_type_display,p_id)
- values
($1,$2,$3,$4)",array($this->me_code,'EXTENSION','S',1));
+ values
($1,$2,$3,$4)",array($this->me_code,'EXT','S',1));
$this->cn->commit();
}
catch (Exception $exc)
Modified: phpcompta/trunk/include/class_pre_op_ach.php
===================================================================
--- phpcompta/trunk/include/class_pre_op_ach.php 2011-11-26 14:59:15 UTC
(rev 4478)
+++ phpcompta/trunk/include/class_pre_op_ach.php 2011-11-27 02:20:11 UTC
(rev 4479)
@@ -99,6 +99,7 @@
$this->db->commit();
}
/*!\brief compute an array accordingly with the FormVenView function
+ * @return an array for filling the form
*/
function compute_array()
{
@@ -106,6 +107,7 @@
$a_op=$this->operation->load();
$array=$this->operation->compute_array($a_op);
$p_array=$this->load();
+ if ( empty ($p_array)) return array();
foreach ($p_array as $row)
{
if ( $row['opd_debit']=='f')
@@ -126,7 +128,7 @@
return $array;
}
/*!\brief load the data from the database and return an array
- * \return an array
+ * \return an array
*/
function load()
{
Modified: phpcompta/trunk/include/class_pre_op_advanced.php
===================================================================
--- phpcompta/trunk/include/class_pre_op_advanced.php 2011-11-26 14:59:15 UTC
(rev 4478)
+++ phpcompta/trunk/include/class_pre_op_advanced.php 2011-11-27 02:20:11 UTC
(rev 4479)
@@ -101,6 +101,7 @@
$array=$this->operation->compute_array($a_op);
$array['desc']=$array['e_comm'];
$p_array=$this->load();
+ if (empty($p_array)) return array();
foreach ($p_array as $row)
{
$tmp_array=array("qc_".$count=>'',
@@ -126,7 +127,7 @@
return $array;
}
/*!\brief load the data from the database and return an array
- * \return an array
+ * \return an array
*/
function load()
{
Modified: phpcompta/trunk/include/class_pre_op_ven.php
===================================================================
--- phpcompta/trunk/include/class_pre_op_ven.php 2011-11-26 14:59:15 UTC
(rev 4478)
+++ phpcompta/trunk/include/class_pre_op_ven.php 2011-11-27 02:20:11 UTC
(rev 4479)
@@ -105,6 +105,7 @@
$a_op=$this->operation->load();
$array=$this->operation->compute_array($a_op);
$p_array=$this->load();
+ if (empty($p_array)) return array();
foreach ($p_array as $row)
{
if ( $row['opd_debit']=='t')
@@ -124,7 +125,7 @@
return $array;
}
/*!\brief load the data from the database and return an array
- * \return an array
+ * \return an array
*/
function load()
{
Modified: phpcompta/trunk/include/class_pre_operation.php
===================================================================
--- phpcompta/trunk/include/class_pre_operation.php 2011-11-26 14:59:15 UTC
(rev 4478)
+++ phpcompta/trunk/include/class_pre_operation.php 2011-11-27 02:20:11 UTC
(rev 4479)
@@ -196,11 +196,8 @@
$hid=new IHidden();
$r=$hid->input("action","use_opd");
$r.=$hid->input("jrn_type",$this->get("ledger_type"));
- if ($this->count() != 0 )
- {
- $r.= HtmlInput::submit('use_opd','Utilisez une
op.prédéfinie');
- $r.= $this->show_button();
- }
+ $r.= HtmlInput::submit('use_opd','Utilisez une opération
prédéfinie');
+ $r.= $this->show_button();
return $r;
}
@@ -230,7 +227,7 @@
$value=$this->db->make_array("select od_id,od_name from op_predef ".
" where
jrn_def_id=".sql_string($this->jrn_def_id).
" and od_direct
='".sql_string($this->od_direct)."'".
- " order by od_name");
+ " order by od_name",1);
return $value;
}
function set($p_param,$value)
Modified: phpcompta/trunk/include/menu.inc.php
===================================================================
--- phpcompta/trunk/include/menu.inc.php 2011-11-26 14:59:15 UTC (rev
4478)
+++ phpcompta/trunk/include/menu.inc.php 2011-11-27 02:20:11 UTC (rev
4479)
@@ -155,7 +155,8 @@
break;
}
- echo '<tr>';
+ $class= ( $i%2 == 0)?$class=' class="odd"':$class=' class="even"';
+ echo "<tr $class>";
echo td($js);
echo td($row->me_menu);
echo td($row->me_description);
Modified: phpcompta/trunk/include/search.inc.php
===================================================================
--- phpcompta/trunk/include/search.inc.php 2011-11-26 14:59:15 UTC (rev
4478)
+++ phpcompta/trunk/include/search.inc.php 2011-11-27 02:20:11 UTC (rev
4479)
@@ -117,7 +117,7 @@
} else
{
- if ($step<$max_line ) echo '<span class="notice">Nombre
d\'enregistrements trouvés =' .$max_line.' limite = '.$step.'</span>';
+ if ($step<$max_line ) echo '<h2 class="notice">Liste limitée à
'.$step.' enregistrements. Le nombre d\'enregistrements trouvés est de '
.$max_line.'</h2>';
}
echo '<form method="get" onsubmit="set_reconcile(this);return false">';
echo HtmlInput::submit("upd_rec","Mettre à jour");
Modified: phpcompta/trunk/include/template/param_jrn.php
===================================================================
--- phpcompta/trunk/include/template/param_jrn.php 2011-11-26 14:59:15 UTC
(rev 4478)
+++ phpcompta/trunk/include/template/param_jrn.php 2011-11-27 02:20:11 UTC
(rev 4479)
@@ -119,8 +119,8 @@
<?
if ( $new || ($type != 'ODS' && $type != 'FIN')) {
?>
-<th><?=_('Fiches Débit')?></TH>
-<th><?=_('Fiches Crédit')?></TH>
+<th style="text-align:left"><?=_('Fiches Débit')?></TH>
+<th style="text-align:left"><?=_('Fiches Crédit')?></TH>
<?
}
?>
@@ -139,7 +139,7 @@
break;
}
}
- echo '<TR>';
+ echo '<tr>';
printf ('<TD> <INPUT TYPE="CHECKBOX" VALUE="%s" NAME="FICHEDEB[]"
%s>%s</TD>',
$res['fd_id'],$CHECKED,$res['fd_label']);
$CHECKED=" unchecked";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4479 - in phpcompta/trunk: html html/admin/sql/patch include include/template,
phpcompta-dev <=