本文整理汇总了PHP中Canvas::getCanvas方法的典型用法代码示例。如果您正苦于以下问题:PHP Canvas::getCanvas方法的具体用法?PHP Canvas::getCanvas怎么用?PHP Canvas::getCanvas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Canvas
的用法示例。
在下文中一共展示了Canvas::getCanvas方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ExtraFields
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array($contextpage));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('product');
$search_array_options = $extrafields->getOptionalsFromPost($extralabels, '', 'search_');
if (empty($action)) {
$action = 'list';
}
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$canvas = GETPOST("canvas");
$objcanvas = null;
if (!empty($canvas)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/canvas.class.php';
$objcanvas = new Canvas($db, $action);
$objcanvas->getCanvas('product', 'list', $canvas);
}
// Security check
if ($type == '0') {
$result = restrictedArea($user, 'produit', '', '', '', '', '', $objcanvas);
} else {
if ($type == '1') {
$result = restrictedArea($user, 'service', '', '', '', '', '', $objcanvas);
} else {
$result = restrictedArea($user, 'produit|service', '', '', '', '', '', $objcanvas);
}
}
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array('p.ref' => "Ref", 'pfp.ref_fourn' => "RefSupplier", 'p.label' => "ProductLabel", 'p.description' => "Description", "p.note" => "Note");
// multilang
if (!empty($conf->global->MAIN_MULTILANGS)) {
示例2: GETPOST
$action = (GETPOST('action') ? GETPOST('action') : 'view');
$confirm = GETPOST('confirm');
$socid = GETPOST('socid');
if ($user->societe_id) $socid=$user->societe_id;
$object = new Societe($db);
$extrafields = new ExtraFields($db);
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($socid);
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
if (! empty($canvas))
{
require_once(DOL_DOCUMENT_ROOT."/core/class/canvas.class.php");
$objcanvas = new Canvas($db, $action);
$objcanvas->getCanvas('thirdparty', 'card', $canvas);
}
// Security check
$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
$hookmanager=new HookManager($db);
$hookmanager->initHooks(array('thirdpartycard'));
/*
* Actions
*/
示例3: Product
}
$object = new Product($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
if ($id > 0 || !empty($ref)) {
$object = new Product($db);
$object->fetch($id, $ref);
}
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$canvas = !empty($object->canvas) ? $object->canvas : GETPOST("canvas");
$objcanvas = null;
if (!empty($canvas)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/canvas.class.php';
$objcanvas = new Canvas($db, $action);
$objcanvas->getCanvas('product', 'card', $canvas);
}
// Security check
$fieldvalue = !empty($id) ? $id : (!empty($ref) ? $ref : '');
$fieldtype = !empty($ref) ? 'ref' : 'rowid';
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype, $objcanvas);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('productcard', 'globalcard'));
/*
* Actions
*/
if ($cancel) {
$action = '';
}
$createbarcode = empty($conf->barcode->enabled) ? 0 : 1;
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->barcode->creer_advance)) {
示例4: GETPOST
$socid = GETPOST('socid', 'int');
if ($user->societe_id) {
$socid = $user->societe_id;
}
$object = new Contact($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($id);
$objcanvas = null;
$canvas = !empty($object->canvas) ? $object->canvas : GETPOST("canvas");
if (!empty($canvas)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/canvas.class.php';
$objcanvas = new Canvas($db, $action);
$objcanvas->getCanvas('contact', 'contactcard', $canvas);
}
// Security check
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas);
// If we create a contact with no company (shared contacts), no check on write permission
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('contactcard', 'globalcard'));
/*
* Actions
*/
$parameters = array('id' => $id, 'objcanvas' => $objcanvas);
$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');
}
示例5: doActions
//.........这里部分代码省略.........
else
{
if ( $this->object->fournisseur == 1 )
{
Header("Location: ".DOL_URL_ROOT."/fourn/fiche.php?socid=".$this->object->id);
return;
}
else
{
Header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$this->object->id);
return;
}
}
exit;
}
else
{
$this->db->rollback();
$this->errors=$this->object->errors;
$_GET["action"]='create';
}
}
if ($_POST["action"] == 'update')
{
if ($_POST["cancel"])
{
Header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid);
exit;
}
$oldsoccanvas = new Canvas($this->db);
$oldsoccanvas->getCanvas('thirdparty','card',$this->object->canvas);
$result=$oldsoccanvas->control->object->fetch($socid);
// To avoid setting code if third party is not concerned. But if it had values, we keep them.
if (empty($this->object->client) && empty($oldsoccanvas->control->object->code_client)) $this->object->code_client='';
if (empty($this->object->fournisseur)&& empty($oldsoccanvas->control->object->code_fournisseur)) $this->object->code_fournisseur=''; //var_dump($soccanvas);exit;
$result = $this->object->update($socid,$user,1,$oldsoccanvas->control->object->codeclient_modifiable(),$oldsoccanvas->control->object->codefournisseur_modifiable());
if ($result >= 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid);
exit;
}
else
{
$this->object->id = $socid;
$reload = 0;
$this->errors = $this->object->errors;
$_GET["action"]="edit";
}
}
}
}
if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes')
{
$this->object->fetch($socid);
$result = $this->object->delete($socid);
if ($result >= 0)
{
Header("Location: ".DOL_URL_ROOT."/societe/societe.php?delsoc=".$this->object->nom."");
示例6: MailmanSpip
include_once DOL_DOCUMENT_ROOT . '/mailmanspip/class/mailmanspip.class.php';
$langs->load('mailmanspip');
$mailmanspip = new MailmanSpip($db);
}
$object = new Adherent($db);
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
$object->getCanvas($rowid);
$canvas = $object->canvas ? $object->canvas : GETPOST("canvas");
$objcanvas = null;
if (!empty($canvas)) {
require_once DOL_DOCUMENT_ROOT . '/core/class/canvas.class.php';
$objcanvas = new Canvas($db, $action);
$objcanvas->getCanvas('adherent', 'membercard', $canvas);
}
// Security check
$result = restrictedArea($user, 'adherent', $rowid, '', '', 'fk_soc', 'rowid', $objcanvas);
if ($rowid > 0) {
// Load member
$result = $object->fetch($rowid);
// Define variables to know what current user can do on users
$canadduser = $user->admin || $user->rights->user->user->creer;
// Define variables to know what current user can do on properties of user linked to edited member
if ($object->user_id) {
// $user est le user qui edite, $object->user_id est l'id de l'utilisateur lies au membre edite
$caneditfielduser = $user->id == $object->user_id && $user->rights->user->self->creer || $user->id != $object->user_id && $user->rights->user->user->creer;
$caneditpassworduser = $user->id == $object->user_id && $user->rights->user->self->password || $user->id != $object->user_id && $user->rights->user->user->password;
}
}