Qual: Better error management.
Qual: Uniformize code for canvas
This commit is contained in:
parent
cf52cbfab5
commit
af6f075b5c
@ -68,7 +68,7 @@ $extrafields = new ExtraFields($db);
|
|||||||
$extralabels=$extrafields->fetch_name_optionals_label('member');
|
$extralabels=$extrafields->fetch_name_optionals_label('member');
|
||||||
|
|
||||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||||
$object->getCanvas($socid);
|
$object->getCanvas($rowid);
|
||||||
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
||||||
$objcanvas='';
|
$objcanvas='';
|
||||||
if (! empty($canvas))
|
if (! empty($canvas))
|
||||||
@ -117,7 +117,7 @@ $hookmanager->initHooks(array('membercard'));
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$parameters=array('socid'=>$socid, 'objcanvas'=>$objcanvas);
|
$parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas);
|
||||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer))
|
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer))
|
||||||
@ -694,12 +694,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// When used with CANVAS
|
// When used with CANVAS
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
if (empty($object->error) && $socid)
|
if (empty($object->error) && $rowid)
|
||||||
{
|
{
|
||||||
$object = new Adherent($db);
|
$object = new Adherent($db);
|
||||||
$object->fetch($socid);
|
$result=$object->fetch($rowid);
|
||||||
|
if ($result <= 0) dol_print_error('',$object->error);
|
||||||
}
|
}
|
||||||
$objcanvas->assign_values($action, $socid); // Set value for templates
|
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
||||||
$objcanvas->display_canvas($action); // Show template
|
$objcanvas->display_canvas($action); // Show template
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -301,9 +301,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||||||
if (empty($object->error) && $id)
|
if (empty($object->error) && $id)
|
||||||
{
|
{
|
||||||
$object = new Contact($db);
|
$object = new Contact($db);
|
||||||
$object->fetch($id);
|
$result=$object->fetch($id);
|
||||||
|
if ($result <= 0) dol_print_error('',$object->error);
|
||||||
}
|
}
|
||||||
$objcanvas->assign_values($action, $id); // Set value for templates
|
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
||||||
$objcanvas->display_canvas($action); // Show template
|
$objcanvas->display_canvas($action); // Show template
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -244,6 +244,8 @@ ALTER TABLE llx_actioncomm ADD COLUMN transparency integer after fk_user_action;
|
|||||||
|
|
||||||
INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) VALUES (29,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',29);
|
INSERT INTO llx_c_action_trigger (rowid,code,label,description,elementtype,rang) VALUES (29,'FICHINTER_SENTBYMAIL','Intervention sent by mail','Executed when a intervention is sent by mail','ficheinter',29);
|
||||||
|
|
||||||
|
ALTER TABLE llx_adherent ADD COLUMN canvas varchar(32) after fk_user_valid;
|
||||||
|
|
||||||
ALTER TABLE llx_expedition CHANGE COLUMN note note_private text;
|
ALTER TABLE llx_expedition CHANGE COLUMN note note_private text;
|
||||||
ALTER TABLE llx_expedition ADD COLUMN note_public text after note_private;
|
ALTER TABLE llx_expedition ADD COLUMN note_public text after note_private;
|
||||||
ALTER TABLE llx_livraison CHANGE COLUMN note note_private text;
|
ALTER TABLE llx_livraison CHANGE COLUMN note note_private text;
|
||||||
|
|||||||
@ -639,8 +639,14 @@ $formproduct = new FormProduct($db);
|
|||||||
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||||
{
|
{
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
// When used with CANVAS (more simple)
|
// When used with CANVAS
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
if (empty($object->error) && $id)
|
||||||
|
{
|
||||||
|
$object = new Product($db);
|
||||||
|
$result=$object->fetch($id);
|
||||||
|
if ($result <= 0) dol_print_error('',$object->error);
|
||||||
|
}
|
||||||
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
||||||
$objcanvas->display_canvas($action); // Show template
|
$objcanvas->display_canvas($action); // Show template
|
||||||
}
|
}
|
||||||
|
|||||||
@ -531,7 +531,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
|||||||
$result=$object->fetch($socid);
|
$result=$object->fetch($socid);
|
||||||
if ($result <= 0) dol_print_error('',$object->error);
|
if ($result <= 0) dol_print_error('',$object->error);
|
||||||
}
|
}
|
||||||
$objcanvas->assign_values($action, $socid); // Set value for templates
|
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
||||||
$objcanvas->display_canvas($action); // Show template
|
$objcanvas->display_canvas($action); // Show template
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user