Merge remote-tracking branch 'origin/3.7' into develop
This commit is contained in:
commit
02e18bc03d
@ -4867,7 +4867,7 @@ CREATE TABLE `llx_opensurvey_sondage` (
|
||||
`mailsonde` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`survey_link_visible` int(11) DEFAULT '1',
|
||||
`origin` varchar(64) DEFAULT NULL,
|
||||
`tms` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id_sondage`),
|
||||
KEY `idx_id_sondage_admin` (`id_sondage_admin`),
|
||||
KEY `idx_date_fin` (`date_fin`)
|
||||
|
||||
@ -48,13 +48,12 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="s.nom";
|
||||
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_company=GETPOST("search_company");
|
||||
$search_zipcode=GETPOST("search_zipcode");
|
||||
$search_town=GETPOST("search_town");
|
||||
$search_code=GETPOST("search_code");
|
||||
$search_compta=GETPOST("search_compta");
|
||||
$search_status = GETPOST("search_status",'int');
|
||||
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
|
||||
// Load sale and categ filters
|
||||
$search_sale = GETPOST("search_sale");
|
||||
@ -78,21 +77,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x"))
|
||||
{
|
||||
$search_categ='';
|
||||
$catid='';
|
||||
$search_sale='';
|
||||
$socname="";
|
||||
$search_nom="";
|
||||
$search_sale="";
|
||||
$search_categ="";
|
||||
$catid="";
|
||||
$search_company="";
|
||||
$search_zipcode="";
|
||||
$search_town="";
|
||||
$search_idprof1='';
|
||||
$search_idprof2='';
|
||||
$search_idprof3='';
|
||||
$search_idprof4='';
|
||||
$seach_status=1;
|
||||
$search_code='';
|
||||
$search_compta='';
|
||||
$search_status='';
|
||||
}
|
||||
|
||||
|
||||
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
|
||||
/*
|
||||
* view
|
||||
@ -122,8 +118,8 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
|
||||
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_nom) {
|
||||
$sql .= natural_search('s.nom', $search_nom);
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
|
||||
if ($search_town) {
|
||||
@ -156,7 +152,7 @@ if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
$param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
||||
$param = "&search_company=".$search_company."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
||||
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
||||
if ($search_sale != '') $param.='&search_sale='.$search_sale;
|
||||
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||
@ -207,7 +203,7 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_nom" value="'.$search_nom.'" size="10">';
|
||||
print '<input type="text" class="flat" name="search_company" value="'.$search_company.'" size="10">';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
@ -235,7 +231,6 @@ if ($result)
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -56,6 +56,8 @@ $search_societe=GETPOST('search_societe','alpha');
|
||||
$search_montant_ht=GETPOST('search_montant_ht','alpha');
|
||||
$search_author=GETPOST('search_author','alpha');
|
||||
$search_town=GETPOST('search_town','alpha');
|
||||
$viewstatut=$db->escape(GETPOST('viewstatut'));
|
||||
$object_statut=$db->escape(GETPOST('propal_statut'));
|
||||
|
||||
$sall=GETPOST("sall");
|
||||
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
||||
@ -78,6 +80,26 @@ if (! empty($socid))
|
||||
}
|
||||
$result = restrictedArea($user, $module, $objectid, $dbtable);
|
||||
|
||||
if (GETPOST("button_removefilter") || GETPOST("button_removefilter_x")) // Both tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
$search_sale='';
|
||||
$search_ref='';
|
||||
$search_refcustomer='';
|
||||
$search_societe='';
|
||||
$search_montant_ht='';
|
||||
$search_author='';
|
||||
$search_town='';
|
||||
$year='';
|
||||
$month='';
|
||||
$viewstatut='';
|
||||
$object_statut='';
|
||||
}
|
||||
|
||||
if($object_statut != '')
|
||||
$viewstatut=$object_statut;
|
||||
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('propallist'));
|
||||
@ -93,21 +115,6 @@ $parameters=array('socid'=>$socid);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x"))
|
||||
{
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
$search_sale='';
|
||||
$search_ref='';
|
||||
$search_refcustomer='';
|
||||
$search_societe='';
|
||||
$search_montant_ht='';
|
||||
$search_author='';
|
||||
$search_town='';
|
||||
$year='';
|
||||
$month='';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -132,11 +139,6 @@ $offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$viewstatut=$db->escape(GETPOST('viewstatut'));
|
||||
$object_statut = $db->escape(GETPOST('propal_statut'));
|
||||
if($object_statut != '')
|
||||
$viewstatut=$object_statut;
|
||||
|
||||
if (! $sortfield) $sortfield='p.datep';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
$limit = $conf->liste_limit;
|
||||
@ -322,10 +324,12 @@ if ($result)
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$formpropal->selectProposalStatus($viewstatut,1);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" value="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '<input type="image" name="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" name="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$var=true;
|
||||
@ -391,7 +395,7 @@ if ($result)
|
||||
|
||||
// Date proposal
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($obj->dp), 'day');
|
||||
print dol_print_date($db->jdate($objp->dp), 'day');
|
||||
print "</td>\n";
|
||||
|
||||
// Date end validity
|
||||
|
||||
@ -1000,7 +1000,12 @@ class Commande extends CommonOrder
|
||||
$line->marge_tx = $marginInfos[1];
|
||||
$line->marque_tx = $marginInfos[2];
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
// get extrafields from original line
|
||||
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
|
||||
foreach($object->lines[$i]->array_options as $options_key => $value)
|
||||
$line->array_options[$options_key] = $value;
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
}
|
||||
|
||||
$this->socid = $object->socid;
|
||||
@ -1021,6 +1026,11 @@ class Commande extends CommonOrder
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
// get extrafields from original line
|
||||
$object->fetch_optionals($object->id);
|
||||
foreach($object->array_options as $options_key => $value)
|
||||
$this->array_options[$options_key] = $value;
|
||||
|
||||
// Possibility to add external linked objects with hooks
|
||||
$this->linked_objects[$this->origin] = $this->origin_id;
|
||||
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
|
||||
|
||||
@ -735,6 +735,11 @@ class Facture extends CommonInvoice
|
||||
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
|
||||
$line->pa_ht = $marginInfos[0];
|
||||
|
||||
// get extrafields from original line
|
||||
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
|
||||
foreach($object->lines[$i]->array_options as $options_key => $value)
|
||||
$line->array_options[$options_key] = $value;
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
}
|
||||
|
||||
@ -754,6 +759,11 @@ class Facture extends CommonInvoice
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
// get extrafields from original line
|
||||
$object->fetch_optionals($object->id);
|
||||
foreach($object->array_options as $options_key => $value)
|
||||
$this->array_options[$options_key] = $value;
|
||||
|
||||
// Possibility to add external linked objects with hooks
|
||||
$this->linked_objects[$this->origin] = $this->origin_id;
|
||||
if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects))
|
||||
|
||||
@ -429,7 +429,8 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_payme
|
||||
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
|
||||
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
|
||||
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type ";
|
||||
$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.ref_client, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp,";
|
||||
$sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, fk_mode_reglement";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
|
||||
$sql.= " ORDER BY ";
|
||||
$listfield=explode(',',$sortfield);
|
||||
|
||||
@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("banks");
|
||||
$langs->load("categories");
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
|
||||
@ -53,7 +53,7 @@ $search_email=GETPOST("search_email");
|
||||
$search_skype=GETPOST("search_skype");
|
||||
$search_priv=GETPOST("search_priv");
|
||||
$search_categ=GETPOST("search_categ",'int');
|
||||
$search_statu=GETPOST("search_status",'int');
|
||||
$search_status=GETPOST("search_status",'int');
|
||||
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
|
||||
|
||||
@ -96,9 +96,9 @@ else if ($type == "o")
|
||||
$urlfiche="";
|
||||
}
|
||||
|
||||
if (GETPOST('button_removefilter'))
|
||||
if (GETPOST('button_removefilter_x') || GETPOST('button_removefilter')) // Both tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_firstlast_only="";
|
||||
$search_firstlast_only="";
|
||||
$search_lastname="";
|
||||
$search_firstname="";
|
||||
$search_societe="";
|
||||
@ -302,7 +302,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder);
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mob", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder);
|
||||
if (! empty($conf->skype->enabled)) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); }
|
||||
@ -356,8 +356,8 @@ if ($result)
|
||||
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="image" value="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" value="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '<input type="image" name="button_search" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" name="button_removefilter" class="liste_titre" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -79,14 +79,13 @@ $now=dol_now();
|
||||
llxHeader();
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier,";
|
||||
$sql.= " s.nom as name, s.rowid as socid,";
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,';
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,';
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,';
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,';
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
|
||||
$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut,";
|
||||
$sql.= " s.nom as name, s.rowid as socid";
|
||||
$sql.= " ,c.ref_supplier";
|
||||
$sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed';
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
|
||||
@ -107,7 +106,7 @@ if (!empty($search_ref_supplier)) {
|
||||
if ($sall) {
|
||||
$sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall);
|
||||
}
|
||||
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, s.nom, s.rowid";
|
||||
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier, s.nom, s.rowid";
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($conf->liste_limit + 1, $offset);
|
||||
|
||||
|
||||
@ -2179,6 +2179,331 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
/**
|
||||
* Function to get extra fields of a member into $this->array_options
|
||||
* This method is in most cases called by method fetch of objects but you can call it separately.
|
||||
*
|
||||
* @param int $rowid Id of line
|
||||
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label()
|
||||
* @return int <0 if error, 0 if no optionals to find nor found, 1 if a line is found and optional loaded
|
||||
*/
|
||||
function fetch_optionals($rowid,$optionsArray='')
|
||||
{
|
||||
if (! is_array($optionsArray))
|
||||
{
|
||||
// optionsArray not already loaded, so we load it
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$optionsArray = $extrafields->fetch_name_optionals_label($this->table_element);
|
||||
}
|
||||
|
||||
|
||||
// Request to get complementary values
|
||||
if (count($optionsArray) > 0)
|
||||
{
|
||||
$sql = "SELECT rowid";
|
||||
foreach ($optionsArray as $name => $label)
|
||||
{
|
||||
$sql.= ", ".$name;
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields";
|
||||
$sql.= " WHERE fk_object = ".$rowid;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch_optionals sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$numrows=$this->db->num_rows($resql);
|
||||
if ($numrows)
|
||||
{
|
||||
$tab = $this->db->fetch_array($resql);
|
||||
|
||||
foreach ($tab as $key => $value)
|
||||
{
|
||||
// Test fetch_array ! is_int($key) because fetch_array result is a mix table with some key as alpha and some key as int (depend db engine)
|
||||
if ($key != 'rowid' && $key != 'tms' && ! is_int($key))
|
||||
{
|
||||
// we can add this attribute to object properties
|
||||
$this->array_options["options_".$key]=$value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
if ($numrows) return $numrows;
|
||||
else return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all extra fields values for the current object.
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function deleteExtraFields()
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id;
|
||||
dol_syslog(get_class($this)."::deleteExtraFields delete sql=".$sql_del);
|
||||
$resql=$this->db->query($sql_del);
|
||||
if (! $resql)
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::deleteExtraFields ".$this->error,LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add/Update all extra fields values for the current object.
|
||||
* All data to describe values to insert are stored into $this->array_options=array('keyextrafield'=>'valueextrafieldtoadd')
|
||||
*
|
||||
* @return int -1=error, O=did nothing, 1=OK
|
||||
*/
|
||||
function insertExtraFields()
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$error=0;
|
||||
|
||||
if (! empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used
|
||||
|
||||
if (! empty($this->array_options))
|
||||
{
|
||||
// Check parameters
|
||||
$langs->load('admin');
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
$extrafields = new ExtraFields($this->db);
|
||||
$optionsArray = $extrafields->fetch_name_optionals_label($this->table_element);
|
||||
|
||||
foreach($this->array_options as $key => $value)
|
||||
{
|
||||
$attributeKey = substr($key,8); // Remove 'options_' prefix
|
||||
$attributeType = $extrafields->attribute_type[$attributeKey];
|
||||
$attributeSize = $extrafields->attribute_size[$attributeKey];
|
||||
$attributeLabel = $extrafields->attribute_label[$attributeKey];
|
||||
switch ($attributeType)
|
||||
{
|
||||
case 'int':
|
||||
if (!is_numeric($value) && $value!='')
|
||||
{
|
||||
$error++; $this->errors[]=$langs->trans("ExtraFieldHasWrongValue",$attributeLabel);
|
||||
return -1;
|
||||
}
|
||||
elseif ($value=='')
|
||||
{
|
||||
$this->array_options[$key] = null;
|
||||
}
|
||||
break;
|
||||
case 'price':
|
||||
$this->array_options[$key] = price2num($this->array_options[$key]);
|
||||
break;
|
||||
case 'date':
|
||||
$this->array_options[$key]=$this->db->idate($this->array_options[$key]);
|
||||
break;
|
||||
case 'datetime':
|
||||
$this->array_options[$key]=$this->db->idate($this->array_options[$key]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->db->begin();
|
||||
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id;
|
||||
dol_syslog(get_class($this)."::insertExtraFields delete sql=".$sql_del);
|
||||
$this->db->query($sql_del);
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."_extrafields (fk_object";
|
||||
foreach($this->array_options as $key => $value)
|
||||
{
|
||||
$attributeKey = substr($key,8); // Remove 'options_' prefix
|
||||
// Add field of attribut
|
||||
if (isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate
|
||||
$sql.=",".$attributeKey;
|
||||
}
|
||||
$sql .= ") VALUES (".$this->id;
|
||||
foreach($this->array_options as $key => $value)
|
||||
{
|
||||
$attributeKey = substr($key,8); // Remove 'options_' prefix
|
||||
// Add field o fattribut
|
||||
if(isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate)
|
||||
{
|
||||
if ($this->array_options[$key] != '')
|
||||
{
|
||||
$sql.=",'".$this->db->escape($this->array_options[$key])."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.=",null";
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql.=")";
|
||||
|
||||
dol_syslog(get_class($this)."::insertExtraFields insert sql=".$sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to show lines of extrafields with output datas
|
||||
*
|
||||
* @param object $extrafields Extrafield Object
|
||||
* @param string $mode Show output (view) or input (edit) for extrafield
|
||||
* @param array $params Optionnal parameters
|
||||
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function showOptionals($extrafields, $mode='view', $params=0, $keyprefix='')
|
||||
{
|
||||
global $_POST, $conf;
|
||||
|
||||
$out = '';
|
||||
|
||||
if (count($extrafields->attribute_label) > 0)
|
||||
{
|
||||
$out .= "\n";
|
||||
$out .= '<!-- showOptionalsInput --> ';
|
||||
$out .= "\n";
|
||||
|
||||
$e = 0;
|
||||
foreach($extrafields->attribute_label as $key=>$label)
|
||||
{
|
||||
if (is_array($params) && count($params)>0) {
|
||||
if (array_key_exists('colspan',$params)) {
|
||||
$colspan=$params['colspan'];
|
||||
}
|
||||
}else {
|
||||
$colspan='3';
|
||||
}
|
||||
switch($mode) {
|
||||
case "view":
|
||||
$value=$this->array_options["options_".$key];
|
||||
break;
|
||||
case "edit":
|
||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$this->array_options["options_".$key]);
|
||||
break;
|
||||
}
|
||||
if ($extrafields->attribute_type[$key] == 'separate')
|
||||
{
|
||||
$out .= $extrafields->showSeparator($key);
|
||||
}
|
||||
else
|
||||
{
|
||||
$csstyle='';
|
||||
if (is_array($params) && count($params)>0) {
|
||||
if (array_key_exists('style',$params)) {
|
||||
$csstyle=$params['style'];
|
||||
}
|
||||
}
|
||||
if ( !empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0)
|
||||
{
|
||||
$out .= '<tr '.$csstyle.'>';
|
||||
$colspan='0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$out .= '<tr '.$csstyle.'>';
|
||||
}
|
||||
// Convert date into timestamp format
|
||||
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
|
||||
{
|
||||
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]);
|
||||
}
|
||||
|
||||
if($extrafields->attribute_required[$key])
|
||||
$label = '<span class="fieldrequired">'.$label.'</span>';
|
||||
|
||||
$out .= '<td>'.$label.'</td>';
|
||||
$out .='<td'.($colspan?' colspan="'.$colspan.'"':'').'>';
|
||||
|
||||
switch($mode) {
|
||||
case "view":
|
||||
$out .= $extrafields->showOutputField($key,$value);
|
||||
break;
|
||||
case "edit":
|
||||
$out .= $extrafields->showInputField($key,$value,'',$keyprefix);
|
||||
break;
|
||||
}
|
||||
|
||||
$out .= '</td>'."\n";
|
||||
|
||||
if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && (($e % 2) == 1)) $out .= '</tr>';
|
||||
else $out .= '</tr>';
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
$out .= "\n";
|
||||
$out .= '<!-- /showOptionalsInput --> ';
|
||||
$out .= '
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function showOptions(child_list, parent_list)
|
||||
{
|
||||
var val = $("select[name=\"options_"+parent_list+"\"]").val();
|
||||
var parentVal = parent_list + ":" + val;
|
||||
if(val > 0) {
|
||||
$("select[name=\""+child_list+"\"] option[parent]").hide();
|
||||
$("select[name=\""+child_list+"\"] option[parent=\""+parentVal+"\"]").show();
|
||||
} else {
|
||||
$("select[name=\""+child_list+"\"] option").show();
|
||||
}
|
||||
}
|
||||
function setListDependencies() {
|
||||
jQuery("select option[parent]").parent().each(function() {
|
||||
var child_list = $(this).attr("name");
|
||||
var parent = $(this).find("option[parent]:first").attr("parent");
|
||||
var infos = parent.split(":");
|
||||
var parent_list = infos[0];
|
||||
$("select[name=\"options_"+parent_list+"\"]").change(function() {
|
||||
showOptions(child_list, parent_list);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setListDependencies();
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
>>>>>>> refs/remotes/origin/3.6
|
||||
/**
|
||||
* Function to check if an object is used by others.
|
||||
* Check is done into this->childtables. There is no check into llx_element_element.
|
||||
|
||||
@ -36,7 +36,7 @@ $result = restrictedArea($user, 'expedition',$expeditionid,'');
|
||||
|
||||
$search_ref_exp = GETPOST("search_ref_exp");
|
||||
$search_ref_liv = GETPOST('search_ref_liv');
|
||||
$search_societe = GETPOST("search_societe");
|
||||
$search_company = GETPOST("search_company");
|
||||
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
@ -51,12 +51,12 @@ if (! $sortfield) $sortfield="e.ref";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
$limit = $conf->liste_limit;
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x"))
|
||||
{
|
||||
$search_ref_exp='';
|
||||
$search_ref_liv='';
|
||||
$search_societe='';
|
||||
$search_company='';
|
||||
}
|
||||
|
||||
/*
|
||||
@ -92,7 +92,7 @@ if ($socid)
|
||||
}
|
||||
if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
|
||||
if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv);
|
||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit + 1,$offset);
|
||||
@ -107,12 +107,13 @@ if ($resql)
|
||||
$param="";
|
||||
if ($search_ref_exp) $param.= "&search_ref_exp=".$search_ref_exp;
|
||||
if ($search_ref_liv) $param.= "&search_ref_liv=".$search_ref_liv;
|
||||
if ($search_societe) $param.= "&search_societe=".$search_societe;
|
||||
if ($search_company) $param.= "&search_company=".$search_company;
|
||||
|
||||
print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num);
|
||||
|
||||
|
||||
$i = 0;
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -124,6 +125,7 @@ if ($resql)
|
||||
print_liste_field_titre($langs->trans("DateReceived"),"ship2bill.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("Status"),"ship2bill.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Lignes des champs de filtre
|
||||
@ -132,7 +134,7 @@ if ($resql)
|
||||
print '<input class="flat" size="10" type="text" name="search_ref_exp" value="'.$search_ref_exp.'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">';
|
||||
print '<input class="flat" type="text" size="10" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
if($conf->livraison_bon->enabled) {
|
||||
@ -141,13 +143,9 @@ if ($resql)
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
}
|
||||
print '<td class="liste_titre" align="right">';
|
||||
// Développé dans la 3.7
|
||||
//print img_search();
|
||||
//print img_searchclear();
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
|
||||
print '</td>';
|
||||
@ -161,12 +159,15 @@ if ($resql)
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$var=!$var;
|
||||
|
||||
// Ref
|
||||
print "<tr ".$bc[$var].">";
|
||||
print "<td>";
|
||||
$shipment->id=$objp->rowid;
|
||||
$shipment->ref=$objp->ref;
|
||||
print $shipment->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
// Third party
|
||||
print '<td>';
|
||||
$companystatic->id=$objp->socid;
|
||||
@ -174,7 +175,8 @@ if ($resql)
|
||||
$companystatic->name=$objp->socname;
|
||||
print $companystatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
// Date delivery planed
|
||||
|
||||
// Date delivery planed
|
||||
print "<td align=\"center\">";
|
||||
print dol_print_date($db->jdate($objp->date_expedition),"day");
|
||||
/*$now = time();
|
||||
|
||||
@ -99,7 +99,7 @@ $var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td class="fieldrequired">'.$langs->trans("Label")."</td>";
|
||||
print "<td><input type=\"text\" class=\"flat\" name=\"EXTERNALSITE_LABEL\" value=\"". (GETPOST('EXTERNALSITE_LABEL','alpha')?GETPOST('EXTERNALSITE_LABEL','alpha'):((empty($conf->global->EXTERNALSITE_LABEL) || $conf->global->EXTERNALSITE_LABEL=='ExternalSite')?'':$conf->global->EXTERNALSITE_LABEL)) . "\" size=\"12\"></td>";
|
||||
print "<td>My menu entry</td>";
|
||||
print "<td>".$langs->trans("ExampleMyMenuEntry")."</td>";
|
||||
print "</tr>";
|
||||
|
||||
$var=!$var;
|
||||
|
||||
@ -155,7 +155,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans("Date").'</td>';
|
||||
print "<td colspan=\"2\">".dol_print_date($object->date,"daytext")."</td>\n";
|
||||
print "<td colspan=\"2\">".dol_print_date($object->datec,"daytext")."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -158,7 +158,7 @@ if ($result)
|
||||
}
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$liststatus=$interventionstatic->statuts_short;
|
||||
print $form->selectarray('search_status', $liststatus, GETPOST('search_status'), 1, 0, 0, '', 1);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
|
||||
@ -117,7 +117,7 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
|
||||
if ($search_ref)
|
||||
{
|
||||
$sql .= " AND f.rowid LIKE '%".$search_ref."%'";
|
||||
$sql .= " AND f.ref LIKE '%".$search_ref."%'";
|
||||
}
|
||||
if ($search_ref_supplier)
|
||||
{
|
||||
@ -241,7 +241,7 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print $facturestatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
print '<td class="nowrap">'.dol_trunc($objp->ref_supplier,12)."</td>\n";
|
||||
print '<td class="nowrap">'.dol_trunc($objp->ref_supplier,12).'</td>';
|
||||
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->df),'day')."</td>\n";
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->datelimite),'day');
|
||||
@ -258,7 +258,7 @@ if ($user->rights->fournisseur->facture->lire)
|
||||
print "<td align=\"right\">".price($objp->total_ttc)."</td>";
|
||||
print "<td align=\"right\">".price($objp->am)."</td>";
|
||||
|
||||
// Affiche statut de la facture
|
||||
// Show invoice status
|
||||
print '<td align="right" class="nowrap">';
|
||||
print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am);
|
||||
print '</td>';
|
||||
|
||||
@ -72,8 +72,9 @@ $search_amount_no_tax = GETPOST("search_amount_no_tax","alpha");
|
||||
$search_amount_all_tax = GETPOST("search_amount_all_tax","alpha");
|
||||
$month = GETPOST("month","int");
|
||||
$year = GETPOST("year","int");
|
||||
$filter = GETPOST("filtre");
|
||||
|
||||
if (GETPOST("button_removefilter"))
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_ref_supplier="";
|
||||
@ -83,6 +84,7 @@ if (GETPOST("button_removefilter"))
|
||||
$search_amount_all_tax="";
|
||||
$year="";
|
||||
$month="";
|
||||
$filter="";
|
||||
}
|
||||
|
||||
/*
|
||||
@ -136,9 +138,9 @@ if ($socid)
|
||||
{
|
||||
$sql .= " AND s.rowid = ".$socid;
|
||||
}
|
||||
if (GETPOST('filtre') && GETPOST('filtre') != -1) // GETPOST('filtre') may be a string
|
||||
if ($filter && $filter != -1) // GETPOST('filtre') may be a string
|
||||
{
|
||||
$filtrearr = explode(",", GETPOST('filtre'));
|
||||
$filtrearr = explode(",", $filter);
|
||||
foreach ($filtrearr as $fil)
|
||||
{
|
||||
$filt = explode(":", $fil);
|
||||
@ -217,7 +219,7 @@ if ($resql)
|
||||
if ($search_company) $param.='&search_company='.urlencode($search_company);
|
||||
if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax);
|
||||
if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
|
||||
if (GETPOST("filtre") && GETPOST('filtre') != -1) $param.='&filtre='.urlencode(GETPOST("filtre"));
|
||||
if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter);
|
||||
|
||||
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
|
||||
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -269,8 +271,8 @@ if ($resql)
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
$liststatus=array('paye:0'=>$langs->trans("Unpayed"), 'paye:1'=>$langs->trans("Payed"));
|
||||
print $form->selectarray('filtre', $liststatus, GETPOST('filtre'), 1);
|
||||
$liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
|
||||
print $form->selectarray('filtre', $liststatus, $filter, 1);
|
||||
print '</td><td class="liste_titre" align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
@ -329,7 +331,7 @@ if ($resql)
|
||||
//print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$objp->am);
|
||||
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5);
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="center"> </td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -536,7 +536,7 @@ if (empty($action))
|
||||
print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'c.libelle','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$paramlist,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'f.amount','',$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'p.amount','',$paramlist,'align="right"',$sortfield,$sortorder);
|
||||
//print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$paramlist,'',$sortfield,$sortorder);
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -84,7 +84,7 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'56','Soci
|
||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'57','Société par actions simplifiée (SAS)');
|
||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'58','Entreprise Unipersonnelle à Responsabilité Limitée (EURL)');
|
||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'59','Société par actions simplifiée unipersonnelle (SASU)');
|
||||
|
||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'60', 'Entreprise Individuelle à Responsabilité Limitée (EIRL)');
|
||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'61','Caisse d''épargne et de prévoyance');
|
||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'62','Groupement d''intérêt économique (GIE)');
|
||||
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'63','Société coopérative agricole');
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
|
||||
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
|
||||
|
||||
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (1, '60', 'Entreprise Individuelle à Responsabilité Limitée (EIRL)', 1);
|
||||
|
||||
--insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19);
|
||||
--insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention delete','Executed when a intervention is delete','ficheinter',19);
|
||||
@ -90,7 +91,6 @@ ALTER TABLE llx_bank_account ADD COLUMN accountancy_journal varchar(3) DEFAULT N
|
||||
|
||||
ALTER TABLE llx_accountingaccount add column entity integer DEFAULT 1 NOT NULL AFTER rowid;
|
||||
ALTER TABLE llx_accountingaccount add column datec datetime AFTER entity;
|
||||
ALTER TABLE llx_accountingaccount add column tms timestamp AFTER datec;
|
||||
ALTER TABLE llx_accountingaccount add column fk_user_author integer DEFAULT NULL AFTER label;
|
||||
ALTER TABLE llx_accountingaccount add column fk_user_modif integer DEFAULT NULL AFTER fk_user_author;
|
||||
|
||||
@ -102,6 +102,8 @@ UPDATE llx_const SET name = 'ACCOUNTING_PRODUCT_BUY_ACCOUNT' WHERE name = 'COMPT
|
||||
UPDATE llx_const SET name = 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT' WHERE name = 'COMPTA_PRODUCT_SOLD_ACCOUNT';
|
||||
UPDATE llx_const SET name = 'ACCOUNTING_SERVICE_BUY_ACCOUNT' WHERE name = 'COMPTA_SERVICE_BUY_ACCOUNT';
|
||||
UPDATE llx_const SET name = 'ACCOUNTING_SERVICE_SOLD_ACCOUNT' WHERE name = 'COMPTA_SERVICE_SOLD_ACCOUNT';
|
||||
UPDATE llx_const SET name = 'ACCOUNTING_VAT_ACCOUNT' WHERE name = 'COMPTA_VAT_ACCOUNT';
|
||||
UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT';
|
||||
|
||||
-- Compatibility with module Accounting Expert
|
||||
UPDATE llx_const SET name = 'ACCOUNTING_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV';
|
||||
@ -127,6 +129,7 @@ DROP TABLE llx_compta_compte_generaux;
|
||||
-- Align size for accounting account
|
||||
ALTER TABLE llx_accountingaccount MODIFY COLUMN account_number varchar(32);
|
||||
ALTER TABLE llx_accountingaccount MODIFY COLUMN account_parent varchar(32);
|
||||
ALTER TABLE llx_accountingaccount add column tms timestamp AFTER datec;
|
||||
ALTER TABLE llx_accountingdebcred MODIFY COLUMN account_number varchar(32);
|
||||
ALTER TABLE llx_bank_account MODIFY COLUMN account_number varchar(32);
|
||||
ALTER TABLE llx_c_chargesociales MODIFY COLUMN accountancy_code varchar(32);
|
||||
|
||||
@ -54,6 +54,7 @@ CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer
|
||||
|
||||
-- Add triggers for timestamp fields
|
||||
CREATE OR REPLACE FUNCTION update_modified_column_tms() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE plpgsql;
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accountingaccount FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accountingtransaction FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_actioncomm FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
|
||||
@ -33,6 +33,6 @@ IConfirmDonationReception=The recipient declare reception, as a donation, of the
|
||||
MinimumAmount=Minimum amount is %s
|
||||
FreeTextOnDonations=Free text to show in footer
|
||||
FrenchOptions=Options for France
|
||||
DONATION_ART200=Show legacy article 200
|
||||
DONATION_ART238=Show legacy article 238
|
||||
DONATION_ART885=Show legacy article 885
|
||||
DONATION_ART200=Show article 200 from CGI if you are concerned
|
||||
DONATION_ART238=Show article 238 from CGI if you are concerned
|
||||
DONATION_ART885=Show article 885 from CGI if you are concerned
|
||||
|
||||
@ -2,3 +2,4 @@
|
||||
ExternalSiteSetup=Setup link to external website
|
||||
ExternalSiteURL=External Site URL
|
||||
ExternalSiteModuleNotComplete=Module ExternalSite was not configured properly.
|
||||
ExampleMyMenuEntry=My menu entry
|
||||
@ -124,7 +124,7 @@ if (empty($reshook))
|
||||
// Barcode value
|
||||
if ($action == 'setbarcode' && $createbarcode)
|
||||
{
|
||||
$result=$object->check_barcode(GETPOST('barcode'),GETPOT('barcode_type_code'));
|
||||
$result=$object->check_barcode(GETPOST('barcode'),GETPOST('barcode_type_code'));
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
|
||||
@ -87,12 +87,14 @@ else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (isset($_POST["button_removefilter_x"]))
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$sref="";
|
||||
$sbarcode="";
|
||||
$snom="";
|
||||
$search_categ=0;
|
||||
$tosell="";
|
||||
$tobuy="";
|
||||
}
|
||||
|
||||
|
||||
@ -379,7 +381,7 @@ else
|
||||
|
||||
print '<td class="liste_titre nowrap" align="right">';
|
||||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user